/* ══════════════════════════════════════════════════════════════════════
   ATARprepAI · Signal design system
   ----------------------------------------------------------------------
   Grown out of the homepage hero: a luminous violet network on a white (or
   near-black) ground. Knowledge is drawn as connections, marks are signals.

   Type     Inter Tight (display, same face as the hero slogan)
            Plus Jakarta Sans (text) · JetBrains Mono (data + labels)
   Colour   Violet #5b50e8 on paper #fff / night #111113, with three marking
            signals: mint (earned) · amber (partial) · coral (missed)
   Motion   static/ds/motion.js (GSAP). Nothing here hides content unless
            motion.js has put `ds-motion` on <html>, so no-JS, reduced motion
            and a failed script all get the finished page.

   Every class is prefixed `ds-` so this layer can sit beside the legacy
   stylesheets without either one reaching into the other.
   ══════════════════════════════════════════════════════════════════════ */

/* JetBrains Mono is distributed under the SIL Open Font License
   (fonts/JetBrainsMono-OFL.txt). Latin subset, variable weight. */
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url('/static/fonts/jetbrains-mono-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
    --ds-font-display: 'Inter Tight', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ds-font-text: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --ds-font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

    /* Violet ramp around the brand #5b50e8 */
    --ds-violet-50: #f5f4ff;
    --ds-violet-100: #ecebfe;
    --ds-violet-200: #dad6fd;
    --ds-violet-300: #bdb5fb;
    --ds-violet-400: #9b8ff7;
    --ds-violet-500: #7a6ef0;
    --ds-violet-600: #5b50e8;
    --ds-violet-700: #4a3fd0;
    --ds-violet-800: #3a31a6;
    --ds-violet-900: #2a2475;

    /* Paper (light) */
    --ds-bg: #ffffff;
    --ds-bg-2: #f7f7fb;
    --ds-bg-3: #f0f0f7;
    --ds-surface: #ffffff;
    --ds-surface-2: #fafaff;
    /* The stage product screens are captured on and framed on
       (scripts/capture_product_shots.py STAGE). Change both together. */
    --ds-stage: #f7f7fb;
    --ds-ink: #0e1220;
    --ds-ink-2: #454e63;
    --ds-ink-3: #5f6a80;
    --ds-line: rgba(14, 18, 32, .08);
    --ds-line-2: rgba(14, 18, 32, .14);
    /* Purple is for the brand and primary actions only. */
    --ds-accent: #5940d6;
    --ds-accent-hover: #4932b8;
    --ds-accent-ink: #5035bc;
    --ds-accent-soft: #eae4ff;
    --ds-on-accent: #ffffff;
    --ds-selected: #eae4ff;
    --ds-selected-ink: #5035bc;
    --ds-focus: #7053e8;
    /* Field edges must read at 3:1 against the surface around them. */
    --ds-input-line: #8f897d;

    /* Night: the dark hero's own ground, used for ink bands on either theme */
    --ds-night: #111113;
    --ds-night-2: #18181b;
    --ds-night-3: #222226;
    --ds-night-ink: #f4f5fa;
    --ds-night-ink-2: #b2b9d9;
    --ds-night-ink-3: #8a91ad;
    --ds-night-line: rgba(255, 255, 255, .09);

    /* Marking signals: always with a label or symbol, never colour alone. */
    --ds-mint: #216443;
    --ds-mint-soft: #e5f0e8;
    --ds-amber: #805000;
    --ds-amber-soft: #fff0d5;
    --ds-coral: #a1352b;
    --ds-coral-soft: #fbe9e5;
    --ds-info: #315a83;
    --ds-info-soft: #e8eff7;
    --ds-cyan: #5eeaf6;

    --ds-radius-xs: 8px;
    --ds-radius-sm: 12px;
    --ds-radius: 18px;
    --ds-radius-lg: 26px;
    --ds-radius-xl: 34px;

    --ds-shadow-1: 0 1px 2px rgba(14, 18, 32, .05), 0 2px 6px -2px rgba(14, 18, 32, .06);
    --ds-shadow-2: 0 1px 2px rgba(14, 18, 32, .05), 0 12px 32px -12px rgba(30, 24, 90, .16);
    --ds-shadow-3: 0 2px 4px rgba(14, 18, 32, .05), 0 32px 64px -24px rgba(30, 24, 90, .28);
    --ds-glow: 0 0 0 1px rgba(91, 80, 232, .22), 0 1px 2px rgba(14, 18, 32, .06), 0 12px 32px -16px rgba(14, 18, 32, .18);

    --ds-ease-out: cubic-bezier(.16, 1, .3, 1);
    --ds-ease-in-out: cubic-bezier(.65, 0, .35, 1);
    --ds-ease-spring: cubic-bezier(.34, 1.56, .64, 1);

    --ds-gutter: clamp(20px, 5vw, 64px);
    --ds-max: 1240px;
    --ds-section-y: clamp(88px, 12vw, 168px);
}

