* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ===== WARM PAPER + EMERALD (single light theme) ==================
       Warm off-white paper, deep green-black ink, emerald as the one
       accent. Dark mode was retired 2026-07 - this is the only theme. */
    --bg: #FAF9F5;
    --bg-deep: #F1EFE8;
    --surface: #FFFFFF;
    --surface-alt: #F6F4ED;
    --surface-hi: #EFECE3;
    --primary: #0E9F70;
    --primary-hover: #0B8A60;
    --primary-bright: #10B981;
    --primary-deep: #0B7A54;
    --text: #1A211C;
    --text-muted: #5C685F;
    --text-secondary: #5C685F;
    --text-faint: #97A098;
    --border: #E6E2D6;
    --border-hi: #D8D3C4;

    /* Emerald glow — used for focus rings, halos, active states only */
    --glow: rgba(14, 159, 112, 0.32);
    --glow-soft: rgba(14, 159, 112, 0.12);
    --glow-faint: rgba(14, 159, 112, 0.06);

    /* Complementary (status only) */
    --danger: #C13543;
    --warning: #A96B00;
    --success: #0B8A60;
    --info: #2563EB;

    /* ===== SURFACE HIERARCHY =========================================
       Five rising planes, darkest → lightest. Every panel picks the level
       above its parent so depth is always legible:
         bg-deep  recesses / well backgrounds (timeline gutters, code wells)
         bg       the page itself
         surface  primary resting cards & panels
         surface-alt  controls and inset elements on a card
         surface-hi   the topmost interactive layer (hover, active rows) */

    /* ===== TYPE ======================================================= */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
    --font-serif: 'Newsreader', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

    /* Fluid editorial type scale — one coherent ramp, viewport-aware */
    --fs-display: clamp(48px, 8vw, 112px);
    --fs-h1: clamp(38px, 5.5vw, 72px);
    --fs-h2: clamp(28px, 3.4vw, 44px);
    --fs-h3: clamp(21px, 2vw, 28px);
    --fs-h4: clamp(18px, 1.5vw, 22px);
    --fs-lead: clamp(18px, 1.7vw, 23px);
    --fs-body: clamp(15px, 1.1vw, 17px);
    --fs-small: 13.5px;
    --fs-eyebrow: 12px;
    --fs-micro: 11px;

    /* Line-heights — tight for display, relaxed for reading */
    --lh-tight: 1.05;
    --lh-snug: 1.25;
    --lh-normal: 1.6;
    --lh-relaxed: 1.8;

    /* Letter-spacing — large type tightens, small/labels open up */
    --ls-display: -0.03em;
    --ls-tight: -0.02em;
    --ls-snug: -0.01em;
    --ls-normal: 0;
    --ls-wide: 0.02em;
    --ls-eyebrow: 0.18em;

    /* Weights */
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-black: 800;

    /* ===== SPACING SCALE (8px base) ==================================
       One ramp for every gap, pad and margin. Use these instead of ad-hoc
       pixel values so vertical rhythm stays consistent across pages. */
    --space-2xs: 4px;
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;

    /* Section rhythm — the spacing BETWEEN major page regions and the
       blocks within them. Fluid so it breathes on large screens. */
    --section-gap: clamp(72px, 11vw, 150px);
    --block-gap: clamp(32px, 5vw, 64px);
    --stack-gap: clamp(16px, 2vw, 24px);

    /* Comfortable measure for reading columns */
    --measure: 64ch;
    --measure-tight: 48ch;

    /* ===== RADIUS SCALE ==============================================
       Soft, engineered corners — never fully rounded except pills. */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-pill: 999px;

    /* ===== ELEVATION ================================================== */
    --shadow-xs: 0 1px 2px rgba(30, 41, 35, 0.06);
    --shadow-sm: 0 1px 2px rgba(15, 40, 30, 0.08);
    --shadow: 0 10px 30px -10px rgba(15, 40, 30, 0.16);
    --shadow-md: 0 14px 36px -12px rgba(15, 40, 30, 0.18);
    --shadow-lg: 0 30px 60px -20px rgba(15, 40, 30, 0.22);
    --shadow-glow: 0 12px 40px -10px var(--glow-soft);

    /* ===== GLASS ===================================================== */
    --glass-bg: rgba(255, 255, 255, 0.62);
    --glass-bg-strong: rgba(255, 255, 255, 0.82);
    --glass-border: rgba(15, 40, 30, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 16px 50px -14px rgba(15, 40, 30, 0.14);
    --glass-tint: rgba(15, 40, 30, 0.04);
    --glass-tint-strong: rgba(16, 185, 129, 0.12);
    /* one canonical blur strength so every frosted surface matches */
    --glass-blur: blur(18px) saturate(150%);
    --glass-blur-strong: blur(28px) saturate(160%);

    /* ===== ICON SIZING =============================================== */
    --icon-xs: 14px;
    --icon-sm: 16px;
    --icon-md: 20px;
    --icon-lg: 24px;
    --icon-xl: 32px;
    --icon-stroke: 2;

    /* ===== MOTION TOKENS =============================================
       Durations climb with the distance a thing travels; easing is almost
       always the calm "out" curve. Keep these in sync with motion.js Ease. */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);      /* default — decisive settle */
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);  /* symmetric moves */
    --ease-back: cubic-bezier(0.34, 1.3, 0.64, 1);  /* gentle overshoot, used sparingly */
    --dur-instant: 0.12s;
    --dur-fast: 0.22s;
    --dur: 0.4s;
    --dur-slow: 0.7s;
    --dur-slower: 0.95s;
    --dur-reveal: 0.8s;    /* scroll-reveal entrance */

    /* ===== FOCUS / INTERACTION ======================================= */
    --ring: 0 0 0 3px var(--glow-soft);
    --ring-strong: 0 0 0 3px var(--glow);
    --hover-lift: -3px;            /* canonical card hover translateY */
    --press-scale: 0.97;          /* canonical active() compression */

    /* ===== LAYOUT RHYTHM ============================================= */
    --content-pad: clamp(24px, 5vw, 72px);
    --maxw: 1240px;

    /* driven by Motion engine (0 → 1 across the page) */
    --scroll-progress: 0;

    /* ===== CINEMATIC VIDEO OVERLAYS (theme-aware) ====================
       Used by the History establishing-shot video so one file blends into
       both themes — dark-emerald cinematic wash in dark, light translucent
       wash in light. */
    --cine-tint: linear-gradient(168deg, rgba(255,255,255,0.20) 0%, rgba(255,255,255,0.03) 42%, rgba(14,159,112,0.10) 100%);
    --cine-vignette: radial-gradient(80% 80% at 50% 44%, transparent 56%, rgba(244,242,235,0.58) 100%);
    --cine-feather-color: var(--bg-deep);
}

/* ===== HISTORY PAGE — PINNED SCRUB TIMELINE (Apple spec-page style) ===== */
.scrub-section {
    display: grid;
    grid-template-columns: clamp(200px, 26vw, 380px) 1fr;
    gap: clamp(32px, 6vw, 96px);
    margin: clamp(80px, 12vw, 160px) 0;
}

.scrub-pin {
    position: sticky;
    top: clamp(80px, 18vh, 160px);
    align-self: start;
    height: fit-content;
}

.scrub-pin-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: clamp(12px, 2vw, 20px);
}

