:root {
    color-scheme: light;
    --background: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #eef3f9;
    --text: #1d2733;
    --muted: #65758a;
    --primary: #2454d6;
    --primary-dark: #173a99;
    --border: #d9e2ef;
    --danger: #b42318;
    --warning: #9a6700;
    --success: #087443;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    line-height: 1.55;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 1rem 0;
}

.brand {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
}

.tagline,
.form-hint,
.metric-label {
    color: var(--muted);
}

.main-content {
    padding: 2rem 0 4rem;
}

.site-footer {
    background: #172033;
    color: #dbe6f3;
    margin-top: 2rem;
    padding: 2rem 0;
}

.footer-content {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(260px, 1fr) minmax(320px, 2fr);
}

.footer-content h2 {
    color: #ffffff;
    font-size: 1.1rem;
    margin: 0 0 .75rem;
}

.footer-content address,
.footer-content p {
    font-style: normal;
    margin: 0 0 .75rem;
}

.footer-content a {
    color: #ffffff;
}

.hero,
.card,
.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 16px 38px rgb(15 23 42 / 7%);
}

.hero {
    padding: clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: 1.25rem;
}

.hero h1 {
    margin: 0 0 .75rem;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.05;
}

.eyebrow {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: .08em;
    margin: 0 0 .75rem;
    text-transform: uppercase;
}

.card {
    padding: clamp(1rem, 3vw, 1.75rem);
    margin-bottom: 1.25rem;
}

.explanation-card h2 {
    margin-top: 0;
}

.explanation-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
}

.explanation-grid article {
    background: var(--surface-soft);
    border-radius: 14px;
    padding: 1rem;
}

.explanation-grid h3 {
    margin-top: 0;
}

.explanation-grid p {
    margin-bottom: 0;
}

.analysis-form {
    display: grid;
    gap: .85rem;
}

label {
    font-weight: 700;
}

textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font: inherit;
    min-height: 14rem;
    padding: 1rem;
    resize: vertical;
}

textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgb(36 84 214 / 12%);
    outline: none;
}

button {
    justify-self: start;
    background: var(--primary);
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: .8rem 1.35rem;
}

button:hover,
button:focus-visible {
    background: var(--primary-dark);
}

.validation-summary,
.field-validation,
.warning {
    color: var(--danger);
    font-weight: 600;
}

.warning {
    background: #fff8db;
    border: 1px solid #f5d26a;
    border-radius: 12px;
    color: var(--warning);
    padding: .8rem 1rem;
}

.notice-card {
    background: #f8fbff;
    border-style: dashed;
}

.notice-card h2 {
    margin-top: 0;
}

.notice-card p {
    margin-bottom: 0;
}

.turnstile-box {
    margin-top: .25rem;
}

.result-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1.25rem;
}

.metric-card {
    padding: 1.25rem;
}

.metric-value {
    display: block;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1;
}

.cleaned-text {
    background: var(--surface-soft);
}

.table-wrapper {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    min-width: 780px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--border);
    padding: .75rem;
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--surface-soft);
    font-size: .9rem;
    text-transform: uppercase;
}

.compact-table td,
.compact-table th {
    padding: .55rem .75rem;
}

code,
.character-pill {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .12rem .35rem;
}

.character-pill {
    display: inline-block;
    font-family: Consolas, "Courier New", monospace;
    min-width: 2rem;
    text-align: center;
}

.assessment {
    border-radius: 999px;
    display: inline-block;
    font-weight: 800;
    margin: 0 0 .5rem;
    padding: .35rem .75rem;
}

.assessment-none {
    background: #e8f7ef;
    color: var(--success);
}

.assessment-few {
    background: #fff8db;
    color: var(--warning);
}

.assessment-multiple {
    background: #fee4e2;
    color: var(--danger);
}

.style-facts {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
}

.style-facts div {
    background: var(--surface-soft);
    border-radius: 12px;
    padding: .75rem 1rem;
}

.style-facts dt {
    color: var(--muted);
    font-size: .85rem;
}

.style-facts dd {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
}

.findings {
    display: grid;
    gap: 1rem;
}

.finding {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
}

.finding h3 {
    margin-top: 0;
}

@media (max-width: 760px) {
    .site-header .container,
    .style-facts {
        align-items: flex-start;
        flex-direction: column;
    }

    .explanation-grid,
    .footer-content,
    .result-grid {
        grid-template-columns: 1fr;
    }
}