/* The dark shell: neutral charcoal, not navy. Panels step up in lightness,
   never in hue; purple appears only on primary actions, links and selection. */
[data-dark] {
    --ds-bg: #111113;
    --ds-bg-2: #18181b;
    --ds-bg-3: #222226;
    --ds-surface: #18181b;
    --ds-surface-2: #222226;
    --ds-stage: #18181b;
    --ds-ink: #f5f5f7;
    --ds-ink-2: #b5b5bf;
    --ds-ink-3: #8e8e99;
    --ds-line: #2a2a30;
    --ds-line-2: #38383f;
    --ds-accent: #5940d6;
    --ds-accent-hover: #4932b8;
    --ds-accent-ink: #b6a6ff;
    --ds-accent-soft: #302747;
    --ds-selected: #302747;
    --ds-selected-ink: #d8ceff;
    --ds-focus: #b6a6ff;
    --ds-input-line: #6b6b75;

    --ds-night: #111113;
    --ds-night-2: #18181b;
    --ds-night-3: #222226;
    --ds-night-ink: #f5f5f7;
    --ds-night-ink-2: #b5b5bf;
    --ds-night-ink-3: #8e8e99;
    --ds-night-line: #2a2a30;

    --ds-mint: #9ddbb5;
    --ds-mint-soft: #20372a;
    --ds-amber: #f0c779;
    --ds-amber-soft: #3b301d;
    --ds-coral: #f3aba3;
    --ds-coral-soft: #3e2625;
    --ds-info: #adcdf2;
    --ds-info-soft: #243246;

    --ds-shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --ds-shadow-2: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .7);
    --ds-shadow-3: 0 2px 4px rgba(0, 0, 0, .4), 0 40px 80px -24px rgba(0, 0, 0, .8);
    --ds-glow: 0 0 0 1px rgba(155, 143, 247, .26), 0 12px 32px -16px rgba(0, 0, 0, .6);
}