.scrub-pin-year {
    font-size: clamp(44px, 6vw, 76px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.scrub-pin-track {
    margin-top: clamp(20px, 3vw, 32px);
    width: 100%;
    height: 2px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.scrub-pin-progress {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    transition: width 0.4s ease;
}

.scrub-pin-count {
    margin-top: clamp(10px, 2vw, 16px);
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.scrub-pin-count strong { color: var(--text); }

.scrub-entries {
    position: relative;
}

.scrub-entry {
    min-height: 62vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(24px, 4vw, 40px) 0;
    opacity: 0.25;
    filter: blur(2px);
    transform: translateY(16px);
    transition: opacity 0.5s ease, filter 0.5s ease, transform 0.5s ease;
}

.scrub-entry:last-child {
    min-height: 50vh;
}

.scrub-entry.active {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

.scrub-entry-year {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: clamp(10px, 1.6vw, 16px);
    transition: color 0.4s ease;
}

.scrub-entry.active .scrub-entry-year {
    color: var(--primary);
}

.scrub-entry-title {
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 800;
    letter-spacing: -0.015em;
    margin-bottom: clamp(14px, 2vw, 20px);
    max-width: 600px;
}

.scrub-entry-desc {
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.75;
    color: var(--text-muted);
    max-width: 560px;
}

.scrub-entry-desc strong {
    color: var(--text);
    font-weight: 600;
}

@media (max-width: 760px) {
    .scrub-section {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .scrub-pin {
        position: sticky;
        top: 0;
        z-index: 5;
        padding: 16px 0 20px;
        background: linear-gradient(to bottom, var(--bg) 70%, transparent);
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .scrub-pin-eyebrow { display: none; }

    .scrub-pin-year {
        font-size: clamp(36px, 14vw, 56px);
    }

    .scrub-pin-track,
    .scrub-pin-count {
        margin-top: 0;
    }

    .scrub-entry {
        min-height: 38vh;
    }
}

/* ===== HISTORY PAGE — full-bleed background video moment =====
   A mid-page cinematic break before the timeline uses a full-viewport
   <video> as ambient background rather than a boxed card (plays once it
   scrolls into view, pauses once scrolled past). It breaks out of
   .content-area's padding via negative margins so the video runs edge-to-edge
   regardless of the app's fixed layout. */
.history-cinematic-break {
    position: relative;
    width: calc(100% + var(--content-pad) * 2);
    margin-left: calc(var(--content-pad) * -1);
    margin-right: calc(var(--content-pad) * -1);
    overflow: hidden;
    background-color: var(--bg-deep);
    height: auto;
    min-height: clamp(560px, 82vh, 880px);
    border-radius: 24px;
    margin-top: clamp(40px, 6vw, 80px);
    margin-bottom: clamp(60px, 10vw, 120px);
}

.history-cinematic-break .bg-video {
    cursor: pointer;
}

.bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.history-hero-fade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.12) 0%, transparent 18%, transparent 82%, var(--bg) 100%);
    pointer-events: none;
}

@media (max-width: 768px) {
    .history-cinematic-break {
        min-height: clamp(440px, 70vh, 620px);
        border-radius: 16px;
    }
}

html {
    scroll-behavior: smooth;
}

html, body {
    width: 100%;
    min-height: 100%;
    font-family: var(--font-sans);
    font-size: var(--fs-body);
    background-color: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 0.5s var(--ease-out), color 0.5s var(--ease-out);
}

body {
    overflow-x: hidden;
    position: relative;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== AMBIENT BACKGROUND — slow emerald aurora, evolves with scroll ===== */
.ambient {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(120% 80% at 50% -10%, rgba(16, 185, 129, 0.07), transparent 60%),
        var(--bg);
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.5;
    will-change: transform;
}

.ambient-orb-1 {
    width: 60vw;
    height: 60vw;
    left: -10vw;
    top: -10vw;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.22), transparent 65%);
    transform: translateY(calc(var(--scroll-progress) * 40vh));
    transition: transform 0.6s linear;
}

.ambient-orb-2 {
    width: 50vw;
    height: 50vw;
    right: -12vw;
    bottom: -8vw;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.14), transparent 65%);
    transform: translateY(calc(var(--scroll-progress) * -32vh));
    transition: transform 0.6s linear;
}

.ambient-grain {
    position: absolute;
    inset: -50%;
    opacity: 0.04;
    background-image: radial-gradient(rgba(255,255,255,0.5) 0.5px, transparent 0.5px);
    background-size: 4px 4px;
}

.ambient {
    background:
        radial-gradient(120% 80% at 50% -10%, rgba(14, 159, 112, 0.06), transparent 60%),
        var(--bg);
}
.ambient-orb-1 { background: radial-gradient(circle, rgba(14, 159, 112, 0.14), transparent 65%); }
.ambient-orb-2 { background: radial-gradient(circle, rgba(52, 211, 153, 0.12), transparent 65%); }
.ambient-grain { opacity: 0.015; }

/* the app shell sits above the ambient layer; let it show through */
.content-area, .main-container { background: transparent !important; }

/* ===== HEADER ===== */
.header {
    height: 76px;
    background-color: transparent;
    -webkit-backdrop-filter: blur(0px);
    backdrop-filter: blur(0px);
    border-bottom: 1px solid transparent;
    box-shadow: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--content-pad);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: height 0.45s var(--ease-out),
        background-color 0.45s var(--ease-out),
        border-color 0.45s var(--ease-out),
        box-shadow 0.45s var(--ease-out),
        backdrop-filter 0.45s var(--ease-out),
        transform 0.45s var(--ease-out);
}

/* Glass crystallizes only once the user leaves the top of the page */
.header.header-scrolled {
    height: 62px;
    background-color: var(--glass-bg);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}

.header.header-hidden {
    transform: translateY(-100%);
}

.header-left {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: clamp(20px, 3vw, 52px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.01em;
    cursor: pointer;
    transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.logo:hover { opacity: 0.82; }
.logo:active { transform: scale(0.97); }

.logo-text em {
    font-style: normal;
    font-weight: 500;
    color: var(--text-muted);
}

.logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(140deg, var(--primary-hover), var(--primary-deep));
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #04130D;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px -2px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    transition: width 0.45s var(--ease-out), height 0.45s var(--ease-out);
}

.header.header-scrolled .logo-icon { width: 32px; height: 32px; }

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.logo-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.04) 48%, rgba(255, 255, 255, 0) 60%);
    pointer-events: none;
}

.nav {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
    gap: 2px;
}

.nav-item {
    position: relative;
    z-index: 1;
    padding: 9px 18px;
    background: none;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease-out), transform 0.12s var(--ease-out);
}

.nav-item:hover { color: var(--text); }
.nav-item:active { transform: scale(0.95); }
.nav-item.active { color: var(--primary-bright); }

/* single gliding indicator that slides between items */
.nav-indicator {
    position: absolute;
    z-index: 0;
    top: 50%;
    left: 0;
    height: 36px;
    width: 0;
    transform: translateY(-50%);
    border-radius: 999px;
    background: var(--glass-tint-strong);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 var(--glass-highlight);
    opacity: 0;
    transition: transform 0.42s var(--ease-out), width 0.42s var(--ease-out), background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    pointer-events: none;
}
.nav-indicator.is-ready { opacity: 1; }
.nav-indicator.is-hovering {
    background: var(--glass-tint-strong);
    border-color: var(--primary-deep);
    box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 0 1px var(--glow-soft), 0 6px 18px -8px var(--glow);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* prev/next section arrows — glass pill */
.nav-arrows {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 32px;
    padding: 2px;
    background-color: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18), inset 0 -1px 0 var(--glass-highlight);
}
.nav-arrow {
    width: 30px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 50px;
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease, transform 0.15s ease;
}
.nav-arrow:hover { color: var(--text); background-color: var(--glass-border); }
.nav-arrow:active { transform: scale(0.92); }
.nav-arrow:disabled { opacity: 0.3; cursor: default; pointer-events: none; }
.nav-arrow svg { display: block; }
.nav-arrow:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--primary-bright); }

/* ===== MAIN LAYOUT ===== */
.main-container {
    display: flex;
    min-height: calc(100vh - 76px);
    height: auto;
    overflow: visible;
}

.sidebar {
    width: 0;
    background-color: transparent;
    border-right: none;
    overflow: hidden;
    transition: width 0.3s ease;
}

.content-area {
    flex: 1;
    min-width: 0;
    overflow-y: visible;
    background-color: transparent;
    padding: clamp(32px, 5vw, 72px) var(--content-pad) 96px;
}

/* top-of-page scroll progress rail */
.scroll-rail {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 1001;
    background: transparent;
    pointer-events: none;
}
.scroll-rail-fill {
    height: 100%;
    width: calc(var(--scroll-progress) * 100%);
    background: linear-gradient(90deg, var(--primary-deep), var(--primary-bright));
    box-shadow: 0 0 12px var(--glow);
    transition: width 0.1s linear;
}

.detail-panel {
    width: 0;
    background-color: var(--surface);
    border-left: 1px solid var(--border);
    overflow: hidden;
    transition: width 0.3s ease;
    position: relative;
}

.detail-panel.open {
    width: 420px;
}

.detail-panel-content {
    width: 420px;
    height: 100%;
    overflow-y: auto;
    padding: 32px;
    animation: slideInRight 0.3s ease;
}

/* ===== MESSAGE EXPLORER POPUP (Phase 7) =====
   An "Outlook-style" reading window: centered card over a dimmed, blurred
   backdrop. Reuses .detail-panel-content for the inner layout. */
.msg-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 56px 20px;
    background: rgba(4, 8, 7, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    overflow-y: auto;
}
.msg-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
.msg-modal {
    width: min(580px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    transform: translateY(14px) scale(0.985);
    transition: transform 0.22s ease;
    margin: auto 0;
}
.msg-modal-overlay.open .msg-modal {
    transform: none;
}
.msg-modal .detail-panel-content {
    width: 100%;
    height: auto;
    max-height: none;
    animation: none;
    padding: 32px;
}
@media (max-width: 640px) {
    .msg-modal-overlay { padding: 20px 12px; }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page {
    animation: fadeIn 0.3s ease;
}

/* ===== PAGE STYLES ===== */
.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 32px;
    color: var(--text);
}

.section-description {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 900px;
    margin-bottom: 32px;
}

.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    transition: all 0.2s ease;
}

.card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.card-description {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.highlight-box {
    background-color: var(--surface-alt);
    border-left: 4px solid var(--primary);
    padding: 24px;
    border-radius: 8px;
    margin: 24px 0;
}

/* ===== GRID ===== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* ===== MESSAGE EXPLORER SPECIFIC ===== */
.explorer-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    height: calc(100vh - 200px);
}

.family-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.family-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.family-card:hover {
    border-color: var(--primary);
    background-color: var(--surface-alt);
}

.family-card.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
}

.family-card-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}

.family-card-count {
    font-size: 12px;
    opacity: 0.7;
}

.message-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    overflow-y: auto;
}

.message-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.message-card:hover {
    border-color: var(--primary);
    background-color: var(--surface-alt);
}

.message-card.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
}

/* ===== BUSINESS CATALOGUE ===== */
.pillar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 32px;
}

.pillar-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.pillar-card:hover {
    border-color: var(--primary);
    background-color: var(--surface-alt);
}

.pillar-card.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--bg);
}

.pillar-card-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.pillar-card-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
}

.pillar-card-count {
    font-size: 12px;
    opacity: 0.7;
}

.participant-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.participant-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 12px;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.participant-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.participant-icon {
    font-size: 22px;
    width: 44px;
    height: 44px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
}

.participant-role {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.process-map {
    margin-bottom: 16px;
    padding: 16px 18px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.process-map-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
}

.process-map-flow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    overflow-x: auto;
}

