:root {
    --brand: #0f766e;
    --brand-dark: #134e4a;
    --accent: #d97706;
    --success: #15803d;
    --warning: #b45309;
    --error: #b91c1c;
    --ink: #14211f;
    --ink-2: #263a36;
    --muted: #60716d;
    --muted-2: #7c8d89;
    --bg: #f6f8f5;
    --bg-soft: #edf6f2;
    --surface: #ffffff;
    --surface-2: #fbf7ef;
    --line: #d9e4df;
    --line-strong: #c3d2cc;
    --shadow-sm: 0 1px 2px rgba(20, 33, 31, .08);
    --shadow-md: 0 18px 45px rgba(20, 33, 31, .11);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 18px;
    --max: 1180px;
    --read: 760px;
    --header-height: 74px;
    --s-1: .25rem;
    --s-2: .5rem;
    --s-3: .75rem;
    --s-4: 1rem;
    --s-5: 1.5rem;
    --s-6: 2rem;
    --s-7: 3rem;
    --s-8: 4.5rem;
    --fs-xs: .78rem;
    --fs-sm: .9rem;
    --fs-md: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.45rem;
    --fs-2xl: clamp(1.75rem, 3vw, 2.45rem);
    --fs-hero: clamp(2.35rem, 6vw, 4.9rem);
    --fw-regular: 400;
    --fw-semibold: 650;
    --fw-bold: 800;
    --ease: 160ms ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1.6;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(237, 246, 242, .85), rgba(246, 248, 245, 0) 360px),
        var(--bg);
    text-rendering: optimizeLegibility;
}

body.menu-open {
    overflow: hidden;
}

a {
    color: var(--brand-dark);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--brand);
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
summary:focus {
    outline: 3px solid rgba(217, 119, 6, .38);
    outline-offset: 3px;
}

img,
svg {
    max-width: 100%;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -48px;
    left: var(--s-4);
    z-index: 100;
    padding: var(--s-3) var(--s-4);
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: #fff;
}

.skip-link:focus {
    top: var(--s-4);
}

.utility-bar {
    padding: .45rem var(--s-4);
    background: var(--brand-dark);
    color: #e7fffa;
    text-align: center;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: var(--header-height);
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(217, 228, 223, .9);
    backdrop-filter: blur(16px);
}

.nav {
    max-width: var(--max);
    min-height: var(--header-height);
    margin: 0 auto;
    padding: 0 var(--s-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
}

.brand,
.footer-brand strong {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-weight: 850;
    color: var(--ink);
    text-decoration: none;
    letter-spacing: 0;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--brand);
    color: #fff;
    box-shadow: inset 0 -10px 20px rgba(0, 0, 0, .08);
    font-weight: 900;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: .95rem;
}

.nav-links a {
    color: var(--ink-2);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    white-space: nowrap;
}

.nav-links a:not(.nav-cta, .account-link):hover {
    color: var(--brand);
}

.nav-links a.is-active:not(.nav-cta, .account-link) {
    color: var(--brand-dark);
    position: relative;
}

.nav-links a.is-active:not(.nav-cta, .account-link)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -.55rem;
    height: 3px;
    border-radius: 999px;
    background: var(--brand);
}

.nav-cta,
.account-link,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 44px;
    padding: .78rem 1.05rem;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    border: 1px solid var(--brand);
    font-weight: var(--fw-bold);
    line-height: 1.1;
    cursor: pointer;
    transition: transform var(--ease), background var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.nav-cta:hover,
.button:hover {
    color: #fff;
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.account-link,
.button.secondary {
    background: #fff;
    color: var(--brand-dark);
    border-color: var(--line-strong);
}

.account-link:hover,
.button.secondary:hover {
    color: var(--brand-dark);
    border-color: var(--brand);
    background: var(--bg-soft);
}

.button-small {
    min-height: 40px;
    padding: .65rem .85rem;
    font-size: var(--fs-sm);
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: #fff;
    padding: 10px;
}

.menu-toggle span:not(.sr-only) {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--ink);
}

.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: var(--s-8) var(--s-4);
}

.wrap-narrow {
    max-width: var(--read);
    margin: 0 auto;
    padding: var(--s-7) var(--s-4);
}

.section {
    border-bottom: 1px solid var(--line);
}

.section-muted {
    background: #fff;
}

.section-title {
    max-width: 760px;
    margin-bottom: var(--s-6);
}

h1,
h2,
h3 {
    line-height: 1.12;
    margin: 0 0 var(--s-3);
    color: var(--ink);
}

h1 {
    font-size: var(--fs-hero);
    letter-spacing: 0;
    max-width: 850px;
}

h2 {
    font-size: var(--fs-2xl);
}

h3 {
    font-size: var(--fs-xl);
}

p {
    margin: 0 0 var(--s-4);
}

.lead {
    max-width: 760px;
    font-size: var(--fs-lg);
    color: var(--muted);
}