/* ── Page base (only for pages that opt in with body.ds-page) ─────── */
body.ds-page {
    margin: 0;
    background: var(--ds-bg);
    color: var(--ds-ink);
    font-family: var(--ds-font-text);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
body.ds-page *,
body.ds-page *::before,
body.ds-page *::after { box-sizing: border-box; }
body.ds-page :where(h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd) { margin: 0; }
body.ds-page :where(ul, ol) { padding: 0; }
body.ds-page :where(img, svg) { display: block; max-width: 100%; }
:where(body.ds-page a) { color: inherit; }
body.ds-page ::selection { background: var(--ds-violet-200); color: var(--ds-ink); }
[data-dark] body.ds-page ::selection { background: var(--ds-selected); color: var(--ds-selected-ink); }

.ds-skip {
    position: absolute; left: 16px; top: -60px; z-index: 1000;
    padding: 10px 16px; border-radius: 10px;
    background: var(--ds-ink); color: var(--ds-bg); font-weight: 700; text-decoration: none;
    transition: top .2s var(--ds-ease-out);
}
.ds-skip:focus { top: 12px; }

/* Keyboard focus: one ring everywhere */
:where([class^="ds-"], [class*=" ds-"]):focus-visible,
.ds-page :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--ds-focus);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ── Layout ─────────────────────────────────────────────────────────── */
.ds-container {
    width: 100%;
    max-width: calc(var(--ds-max) + var(--ds-gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--ds-gutter);
}
.ds-container--narrow { max-width: calc(820px + var(--ds-gutter) * 2); }
.ds-section { position: relative; padding-block: var(--ds-section-y); }
.ds-section--tight { padding-block: clamp(56px, 8vw, 104px); }
.ds-section--tint { background: var(--ds-bg-2); }

/* Night band: the dark hero's ground brought back as a chapter break */
.ds-night {
    --ds-ink: var(--ds-night-ink);
    --ds-ink-2: var(--ds-night-ink-2);
    --ds-ink-3: var(--ds-night-ink-3);
    --ds-line: var(--ds-night-line);
    --ds-line-2: rgba(255, 255, 255, .16);
    --ds-surface: var(--ds-night-2);
    --ds-surface-2: var(--ds-night-3);
    --ds-accent-ink: #b1a7ff;
    --ds-accent-soft: rgba(122, 110, 240, .16);
    --ds-bg: var(--ds-night);
    --ds-bg-2: rgba(255, 255, 255, .04);
    --ds-bg-3: rgba(255, 255, 255, .07);
    --ds-mint: #34d399;
    --ds-mint-soft: rgba(52, 211, 153, .13);
    --ds-amber: #fbbf24;
    --ds-amber-soft: rgba(251, 191, 36, .13);
    --ds-coral: #fb7185;
    --ds-coral-soft: rgba(251, 113, 133, .13);
    --ds-shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --ds-shadow-2: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .7);
    position: relative;
    isolation: isolate;
    background: var(--ds-night);
    color: var(--ds-ink);
    color-scheme: dark;
}
.ds-night::before {
    /* one restrained violet signal, top-centre */
    content: '';
    position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(60% 50% at 50% 0%, rgba(91, 80, 232, .22), transparent 70%),
        radial-gradient(40% 40% at 90% 100%, rgba(94, 234, 246, .06), transparent 70%);
}
.ds-night--rounded {
    border-radius: clamp(24px, 4vw, 44px);
    margin-inline: clamp(8px, 1.5vw, 20px);
    overflow: hidden;
}

/* ── Type ───────────────────────────────────────────────────────────── */
/* Section labels are plain words in the accent: no caps, no tracking, no
   status dot. They name the section; they don't announce it. */
.ds-eyebrow {
    display: inline-block;
    font: 500 .8125rem/1.3 var(--ds-font-mono);
    letter-spacing: 0;
    color: var(--ds-accent-ink);
}
.ds-eyebrow--muted { color: var(--ds-ink-3); }

.ds-display,
.ds-h1,
.ds-h2,
.ds-h3 {
    font-family: var(--ds-font-display);
    color: var(--ds-ink);
    font-kerning: normal;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1, "cv05" 1;
    text-wrap: balance;
}
.ds-display {
    font-size: clamp(2.75rem, 7vw, 6.25rem);
    font-weight: 700; line-height: .94; letter-spacing: -.045em; word-spacing: .04em;
}
.ds-h1 {
    font-size: clamp(2.5rem, 5.6vw, 4.75rem);
    font-weight: 700; line-height: .98; letter-spacing: -.042em; word-spacing: .04em;
}
.ds-h2 {
    font-size: clamp(2.125rem, 4.2vw, 3.5rem);
    font-weight: 700; line-height: 1.02; letter-spacing: -.038em; word-spacing: .035em;
}
.ds-h3 {
    font-size: clamp(1.25rem, 1.7vw, 1.5rem);
    font-weight: 650; line-height: 1.2; letter-spacing: -.02em;
}
.ds-em { color: var(--ds-accent-ink); font-style: normal; }
.ds-em--soft { color: var(--ds-ink-3); font-style: normal; }
.ds-lead {
    font-size: clamp(1.0625rem, 1.3vw, 1.25rem);
    line-height: 1.6; color: var(--ds-ink-2);
    text-wrap: pretty;
    max-width: 38em;
}
.ds-body { color: var(--ds-ink-2); line-height: 1.65; text-wrap: pretty; }
.ds-small { font-size: .875rem; color: var(--ds-ink-3); line-height: 1.55; }
.ds-mono { font-family: var(--ds-font-mono); font-feature-settings: "zero" 0; }
.ds-tnum { font-variant-numeric: tabular-nums; }