.process-map-step {
    background-color: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.process-map-arrow {
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
}

/* ===== DETAIL PANEL ===== */
.detail-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.detail-tab {
    background: none;
    border: none;
    padding: 10px 4px;
    margin-right: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.detail-tab:hover {
    color: var(--text);
}

.detail-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.detail-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.detail-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.detail-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.detail-section {
    margin-bottom: 24px;
}

.detail-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.detail-value {
    font-size: 15px;
    color: var(--text);
    font-weight: 500;
}

.detail-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
}

.tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.tag {
    background-color: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.xml-example {
    background-color: var(--surface-alt);
    color: var(--primary);
    padding: 16px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    margin-top: 12px;
    border: 1px solid var(--border);
}

/* ===== GLOSSARY ===== */
.search-box {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background-color: var(--surface);
    color: var(--text);
    font-size: 14px;
    margin-bottom: 32px;
    transition: all 0.2s ease;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.glossary-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid var(--primary);
    transition: all 0.2s ease;
}

.glossary-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.glossary-term {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.glossary-definition {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: var(--bg);
    padding: 80px 60px;
    border-radius: 16px;
    margin-bottom: 80px;
    text-align: center;
}

.hero h1 {
    font-size: 52px;
    font-weight: 700;
    margin-bottom: 16px;
}

.hero p {
    font-size: 18px;
    opacity: 0.95;
    line-height: 1.6;
}

/* ===== TIMELINE ===== */
.timeline {
    margin-top: 32px;
}

.timeline-item {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
}

.timeline-dot {
    width: 16px;
    height: 16px;
    background-color: var(--primary);
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
    border: 3px solid var(--bg);
    box-shadow: 0 0 0 2px var(--border);
}

.timeline-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.timeline-content p {
    font-size: 14px;
    color: var(--text);
    line-height: 1.6;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 24px;
    background-color: var(--primary);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .glossary-grid {
        grid-template-columns: 1fr;
    }

    .explorer-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .message-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 16px;
    }

    .content-area {
        padding: 24px;
    }

    .nav-item {
        padding: 8px 12px;
        font-size: 12px;
    }

    .hero {
        padding: 40px 24px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }

    .detail-panel.open {
        width: 100%;
        position: absolute;
        right: 0;
        top: 0;
        z-index: 1001;
    }
}


/* Ticker banner removed -- the scrolling currency/network ticker competed
   for attention right under the header, so it was dropped. */

/* ===== STORY SECTIONS (History intro) — static stacked, fade-in on scroll ===== */
.story-section {
    max-width: 900px;
    margin: clamp(90px, 16vw, 160px) auto;
    text-align: center;
    width: 100%;
}

.story-section:first-of-type {
    margin-top: clamp(16px, 3vw, 40px);
}

.story-year {
    color: var(--primary);
    font-size: clamp(12px, 1.4vw, 14px);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: clamp(12px, 2vw, 16px);
}

.story-section h2 {
    font-size: clamp(40px, 7vw, 96px);
    line-height: 1.15;
    letter-spacing: -0.025em;
    margin-bottom: clamp(18px, 3vw, 24px);
    font-weight: 800;
    padding-bottom: 0.08em;
}

.story-section p {
    font-size: clamp(17px, 2vw, 22px);
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 760px;
    margin: 0 auto;
}

.gradient-text {
    background: linear-gradient(120deg, var(--primary) 0%, var(--primary-hover) 45%, var(--text) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.iso-birth {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.iso-birth::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(16, 185, 129, 0.08);
    filter: blur(120px);
    border-radius: 50%;
    z-index: -1;
}

.iso-year {
    font-size: clamp(120px, 18vw, 260px);
    font-weight: 800;
    line-height: 1;
}

.iso-year {
    color: rgba(15, 23, 42, 0.08);
}

.iso-name {
    font-size: clamp(64px, 8vw, 140px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-top: -20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.iso-tagline {
    margin-top: clamp(12px, 2vw, 20px);
    font-size: clamp(16px, 2vw, 24px);
    color: var(--text-muted);
}

.reveal-section {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.reveal-section.in-view {
    opacity: 1;
}

/* ============================
   INTRO PRELOADER
   ============================ */

body.preloader-active {
    overflow: hidden;
}

.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
}

.preloader.is-done {
    display: none;
}

.preloader-currency {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.preloader.is-exiting .preloader-currency {
    opacity: 0;
}

.currency-symbol {
    position: absolute;
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: clamp(72px, 13vw, 180px);
    line-height: 1;
    background: linear-gradient(120deg, var(--primary) 0%, var(--primary-hover) 45%, var(--text) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: scale(0.3);
    filter: blur(16px);
    transition: opacity 0.42s cubic-bezier(0.34, 1.56, 0.64, 1),
        transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1),
        filter 0.42s ease;
}

.currency-symbol.is-active {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

.eyelid {
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    background: var(--bg);
    z-index: 1;
    transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1);
}

.eyelid-top {
    top: 0;
    border-radius: 0 0 50% 50% / 0 0 60px 60px;
}

.eyelid-bottom {
    bottom: 0;
    border-radius: 50% 50% 0 0 / 60px 60px 0 0;
}

.preloader.is-opening .eyelid-top {
    transform: translateY(-100%);
}

.preloader.is-opening .eyelid-bottom {
    transform: translateY(100%);
}

@media (prefers-reduced-motion: reduce) {
    .currency-symbol {
        transition: none;
    }
}

/* ============================
   KINETIC HEADLINE ENTRANCE
   (timed to start as the preloader's eyelids finish opening)
   ============================ */

.kinetic-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(24px);
    filter: blur(6px);
}

body.kinetic-ready .kinetic-headline .kinetic-word {
    animation: kinetic-rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.kinetic-ready .kinetic-headline .kinetic-word:nth-of-type(1) {
    animation-delay: 0s;
}

body.kinetic-ready .kinetic-headline .kinetic-word:nth-of-type(2) {
    animation-delay: 0.2s;
}

@keyframes kinetic-rise {
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .kinetic-word {
        opacity: 1;
        transform: none;
        filter: none;
        animation: none;
    }
}

/* ============================
   STATS STRIP (live numbers, History page hero)
   ============================ */

.stats-strip {
    display: flex;
    align-items: center;
    gap: 32px;
    margin: 28px 0;
    padding: 20px 28px;
    background-color: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
    opacity: 0;
    transform: translateY(16px);
}

body.kinetic-ready .stats-strip {
    animation: stats-fade-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.45s;
}

@keyframes stats-fade-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat {
    flex: 1;
    padding-right: 24px;
    border-right: 1px solid var(--glass-border);
}

.stat:last-child {
    padding-right: 0;
    border-right: none;
}

.stat-value {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 26px;
    color: var(--primary);
    line-height: 1;
}

.stat-prefix,
.stat-suffix {
    font-size: 16px;
    font-weight: 600;
}

.stat-label {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
    .stats-strip {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

@media (max-width: 640px) {
    .stats-strip {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 18px 20px;
    }

    .stat {
        width: 100%;
        padding-right: 0;
        padding-bottom: 14px;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }

    .stat:last-child {
        padding-bottom: 0;
        border-bottom: none;
    }
}

/* ============================
   SCROLL CUE (bottom of first viewport, History page)
   ============================ */

.scroll-cue {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.45s ease;
}

body.kinetic-ready .scroll-cue {
    animation: scroll-cue-fade-in 0.6s ease forwards;
    animation-delay: 1.3s;
}

.scroll-cue.is-hidden {
    opacity: 0 !important;
    pointer-events: none;
}

.scroll-cue-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.scroll-cue-chevron {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--glass-bg);
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(8px) saturate(160%);
    backdrop-filter: blur(8px) saturate(160%);
    box-shadow: inset 0 1px 0 var(--glass-highlight);
    color: var(--primary);
    font-size: 13px;
    animation: scroll-cue-bounce 1.8s ease-in-out infinite;
}

@keyframes scroll-cue-fade-in {
    to {
        opacity: 1;
    }
}

@keyframes scroll-cue-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(6px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .scroll-cue {
        animation: none;
        opacity: 1;
    }
    .scroll-cue-chevron {
        animation: none;
    }
}

.hl-line {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    animation: hl-reveal 0.6s ease forwards;
}

.hl-1 { animation-delay: 0.15s; }
.hl-2 { animation-delay: 0.55s; }

@keyframes hl-reveal {
    to { opacity: 1; transform: translateY(0); }
}

/* ============================
   GLOSSY SQUIRCLE ICONS
   Hand-built "Apple app icon" style tiles (rounded-square gradient + a soft
   highlight sweep), zero dependencies. One gradient per chapter, reused
   anywhere a chapter needs a visual identity -- route markers, the resume
   banner, the chapter header.
   ============================ */

.glossy-icon {
    position: relative;
    border-radius: 28%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: var(--shadow), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.glossy-icon::after {
    content: '';
    position: absolute;
    top: -35%;
    left: -10%;
    width: 120%;
    height: 75%;
    background: radial-gradient(ellipse at top, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 70%);
    pointer-events: none;
}

.glossy-icon svg {
    position: relative;
    z-index: 1;
}

.icon-foundations { background: linear-gradient(135deg, #94a3b8 0%, #475569 100%); }
.icon-payments { background: linear-gradient(135deg, #34d399 0%, #059669 100%); }
.icon-fx { background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%); }
.icon-cards { background: linear-gradient(135deg, #a78bfa 0%, #6d28d9 100%); }
.icon-trade { background: linear-gradient(135deg, #38bdf8 0%, #0369a1 100%); }
.icon-securities { background: linear-gradient(135deg, #2dd4bf 0%, #0f766e 100%); }

.lesson-why-section {
    margin: 28px 0;
    display: grid;
    gap: 12px;
}

.lesson-why-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--text-muted);
    border-radius: 10px;
    padding: 16px 18px;
}

.lesson-why-card-solution {
    border-left-color: var(--primary);
}

.lesson-why-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.lesson-why-card-solution .lesson-why-label {
    color: var(--primary);
}

.lesson-why-text {
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text);
}

.xml-editor-shell {
    display: flex;
    flex-direction: column;
    background-color: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.xml-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
}

.xml-editor-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--border);
}

.xml-editor-filename {
    margin-left: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.xml-editor {
    width: 100%;
    background: none;
    color: var(--primary);
    border: none;
    padding: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.7;
}

.xml-readonly {
    margin: 0;
    overflow-x: auto;
    white-space: pre;
    user-select: text;
}

.spotlight-fields {
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
}

.spotlight-field {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 14px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.spotlight-field-tag {
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    min-width: 90px;
}

.spotlight-field-meaning {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
}

/* =============================================================================
   PREMIUM LAYER — reusable motion primitives + elevated components
   Loaded last so it refines the base styles above without rewriting them.
   ========================================================================== */

/* ---- 1. REVEAL PRIMITIVES ------------------------------------------------ */
[data-reveal] {
    opacity: 0;
    transition:
        opacity var(--dur-reveal) var(--ease-out) var(--reveal-delay, 0ms),
        transform var(--dur-reveal) var(--ease-out) var(--reveal-delay, 0ms),
        filter var(--dur-reveal) var(--ease-out) var(--reveal-delay, 0ms);
    will-change: opacity, transform;
}
[data-reveal="up"]    { transform: translateY(38px); }
[data-reveal="fade"]  { transform: none; }
[data-reveal="left"]  { transform: translateX(-44px); }
[data-reveal="right"] { transform: translateX(44px); }
[data-reveal="scale"] { transform: scale(0.94); }
[data-reveal="blur"]  { transform: translateY(24px); filter: blur(10px); }
[data-reveal].is-revealed {
    opacity: 1;
    transform: none;
    filter: none;
}
@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* ---- 2. EDITORIAL TYPOGRAPHY UTILITIES ----------------------------------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--font-mono);
    font-size: var(--fs-eyebrow);
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--primary);
}
.eyebrow::before {
    content: '';
    width: 22px;
    height: 1px;
    background: linear-gradient(90deg, var(--primary), transparent);
}
.eyebrow.eyebrow-center::before { display: none; }

.serif { font-family: var(--font-serif); font-weight: 400; }
.serif-italic { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

/* a refined gradient text that doesn't clip descenders */
.gradient-text {
    background: linear-gradient(100deg, var(--primary-bright) 0%, var(--primary) 40%, var(--text) 110%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    padding-bottom: 0.06em;
}

/* ---- 3. BUTTONS ---------------------------------------------------------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 26px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
    color: #04130D;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14.5px;
    font-weight: var(--fw-semibold);
    letter-spacing: 0.005em;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 6px 20px -8px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, var(--primary-bright), var(--primary));
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px -10px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: translateY(0) scale(0.98); }
/* arrows inside buttons glide on hover */
.btn { --arrow-shift: 0px; }
.btn:hover { --arrow-shift: 4px; }

.btn-ghost {
    background: var(--glass-bg);
    color: var(--text);
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 var(--glass-highlight);
}
.btn-ghost::after { background: var(--glass-tint-strong); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-hi); box-shadow: var(--shadow-md); }

/* compact + block button variants for consistent sizing */
.btn-sm { padding: 9px 18px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ---- 4. CARD / GLASS SURFACE -------------------------------------------- */
.glass-card {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
    transition: transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
[data-tilt] {
    transition: transform 0.3s var(--ease-out), border-color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
    transform-style: preserve-3d;
}
[data-tilt]::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--glow-faint), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s var(--ease-out);
    pointer-events: none;
}
[data-tilt]:hover::before { opacity: 1; }
[data-tilt]:hover { border-color: var(--border-hi); box-shadow: var(--shadow-lg); }

/* refine base .card to the new system */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    transition: transform var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.card:hover {
    border-color: var(--border-hi);
    box-shadow: var(--shadow-lg);
    transform: translateY(var(--hover-lift));
}

/* ---- 5. LIVING PROCESS MAPS --------------------------------------------- */
.process-map {
    margin-bottom: 16px;
    padding: 22px 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}
.process-map-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text);
    margin-bottom: 18px;
}
.process-map-flow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.process-map-step {
    position: relative;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    /* start hidden; Motion engine reveals actor-by-actor */
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), border-color 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), color 0.35s var(--ease-out);
}
.process-map-step.flow-in { opacity: 1; transform: none; }
/* the value pulse traveling through the system */
.process-map-step.flow-active {
    border-color: var(--primary);
    color: var(--primary-bright);
    box-shadow: 0 0 0 1px var(--primary), 0 8px 24px -8px var(--glow);
    background: var(--glass-tint-strong);
}
.process-map-arrow {
    color: var(--text-faint);
    font-weight: 700;
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), color 0.35s var(--ease-out);
}
.process-map-arrow.flow-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .process-map-step, .process-map-arrow { opacity: 1 !important; transform: none !important; }
}

/* ---- 6. SECTION HEADINGS / STORY ---------------------------------------- */
.section-title {
    font-family: var(--font-display);
    font-size: var(--fs-h1);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin-bottom: 18px;
    color: var(--text);
}
.section-description {
    font-size: var(--fs-lead);
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 60ch;
    margin-bottom: 40px;
    text-wrap: pretty;
}

.story-section h2 {
    font-family: var(--font-display);
    font-size: clamp(40px, 7vw, 92px);
    line-height: 1.08;
    letter-spacing: -0.03em;
    font-weight: 800;
    text-wrap: balance;
}
.story-section p {
    font-size: var(--fs-lead);
    line-height: 1.8;
    color: var(--text-muted);
    text-wrap: pretty;
}
.story-year {
    font-family: var(--font-mono);
    letter-spacing: 0.16em;
    color: var(--primary);
}

/* documentary pull-quote (the italic lines on History) */
.pullquote {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(24px, 3.4vw, 40px);
    line-height: 1.4;
    letter-spacing: -0.01em;
    color: var(--text);
    max-width: 18ch;
    margin: 0 auto;
    text-wrap: balance;
}

/* ---- 7. SCRUB TIMELINE refinement --------------------------------------- */
.scrub-entry-title {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}
.scrub-pin-year { font-family: var(--font-display); }

/* ---- 8. GLOSSARY — interactive encyclopedia ----------------------------- */
.glossary-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
    align-items: center;
    margin-bottom: 36px;
}
.search-box {
    flex: 1;
    min-width: 240px;
    max-width: 520px;
    padding: 14px 18px 14px 46px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238FA39B' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 16px center;
    color: var(--text);
    font-size: 15px;
    font-family: var(--font-sans);
    transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background-color 0.3s var(--ease-out), max-width 0.5s var(--ease-out);
}
.search-box::placeholder { color: var(--text-faint); }
.search-box:focus {
    outline: none;
    border-color: var(--primary);
    max-width: 560px;
    box-shadow: 0 0 0 4px var(--glow-soft), 0 12px 30px -12px rgba(0,0,0,0.4);
}
.glossary-count {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
    letter-spacing: 0.04em;
}
.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.glossary-card {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-left: none;
    border-radius: 16px;
    padding: 22px 24px;
    overflow: hidden;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: transform 0.4s var(--ease-out), border-color 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.glossary-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(var(--primary), var(--primary-deep));
    transform: scaleY(0.18);
    transform-origin: center;
    transition: transform 0.45s var(--ease-out);
}
.glossary-card:hover {
    transform: translateY(var(--hover-lift));
    border-color: var(--border-hi);
    box-shadow: var(--shadow-lg);
}
.glossary-card:hover::before { transform: scaleY(1); }
.glossary-term {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-bright);
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}
.glossary-definition {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-muted);
}
.glossary-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 24px;
    color: var(--text-faint);
    font-size: 15px;
}

/* ---- 9. DETAIL PANEL refinement ----------------------------------------- */
.detail-panel {
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    backdrop-filter: blur(28px) saturate(160%);
    border-left: 1px solid var(--glass-border);
}
.xml-example, .xml-editor {
    color: var(--primary-bright);
    font-family: var(--font-mono);
}

/* ---- 15. RESPONSIVE — header / nav on tablet & mobile -------------------- */
@media (max-width: 980px) {
    .header-left { gap: clamp(14px, 2vw, 28px); }
}
@media (max-width: 860px) {
    .logo-text em { display: none; }
}
/* Tablet/phone: the four-item nav can't keep the desktop gliding pill without
   risking overflow, so it becomes a tidy horizontal scroller that always shows
   the active item from the left, with a soft fade hinting there's more. */
@media (max-width: 720px) {
    .header { padding: 0 16px; }
    .header-left { gap: 12px; flex: 1; min-width: 0; }
    .logo-text { display: none; }
    .logo { flex-shrink: 0; }
    .nav {
        flex: 1;
        min-width: 0;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        justify-content: flex-start;
        -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%);
        mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%);
    }
    .nav::-webkit-scrollbar { display: none; }
    .nav-item { padding: 8px 13px; font-size: 13px; }
    /* the gliding pill is hard to keep aligned inside a scroller — fall back
       to a simple per-item tint on small screens */
    .nav-indicator { display: none; }
    .nav-item.active {
        background: var(--glass-tint-strong);
        border-radius: 999px;
        box-shadow: inset 0 1px 0 var(--glass-highlight);
    }
}
@media (max-width: 380px) {
    .nav-item { padding: 7px 10px; font-size: 12.5px; }
}
@media (max-width: 480px) {
}

/* Legacy reveal-section no longer hides its content behind IntersectionObserver
   — inner [data-reveal] elements carry the entrance motion now, so a missed IO
   callback can never leave a whole section invisible. */
.reveal-section { opacity: 1 !important; }

/* Page wrapper entrance must never gate visibility on a (possibly stuck)
   opacity animation — use a transform-only rise instead. */
.page { animation: page-rise 0.55s var(--ease-out) both !important; }
@keyframes page-rise {
    from { transform: translateY(14px); }
    to { transform: translateY(0); }
}

/* ---- 11. BUTTON ARROW glide --------------------------------------------- */
.btn-arrow {
    display: inline-block;
    transition: transform 0.3s var(--ease-out);
    transform: translateX(var(--arrow-shift, 0));
}

/* ---- 12. HISTORY cinematic establishing scene --------------------------- */
.cinematic-scene {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 4.5vh, 48px);
    padding: clamp(40px, 7vh, 84px) clamp(20px, 5vw, 56px);
    background:
        radial-gradient(80% 120% at 50% 0%, rgba(16, 185, 129, 0.10), transparent 55%),
        linear-gradient(180deg, var(--surface) 0%, var(--bg-deep) 100%);
    border: 1px solid var(--glass-border);
}
.cinematic-flow {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 22px);
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 20px;
    will-change: transform;
}
.cinematic-node {
    font-family: var(--font-mono);
    font-size: clamp(11px, 1.4vw, 14px);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text);
    padding: 9px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--glass-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    white-space: nowrap;
}
.cinematic-wire {
    position: relative;
    width: clamp(36px, 7vw, 96px);
    height: 2px;
    background: linear-gradient(90deg, var(--border-hi), var(--primary-deep), var(--border-hi));
    border-radius: 2px;
    overflow: visible;
}
.cinematic-pulse {
    position: absolute;
    top: 50%;
    left: 0;
    width: 8px;
    height: 8px;
    margin-top: -4px;
    border-radius: 50%;
    background: var(--primary-bright);
    box-shadow: 0 0 12px var(--glow);
    animation: cinematic-travel 3.3s linear infinite;
}
@keyframes cinematic-travel {
    0% { left: 0; opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}
.cinematic-caption {
    text-align: center;
    will-change: transform;
}
.cinematic-caption p {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(20px, 3vw, 34px);
    color: var(--text);
    margin: 12px 0 14px;
    text-wrap: balance;
}
.cinematic-slot-note {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--text-faint);
    text-transform: uppercase;
}
@media (prefers-reduced-motion: reduce) {
    .cinematic-pulse { animation: none; opacity: 1; left: 50%; }
}

