/* ---------- Design tokens ---------- */
:root {
    /* App-aligned brand palette (canonical) */
    --mfa-navy:               #071b3a;
    --mfa-blue-primary:       #2fa8f4;
    --mfa-blue-primary-hover: #2388ee;
    --mfa-blue-deep:          #1f6fe5;
    --mfa-cyan-light:         #67d8ee;
    --mfa-blue-pale:          #eaf6ff;
    --mfa-blue-soft:          #dceeff;
    --mfa-blue-border:        #c6dced;
    --mfa-muted:              #8ca2bf;
    --mfa-card:               #ffffff;

    /* Surfaces */
    --bg: #f7f9fc;
    --surface: var(--mfa-card);

    /* Text — aliases pointing at the canonical mfa-* tokens */
    --text: var(--mfa-navy);
    --text-muted: var(--mfa-muted);
    --text-soft: #94a3b8;

    /* Borders */
    --border: var(--mfa-blue-border);
    --border-strong: #cbd5e1;

    /* Brand blue (links, "Assessment" accent) */
    --primary: var(--mfa-blue-deep);
    --primary-deep: var(--mfa-blue-primary-hover);
    --primary-soft: var(--mfa-blue-soft);

    /* CTA (Get Started button) */
    --cta: var(--mfa-blue-primary);
    --cta-deep: var(--mfa-blue-primary-hover);

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow:    0 8px 24px rgba(15, 23, 42, 0.06);

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 16px;

    --container: 1180px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01';
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-deep); }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 28px;
}
.nowrap { white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header__inner {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
}
.brand:hover { color: var(--text); }
.brand__logo { width: 36px; height: 36px; display: block; }
.brand__url {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-weight: 800;
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
}
.brand__url-accent { color: var(--primary); }

.nav { display: flex; align-items: center; gap: 8px; }
.nav__link {
    padding: 9px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.nav__link:hover {
    border-color: var(--border-strong);
    background: #f1f5f9;
    color: var(--text);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1;
    padding: 14px 26px;
    cursor: pointer;
    transition: transform .08s ease, box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
    text-decoration: none;
    font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn--cta {
    background: var(--cta);
    color: white;
    box-shadow: 0 10px 24px rgba(47, 168, 244, 0.32);
}
.btn--cta:hover { background: var(--cta-deep); color: white; box-shadow: 0 14px 30px rgba(35, 136, 238, 0.36); }
.btn--lg { padding: 18px 34px; font-size: 1.0625rem; }

/* ---------- Hero ---------- */
.hero {
    padding: 92px 0 80px;
    text-align: center;
    background:
        radial-gradient(900px 380px at 50% -120px, rgba(31, 111, 229, 0.09), transparent 70%),
        radial-gradient(700px 340px at 90% 10%,  rgba(47, 168, 244, 0.06), transparent 70%),
        var(--bg);
}
.hero__title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: clamp(2.125rem, 4.1vw, 3.25rem);
    line-height: 1.1;
    letter-spacing: -0.025em;
    font-weight: 800;
    margin: 0 0 18px;
    color: var(--text);
    text-wrap: balance;
}
.hero__title em { font-style: normal; color: var(--primary); }
.hero__subtitle {
    font-size: clamp(1.0625rem, 1.55vw, 1.3125rem);
    color: var(--text-muted);
    margin: 0 auto 28px;
    max-width: 960px;
    font-weight: 400;
    text-wrap: balance;
}
.hero__lead {
    font-size: 1.0625rem;
    color: var(--text);
    margin: 0 auto 40px;
    max-width: 720px;
}
.hero__lead p { margin: 0 0 14px; text-wrap: balance; }
.hero__lead p:last-child { margin: 0; }
.hero__lead a {
    color: var(--primary-deep);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in srgb, var(--primary) 45%, transparent);
}
.hero__lead a:hover { text-decoration-color: var(--primary-deep); }
.hero__lead em { font-style: italic; font-weight: 500; }
.hero__cta {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* ---------- Section ---------- */
.section {
    padding: 84px 0 96px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}
.section__head {
    max-width: 760px;
    margin: 0 auto 40px;
    text-align: center;
}
.section__title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: clamp(1.75rem, 2.6vw, 2.25rem);
    letter-spacing: -0.02em;
    font-weight: 800;
    margin: 0 0 12px;
    text-wrap: balance;
}
.section__sub {
    color: var(--text-muted);
    font-size: 1.0625rem;
    margin: 0;
    text-wrap: balance;
}

/* ---------- Filter toggle (kept subtle so it doesn't pull focus from the data) ---------- */
.filter-toggle-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}
.filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: 0;
    padding: 6px 10px;
    margin-right: -6px;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    border-radius: 6px;
    transition: color .12s ease, background .12s ease;
}
.filter-toggle:hover {
    color: var(--text);
    background: rgba(15, 23, 42, 0.04);
}
.filter-toggle__chevron { transition: transform .15s ease; }
.filter-toggle[aria-expanded="true"] .filter-toggle__chevron { transform: rotate(180deg); }
.filter-toggle[aria-expanded="true"] { color: var(--text); }
[data-filter-panel][hidden] { display: none; }