.ds-heading-block { display: grid; gap: 22px; max-width: 760px; }
.ds-heading-block--center { margin-inline: auto; text-align: center; justify-items: center; }
.ds-heading-split {
    display: grid; gap: 28px 64px; align-items: end;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}
@media (max-width: 860px) { .ds-heading-split { grid-template-columns: 1fr; } }

/* ── Buttons ────────────────────────────────────────────────────────── */
.ds-btn {
    --btn-bg: var(--ds-surface);
    --btn-ink: var(--ds-ink);
    --btn-line: var(--ds-line-2);
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 12px;
    min-height: 52px; padding: 0 26px;
    border: 1px solid var(--btn-line);
    border-radius: 14px;
    background: var(--btn-bg);
    color: var(--btn-ink);
    font-family: var(--ds-font-text);
    font-size: 1rem; font-weight: 650; letter-spacing: -.01em; line-height: 1;
    text-decoration: none; white-space: nowrap;
    cursor: pointer;
    isolation: isolate;
    overflow: hidden;
    transition:
        transform .35s var(--ds-ease-out),
        box-shadow .35s var(--ds-ease-out),
        background-color .25s ease, border-color .25s ease, color .25s ease;
    -webkit-tap-highlight-color: transparent;
}
.ds-btn svg { width: 18px; height: 18px; flex: none; transition: transform .35s var(--ds-ease-out); }
.ds-btn:hover { border-color: var(--ds-accent); }
.ds-btn:hover svg.ds-arrow { transform: translateX(4px); }
.ds-btn:active { transform: scale(.975); transition-duration: .1s; }
.ds-btn--primary {
    --btn-bg: var(--ds-violet-600);
    --btn-ink: #fff;
    --btn-line: transparent;
    box-shadow: 0 1px 2px rgba(14, 18, 32, .16);
}
.ds-btn--primary:hover { background: #5046e0; border-color: transparent; box-shadow: 0 1px 2px rgba(14, 18, 32, .16); }
.ds-btn--dark { --btn-bg: var(--ds-ink); --btn-ink: var(--ds-bg); --btn-line: transparent; }
.ds-btn--dark:hover { border-color: transparent; background: color-mix(in srgb, var(--ds-ink) 88%, var(--ds-accent)); }
.ds-btn--light { --btn-bg: #fff; --btn-ink: #0e1220; --btn-line: transparent; }
.ds-btn--light:hover { border-color: transparent; background: #f1efff; }
.ds-btn--ghost { --btn-bg: transparent; }
.ds-btn--ghost:hover { background: var(--ds-accent-soft); border-color: transparent; }
.ds-btn--lg { min-height: 60px; padding: 0 32px; font-size: 1.0625rem; border-radius: 16px; }
.ds-btn--sm { min-height: 42px; padding: 0 18px; font-size: .9375rem; border-radius: 12px; }
.ds-btn--block { width: 100%; }

.ds-link {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--ds-ink); font-weight: 650; text-decoration: none;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
    padding-bottom: 3px;
    transition: background-size .45s var(--ds-ease-out), color .2s ease;
}
.ds-link svg { width: 16px; height: 16px; transition: transform .35s var(--ds-ease-out); }
.ds-link:hover { background-size: 100% 1px; color: var(--ds-accent-ink); }
.ds-link:hover svg { transform: translateX(4px); }
.ds-link--accent { color: var(--ds-accent-ink); }

.ds-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }

/* ── Chips, badges, tags ───────────────────────────────────────────── */
.ds-chip {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 34px; padding: 0 14px;
    border: 1px solid var(--ds-line-2); border-radius: 999px;
    background: var(--ds-surface);
    color: var(--ds-ink-2); font-size: .875rem; font-weight: 600;
    white-space: nowrap;
}
.ds-badge {
    display: inline-flex; align-items: center; gap: 6px;
    height: 24px; padding: 0 10px; border-radius: 999px;
    background: var(--ds-accent-soft); color: var(--ds-accent-ink);
    font: 600 .75rem/1 var(--ds-font-text);
}
.ds-badge--mint { background: var(--ds-mint-soft); color: var(--ds-mint); }
.ds-badge--amber { background: var(--ds-amber-soft); color: var(--ds-amber); }
.ds-badge--coral { background: var(--ds-coral-soft); color: var(--ds-coral); }
.ds-kbd {
    display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
    border: 1px solid var(--ds-line-2); border-bottom-width: 2px; border-radius: 6px;
    font-family: var(--ds-font-mono); font-size: .6875rem; color: var(--ds-ink-3);
}

/* ── Cards ──────────────────────────────────────────────────────────── */
.ds-card {
    position: relative;
    isolation: isolate;
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    box-shadow: var(--ds-shadow-1);
    transition: border-color .3s ease, box-shadow .45s var(--ds-ease-out), transform .45s var(--ds-ease-out);
}
:where(a.ds-card) { color: inherit; text-decoration: none; display: block; }
.ds-card--hover:hover { border-color: var(--ds-line-2); box-shadow: var(--ds-shadow-2); }
.ds-card--pad { padding: clamp(22px, 2.6vw, 32px); }

/* ── Window (product mock chrome) ──────────────────────────────────── */
.ds-window {
    position: relative;
    border: 1px solid var(--ds-line-2);
    border-radius: 22px;
    background: var(--ds-surface);
    box-shadow: var(--ds-shadow-3);
    overflow: hidden;
}
.ds-window-bar {
    display: flex; align-items: center; gap: 14px;
    height: 44px; padding: 0 16px;
    border-bottom: 1px solid var(--ds-line);
    background: var(--ds-surface-2);
}
.ds-window-dots { display: flex; gap: 6px; }
.ds-window-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--ds-line-2); }
.ds-window-url {
    flex: 1; max-width: 320px; margin-inline: auto;
    height: 26px; padding: 0 12px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    background: var(--ds-bg-3);
    font-family: var(--ds-font-mono); font-size: .6875rem; color: var(--ds-ink-3);
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.ds-window-url svg { width: 11px; height: 11px; flex: none; }

/* ── Score ring (marking) ──────────────────────────────────────────── */
.ds-ring {
    --value: .75;
    position: relative;
    width: 84px; height: 84px; flex: none;
    display: grid; place-items: center;
}
.ds-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ds-ring circle { fill: none; stroke-width: 7; }
.ds-ring .ds-ring-track { stroke: var(--ds-line); }
.ds-ring .ds-ring-fill {
    stroke: var(--ds-accent);
    stroke-linecap: round;
    stroke-dasharray: 1;
    stroke-dashoffset: calc(1 - var(--value));
    transition: stroke-dashoffset 1.2s var(--ds-ease-out);
}
.ds-ring-label {
    position: relative;
    font-family: var(--ds-font-display);
    font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; line-height: 1;
}
.ds-ring-label small { font-size: .9rem; color: var(--ds-ink-3); font-weight: 600; }

/* ── Criteria list (marking) ───────────────────────────────────────── */
.ds-crit { list-style: none; display: grid; gap: 8px; }
.ds-crit li {
    display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--ds-line); border-radius: 12px;
    background: var(--ds-surface);
    font-size: .875rem; font-weight: 550; color: var(--ds-ink);
    line-height: 1.35;
}
.ds-crit li > i {
    width: 26px; height: 26px; border-radius: 8px;
    display: grid; place-items: center; font-style: normal;
}
.ds-crit li > i svg { width: 14px; height: 14px; }
.ds-crit li > b { font-family: var(--ds-font-mono); font-size: .75rem; font-weight: 600; color: var(--ds-ink-3); }
.ds-crit .is-earned > i { background: var(--ds-mint-soft); color: var(--ds-mint); }
.ds-crit .is-part > i { background: var(--ds-amber-soft); color: var(--ds-amber); }
.ds-crit .is-miss > i { background: var(--ds-coral-soft); color: var(--ds-coral); }
.ds-crit .is-miss { border-color: color-mix(in srgb, var(--ds-coral) 30%, transparent); }