/* ---- 12b. CINEMATIC ESTABLISHING-SHOT VIDEO -----------------------------
   The real footage, blended into the page: all four edges feathered with a
   CSS mask so it reads as part of the background rather than a boxed player,
   plus a theme-aware emerald cinematic tint and a soft vignette. The ambient
   CSS scene behind it doubles as the graceful fallback when the file is
   absent. */
.cinematic-video {
    position: relative;
    width: min(100%, 1120px);
    height: min(54vh, 540px);
    margin: 0 auto;
    isolation: isolate;
    /* feather ALL FOUR edges into the page (mask intersect of two gradients) */
    -webkit-mask:
        linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%),
        linear-gradient(to bottom, transparent 0, #000 11%, #000 84%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask:
        linear-gradient(to right, transparent 0, #000 9%, #000 91%, transparent 100%),
        linear-gradient(to bottom, transparent 0, #000 11%, #000 84%, transparent 100%);
    mask-composite: intersect;
    /* gentle reveal: fade + settle from 1.02 -> 1.00 */
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 0.95s var(--ease-out), transform 0.95s var(--ease-out);
}
.cinematic-video.is-revealed { opacity: 1; transform: scale(1); }

.cinematic-video-el {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.8s var(--ease-out);
}
.cinematic-video.has-video .cinematic-video-el { opacity: 1; }

.cinematic-video-tint,
.cinematic-video-vignette,
.cinematic-video-feather {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.cinematic-video-tint { background: var(--cine-tint); z-index: 1; }
.cinematic-video-vignette { background: var(--cine-vignette); z-index: 2; }
/* blend the video's lower edge down into the caption area */
.cinematic-video-feather {
    z-index: 3;
    background: linear-gradient(to bottom, transparent 72%, var(--cine-feather-color) 100%);
}
/* tint/vignette only make sense once footage is showing */
.cinematic-video:not(.has-video) .cinematic-video-tint,
.cinematic-video:not(.has-video) .cinematic-video-vignette,
.cinematic-video:not(.has-video) .cinematic-video-feather { opacity: 0; }

/* graceful fallback — ambient placeholder shown until/unless the file loads */
.cinematic-video-fallback {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 24px;
    text-align: center;
    background: radial-gradient(circle at 50% 42%, var(--glow-faint), transparent 62%);
}
.cinematic-video.is-loading .cinematic-video-fallback,
.cinematic-video.no-video .cinematic-video-fallback { display: flex; }
.cinematic-video.has-video .cinematic-video-fallback { display: none; }
.cinematic-fallback-pulse {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary-bright);
    box-shadow: 0 0 0 0 var(--glow);
    animation: cine-fallback-pulse 2.4s var(--ease-out) infinite;
}
@keyframes cine-fallback-pulse {
    0% { box-shadow: 0 0 0 0 var(--glow); opacity: 1; }
    70% { box-shadow: 0 0 0 22px transparent; opacity: 0.6; }
    100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}
.cinematic-video-fallback .cinematic-slot-note { max-width: 36ch; line-height: 1.6; }
.cinematic-video-fallback code {
    font-family: var(--font-mono);
    color: var(--primary-bright);
    font-size: 0.95em;
}

@media (max-width: 768px) {
    .cinematic-video { height: min(46vh, 380px); }
}
@media (max-width: 600px) {
    .cinematic-video {
        height: min(40vh, 300px);
        -webkit-mask:
            linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%),
            linear-gradient(to bottom, transparent 0, #000 8%, #000 88%, transparent 100%);
        -webkit-mask-composite: source-in;
        mask:
            linear-gradient(to right, transparent 0, #000 5%, #000 95%, transparent 100%),
            linear-gradient(to bottom, transparent 0, #000 8%, #000 88%, transparent 100%);
        mask-composite: intersect;
    }
}
@media (prefers-reduced-motion: reduce) {
    .cinematic-video { opacity: 1 !important; transform: none !important; transition: none; }
}

/* ---- 13. SCRUB intro ----------------------------------------------------- */
.scrub-intro {
    text-align: center;
    max-width: 720px;
    margin: clamp(40px, 8vw, 96px) auto clamp(8px, 2vw, 24px);
}
.scrub-intro-title {
    font-family: var(--font-display);
    font-size: clamp(30px, 4.5vw, 56px);
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-top: 14px;
    text-wrap: balance;
}

/* ---- 14. PLAYGROUND console --------------------------------------------- */
.pg-console {
    margin-top: 12px;
    padding: clamp(20px, 3vw, 34px);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}
.pg-format-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.pg-format { flex: 1; min-width: 160px; }
.pg-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-faint);
    margin-bottom: 8px;
}
.pg-pill {
    padding: 12px 18px;
    border-radius: 12px;
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    color: var(--text);
}
.pg-pill.is-dest { border-color: var(--primary-deep); color: var(--primary-bright); background: var(--glass-tint-strong); }
.pg-transform-badge {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--primary-bright);
    background: var(--glass-tint-strong);
    border: 1px solid var(--glass-border);
}
.pg-panes {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: 16px;
}
.pg-pane {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    min-width: 0;
}
.pg-pane-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.pg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-hi); }
.pg-pane-name {
    margin-left: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
}
.pg-code {
    margin: 0;
    padding: 18px;
    font-family: var(--font-mono);
    font-size: clamp(11px, 1.1vw, 13px);
    line-height: 1.7;
    color: var(--text-muted);
    overflow-x: auto;
    white-space: pre;
}
.pg-code-xml { color: var(--primary-bright); }
.pg-wire {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.pg-wire-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 10px var(--glow);
    animation: pg-pulse 1.8s ease-in-out infinite;
}
@keyframes pg-pulse {
    0%, 100% { opacity: 0.25; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.15); }
}
.pg-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 24px;
}
.pg-stat {
    text-align: center;
    padding: 18px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
}
.pg-stat-num {
    font-family: var(--font-mono);
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 600;
    color: var(--primary-bright);
    line-height: 1;
}
.pg-stat-suffix { font-size: 0.6em; }
.pg-stat-label {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-muted);
}
.pg-soon {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 28px;
    padding: 20px 24px;
    border-radius: 16px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}