/* ---------- Filters: 3 columns side-by-side ---------- */
.filters {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: minmax(260px, auto) minmax(200px, auto) minmax(0, 1fr);
    gap: 24px 28px;
    align-items: start;
}
.filter { min-width: 0; }
.filter__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    min-height: 18px;
}
.filter__label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-soft);
}
.filter__select-all {
    background: none;
    border: 0;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-soft);
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 6px;
    transition: color .12s ease, background .12s ease;
}
.filter__select-all:hover { color: var(--text); background: rgba(15, 23, 42, 0.05); }

@media (max-width: 920px) {
    .filters {
        grid-template-columns: 1fr;
    }
}

/* ---------- Check pills ---------- */
.check-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.check-pills--grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.check-pills--stack { display: flex; flex-direction: column; gap: 6px; }
.check-pills--stack .check-pill { width: 100%; justify-content: flex-start; }

.check-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 14px 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    user-select: none;
    transition: border-color .12s ease, background .12s ease, color .12s ease;
    white-space: nowrap;
}
.check-pill--center { justify-content: center; }
.check-pill input { position: absolute; opacity: 0; pointer-events: none; }
.check-pill__box {
    width: 15px; height: 15px;
    border: 1.5px solid var(--border-strong);
    border-radius: 4px;
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    transition: background .12s ease, border-color .12s ease;
}
.check-pill:hover { border-color: var(--text-muted); color: var(--text); }

/* Default-blue active state (grades) */
.check-pill.is-active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-deep);
}
.check-pill.is-active .check-pill__box {
    background: var(--primary);
    border-color: var(--primary);
}
.check-pill.is-active .check-pill__box::after {
    content: '';
    position: absolute;
    width: 4px; height: 8px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg) translate(-1px, -1px);
}

/* Per-pill colored active state (operations) */
.check-pill--colored.is-active {
    border-color: var(--c);
    background: color-mix(in srgb, var(--c) 12%, white);
    color: color-mix(in srgb, var(--c) 75%, black);
}
.check-pill--colored.is-active .check-pill__box {
    background: var(--c);
    border-color: var(--c);
}

/* ---------- Approach chips (color-coded legend) ---------- */
.approach-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.approach-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    user-select: none;
    transition: border-color .12s ease, background .12s ease, color .12s ease;
    white-space: nowrap;
}
.approach-chip input { position: absolute; opacity: 0; pointer-events: none; }
.approach-chip__box {
    width: 15px; height: 15px;
    border: 1.5px solid var(--border-strong);
    border-radius: 4px;
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
    transition: background .12s ease, border-color .12s ease;
}
.approach-chip__label { line-height: 1; }
.approach-chip__icon {
    display: inline-flex;
    width: 15px; height: 15px;
    color: var(--text-soft);
    transition: color .12s ease;
    flex-shrink: 0;
    margin-left: 2px;
}
.approach-chip__icon svg { width: 100%; height: 100%; display: block; }
.approach-chip:hover { border-color: var(--text-muted); color: var(--text); }
.approach-chip.is-active {
    border-color: var(--c);
    background: color-mix(in srgb, var(--c) 10%, white);
    color: var(--text);
}
.approach-chip.is-active .approach-chip__box {
    background: var(--c);
    border-color: var(--c);
}
.approach-chip.is-active .approach-chip__box::after {
    content: '';
    position: absolute;
    width: 4px; height: 8px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg) translate(-1px, -1px);
}
.approach-chip.is-active .approach-chip__icon { color: var(--c); }