/* ── Accordion ─────────────────────────────────────────────────────── */
.ds-faq { display: grid; border-top: 1px solid var(--ds-line-2); }
.ds-faq details { border-bottom: 1px solid var(--ds-line-2); interpolate-size: allow-keywords; }
.ds-faq summary {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 24px 4px;
    cursor: pointer; list-style: none;
    font-family: var(--ds-font-display);
    font-size: clamp(1.0625rem, 1.4vw, 1.25rem); font-weight: 600; letter-spacing: -.015em;
    color: var(--ds-ink);
    transition: color .2s ease;
}
.ds-faq summary::-webkit-details-marker { display: none; }
.ds-faq summary:hover { color: var(--ds-accent-ink); }
.ds-faq summary .ds-faq-icon {
    position: relative; flex: none;
    width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid var(--ds-line-2);
    transition: transform .45s var(--ds-ease-out), background-color .25s ease, border-color .25s ease;
}
.ds-faq summary .ds-faq-icon::before,
.ds-faq summary .ds-faq-icon::after {
    content: ''; position: absolute; left: 50%; top: 50%;
    width: 12px; height: 1.5px; margin: -.75px 0 0 -6px;
    background: currentColor; border-radius: 2px;
    transition: transform .45s var(--ds-ease-out);
}
.ds-faq summary .ds-faq-icon::after { transform: rotate(90deg); }
.ds-faq details[open] .ds-faq-icon { transform: rotate(180deg); background: var(--ds-accent); border-color: var(--ds-accent); color: #fff; }
.ds-faq details[open] .ds-faq-icon::after { transform: rotate(0deg); }
.ds-faq details > :not(summary) { padding: 0 56px 26px 4px; color: var(--ds-ink-2); line-height: 1.7; max-width: 62ch; }
.ds-faq details > :not(summary) a { color: var(--ds-accent-ink); }
.ds-faq details::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size .5s var(--ds-ease-out), content-visibility .5s allow-discrete;
}
.ds-faq details[open]::details-content { block-size: auto; }