.pg-soon-badge {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-bright);
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--glass-tint-strong);
    border: 1px solid var(--glass-border);
}
.pg-soon p {
    flex: 1;
    min-width: 220px;
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-muted);
    margin: 0;
}
@media (max-width: 760px) {
    .pg-panes { grid-template-columns: 1fr; }
    .pg-wire { flex-direction: row; padding: 4px 0; }
    .pg-stats { grid-template-columns: 1fr; }
}

/* ---- 14b. PLAYGROUND — live MT103 → pacs.008 transformer ----------------- */
.pg-lab { margin-top: 14px; }
.pg-lab-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.05fr);
    gap: 16px;
    align-items: stretch;
}
.pg-pane-edit, .pg-pane-out {
    display: flex;
    flex-direction: column;
    min-height: 460px;
}
.pg-pane-flag {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
}
.pg-pane-flag.is-legacy { color: var(--text-faint); background: var(--surface-alt); }
.pg-pane-flag.is-iso { color: var(--primary-bright); background: var(--glass-tint-strong); border-color: var(--primary-deep); }

/* editable MT103 fields */
.pg-fields { padding: 6px; overflow-y: auto; flex: 1; }
.pg-field-row {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.pg-field-row + .pg-field-row { margin-top: 2px; }
.pg-field-row.is-linked {
    background: var(--glass-tint-strong);
    border-color: var(--primary-deep);
}
.pg-field-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.pg-mt-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-bright);
    flex-shrink: 0;
}
.pg-mt-label { font-size: 11.5px; color: var(--text-muted); line-height: 1.3; }
.pg-field-inputs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pg-field-sep { width: 1px; }
.pg-input {
    flex: 1;
    min-width: 90px;
    padding: 8px 11px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.pg-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--glow-soft);
}
.pg-select { cursor: pointer; flex: 0 0 auto; }

/* wire between the panes */
.pg-lab-wire {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: var(--primary);
}
.pg-wire-arrow { font-size: 22px; opacity: 0.8; }
.pg-wire-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    writing-mode: vertical-rl;
    margin-top: 4px;
}