.eyebrow {
    margin-bottom: var(--s-2);
    color: var(--accent);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.hero {
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(130deg, #f9fcfa 0%, #eff8f4 50%, #fff7ea 100%);
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto -10% -28% 42%;
    height: 360px;
    background: radial-gradient(circle, rgba(15, 118, 110, .12), transparent 65%);
    pointer-events: none;
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(320px, .76fr);
    gap: clamp(2rem, 5vw, 4.75rem);
    align-items: center;
}

.hero-copy .lead {
    margin-top: var(--s-4);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    margin-top: var(--s-5);
}

.trust-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--s-3);
    margin-top: var(--s-6);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: .55rem;
    min-width: 0;
    padding: .72rem .85rem;
    border: 1px solid rgba(195, 210, 204, .72);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .72);
    color: var(--ink-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
}

.trust-item i {
    color: var(--brand);
}

.score-preview {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    gap: var(--s-4);
    align-items: center;
    padding: var(--s-5);
    border-bottom: 1px solid var(--line);
}

.preview-header strong {
    display: block;
    font-size: var(--fs-lg);
}

.preview-header span,
.score-row span,
.test-meta dt {
    color: var(--muted);
    font-size: var(--fs-sm);
}

.score-ring {
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: conic-gradient(var(--brand) 0 78%, #e5eee9 78% 100%);
}

.score-ring span {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    font-weight: var(--fw-bold);
}

.preview-body {
    padding: var(--s-5);
}

.score-row {
    margin-bottom: var(--s-4);
}

.score-row strong {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--s-2);
}

.bar {
    height: 9px;
    border-radius: 999px;
    background: #e5eee9;
    overflow: hidden;
}

.bar > span {
    display: block;
    height: 100%;
    width: var(--value);
    border-radius: inherit;
    background: var(--brand);
}

.preview-note {
    display: flex;
    gap: var(--s-3);
    margin-top: var(--s-5);
    padding: var(--s-4);
    border-radius: var(--radius);
    background: var(--bg-soft);
    color: var(--ink-2);
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s-4);
}

.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s-4);
}

.subject-card,
.exam-card,
.test-card,
.resource-card,
.info-panel,
.card {
    position: relative;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.subject-card {
    display: grid;
    gap: var(--s-4);
    padding: var(--s-5);
    min-height: 245px;
    overflow: hidden;
}

.exam-card {
    display: grid;
    gap: var(--s-4);
    padding: var(--s-5);
    overflow: hidden;
}

.exam-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: var(--subject-accent, var(--brand));
}

.exam-card-main {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: var(--s-4);
    align-items: start;
}

.exam-card h3 a {
    color: var(--ink);
    text-decoration: none;
}

.exam-details {
    padding: var(--s-4);
    border-radius: var(--radius);
    background: #fbfdfc;
    border: 1px solid var(--line);
}

.exam-details p {
    margin-bottom: var(--s-2);
    color: var(--muted);
}

.exam-details p:last-child {
    margin-bottom: 0;
}

.exam-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}

.exam-stats span {
    padding: .4rem .6rem;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--brand-dark);
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
}

.subject-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: var(--subject-accent, var(--brand));
}

.subject-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: #fff;
    background: var(--subject-accent, var(--brand));
}

.subject-card h3 a {
    color: var(--ink);
    text-decoration: none;
}

.subject-card p:not(.eyebrow) {
    color: var(--muted);
}

.text-link {
    align-self: end;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-weight: var(--fw-bold);
    text-decoration: none;
}

.accent-teal { --subject-accent: #0f766e; }
.accent-blue { --subject-accent: #2563eb; }
.accent-amber { --subject-accent: #d97706; }
.accent-violet { --subject-accent: #7c3aed; }
.accent-green { --subject-accent: #15803d; }
.accent-red { --subject-accent: #b91c1c; }
.accent-slate { --subject-accent: #475569; }
.accent-indigo { --subject-accent: #4f46e5; }

.test-card {
    display: grid;
    gap: var(--s-4);
    padding: var(--s-5);
}

.test-card-top,
.test-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-3);
}

.test-subject,
.difficulty {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: .28rem .55rem;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--brand-dark);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
}

.difficulty {
    background: #fff3df;
    color: #8a4b08;
}

.test-card p {
    color: var(--muted);
}

.test-meta {
    justify-content: flex-start;
    margin: 0;
}

.test-meta div {
    min-width: 78px;
}

.test-meta dd {
    margin: .1rem 0 0;
    color: var(--ink);
    font-weight: var(--fw-bold);
}

.step-list {
    counter-reset: steps;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--s-4);
}

.step {
    position: relative;
    padding: var(--s-5);
    border-left: 3px solid var(--brand);
    background: #fff;
    border-radius: var(--radius);
}

.step::before {
    counter-increment: steps;
    content: counter(steps);
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-bottom: var(--s-3);
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: var(--fw-bold);
}

.editorial-layout {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(280px, .55fr);
    gap: var(--s-6);
    align-items: start;
}

.resource-list {
    display: grid;
    gap: var(--s-4);
}

.resource-card {
    padding: var(--s-5);
}

.performance-preview {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1fr);
    gap: var(--s-6);
    align-items: center;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-3);
}

.metric {
    padding: var(--s-4);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.metric strong {
    display: block;
    font-size: var(--fs-xl);
}

.cta-band {
    background: var(--brand-dark);
    color: #fff;
}

.cta-band h2,
.cta-band p {
    color: #fff;
}

.cta-band .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-5);
}

.cta-band .button {
    background: #fff;
    color: var(--brand-dark);
    border-color: #fff;
}

.breadcrumbs {
    margin-bottom: var(--s-5);
    color: var(--muted);
    font-size: var(--fs-sm);
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    padding: 0;
    margin: var(--s-5) 0;
    list-style: none;
}

.pill-list li {
    padding: .45rem .65rem;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--brand-dark);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-3);
}