/* ── Marquee ───────────────────────────────────────────────────────── */
.ds-marquee {
    --gap: 14px;
    --speed: 60s;
    position: relative;
    display: flex; overflow: hidden; gap: var(--gap);
    -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
            mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ds-marquee-track {
    display: flex; flex: none; gap: var(--gap); min-width: 100%;
    list-style: none; margin: 0; padding: 0;
    animation: ds-marquee var(--speed) linear infinite;
}
.ds-marquee--reverse .ds-marquee-track { animation-direction: reverse; }
.ds-marquee:hover .ds-marquee-track,
.ds-marquee:focus-within .ds-marquee-track { animation-play-state: paused; }
@keyframes ds-marquee { to { transform: translateX(calc(-100% - var(--gap))); } }

/* ── Stats ─────────────────────────────────────────────────────────── */
.ds-stats {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--ds-line-2);
}
.ds-stat { padding: 28px 24px 4px 0; display: grid; gap: 8px; align-content: start; }
.ds-stat + .ds-stat { padding-left: 24px; border-left: 1px solid var(--ds-line); }
.ds-stat-value {
    font-family: var(--ds-font-display);
    font-size: clamp(2.5rem, 5vw, 4.25rem); font-weight: 700; letter-spacing: -.05em; line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--ds-ink);
}
.ds-stat-value small { font-size: .5em; letter-spacing: -.02em; color: var(--ds-accent-ink); margin-left: 2px; }
.ds-stat-label { font-size: .9375rem; color: var(--ds-ink-3); }
@media (max-width: 760px) {
    .ds-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ds-stat:nth-child(3) { padding-left: 0; border-left: 0; }
    .ds-stat:nth-child(n + 3) { border-top: 1px solid var(--ds-line); }
}