/* generated XML / plain tree */
.pg-xml-tree {
    flex: 1;
    margin: 0;
    padding: 16px 18px;
    background: var(--bg-deep);
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.65;
    overflow: auto;
    white-space: pre;
}
.pg-xml-line {
    border-radius: 5px;
    padding: 0 5px;
    margin: 0 -5px;
    transition: background var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.pg-xml-line.is-linked {
    background: var(--glass-tint-strong);
    box-shadow: inset 2px 0 0 var(--primary-bright);
}
.x-pt { color: var(--text-faint); }
.x-tg { color: var(--primary-bright); }
.x-at { color: #C99A6B; }
.x-vl { color: var(--text); }
.pg-tree-name { color: var(--text); }
.pg-tree-val { color: var(--primary-bright); }
.pg-tree-ccy { color: #C99A6B; font-size: 11px; }

.pg-view-toggle {
    display: inline-flex;
    margin-left: 10px;
    padding: 2px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 8px;
    gap: 2px;
}
.pg-view-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.03em;
    padding: 4px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.pg-view-btn.is-on { background: var(--primary); color: var(--bg); font-weight: 600; }

/* validation panel */
.pg-valid {
    margin-top: 16px;
    padding: 22px clamp(16px, 2.4vw, 28px);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}
.pg-valid-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.pg-valid-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--text); }
.pg-valid-sum { margin-top: 4px; font-size: 13px; }
.pg-sum-ok { color: var(--primary-bright); font-weight: 600; }
.pg-sum-warn { color: #E0B15E; font-weight: 600; }
.pg-sum-fail { color: #F08A7A; font-weight: 600; }
.pg-valid-score {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 600;
    color: var(--primary-bright);
    line-height: 1;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.pg-valid-score-of { font-size: 12px; color: var(--text-faint); font-weight: 400; }
.pg-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}
.pg-check {
    display: flex;
    gap: 11px;
    padding: 12px 14px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.pg-check.is-linked { border-color: var(--primary); box-shadow: 0 0 0 2px var(--glow-soft); }
.pg-check-icon {
    flex-shrink: 0;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
}
.pg-check.is-pass .pg-check-icon { background: rgba(16,185,129,0.16); color: var(--primary-bright); }
.pg-check.is-warn .pg-check-icon { background: rgba(224,177,94,0.18); color: #E0B15E; }
.pg-check.is-fail .pg-check-icon { background: rgba(240,138,122,0.18); color: #F08A7A; }
.pg-check-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pg-check-label { font-size: 13px; font-weight: 600; color: var(--text); }
.pg-check-detail { font-size: 12px; line-height: 1.45; color: var(--text-muted); }

.pg-faults {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.pg-faults-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}
.pg-fault-btn {
    font-size: 12.5px;
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.pg-fault-btn:hover { border-color: #F08A7A; color: var(--text); }
.pg-fault-reset { margin-left: auto; }
.pg-fault-reset:hover { border-color: var(--primary); }

@media (max-width: 860px) {
    .pg-lab-grid { grid-template-columns: 1fr; }
    .pg-lab-wire { flex-direction: row; padding: 6px 0; }
    .pg-lab-wire .pg-wire-arrow { transform: rotate(90deg); }
    .pg-wire-label { writing-mode: horizontal-tb; margin: 0; }
    .pg-pane-edit, .pg-pane-out { min-height: 0; }
}

/* =============================================================================
   DESIGN SYSTEM — GLOBAL PRIMITIVES
   The handcrafted defaults every page inherits. Nothing here changes page
   layout or content; it standardizes the shared visual language: selection,
   scrollbars, focus, links, icons, surfaces, and section rhythm.
   ========================================================================== */

/* ---- SELECTION ---------------------------------------------------------- */
::selection {
    background: rgba(16, 185, 129, 0.28);
    color: var(--text);
    text-shadow: none;
}
::-moz-selection {
    background: rgba(16, 185, 129, 0.28);
    color: var(--text);
}
::selection { background: rgba(14, 159, 112, 0.20); }

/* ---- SCROLLBAR ---------------------------------------------------------- */
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-hi) transparent;
}
/* WebKit — slim, recessed, emerald on hover */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-hi);
    border-radius: var(--radius-pill);
    border: 3px solid transparent;
    background-clip: padding-box;
    transition: background-color var(--dur) var(--ease-out);
}
::-webkit-scrollbar-thumb:hover { background: var(--primary-deep); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---- GLOBAL FOCUS-VISIBLE ----------------------------------------------
   One calm emerald ring for keyboard users on EVERY interactive element,
   never shown for mouse clicks (focus-visible only).
   7.4: dropped the fixed selector allowlist — which silently missed
   glossary chips, filter chips and generic content links — for a single
   universal :focus-visible rule. The browser fires focus-visible only on
   genuine keyboard focus, so this rings everything focusable (including any
   element added later) without an allowlist to fall out of date. */
:focus { outline: none; }
:focus-visible {
    outline: none;
    box-shadow: var(--ring-strong);
    border-radius: var(--radius-sm);
    transition: box-shadow var(--dur-fast) var(--ease-out);
}
/* pill-shaped controls keep a pill ring; larger cards keep their own radius */
.nav-item:focus-visible,
.filter-chip:focus-visible,
.tag:focus-visible { border-radius: var(--radius-pill); }
.learn-card:focus-visible { border-radius: var(--radius-md); }
.md-embed:focus-visible { border-radius: 14px; }

/* ---- LINKS --------------------------------------------------------------
   Inline links inside prose get an elegant animated underline that grows
   from the left; structural links (logo, nav, cards) opt out via their own
   rules and are unaffected. */
.prose a,
a.link {
    color: var(--primary-bright);
    text-decoration: none;
    background-image: linear-gradient(var(--primary-bright), var(--primary-bright));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0% 1.5px;
    transition: background-size var(--dur) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.prose a:hover,
a.link:hover {
    color: var(--primary-hover);
    background-size: 100% 1.5px;
}

/* ---- ICON SIZING --------------------------------------------------------
   Standard icon footprints; svgs inherit currentColor + token stroke. */
.icon { width: var(--icon-md); height: var(--icon-md); flex: 0 0 auto; }
.icon-xs { width: var(--icon-xs); height: var(--icon-xs); }
.icon-sm { width: var(--icon-sm); height: var(--icon-sm); }
.icon-lg { width: var(--icon-lg); height: var(--icon-lg); }
.icon-xl { width: var(--icon-xl); height: var(--icon-xl); }
.icon svg, .icon-xs svg, .icon-sm svg, .icon-lg svg, .icon-xl svg {
    width: 100%; height: 100%; display: block;
    stroke-width: var(--icon-stroke);
}

/* ---- SURFACE PRIMITIVES -------------------------------------------------
   Opt-in helpers that codify the surface hierarchy + glass recipe so new UI
   stays consistent without re-declaring blur/border/shadow each time. */
.surface {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.surface-2 { background: var(--surface-alt); }
.surface-3 { background: var(--surface-hi); }
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-highlight);
}
.glass-strong {
    background: var(--glass-bg-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    backdrop-filter: var(--glass-blur-strong);
}

/* ---- SECTION RHYTHM -----------------------------------------------------
   Vertical spacing helpers built on the rhythm tokens. Opt-in: they don't
   touch existing markup, but every new page region can use them for a
   consistent cadence. */
.section + .section { margin-top: var(--section-gap); }
.stack > * + * { margin-top: var(--stack-gap); }
.stack-lg > * + * { margin-top: var(--block-gap); }
.measure { max-width: var(--measure); }
.measure-tight { max-width: var(--measure-tight); }

/* ---- HOVER / INTERACTION PRIMITIVES ------------------------------------ */
.interactive {
    transition: transform var(--dur) var(--ease-out),
        border-color var(--dur) var(--ease-out),
        box-shadow var(--dur) var(--ease-out);
}
.interactive:hover { transform: translateY(var(--hover-lift)); }
.interactive:active { transform: scale(var(--press-scale)); }
@media (prefers-reduced-motion: reduce) {
    .interactive:hover, .interactive:active { transform: none; }
}

/* ---- RESPONSIVE SPACING -------------------------------------------------
   Tighten the global rhythm a step on small screens so dense content keeps
   premium breathing room without feeling sparse. */
@media (max-width: 720px) {
    :root {
        --section-gap: clamp(56px, 14vw, 88px);
        --block-gap: clamp(28px, 7vw, 44px);
        --stack-gap: 16px;
    }
}
@media (max-width: 480px) {
    :root {
        --content-pad: 20px;
        --section-gap: 52px;
    }
}

/* =============================================================================
   LANDING HERO — "How money moves around the world"
   A full-bleed, Apple-launch-style opening that introduces the PLATFORM before
   the documentary begins. Abstract financial-network background (SVG + CSS,
   almost imperceptible motion); layered text entrance gated on kinetic-ready.
   Scoped entirely to .hero-stage — touches no other section.
   ========================================================================== */
.hero-stage {
    position: relative;
    isolation: isolate;
    /* full-bleed out of the content-area padding, and pull up under the
       transparent header so the opening fills the viewport */
    width: calc(100% + var(--content-pad) * 2);
    margin-left: calc(var(--content-pad) * -1);
    margin-right: calc(var(--content-pad) * -1);
    margin-top: calc(clamp(32px, 5vw, 72px) * -1);
    margin-bottom: clamp(16px, 3vw, 40px);
    /* match the 16:9 video frame so the whole globe is visible,
       capped by the viewport so it never overflows the first screen */
    min-height: min(calc(100vh - 24px), 56.25vw);
    min-height: min(calc(100svh - 24px), 56.25vw);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: clamp(64px, 12vh, 120px) var(--content-pad) clamp(56px, 9vh, 104px);
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
}

/* ---- abstract network background ---------------------------------------- */
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }

.hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.hero-vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(110% 100% at 50% 48%, transparent 72%, var(--bg) 100%),
        linear-gradient(180deg, transparent 90%, var(--bg) 100%);
}

/* ---- hero content ------------------------------------------------------- */
.hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 940px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: clamp(18px, 2.4vw, 28px);
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 16px 8px 13px;
    border-radius: var(--radius-pill);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: inset 0 1px 0 var(--glass-highlight);
    font-family: var(--font-mono);
    font-size: var(--fs-eyebrow);
    font-weight: var(--fw-medium);
    letter-spacing: var(--ls-eyebrow);
    text-transform: uppercase;
    color: var(--text-muted);
}
.hero-eyebrow-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--primary-bright);
    box-shadow: 0 0 10px var(--glow);
    animation: hero-dot-pulse 2.6s var(--ease-in-out) infinite;
}
@keyframes hero-dot-pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }

.hero-headline {
    font-family: var(--font-display);
    font-weight: var(--fw-black);
    font-size: clamp(44px, 7.4vw, 104px);
    line-height: 1.02;
    letter-spacing: var(--ls-display);
    color: var(--text);
    text-wrap: balance;
}
.hero-headline .hl-line { display: block; }