.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--s-4);
}

.faq summary {
    cursor: pointer;
    font-weight: var(--fw-bold);
}

.faq p {
    margin-top: var(--s-3);
    color: var(--muted);
}

.ad-slot {
    margin: var(--s-6) 0;
    min-height: 112px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: #fbfdfc;
    display: grid;
    place-items: center;
    padding: var(--s-4);
    color: var(--muted);
    text-align: center;
}

.ad-slot span {
    display: block;
    margin-bottom: var(--s-1);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.site-footer {
    max-width: var(--max);
    margin: 0 auto;
    padding: var(--s-7) var(--s-4);
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: var(--s-6);
    color: var(--muted);
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    justify-content: flex-end;
}

.site-footer a {
    color: var(--ink-2);
    font-size: var(--fs-sm);
    text-decoration: none;
}

.form-shell {
    max-width: 980px;
    margin: 0 auto;
    padding: var(--s-7) var(--s-4);
    display: grid;
    grid-template-columns: minmax(0, .75fr) minmax(320px, .55fr);
    gap: var(--s-6);
    align-items: start;
}

.form-card {
    padding: var(--s-6);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-md);
}

.form-field {
    margin-bottom: var(--s-4);
}

.form-field label {
    display: block;
    margin-bottom: var(--s-2);
    font-weight: var(--fw-bold);
}

.form-field input {
    width: 100%;
    min-height: 48px;
    padding: .75rem .85rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font: inherit;
}

.form-alert {
    padding: var(--s-3) var(--s-4);
    border-radius: var(--radius);
    background: #fff1f1;
    color: var(--error);
    font-weight: var(--fw-semibold);
}

.form-help {
    margin-top: var(--s-4);
    color: var(--muted);
    font-size: var(--fs-sm);
}

@media (max-width: 1040px) {
    .nav-links {
        gap: .65rem;
    }

    .nav-links a {
        font-size: .84rem;
    }

    .subject-grid,
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trust-strip,
    .step-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .hero-grid,
    .editorial-layout,
    .performance-preview,
    .site-footer,
    .form-shell {
        grid-template-columns: 1fr;
    }

    .cta-band .wrap {
        display: block;
    }

    .cta-band .button {
        margin-top: var(--s-4);
    }
}

@media (max-width: 720px) {
    .utility-bar {
        font-size: .82rem;
        line-height: 1.35;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: calc(var(--header-height) + 31px);
        left: var(--s-3);
        right: var(--s-3);
        display: none;
        max-height: calc(100vh - var(--header-height) - 55px);
        overflow: auto;
        padding: var(--s-4);
        border: 1px solid var(--line);
        border-radius: var(--radius-lg);
        background: rgba(255, 255, 255, .98);
        box-shadow: var(--shadow-md);
    }

    .nav-links.is-open {
        display: grid;
        gap: var(--s-2);
    }

    .nav-links a {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: .35rem .4rem;
        font-size: var(--fs-md);
    }

    .nav-cta,
    .account-link {
        justify-content: center;
        padding: .8rem 1rem !important;
    }

    .wrap,
    .wrap-narrow {
        padding: var(--s-7) var(--s-4);
    }

    .hero .wrap {
        padding-top: var(--s-7);
    }

    .subject-grid,
    .grid,
    .grid.three,
    .grid.two,
    .trust-strip,
    .step-list,
    .faq-grid,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .actions .button,
    .actions a {
        width: 100%;
    }

    .subject-card {
        min-height: 0;
    }

    .preview-header,
    .test-card-top {
        align-items: flex-start;
    }

    .site-footer nav {
        justify-content: flex-start;
    }
}

@media (max-width: 380px) {
    .brand {
        font-size: .98rem;
    }

    .brand-mark {
        width: 30px;
        height: 30px;
    }

    h1 {
        font-size: 2.15rem;
    }
}