/* ── Footer ────────────────────────────────────────────────────────── */
.ds-footer {
    position: relative;
    padding: clamp(64px, 8vw, 104px) 0 36px;
    border-top: 1px solid var(--ds-line);
    background: var(--ds-bg);
    color: var(--ds-ink-2);
    font-family: var(--ds-font-text);
    overflow: hidden;
}
.ds-footer-top {
    display: grid; gap: 48px 40px;
    grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(0, 1fr));
}
.ds-footer-brand { display: grid; gap: 18px; align-content: start; max-width: 320px; }
.ds-footer-logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ds-ink); font-weight: 750; font-size: 1.0625rem; letter-spacing: -.02em; }
.ds-footer-logo img { width: 36px; height: 36px; border-radius: 11px; background: #5b50e8; }
.ds-footer-brand p { font-size: .9375rem; line-height: 1.6; color: var(--ds-ink-3); }
.ds-footer-col h2 {
    margin: 0 0 16px;
    font: 600 .875rem/1.3 var(--ds-font-text); color: var(--ds-ink);
}
.ds-footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ds-footer-col a {
    color: var(--ds-ink-2); text-decoration: none; font-size: .9375rem;
    transition: color .2s ease;
}
.ds-footer-col a:hover { color: var(--ds-accent-ink); }
.ds-footer-subjects {
    margin-top: 56px; padding-top: 28px;
    border-top: 1px solid var(--ds-line);
}
.ds-footer-subjects h2 { margin: 0 0 14px; font: 600 .875rem/1.3 var(--ds-font-text); color: var(--ds-ink); }
.ds-footer-subjects ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ds-footer-subjects a { color: var(--ds-ink-3); font-size: .8125rem; text-decoration: none; }
.ds-footer-subjects a:hover { color: var(--ds-accent-ink); }
/* The wordmark as a watermark: solid letters (outlines crossed where the
   tight tracking made glyphs touch) filled with ink that fades out toward
   the baseline, so it closes the page without competing with it. */
.ds-footer-mark {
    margin: clamp(48px, 7vw, 88px) 0 0;
    padding-bottom: .12em;
    font-family: var(--ds-font-display);
    font-size: clamp(3.5rem, 15vw, 14.5rem); font-weight: 700; letter-spacing: -.045em; line-height: .9;
    color: transparent;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--ds-ink) 12%, transparent) 10%,
        color-mix(in srgb, var(--ds-ink) 4%, transparent) 62%,
        transparent 96%);
    -webkit-background-clip: text; background-clip: text;
    user-select: none; pointer-events: none;
    white-space: nowrap;
    text-align: center;
}
.ds-footer-bottom {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
    margin-top: 8px; padding-top: 22px; border-top: 1px solid var(--ds-line);
    font-size: .8125rem; color: var(--ds-ink-3);
}
.ds-footer-bottom a { color: inherit; }
@media (max-width: 980px) {
    .ds-footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ds-footer-brand { grid-column: 1 / -1; }
}

/* ── Progress bar (reading / scroll) ───────────────────────────────── */
.ds-progress {
    position: fixed; left: 0; top: 0; z-index: 1200;
    width: 100%; height: 3px;
    transform-origin: 0 50%; transform: scaleX(var(--p, 0));
    background: var(--ds-accent);
    pointer-events: none;
}

/* ── Product screens (the shot() macro) ────────────────────────────── */
/* The theme switch doubles its classes to outrank body.ds-page :where(img)
   (0,1,1): a hidden lazy image is never fetched, a visible one always is. */