.hero-sub {
    max-width: 60ch;
    font-size: var(--fs-lead);
    line-height: var(--lh-normal);
    color: var(--text-muted);
    text-wrap: pretty;
}
.hero-sub strong { color: var(--text); font-weight: var(--fw-semibold); }

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: clamp(6px, 1.5vw, 14px);
}

/* ---- layered entrance (gated like the rest of the kinetic system) ------- */
.hero-stage .hl-line {
    opacity: 0;
    transform: translateY(26px);
    filter: blur(6px);
    will-change: opacity, transform, filter;
}
body.kinetic-ready .hero-stage .hl-line {
    animation: hero-line-rise var(--dur-slower) var(--ease-out) forwards;
}
body.kinetic-ready .hero-stage .hero-eyebrow { animation-delay: 0.15s; }
body.kinetic-ready .hero-stage .hero-headline .hl-line:nth-child(1) { animation-delay: 0.30s; }
body.kinetic-ready .hero-stage .hero-headline .hl-line:nth-child(2) { animation-delay: 0.45s; }
body.kinetic-ready .hero-stage .hero-sub { animation-delay: 0.72s; }
body.kinetic-ready .hero-stage .hero-cta { animation-delay: 0.98s; }
@keyframes hero-line-rise {
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ---- responsive: adapt, don't just scale -------------------------------- */
@media (max-width: 900px) {
    .hero-stage { min-height: clamp(240px, 56.25vw, 460px); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
}
@media (max-width: 600px) {
    .hero-stage {
        padding: clamp(88px, 18vh, 132px) var(--content-pad) clamp(56px, 12vh, 96px);
        align-items: flex-start;
    }
    .hero-inner { align-items: flex-start; text-align: left; gap: 20px; }
    .hero-sub { font-size: 16px; }
    .hero-cta { width: 100%; flex-direction: column; align-items: stretch; }
    .hero-cta .btn { width: 100%; justify-content: center; }
    .hero-vignette {
        background:
            radial-gradient(120% 70% at 30% 30%, transparent 30%, var(--bg) 96%),
            linear-gradient(180deg, transparent 55%, var(--bg) 100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-stage .hl-line { opacity: 1 !important; transform: none !important; filter: none !important; animation: none !important; }
    .hero-eyebrow-dot { animation: none !important; }
}

/* ===========================================================================
   15. ARTICLES — the Markdown library (Learn index + prose reader)
   Native to the emerald theme; reuses the editorial type ramp and tokens.
   =========================================================================== */

/* ---- 15a. The Library index ------------------------------------------- */
.learn-head { max-width: 760px; margin-bottom: 8px; }
.learn-level { margin-top: clamp(36px, 5vw, 64px); }
.learn-level-head {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding-bottom: 18px;
    margin-bottom: 26px;
    border-bottom: 1px solid var(--border);
}
.learn-level-num {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-bright);
    padding: 6px 12px;
    border: 1px solid var(--primary-deep);
    border-radius: 999px;
    background: var(--glow-faint);
    line-height: 1;
}
.learn-level-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(20px, 2.4vw, 28px);
    letter-spacing: var(--ls-tight);
    color: var(--text);
}
.learn-level-blurb {
    margin-top: 5px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-muted);
    max-width: 64ch;
}
.learn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 18px;
}
.learn-card {
    display: flex;
    flex-direction: column;
    padding: 22px 22px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: transform var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out),
                box-shadow var(--dur-fast) var(--ease-out);
}
.learn-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-deep);
    background: var(--surface-alt);
    box-shadow: 0 14px 36px -18px rgba(0, 0, 0, 0.7);
}
/* focus ring handled globally (7.4); radius override above keeps the card shape */
.learn-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.learn-card-num {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-bright);
    letter-spacing: 0.04em;
}
.learn-card-min, .learn-card-status {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
}
.learn-card-status { color: var(--warning); border-color: rgba(245, 181, 68, 0.35); }
.learn-card-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    line-height: 1.3;
    letter-spacing: var(--ls-snug);
    color: var(--text);
    margin-bottom: 9px;
    text-wrap: balance;
}
.learn-card-summary {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-muted);
    flex: 1;
}
.learn-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
}
.learn-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.learn-tag {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--surface-hi);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 8px;
}
.learn-card-go {
    flex-shrink: 0;
    color: var(--text-faint);
    transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.learn-card:hover .learn-card-go { color: var(--primary-bright); transform: translateX(3px); }
.learn-card.is-draft { opacity: 0.82; }
.learn-card.is-draft:hover { opacity: 1; }

/* ---- 15b. The article reader ------------------------------------------ */
.article-loading, .article-error {
    padding: 60px 0;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 14px;
}
.article-error h3 { font-family: var(--font-display); color: var(--text); margin-bottom: 8px; }

/* Two-column article shell: prose + sticky "On this page" rail. */
.article-layout { max-width: 1080px; margin: 0 auto; }
.article-layout.has-toc {
    display: grid;
    grid-template-columns: minmax(0, 760px) 240px;
    gap: 56px;
    align-items: start;
    justify-content: center;
}
.article-toc {
    position: sticky;
    top: 96px;
    padding: 4px 0 4px 20px;
    border-left: 1px solid var(--border);
}
.article-toc-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 14px;
}
.article-toc-list { display: flex; flex-direction: column; gap: 2px; }
.article-toc-link {
    display: block;
    padding: 5px 10px;
    margin-left: -10px;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out);
}
.article-toc-link:hover { color: var(--text); background: var(--surface-alt); }
.article-toc-link.is-on { color: var(--primary-bright); background: var(--glow-faint); }
@media (max-width: 1100px) {
    .article-layout.has-toc { display: block; }
    .article-toc { display: none; }
}

/* Split-title: the tail after "?" / ":" softly blurred, sharpens on hover. */
.title-tail {
    display: block;
    margin-top: 10px;
    font-size: 0.42em;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.35;
    color: var(--text-muted);
    filter: blur(2.2px);
    opacity: 0.55;
    transition: filter 0.45s var(--ease-out), opacity 0.45s var(--ease-out);
}
.article-title:hover .title-tail { filter: blur(0); opacity: 0.9; }
.title-tail-sm {
    display: block;
    margin-top: 3px;
    font-size: 0.78em;
    font-weight: 500;
    filter: blur(1.6px);
    opacity: 0.5;
    transition: filter 0.45s var(--ease-out), opacity 0.45s var(--ease-out);
}
.learn-card:hover .title-tail-sm { filter: blur(0); opacity: 0.85; }
@media (prefers-reduced-motion: reduce) {
    .title-tail, .title-tail-sm { filter: none; opacity: 0.7; }
}

.article-page { max-width: 760px; margin: 0 auto; min-width: 0; }
.article-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 0;
    margin-bottom: 28px;
    transition: color var(--dur-fast) var(--ease-out);
}
.article-back:hover { color: var(--primary-bright); }

.article-head { margin-bottom: 36px; }
.article-kicker {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.article-level-pill {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--primary-bright);
    background: var(--glow-faint);
    border: 1px solid var(--primary-deep);
    border-radius: 999px;
    padding: 5px 12px;
}
.article-min {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-faint);
    letter-spacing: 0.04em;
}
.article-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(30px, 4.4vw, 50px);
    line-height: 1.08;
    letter-spacing: var(--ls-display);
    color: var(--text);
    text-wrap: balance;
}
.article-standfirst {
    margin-top: 20px;
    font-family: var(--font-serif);
    font-size: clamp(18px, 1.7vw, 22px);
    line-height: 1.5;
    color: var(--text-muted);
    font-style: italic;
}

/* The prose body — Newsreader serif for long-form reading comfort. */
.md-body {
    font-family: var(--font-serif);
    font-size: 18.5px;
    line-height: 1.72;
    color: #2C3B34;
}
.md-body > *:first-child { margin-top: 0; }
.md-body p { margin: 0 0 22px; }
.md-body h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(22px, 2.6vw, 30px);
    line-height: 1.2;
    letter-spacing: var(--ls-tight);
    color: var(--text);
    margin: 46px 0 16px;
    padding-top: 8px;
}
.md-body h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(18px, 2vw, 22px);
    color: var(--text);
    margin: 32px 0 12px;
    letter-spacing: var(--ls-snug);
}
.md-body h4 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 17px;
    color: var(--primary-bright);
    margin: 26px 0 10px;
}
.md-body strong { color: var(--text); font-weight: 700; }
.md-body em { color: #16221C; }
.md-body a { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--primary-deep); }
.md-body a:hover { color: var(--primary-bright); }

/* Lists */
.md-body ul, .md-body ol { margin: 0 0 22px; padding-left: 26px; }
.md-body li { margin-bottom: 10px; }
.md-body li::marker { color: var(--primary-deep); }

/* The problem-first opening quote — the academy's signature callout */
.md-body blockquote {
    font-family: var(--font-sans);
    font-size: 16.5px;
    line-height: 1.6;
    color: var(--text);
    background: var(--glow-faint);
    border: 1px solid var(--border-hi);
    border-left: 3px solid var(--primary);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 0 0 30px;
}
.md-body blockquote p { margin: 0; }
.md-body blockquote strong { color: var(--primary-bright); }

/* Inline code + fenced code (matches the mono surfaces elsewhere) */
.md-body code {
    font-family: var(--font-mono);
    font-size: 0.82em;
    color: var(--primary-bright);
    background: var(--surface-hi);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 1px 6px;
}
.md-body pre {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    overflow-x: auto;
    margin: 0 0 24px;
    line-height: 1.6;
}
.md-body pre code {
    font-size: 13px;
    color: #2C3B34;
    background: none;
    border: none;
    padding: 0;
    white-space: pre;
}
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }

/* Tables — same register as the code wells, so every article matches */
.md-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 26px;
    font-family: var(--font-sans);
    font-size: 14.5px;
    line-height: 1.5;
}
.md-body th {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-faint);
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-hi);
    background: var(--surface);
}
.md-body td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    color: #2C3B34;
    vertical-align: top;
}
.md-body tr:last-child td { border-bottom: none; }
.md-body table { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: block; }
.md-body table thead, .md-body table tbody { display: table; width: 100%; table-layout: fixed; }