/* ---------- More dropdown ---------- */
.more { position: relative; }
.approach-chip--more {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border-strong);
    gap: 6px;
}
.approach-chip--more:hover { border-color: var(--text-muted); }
.more.is-open .approach-chip--more {
    border-color: var(--text);
    color: var(--text);
}
.more__count {
    display: none;
    background: var(--primary);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    line-height: 1.4;
}
.more__count.is-visible { display: inline-flex; }
.more__chevron { transition: transform .15s ease; }
.more.is-open .more__chevron { transform: rotate(180deg); }
.more__menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px;
    z-index: 30;
    flex-direction: column;
    gap: 6px;
    min-width: 240px;
}
.more.is-open .more__menu { display: flex; }
.approach-chip--in-menu { width: 100%; justify-content: flex-start; }

/* ---------- Results table ---------- */
.results {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.results__head, .results__row {
    display: grid;
    /* Class | Grade | Fluency bar | Students | Usage | Approach bar */
    grid-template-columns:
        minmax(140px, 1.3fr)
        56px
        minmax(180px, 1.7fr)
        78px
        70px
        minmax(260px, 2.1fr);
    align-items: center;
    gap: 20px;
    padding: 12px 26px;
}
.results__head {
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-soft);
    font-weight: 700;
    padding-top: 14px;
    padding-bottom: 14px;
}
.results__row { border-bottom: 1px solid var(--border); }
.results__row:last-of-type { border-bottom: 0; }
.results__row:hover { background: #fafbfd; }

.class-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.class-dot {
    width: 26px; height: 26px;
    border-radius: 7px;
    background: var(--c);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.7rem;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.10);
    letter-spacing: -0.01em;
}
.class-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.grade-cell {
    color: var(--text-muted);
    font-size: 0.9375rem;
    font-variant-numeric: tabular-nums;
}
.students-cell {
    color: var(--text);
    font-weight: 600;
    font-size: 0.9375rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.hours-cell {
    color: var(--text);
    font-weight: 600;
    font-size: 0.9375rem;
    font-variant-numeric: tabular-nums;
    text-align: center;
}
.results__head > div:nth-child(4),
.results__head > div:nth-child(5) { text-align: center; }
.hours-cell .hours-sub { color: var(--text-soft); font-weight: 400; font-size: 0.8125rem; margin-left: 4px; }

/* ---------- Fluency bar (the hero metric) ---------- */
.fluency { display: block; min-width: 0; }
.fluency__bar {
    width: 100%;
    height: 22px;
    background: #eef2f7;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(15,23,42,0.04);
}
.fluency__fill {
    height: 100%;
    width: var(--w, 0%);
    background: linear-gradient(90deg, var(--mfa-blue-primary), var(--mfa-blue-deep));
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(47, 168, 244, 0.28);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    min-width: 44px;
    transition: width .7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fluency__value {
    color: #fff;
    font-weight: 700;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 1px rgba(0,0,0,0.18);
    letter-spacing: 0.01em;
}

/* ---------- Approach stacked bar ---------- */
.approach { display: block; min-width: 0; }
.approach__bar {
    display: flex;
    width: 100%;
    height: 22px;
    border-radius: 999px;
    overflow: hidden;
    background: #eef2f7;
    box-shadow: inset 0 0 0 1px rgba(15,23,42,0.04);
}
.approach__seg {
    display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
    background: var(--c);
    color: #fff;
    overflow: hidden;
    padding: 0 7px;
    cursor: default;
    transition: filter .12s ease;
    min-width: 0;
}
.approach__seg:hover { filter: brightness(1.07); }
.approach__seg-icon {
    width: 11px; height: 11px;
    display: inline-flex;
    flex-shrink: 0;
    opacity: 0.95;
}
.approach__seg-icon svg { width: 100%; height: 100%; display: block; }
.approach__seg-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    text-shadow: 0 1px 1px rgba(0,0,0,0.18);
    min-width: 0;
}

/* Mobile meta line (hidden on desktop; replaces grade/students/hours cells on narrow) */
.row-meta { display: none; }

/* Empty state */
.empty {
    text-align: center;
    padding: 56px 20px;
    color: var(--text-muted);
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 32px 0;
    color: var(--text-soft);
    font-size: 0.875rem;
    text-align: center;
}
.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 22px;
    margin-bottom: 12px;
}
.site-footer__links a { color: var(--text-muted); font-weight: 600; }
.site-footer__links a:hover { color: var(--primary); }
.site-footer__meta { font-variant-numeric: tabular-nums; }