.ds-shot { display: block; width: 100%; height: auto; }
.ds-shot.ds-shot--dark,
[data-dark] .ds-shot.ds-shot--light { display: none; }
[data-dark] .ds-shot.ds-shot--dark { display: block; }

/* ── Utilities ─────────────────────────────────────────────────────── */
/* `hidden` must win over every component's own display value. */
/* Matched on whole class tokens, so an app class that merely contains the
   letters ("cards-grid") is left alone. */
[hidden]:where([class^="ds-"], [class*=" ds-"], [class^="hs-"], [class*=" hs-"]) { display: none !important; }
.ds-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ds-divider { height: 1px; background: var(--ds-line); border: 0; margin: 0; }
.ds-hairline-top { border-top: 1px solid var(--ds-line); }
.ds-center { text-align: center; }

/* The worked marking example (.mark-demo) is styled with the app's own
   examiner report in static/ds/marking.css, so the two cannot drift apart. */


/* ══════════════════════════════════════════════════════════════════════
   Motion states. Armed only by motion.js (html.ds-motion), which checks for
   GSAP and for reduced motion first; the script, not CSS, reveals them.
   ══════════════════════════════════════════════════════════════════════ */
html.ds-motion [data-ds-reveal]:not(.ds-in) { opacity: 0; }
html.ds-motion [data-ds-stagger]:not(.ds-in) > * { opacity: 0; }
html.ds-motion [data-ds-split]:not(.ds-in) { opacity: 0; }
.ds-split-line { display: block; overflow: clip; padding-block: .06em; margin-block: -.06em; }
.ds-split-word { display: inline-block; will-change: transform; }

[data-ds-draw] path,
[data-ds-draw] line,
[data-ds-draw] polyline,
[data-ds-draw] circle.ds-draw { stroke-dasharray: 1; }
html.ds-motion [data-ds-draw]:not(.ds-in) path,
html.ds-motion [data-ds-draw]:not(.ds-in) line,
html.ds-motion [data-ds-draw]:not(.ds-in) polyline,
html.ds-motion [data-ds-draw]:not(.ds-in) circle.ds-draw { stroke-dashoffset: 1; }
[data-ds-draw].ds-in path,
[data-ds-draw].ds-in line,
[data-ds-draw].ds-in polyline,
[data-ds-draw].ds-in circle.ds-draw { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ds-ease-out); }

@media (prefers-reduced-motion: reduce) {
    .ds-marquee { overflow-x: auto; -webkit-mask: none; mask: none; scrollbar-width: none; }
    .ds-marquee-track { animation: none; }
    .ds-marquee-track[aria-hidden="true"] { display: none; }
    .ds-btn, .ds-link, .ds-card, .ds-faq summary .ds-faq-icon { transition: none; }
    .ds-faq details::details-content { transition: none; }
}
@media print {
    html.ds-motion [data-ds-reveal],
    html.ds-motion [data-ds-stagger] > *,
    html.ds-motion [data-ds-split] { opacity: 1 !important; transform: none !important; }
    .ds-night { background: #fff !important; color: #000 !important; }
}

/* ── Icons + mascot ────────────────────────────────────────────────── */
.ds-ico { width: 20px; height: 20px; flex: none; }
.ds-avi { display: block; }
[data-dark] .ds-night--rounded,
[data-dark] .hs-teach-card,
[data-dark] .hs-cta-card { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }

/* ── Motion tokens ──────────────────────────────────────────────────── */
/* Motion answers an action. Durations and curves that more than one surface
   uses live here; reduced-motion handling sits beside each use. */
:root {
    --motion-press: 80ms;
    --motion-fast: 120ms;
    --motion-base: 200ms;
    --motion-slow: 320ms;
    --motion-exit: 140ms;
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --ease-in: cubic-bezier(.4, 0, 1, 1);
    --ease-standard: cubic-bezier(.4, 0, .2, 1);
    --motion-shift: 6px;
}