/* Inline interactive link (from {{link:...}}) */
.md-inline-link {
    color: var(--primary-hover);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-style: dotted;
    cursor: pointer;
}
.md-inline-link:hover { color: var(--primary-bright); }

/* Embed card (from a block {{embed:...}}) — hands off to interactive surfaces */
.md-embed {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 30px 0;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--border-hi);
    border-radius: 14px;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: border-color var(--dur-fast) var(--ease-out),
                background var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}
.md-embed:hover {
    border-color: var(--primary);
    background: var(--surface-alt);
    transform: translateY(-2px);
}
/* focus ring handled globally (7.4); radius override above keeps the card shape */
.md-embed-mark {
    flex-shrink: 0;
    width: 42px; height: 42px;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary-bright);
    background: var(--glow-faint);
    border: 1px solid var(--primary-deep);
    border-radius: 11px;
}
.md-embed-body { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.md-embed-kicker {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-faint);
}
.md-embed-title { font-size: 16px; font-weight: 600; color: var(--text); }
.md-embed-sub { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.md-embed-go {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--primary-bright);
    border: 1px solid var(--primary-deep);
    border-radius: 999px;
    padding: 7px 16px;
    transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.md-embed:hover .md-embed-go { background: var(--primary); color: var(--bg); }

/* "You can now" earned-skill payoff */
.article-earned {
    margin: 40px 0 8px;
    padding: 22px 24px;
    background: var(--glow-faint);
    border: 1px solid var(--primary-deep);
    border-radius: 14px;
}
.article-earned-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--primary-bright);
    margin-bottom: 8px;
}
.article-earned p {
    font-family: var(--font-serif);
    font-size: 17px;
    line-height: 1.55;
    color: var(--text);
    margin: 0;
}

/* Related articles */
.article-related { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--border); }
.article-related-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 16px;
}
.article-related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.article-related-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.article-related-card:hover { border-color: var(--primary-deep); background: var(--surface-alt); }
.article-related-num {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-bright);
    flex-shrink: 0;
}
.article-related-title { font-size: 14px; color: var(--text); line-height: 1.35; }

@media (max-width: 680px) {
    .learn-grid { grid-template-columns: 1fr; }
    .md-body { font-size: 17.5px; }
    .md-embed { flex-wrap: wrap; }
    .md-embed-go { margin-left: 54px; }
}




/* ===========================================================================
   16. UI-FIX PASS — reader contrast, hero financial stream,
   and the Learning Journey "Coming Soon" placeholder.
   =========================================================================== */

/* ---- #1 Library reader: readable body text in LIGHT mode ---------------- */
/* .md-body had a hardcoded near-white (#DCE6E1) that never flipped, so only
   bold (var(--text)) stayed visible on the light background. */
/* (single light theme: reader ink is set directly on .md-body above) */

/* ---- #2 Hero video backdrop (replaced the animated financial stream) ---- */
@media (prefers-reduced-motion: reduce) {
    .hero-video { display: none; }
}

/* ===== SHELL FOOTER (Session 1.3) =============================================
   Shared footer for the app shell — sits below .main-container on every section.
   Tokens only; mirrors the header's calm glass register. */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-deep);
    padding: var(--space-3xl) var(--content-pad) var(--space-2xl);
    margin-top: var(--space-2xl);
}
.site-footer-inner {
    max-width: var(--maxw);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2xl);
}
.site-footer-brand {
    max-width: 34ch;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.site-footer-brand .logo { cursor: pointer; }
.site-footer-mission {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--fs-body);
    line-height: var(--lh-normal);
}
.site-footer-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    min-width: 140px;
}
.site-footer-nav-label {
    font-family: var(--font-mono);
    font-size: var(--fs-eyebrow);
    letter-spacing: var(--ls-eyebrow);
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: var(--space-2xs);
}
.site-footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--fs-body);
    width: fit-content;
    transition: color var(--dur-fast) var(--ease-out);
}
.site-footer-nav a:hover { color: var(--primary-bright); }
.site-footer-base {
    max-width: var(--maxw);
    margin: var(--space-2xl) auto 0;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
    color: var(--text-faint);
    font-size: var(--fs-small);
}
.site-footer-dot { color: var(--border-hi); }
.site-footer-credit {
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px solid var(--border-hi);
    transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.site-footer-credit:hover { color: var(--primary); border-color: var(--primary); }
@media (max-width: 768px) {
    .site-footer-inner { flex-direction: column; gap: var(--space-xl); }
}

/* ===== FILTER BAR â interactive category / segment filter row (Session 1.4)
   IA-validation gap fix: Glossary needs `#/glossary?category=<cat>` filtering
   (docs/HANDBOOK.md (IA) Â§3) and the Library level index can reuse the same control.
   `.tag` is a static metadata pill; this is the pressable, stateful filter. ===== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}
.filter-chip {
    appearance: none;
    cursor: pointer;
    font: inherit;
    font-size: var(--fs-small);
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    line-height: 1;
    transition: color var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                background-color var(--dur-fast) var(--ease-out),
                transform var(--dur-instant) var(--ease-out);
}
.filter-chip:hover { color: var(--text); border-color: var(--border-hi); background: var(--surface-alt); }
.filter-chip:active { transform: scale(0.96); }
.filter-chip.active {
    color: var(--bg);
    background: var(--primary);
    border-color: var(--primary);
}
.filter-chip .filter-chip-count {
    margin-left: 6px;
    opacity: 0.6;
    font-variant-numeric: tabular-nums;
}

/* ===== PAGER — sequential prev / next reader nav (Session 1.4)
   IA-validation gap fix: History chapters are "read in order" (Phase 2) and a
   Library level is a five-lesson sequence (Phase 3). Both need the same
   prev/next reader nav at the foot of the reading column. Shared, not page-owned. ===== */
.pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-top: var(--space-3xl);
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border);
}
.pager-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
    padding: var(--space-md) var(--space-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    transition: border-color var(--dur-fast) var(--ease-out),
                background-color var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}
.pager-link:hover { border-color: var(--primary); background: var(--surface-alt); transform: translateY(var(--hover-lift)); }
.pager-link.pager-next { text-align: right; }
.pager-link.pager-disabled { opacity: 0.4; pointer-events: none; }
.pager-dir {
    font-family: var(--font-mono);
    font-size: var(--fs-eyebrow);
    letter-spacing: var(--ls-eyebrow);
    text-transform: uppercase;
    color: var(--primary);
}
.pager-label {
    font-size: var(--fs-body);
    font-weight: 600;
    color: var(--text);
}
@media (max-width: 768px) {
    .pager { grid-template-columns: 1fr; }
    .pager-link.pager-next { text-align: left; }
}

/* ==========================================================================
   KNOWLEDGE CHECKS + PROGRESS (Session 7.5)
   The end-of-lesson check card, the "mark as learned" toggle, the learned
   badge on Library cards, and the Library progress note. Token-driven so
   both themes work untouched.
   ========================================================================== */
.kc-card {
    margin: var(--space-xl) 0;
    padding: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.kc-kicker {
    font-family: var(--font-mono);
    font-size: var(--fs-eyebrow);
    letter-spacing: var(--ls-eyebrow);
    text-transform: uppercase;
    color: var(--primary);
}
.kc-q { margin: 0; font-weight: 600; color: var(--text); }
.kc-options { display: flex; flex-direction: column; gap: var(--space-xs); }
.kc-opt {
    appearance: none;
    cursor: pointer;
    text-align: left;
    font: inherit;
    padding: var(--space-sm) var(--space-md);
    background: var(--surface-alt);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color var(--dur-fast) var(--ease-out),
                background-color var(--dur-fast) var(--ease-out),
                opacity var(--dur-fast) var(--ease-out);
}
.kc-opt:hover { border-color: var(--primary); background: var(--surface-hi); }
.kc-opt:disabled { cursor: default; }
.kc-card.is-answered .kc-opt { opacity: 0.55; }
.kc-card.is-answered .kc-opt:hover { border-color: var(--border); background: var(--surface-alt); }
.kc-card.is-answered .kc-opt.is-answer {
    opacity: 1;
    border-color: var(--success);
    background: var(--glass-tint-strong);
}
.kc-card.is-answered .kc-opt.is-wrong {
    opacity: 1;
    border-color: var(--danger);
    color: var(--danger);
}
.kc-result { margin: 0; min-height: 1.4em; color: var(--text-muted); }
.kc-result.is-right { color: var(--success); }
.kc-result.is-wrong { color: var(--danger); }

/* "Mark as learned" toggle at the foot of every lesson */
.article-learned-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
}
.learned-toggle {
    appearance: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font: inherit;
    font-weight: 600;
    padding: 10px var(--space-lg);
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--dur-fast) var(--ease-out),
                background-color var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out);
}
.learned-toggle:hover { border-color: var(--primary); }
.learned-toggle .learned-tick { display: inline-flex; opacity: 0.35; transition: opacity var(--dur-fast) var(--ease-out); }
.learned-toggle.is-learned {
    border-color: var(--primary-deep);
    background: var(--glass-tint-strong);
    color: var(--primary);
}
.learned-toggle.is-learned .learned-tick { opacity: 1; }
.learned-hint { color: var(--text-faint); font-size: 0.9em; }

/* Learned badge on Library cards */
.learn-card-done {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-mono);
    font-size: var(--fs-eyebrow);
    letter-spacing: var(--ls-eyebrow);
    text-transform: uppercase;
    color: var(--success);
}

/* Progress note between the Library head and the level sections */
.learn-progress {
    margin: 0 0 var(--space-2xl);
    font-family: var(--font-mono);
    font-size: var(--fs-eyebrow);
    letter-spacing: var(--ls-eyebrow);
    text-transform: uppercase;
    color: var(--text-muted);
}
.learn-progress-count { color: var(--primary); }