/* ---------- Legal pages (privacy, terms) ---------- */
.legal-hero {
    background:
        radial-gradient(900px 380px at 50% -120px, rgba(31, 111, 229, 0.09), transparent 70%),
        var(--bg);
    padding: 56px 0 32px;
    border-bottom: 1px solid var(--border);
}
.legal-hero__title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: clamp(1.875rem, 3.4vw, 2.5rem);
    letter-spacing: -0.025em;
    font-weight: 800;
    margin: 0 0 8px;
    color: var(--text);
}
.legal-hero__meta { color: var(--text-muted); font-size: 0.9375rem; margin: 0; }

.legal {
    background: var(--surface);
    padding: 48px 0 80px;
}
.legal__inner { max-width: 800px; margin: 0 auto; }

.legal__callout {
    background: var(--mfa-blue-pale);
    border: 1px solid var(--mfa-blue-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 0 0 28px;
}
.legal__callout p { margin: 0; }

.legal__toc {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin: 28px 0 44px;
}
.legal__toc-title {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-soft);
    margin: 0 0 10px;
}
.legal__toc ol {
    margin: 0;
    padding-left: 20px;
    columns: 2;
    column-gap: 32px;
    font-size: 0.9375rem;
}
.legal__toc li { margin: 0 0 6px; break-inside: avoid; }

.legal h2 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 1.375rem;
    letter-spacing: -0.015em;
    font-weight: 800;
    margin: 44px 0 14px;
    scroll-margin-top: 88px;
    color: var(--text);
}
.legal h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin: 26px 0 10px;
    color: var(--text);
}
.legal p, .legal li { color: var(--text); font-size: 1rem; }
.legal p { margin: 0 0 16px; }
.legal ul { margin: 0 0 18px; padding-left: 22px; }
.legal li { margin: 0 0 8px; }
.legal a { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.legal strong { font-weight: 700; }

@media (max-width: 560px) {
    .legal__toc ol { columns: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
    .results__head, .results__row {
        grid-template-columns:
            minmax(130px, 1.2fr)
            48px
            minmax(160px, 1.6fr)
            64px
            60px
            minmax(220px, 2fr);
        gap: 14px;
        padding: 12px 20px;
    }
}
@media (max-width: 820px) {
    .results__head { display: none; }
    .results__row {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas:
            "class"
            "meta"
            "fluency"
            "approach";
        gap: 10px;
        padding: 16px 18px;
    }
    .class-cell { grid-area: class; }
    .fluency    { grid-area: fluency; }
    .approach   { grid-area: approach; }
    .row-meta {
        grid-area: meta;
        display: block;
        color: var(--text-muted);
        font-size: 0.875rem;
        padding-left: 36px; /* visually align under class name, not the colored dot */
    }
    .grade-cell, .students-cell, .hours-cell { display: none; }
}
@media (max-width: 560px) {
    .container { padding: 0 18px; }
    .hero { padding: 64px 0 56px; }
    .section { padding: 64px 0; }
    .site-header__inner { height: 64px; }
    .brand__url { font-size: 0.9375rem; }
    .check-pills--grid4 { grid-template-columns: repeat(4, 1fr); }
}
