/* ─────────────────────────────────────────────────────────────────────────
   EDME design system
   Subject: data-engineering platform for legacy ETL archaeology.
   Two themes: dark (default) and warm-paper light.
   Brand anchor: EY yellow, same hex in both themes.
   Signature: measurement-rule dividers between sections.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Reset (minimal, scoped) ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 3px; }
[hidden] { display: none !important; }

/* ── Tokens — DARK is the default ──────────────────────────────────────── */
:root,
[data-theme="dark"] {
    --bg: #0B0D11;
    --surface: #14171D;
    --elevated: #1B1F27;
    --rule: #232831;
    --rule-strong: #313844;

    --ink: #E7E9EE;
    --ink-2: #9097A2;
    --ink-3: #5F6571;

    --signal: #FFE600;
    --signal-text: #FFE600;
    --signal-soft: rgba(255, 230, 0, 0.08);
    --signal-line: rgba(255, 230, 0, 0.22);
    --signal-ink: #0B0D11;

    --ok: #2EA56C;
    --warn: #C98A1E;
    --err: #C84444;
    --info: #4B82D6;

    color-scheme: dark;
}

[data-theme="light"] {
    --bg: #F7F6F2;
    --surface: #FFFFFF;
    --elevated: #F1EFE9;
    --rule: #E3DFD5;
    --rule-strong: #C6C0B0;

    --ink: #1A1C20;
    --ink-2: #5C5F68;
    --ink-3: #8A8D94;

    --signal: #FFE600;
    --signal-text: #8A6A00;
    --signal-soft: rgba(255, 230, 0, 0.15);
    --signal-line: rgba(214, 196, 0, 0.4);
    --signal-ink: #0B0D11;

    --ok: #1F7A4E;
    --warn: #A56B0E;
    --err: #A8302E;
    --info: #2B5FA8;

    color-scheme: light;
}

/* ── Type stacks ───────────────────────────────────────────────────────── */
:root {
    /* Display/headings: editorial sans (Stripe/Twilio-grade). The brand wordmark keeps mono. */
    --type-display: 'Inter var', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --type-body: 'Inter var', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --type-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    --type-brand: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    /* spacing scale — multiples of 4 */
    --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
    --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 48px;
    --s-9: 64px; --s-10: 96px;

    /* page measure — referenced by the rule signature */
    --measure: 1200px;
    --gutter: 24px;
    --topbar-h: 56px;

    /* left navigation rail */
    --rail-w: 60px;
    --rail-w-open: 236px;
}

/* ── Base ──────────────────────────────────────────────────────────────── */
html { font-feature-settings: 'cv11', 'ss01', 'ss03'; }
body {
    font-family: var(--type-body);
    font-size: 15px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-variant-numeric: tabular-nums;
    text-rendering: optimizeLegibility;
    transition: background-color 180ms ease, color 180ms ease;
}
@supports (font-variation-settings: normal) {
    body { font-family: 'Inter var', system-ui, sans-serif; }
}
::selection { background: var(--signal); color: var(--signal-ink); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--type-display);
    color: var(--ink);
    text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.5rem + 1.6vw, 2.5rem); line-height: 1.15; font-weight: 700; letter-spacing: -0.022em; }
h2 { font-size: clamp(1.4rem, 1.15rem + 0.9vw, 1.7rem); line-height: 1.2; font-weight: 700; letter-spacing: -0.018em; }
h3 { font-size: 1.2rem; line-height: 1.3; font-weight: 650; letter-spacing: -0.013em; }
h4 { font-size: 1.02rem; line-height: 1.35; font-weight: 650; letter-spacing: -0.008em; }
h5 { font-size: 0.92rem; line-height: 1.4; font-weight: 650; letter-spacing: -0.004em; }
h6 { font-size: 0.8rem; line-height: 1.4; font-weight: 700; letter-spacing: 0.02em; }

code, kbd, samp { font-family: var(--type-mono); font-size: 0.92em; }
.mono { font-family: var(--type-mono); font-variant-numeric: tabular-nums; }

/* ── Scrollbar — restrained ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 4px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* ─────────────────────────────────────────────────────────────────────────
   LEFT NAVIGATION RAIL (collapsible icon rail, fixed full-height)
   Collapsed to icons by default; rolls out on hover, or stays pinned open.
   ───────────────────────────────────────────────────────────────────────── */
.sidenav {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--rail-w);
    z-index: 200;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--rule);
    overflow: hidden;
    transition: width 180ms cubic-bezier(0.4, 0, 0.2, 1);
}
/* Roll out on hover (peek) or when pinned open via the toggle. The topbar
   sits above the rail (higher z-index), so the header is never hidden.
   ``nav-peek`` is the JS-driven equivalent of :hover (deterministic). */
.sidenav:hover,
body.nav-peek .sidenav,
body.nav-open .sidenav { width: var(--rail-w-open); }

.sidenav__head {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: 0 14px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--rule);
}
.sidenav__toggle {
    width: 32px; height: 32px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: var(--ink-2);
    transition: background 150ms ease, color 150ms ease;
}
.sidenav__toggle:hover { background: var(--elevated); color: var(--ink); }
.sidenav__toggle svg { width: 18px; height: 18px; }

.sidenav__scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--s-3) 0 var(--s-5);
}
.sidenav__scroll::-webkit-scrollbar { width: 0; }

.sidenav__section { margin-bottom: var(--s-2); }
.sidenav__section-label {
    display: block;
    height: 14px;
    margin: var(--s-3) 0 var(--s-1);
    padding: 0 18px;
    font-family: var(--type-mono);
    font-size: 9.5px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-3);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 140ms ease;
}
.sidenav:hover .sidenav__section-label,
body.nav-peek .sidenav__section-label,
body.nav-open .sidenav__section-label { opacity: 1; }

.sidenav__list { list-style: none; }
.sidenav__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 40px;
    margin: 1px 8px;
    padding: 0 9px;
    border-radius: 8px;
    color: var(--ink-2);
    white-space: nowrap;
    transition: background 150ms ease, color 150ms ease;
}
.sidenav__item:hover { background: var(--elevated); color: var(--ink); }
.sidenav__icon {
    flex-shrink: 0;
    width: 22px; height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.sidenav__icon svg { width: 19px; height: 19px; }
.sidenav__label {
    font-size: 13px;
    opacity: 0;
    transition: opacity 140ms ease;
}
.sidenav:hover .sidenav__label,
body.nav-peek .sidenav__label,
body.nav-open .sidenav__label { opacity: 1; }

/* Active item — yellow signal bar + ink text. */
.sidenav__item[aria-current="page"] {
    color: var(--ink);
    background: var(--signal-soft);
}
.sidenav__item[aria-current="page"]::before {
    content: '';
    position: absolute;
    left: -8px; top: 8px; bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--signal);
}

/* "Soon" capabilities — visible but inert. */
.sidenav__item--soon { color: var(--ink-3); cursor: default; }
.sidenav__item--soon:hover { background: transparent; color: var(--ink-3); }
.sidenav__badge {
    margin-left: auto;
    padding: 1px 7px;
    font-family: var(--type-mono);
    font-size: 9px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-3);
    border: 1px solid var(--rule);
    border-radius: 999px;
    opacity: 0;
    transition: opacity 140ms ease;
}
.sidenav:hover .sidenav__badge,
body.nav-peek .sidenav__badge,
body.nav-open .sidenav__badge { opacity: 1; }

/* ─────────────────────────────────────────────────────────────────────────
   TOPBAR (sticky 56px chrome, used by every page)
   ───────────────────────────────────────────────────────────────────────── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 300;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: var(--s-4);
    padding: 0 var(--gutter);
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
}
.topbar__logo { display: flex; align-items: center; flex-shrink: 0; opacity: 0.95; }
.topbar__logo img { height: 22px; width: auto; }
.topbar__brand {
    font-family: var(--type-brand);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.005em;
    color: var(--ink);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: var(--s-2);
}
.topbar__brand::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--signal);
}
.topbar__nav {
    display: flex;
    gap: 0;
    margin-left: var(--s-7);
}
.topbar__nav a {
    position: relative;
    padding: 0 var(--s-4);
    height: var(--topbar-h);
    display: inline-flex;
    align-items: center;
    color: var(--ink-2);
    font-size: 13px;
    transition: color 150ms ease;
}
.topbar__nav a:hover { color: var(--ink); }
.topbar__nav a[aria-current="page"] {
    color: var(--ink);
}
.topbar__nav a[aria-current="page"]::after {
    content: '';
    position: absolute;
    left: var(--s-4); right: var(--s-4); bottom: -1px;
    height: 2px;
    background: var(--signal);
}
.topbar__spacer { flex: 1; }
.topbar__meta {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-family: var(--type-mono);
    font-size: 11px;
    color: var(--ink-3);
}
.topbar__meta .chip {
    padding: 4px var(--s-3);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 999px;
    color: var(--ink-2);
}
.topbar__meta .chip b { color: var(--ink); font-weight: 600; }

/* Theme toggle ──── */
.topbar__theme {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 999px;
}
.topbar__theme button {
    width: 24px; height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--ink-3);
    transition: background 150ms ease, color 150ms ease;
}
.topbar__theme button:hover { color: var(--ink); }
.topbar__theme button[aria-pressed="true"] {
    background: var(--signal);
    color: var(--signal-ink);
}
.topbar__theme svg { width: 14px; height: 14px; }

/* ─────────────────────────────────────────────────────────────────────────
   MEASUREMENT-RULE SIGNATURE
   Used as section dividers. The width and gap labels are read from CSS
   variables, not hardcoded HTML, so they stay honest.
   ───────────────────────────────────────────────────────────────────────── */
.rule {
    --rule-w: var(--measure);
    --rule-gap: var(--s-7);
    display: block;
    margin: var(--rule-gap) auto;
    width: 100%;
    max-width: var(--measure);
    padding: 0 var(--gutter);
    height: 1px;
    background: var(--rule);
}
.rule::before, .rule::after {
    content: none;
}
.rule__label { white-space: nowrap; user-select: none; }
.rule__label::before {
    content: none;
    color: var(--ink-3);
    opacity: 0.6;
}

/* Variant: numeric width label (uses --measure expressed in px) */
.rule--measure .rule__label::before { content: none; }

/* ─────────────────────────────────────────────────────────────────────────
   LAYOUT
   ───────────────────────────────────────────────────────────────────────── */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-left: var(--rail-w);
    transition: padding-left 180ms cubic-bezier(0.4, 0, 0.2, 1);
}
/* Push the content over when the rail rolls out — whether pinned open or
   peeking on hover — so it is never hidden behind the expanded rail. */
body.nav-open .page,
body.nav-peek .page { padding-left: var(--rail-w-open); }
.page__main {
    flex: 1;
    width: 100%;
    margin: 0 auto;
    padding: var(--s-8) var(--gutter) var(--s-9);
    max-width: var(--measure);
}
.page__main--wide { max-width: 1600px; }

/* Hero */
.hero {
    margin-bottom: var(--s-8);
}
.hero--split {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: var(--s-9);
    align-items: center;
}
.hero__copy { min-width: 0; }
.hero__eyebrow {
    display: block;
    font-family: var(--type-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: var(--s-4);
}
.hero__eyebrow::before {
    content: '— ';
    color: var(--signal-text);
}
.hero__title {
    font-family: var(--type-display);
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--ink);
}
.hero__static { color: var(--ink); }
/* Cycling word animation */
.hero__cycle {
    display: inline-block;
    position: relative;
    min-height: 1.1em;
    vertical-align: bottom;
}
.hero__word {
    display: block;
    position: absolute;
    top: 0; left: 0;
    color: var(--signal-text);
    white-space: nowrap;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 350ms ease, transform 350ms ease;
    pointer-events: none;
}
.hero__word--active {
    position: relative;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.hero__lede {
    margin-top: var(--s-5);
    max-width: 56ch;
    color: var(--ink-2);
    font-size: 15.5px;
    line-height: 1.6;
}
/* Hero call-to-action (e.g. the per-capability Architecture Walkthrough link) */
.hero__cta { margin-top: var(--s-5); }
/* Engine chips */
.hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    margin-top: var(--s-5);
}
.hero__chip {
    font-family: var(--type-mono);
    font-size: 10.5px;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--rule-strong);
    color: var(--ink-3);
}
.hero__chip--live {
    border-color: rgba(46,165,108,0.4);
    color: var(--ok);
    background: rgba(46,165,108,0.07);
}
.hero__chip--wip {
    border-color: rgba(201,138,30,0.35);
    color: var(--warn);
    background: rgba(201,138,30,0.07);
}
/* 3-D canvas pane */
.hero__viz {
    width: 100%;
    height: 380px;
    border-radius: 16px;
    overflow: hidden;
    background: transparent;
    border: 0;
    flex-shrink: 0;
}
.hero__viz canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Step header — explicitly used only on pages where ordering is meaningful */
.step {
    display: flex;
    align-items: baseline;
    gap: var(--s-4);
    margin-bottom: var(--s-5);
}
.step__num {
    font-family: var(--type-display);
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-3);
    padding: 2px 8px;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: var(--surface);
}
.step__title {
    font-family: var(--type-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.005em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.step__meta {
    margin-left: auto;
    font-family: var(--type-mono);
    font-size: 11px;
    color: var(--ink-3);
}

/* ─────────────────────────────────────────────────────────────────────────
   SURFACES
   ───────────────────────────────────────────────────────────────────────── */
.surface {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 10px;
}
.surface--inset {
    background: var(--elevated);
}

/* ─────────────────────────────────────────────────────────────────────────
   BUTTONS — one shape, three intents.
   The PRIMARY button is the brand signal. Use it once per page.
   ───────────────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: 9px var(--s-4);
    font-family: var(--type-body);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    color: var(--ink-2);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 6px;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 80ms ease;
}
.btn:hover { color: var(--ink); border-color: var(--rule-strong); background: var(--elevated); }
.btn:active { transform: translateY(1px); }
.btn:disabled {
    color: var(--ink-3);
    background: var(--surface);
    border-color: var(--rule);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.btn--primary {
    color: var(--signal-ink);
    background: var(--signal);
    border-color: var(--signal);
    font-weight: 600;
}
.btn--primary:hover { color: var(--signal-ink); background: #FFEB33; border-color: #FFEB33; }
.btn--primary:disabled {
    background: var(--surface);
    color: var(--ink-3);
    border-color: var(--rule);
    opacity: 0.6;
}

.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--elevated); border-color: var(--rule); }

.btn--lg {
    padding: 12px var(--s-5);
    font-size: 14.5px;
}

.btn--danger {
    color: var(--err);
    border-color: rgba(200, 68, 68, 0.3);
}
.btn--danger:hover {
    color: #fff;
    background: var(--err);
    border-color: var(--err);
}

/* ─────────────────────────────────────────────────────────────────────────
   FORM CONTROLS
   ───────────────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field__label {
    font-family: var(--type-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
}
.field__hint {
    font-size: 11.5px;
    color: var(--ink-3);
}
.input,
.select {
    padding: 9px 12px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 6px;
    color: var(--ink);
    font-size: 13.5px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    width: 100%;
}
.input::placeholder { color: var(--ink-3); }
.input:focus,
.select:focus {
    outline: none;
    border-color: var(--signal-line);
    box-shadow: 0 0 0 3px var(--signal-soft);
}

/* Custom checkbox — square, accent on check */
.check {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    cursor: pointer;
    user-select: none;
    color: var(--ink);
    font-size: 13.5px;
}
.check input {
    appearance: none;
    width: 16px; height: 16px;
    border: 1px solid var(--rule-strong);
    border-radius: 3px;
    background: var(--surface);
    display: inline-grid;
    place-items: center;
    transition: background 120ms ease, border-color 120ms ease;
}
.check input:checked {
    background: var(--signal);
    border-color: var(--signal);
}
.check input:checked::after {
    content: '';
    width: 9px; height: 5px;
    border: 2px solid var(--signal-ink);
    border-top: 0;
    border-right: 0;
    transform: rotate(-45deg) translate(1px, -1px);
}
.check input:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 2px;
}

/* Radio — round version of check */
.radio {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    cursor: pointer;
    color: var(--ink);
    font-size: 13.5px;
}
.radio input {
    appearance: none;
    width: 16px; height: 16px;
    border: 1px solid var(--rule-strong);
    border-radius: 50%;
    background: var(--surface);
    display: inline-grid;
    place-items: center;
    transition: border-color 120ms ease;
}
.radio input:checked { border-color: var(--signal); }
.radio input:checked::after {
    content: '';
    width: 8px; height: 8px;
    background: var(--signal);
    border-radius: 50%;
}

/* Range slider — minimal */
.range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--rule);
    border-radius: 999px;
    outline: none;
}
.range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--signal);
    cursor: pointer;
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 1px var(--rule-strong);
}
.range::-moz-range-thumb {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--signal);
    cursor: pointer;
    border: 2px solid var(--bg);
    box-shadow: 0 0 0 1px var(--rule-strong);
}

/* ─────────────────────────────────────────────────────────────────────────
   UPLOAD DROP ZONE
   ───────────────────────────────────────────────────────────────────────── */
.drop {
    position: relative;
    padding: var(--s-9) var(--s-6);
    background: var(--surface);
    border: 1.5px dashed var(--rule-strong);
    border-radius: 10px;
    text-align: center;
    transition: border-color 180ms ease, background 180ms ease;
}
.drop:hover,
.drop.is-dragover {
    border-color: var(--signal);
    background: var(--elevated);
}
.drop__title {
    font-family: var(--type-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: var(--s-2);
}
.drop__sub {
    color: var(--ink-3);
    font-size: 12.5px;
    margin-bottom: var(--s-5);
}
.drop__actions {
    display: inline-flex;
    gap: var(--s-2);
}
.drop__actions label {
    cursor: pointer;
}

/* File staging preview */
.staged {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    margin-top: var(--s-4);
}
.staged__row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--s-4);
    padding: 10px var(--s-4);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 6px;
    font-family: var(--type-mono);
    font-size: 12px;
    align-items: center;
}
.staged__folder {
    color: var(--signal-text);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 10.5px;
}
.staged__detail { color: var(--ink-2); }
.staged__count {
    color: var(--ink-3);
    font-size: 11px;
}

/* ─────────────────────────────────────────────────────────────────────────
   CARDS — entry-card variant used on home; product-card variant elsewhere.
   ───────────────────────────────────────────────────────────────────────── */
.card {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    padding: var(--s-5) var(--s-6);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 10px;
    transition: border-color 150ms ease, transform 150ms ease;
}
.card:hover {
    border-color: var(--rule-strong);
    transform: translateY(-1px);
}
.card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-4);
}
.card__title {
    font-family: var(--type-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.005em;
}
.card__tag {
    font-family: var(--type-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 2px 7px;
    border-radius: 3px;
    background: var(--elevated);
    color: var(--ink-2);
    border: 1px solid var(--rule);
    white-space: nowrap;
}
.card__tag--soon { color: var(--ink-3); }
.card__tag--ready { color: var(--ok); border-color: rgba(46, 165, 108, 0.3); }
.card__tag--wip { color: var(--warn); border-color: rgba(201, 138, 30, 0.3); }
.card__body { color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.card__cta {
    margin-top: auto;
    padding-top: var(--s-4);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--type-mono);
    font-size: 11.5px;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: color 150ms ease, gap 150ms ease;
}
.card:hover .card__cta { color: var(--signal-text); gap: 10px; }
.card__cta::after { content: '→'; font-family: var(--type-body); font-size: 14px; }

.card--linkable { cursor: pointer; }
.card--disabled { opacity: 0.6; cursor: not-allowed; }
.card--disabled:hover { border-color: var(--rule); transform: none; }

.grid {
    display: grid;
    gap: var(--s-4);
}
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* Section sub-heading + trailing note (e.g. "Learn the platform") */
.subhead {
    margin: 0 0 var(--s-4);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.arch-note {
    margin: var(--s-6) 0 0;
    color: var(--ink-2);
    font-size: 14px;
    line-height: 1.6;
    max-width: 92ch;
}
.arch-note strong { color: var(--ink); font-weight: 600; }
.ref-group {
    margin: var(--s-7) 0 var(--s-4);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-2);
}
.ref-group:first-of-type { margin-top: var(--s-2); }

/* ─── Input → Process → Output mini-flow (per-capability glimpse) ───────── */
.io-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: stretch;
    gap: var(--s-3);
}
.io-flow__col {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    min-width: 0;
    padding: var(--s-5);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-top-width: 2px;
    border-radius: 12px;
}
.io-flow__col--in  { border-top-color: var(--rule-strong); }
.io-flow__col--mid { border-top-color: var(--signal); }
.io-flow__col--out { border-top-color: var(--ok); }
.io-flow__label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--type-mono);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.io-flow__label::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ink-3);
}
.io-flow__col--mid .io-flow__label::before { background: var(--signal); }
.io-flow__col--out .io-flow__label::before { background: var(--ok); }
.io-flow__hint {
    margin: auto 0 0;
    font-size: 12px;
    color: var(--ink-2);
    line-height: 1.55;
}
.io-flow__chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.io-chip {
    padding: 4px 10px;
    font-family: var(--type-mono);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-2);
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: 6px;
}
.io-chip--out {
    color: var(--ok);
    background: rgba(46, 165, 108, 0.08);
    border-color: rgba(46, 165, 108, 0.3);
}
.io-flow__steps {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: ioflow;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.io-flow__steps li {
    position: relative;
    counter-increment: ioflow;
    padding-left: 28px;
    font-size: 12.5px;
    color: var(--ink);
    line-height: 1.5;
}
.io-flow__steps li::before {
    content: counter(ioflow);
    position: absolute;
    left: 0;
    top: -1px;
    width: 19px;
    height: 19px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--type-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--signal-ink);
    background: var(--signal);
    border-radius: 50%;
}
.io-flow__arrow {
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--ink-3);
    font-weight: 700;
}
@media (max-width: 860px) {
    .io-flow { grid-template-columns: 1fr; }
    .io-flow__arrow { transform: rotate(90deg); justify-self: center; padding: 4px 0; }
    .io-flow__hint { margin-top: var(--s-2); }
}

/* ─────────────────────────────────────────────────────────────────────────
   KPI BLOCKS
   ───────────────────────────────────────────────────────────────────────── */
.kpi {
    padding: var(--s-5) var(--s-5);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 10px;
}
.kpi__label {
    font-family: var(--type-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
}
.kpi__value {
    margin-top: var(--s-2);
    font-family: var(--type-display);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.kpi__delta {
    margin-top: var(--s-3);
    font-family: var(--type-mono);
    font-size: 11px;
    color: var(--ink-3);
}
.kpi__delta b { color: var(--ink-2); font-weight: 500; }

/* ─────────────────────────────────────────────────────────────────────────
   TABLES
   ───────────────────────────────────────────────────────────────────────── */
.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.tbl th {
    text-align: left;
    padding: 10px 14px;
    font-family: var(--type-mono);
    font-size: 10.5px;
    font-weight: 500;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--rule);
    background: var(--surface);
}
.tbl td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--rule);
    color: var(--ink);
    vertical-align: top;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--elevated); }
.tbl td.num,
.tbl th.num {
    text-align: right;
    font-family: var(--type-mono);
    font-variant-numeric: tabular-nums;
}
.tbl--rounded {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 10px;
    overflow: hidden;
}

/* ─────────────────────────────────────────────────────────────────────────
   BADGES
   ───────────────────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-family: var(--type-mono);
    font-size: 10.5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 4px;
    background: var(--elevated);
    color: var(--ink-2);
    border: 1px solid var(--rule);
}
.badge--ok    { color: var(--ok);   background: rgba(46, 165, 108, 0.12); border-color: rgba(46, 165, 108, 0.3); }
.badge--warn  { color: var(--warn); background: rgba(201, 138, 30, 0.12); border-color: rgba(201, 138, 30, 0.3); }
.badge--err   { color: var(--err);  background: rgba(200, 68, 68, 0.12);  border-color: rgba(200, 68, 68, 0.3); }
.badge--info  { color: var(--info); background: rgba(75, 130, 214, 0.12); border-color: rgba(75, 130, 214, 0.3); }

/* ─────────────────────────────────────────────────────────────────────────
   PROGRESS
   ───────────────────────────────────────────────────────────────────────── */
.progress {
    height: 4px;
    background: var(--rule);
    border-radius: 999px;
    overflow: hidden;
}
.progress__fill {
    height: 100%;
    background: var(--signal);
    transition: width 350ms ease;
    border-radius: 999px;
}

/* Stepped run log — used by the live pipeline panel */
.runlog {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 10px;
    padding: var(--s-4) var(--s-5);
}
.runlog__head {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin-bottom: var(--s-4);
    padding-bottom: var(--s-4);
    border-bottom: 1px solid var(--rule);
}
.runlog__id {
    font-family: var(--type-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
}
.runlog__pct {
    margin-left: auto;
    font-family: var(--type-mono);
    font-size: 12px;
    color: var(--ink-2);
}
.runlog__pct b { color: var(--ink); font-weight: 600; }
.runlog__steps { display: flex; flex-direction: column; gap: 0; }
.runlog__step {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    gap: var(--s-3);
    padding: 8px 0;
    border-bottom: 1px dashed var(--rule);
    font-size: 13px;
    color: var(--ink-2);
    align-items: center;
}
.runlog__step:last-child { border-bottom: 0; }
.runlog__step .glyph {
    font-family: var(--type-mono);
    font-size: 11px;
    color: var(--ink-3);
    text-align: center;
}
.runlog__step.is-running { color: var(--ink); }
.runlog__step.is-running .glyph { color: var(--signal-text); animation: pulse 1.4s ease-in-out infinite; }
.runlog__step.is-done { color: var(--ink-2); }
.runlog__step.is-done .glyph { color: var(--ok); }
.runlog__step.is-failed { color: var(--err); }

/* ─────────────────────────────────────────────────────────────────────────
   AUTHENTICATION
   ───────────────────────────────────────────────────────────────────────── */
body.auth-page {
    background:
        radial-gradient(circle at top left, rgba(255, 230, 0, 0.08), transparent 28%),
        radial-gradient(circle at bottom right, rgba(75, 130, 214, 0.12), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%),
        var(--bg);
}

body.auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 95%);
}

.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(28px, 5vw, 64px);
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(360px, 500px);
    gap: clamp(24px, 4vw, 56px);
    align-items: center;
}

.auth-brief {
    display: grid;
    gap: var(--s-4);
    align-content: center;
    max-width: 520px;
}

.auth-kicker,
.auth-card__eyebrow,
.auth-signal-card__label {
    font-family: var(--type-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.auth-kicker {
    color: var(--signal-text);
}

.auth-brief__title {
    max-width: 10ch;
    font-size: clamp(42px, 5vw, 58px);
    line-height: 0.96;
    letter-spacing: -0.05em;
}

.auth-brief__copy,
.auth-card__copy,
.auth-support,
.auth-signal-card__copy {
    color: var(--ink-2);
}

.auth-brief__copy {
    max-width: 46ch;
    font-size: 16px;
    line-height: 1.7;
}

.auth-brief__note {
    max-width: 42ch;
    font-family: var(--type-mono);
    font-size: 11px;
    line-height: 1.7;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.auth-card {
    position: relative;
    padding: clamp(26px, 3vw, 34px);
    background: linear-gradient(180deg, rgba(20, 23, 29, 0.95), rgba(20, 23, 29, 0.88));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    display: grid;
    gap: var(--s-4);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--signal), rgba(255, 230, 0, 0.15), transparent 72%);
}

.auth-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--s-4);
}

.auth-card__eyebrow {
    margin-bottom: var(--s-2);
    color: var(--ink-3);
}

.auth-card__title {
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1;
    letter-spacing: -0.03em;
}

.auth-alert {
    padding: 12px 14px;
    border: 1px solid rgba(200, 68, 68, 0.38);
    border-radius: 10px;
    background: rgba(200, 68, 68, 0.12);
    color: #ffc0c0;
    font-size: 13.5px;
}

.auth-form {
    display: grid;
    gap: var(--s-4);
}

.auth-form__field {
    gap: 10px;
}

.auth-form__input {
    min-height: 50px;
    border-radius: 10px;
    background: rgba(11, 13, 17, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

.auth-form__input:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

.auth-submit {
    margin-top: var(--s-2);
    min-height: 52px;
    padding: 0 18px;
    border-radius: 12px;
    background: var(--signal);
    color: var(--signal-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--type-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.auth-submit::after {
    content: "→";
    font-family: var(--type-body);
    font-size: 15px;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 32px rgba(255, 230, 0, 0.18);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-card__footer {
    display: grid;
    gap: var(--s-3);
    padding-top: var(--s-2);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-support {
    font-size: 13px;
    line-height: 1.7;
}

.auth-secondary-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--type-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--signal-text);
}

.auth-secondary-link::after {
    content: "→";
    font-family: var(--type-body);
    font-size: 15px;
}

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-brief__title {
            max-width: 12ch;
    }
}

@media (max-width: 640px) {
    .auth-shell {
        padding: 22px;
        gap: 24px;
    }

    .auth-card__header {
        flex-direction: column;
    }

    .auth-card {
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-submit,
    .auth-form__input,
    .auth-signal-card,
    .auth-card {
        transition: none;
    }
}
.runlog__step.is-failed .glyph { color: var(--err); }
.runlog__step .meta {
    font-family: var(--type-mono);
    font-size: 11px;
    color: var(--ink-3);
    white-space: nowrap;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ─────────────────────────────────────────────────────────────────────────
   MESSAGE BANNERS
   ───────────────────────────────────────────────────────────────────────── */
.banner {
    padding: var(--s-4) var(--s-5);
    border-radius: 8px;
    border: 1px solid var(--rule);
    background: var(--surface);
    font-size: 13.5px;
    line-height: 1.55;
}
.banner--ok   { border-color: rgba(46, 165, 108, 0.35); background: rgba(46, 165, 108, 0.07); color: var(--ok); }
.banner--err  { border-color: rgba(200, 68, 68, 0.35); background: rgba(200, 68, 68, 0.07); color: var(--err); }
.banner--warn { border-color: rgba(201, 138, 30, 0.35); background: rgba(201, 138, 30, 0.07); color: var(--warn); }

/* ─────────────────────────────────────────────────────────────────────────
   FOOTER (logo + © Ernst & Young)
   ───────────────────────────────────────────────────────────────────────── */
.footer {
    margin-top: auto;
    padding: var(--s-5) var(--gutter);
    background: var(--bg);
    border-top: 1px solid var(--rule);
}
.footer__inner {
    max-width: var(--measure);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    flex-wrap: wrap;
}
.footer__brand {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    color: var(--ink-2);
    font-family: var(--type-display);
    font-size: 12px;
    font-weight: 700;
}
.footer__brand img { height: 18px; width: auto; opacity: 0.85; }
.footer__copy {
    color: var(--ink-3);
    font-family: var(--type-mono);
    font-size: 10.5px;
    text-align: right;
}

[data-theme="light"] .topbar {
    background: rgba(247, 246, 242, 0.92);
    backdrop-filter: blur(10px);
}

[data-theme="light"] .topbar__logo {
    padding: 4px 8px;
    background: #2b2f36;
    border: 1px solid rgba(26, 28, 32, 0.14);
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(26, 28, 32, 0.10);
    opacity: 1;
}

[data-theme="light"] .topbar__logo img,
[data-theme="light"] .footer__brand img {
    opacity: 1;
}

[data-theme="light"] .card,
[data-theme="light"] .kpi,
[data-theme="light"] .drop,
[data-theme="light"] .runlog,
[data-theme="light"] .tbl--rounded,
[data-theme="light"] .topbar__theme,
[data-theme="light"] .topbar__meta .chip {
    box-shadow: 0 8px 24px rgba(26, 28, 32, 0.04);
}

[data-theme="light"] .footer {
    background: #F2F0EA;
}

[data-theme="light"] .footer__brand img {
    padding: 3px 6px;
    background: #2b2f36;
    border-radius: 6px;
}

@media (max-width: 600px) {
    .footer__inner { flex-direction: column; align-items: flex-start; }
    .footer__copy { text-align: left; }
}

/* ─────────────────────────────────────────────────────────────────────────
   HERO BRAND LOCKUP — animated EDME glyph + wordmark (home hero)
   ───────────────────────────────────────────────────────────────────────── */
.hero__lockup {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin-bottom: var(--s-3);
}
.hero__glyph { display: inline-flex; width: 40px; height: 40px; color: var(--signal); }
.hero__glyph svg { width: 40px; height: 40px; overflow: visible; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--signal) 40%, transparent)); }
.brandfilm__ring { fill: none; stroke: var(--signal); stroke-width: 2; transform-box: fill-box; transform-origin: center; }
.brandfilm__ring--1 { opacity: 0.85; stroke-dasharray: 40 14; animation: bf-spin 16s linear infinite; }
.brandfilm__ring--2 { opacity: 0.45; stroke-dasharray: 24 10; animation: bf-spin 11s linear infinite reverse; }
.brandfilm__spark { stroke: var(--signal); stroke-width: 2; stroke-linecap: round; opacity: 0; animation: bf-fade 0.7s ease forwards 0.6s, bf-node 2.6s ease-in-out infinite 1.4s; }
.brandfilm__core { fill: var(--signal); transform-box: fill-box; transform-origin: center; animation: bf-core 2.6s ease-in-out infinite; }
@keyframes bf-spin { to { transform: rotate(360deg); } }
@keyframes bf-core { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.25); opacity: 0.75; } }
@keyframes bf-node { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.hero__wordmark {
    display: inline-flex;
    font-family: var(--type-display);
    font-weight: 800;
    font-size: 34px;
    line-height: 1;
    letter-spacing: 0.05em;
    color: var(--ink);
}
.brandfilm__letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: bf-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.brandfilm__letter:nth-child(1) { animation-delay: 0.15s; }
.brandfilm__letter:nth-child(2) { animation-delay: 0.29s; }
.brandfilm__letter:nth-child(3) { animation-delay: 0.43s; color: var(--signal); }
.brandfilm__letter:nth-child(4) { animation-delay: 0.57s; }
@keyframes bf-rise { to { opacity: 1; transform: none; } }
@keyframes bf-fade { to { opacity: 1; } }

@media (max-width: 600px) {
    .hero__wordmark { font-size: 28px; }
    .hero__glyph, .hero__glyph svg { width: 34px; height: 34px; }
}

/* ─────────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .topbar { padding: 0 var(--s-4); gap: var(--s-3); }
    .topbar__nav { margin-left: var(--s-3); }
    .topbar__nav a { padding: 0 var(--s-3); font-size: 12.5px; }
    .topbar__meta { display: none; }
    .page__main { padding: var(--s-7) var(--s-4) var(--s-8); }
    .rule { padding: 0 var(--s-4); }
    .hero--split { grid-template-columns: 1fr; }
    .hero__viz { height: 260px; }

    /* Rail overlays content on small screens instead of reserving space. */
    .page,
    body.nav-open .page { padding-left: 0; }
    .sidenav { box-shadow: var(--shadow, 0 0 40px rgba(0, 0, 0, 0.45)); }
}
@media (max-width: 600px) {
    .topbar__brand { font-size: 12px; }
    .topbar__brand::before { width: 5px; height: 5px; }
    .topbar__nav a { padding: 0 var(--s-2); font-size: 12px; }
    .hero__title { font-size: 28px; }
    .hero__viz { height: 200px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   DOCUMENTATION — portal layout (sticky TOC + reading column),
   endpoint reference blocks, param tables, copyable code, callouts.
   Shared by the API reference pages.
   ───────────────────────────────────────────────────────────────────────── */
.docs {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: var(--s-9);
    align-items: start;
}

/* Sticky table of contents */
.docs__toc {
    position: sticky;
    top: calc(var(--topbar-h) + var(--s-6));
    align-self: start;
    max-height: calc(100vh - var(--topbar-h) - var(--s-8));
    overflow-y: auto;
    border-left: 1px solid var(--rule);
}
.docs__toc-label {
    display: block;
    font-family: var(--type-mono);
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 0 0 var(--s-3) var(--s-4);
}
.docs__toc a {
    display: block;
    padding: 6px var(--s-4);
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--ink-2);
    font-size: 13.5px;
    line-height: 1.4;
    transition: color 140ms ease, border-color 140ms ease;
}
.docs__toc a:hover { color: var(--ink); }
.docs__toc a.is-active {
    color: var(--ink);
    border-left-color: var(--signal);
    font-weight: 550;
}

/* Reading column */
.docs__main { min-width: 0; max-width: 760px; }
.docs__header { margin-bottom: var(--s-7); }
.docs__header h1 { margin: var(--s-3) 0 0; }

.eyebrow {
    display: block;
    font-family: var(--type-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.eyebrow::before { content: '— '; color: var(--signal-text); }

.lede {
    margin-top: var(--s-4);
    max-width: 64ch;
    color: var(--ink-2);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Quick-facts row under the page header */
.docs__facts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-3);
    margin-top: var(--s-6);
}
.docs__fact {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--s-3) var(--s-4);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 8px;
}
.docs__fact dt {
    font-family: var(--type-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.docs__fact dd {
    font-family: var(--type-mono);
    font-size: 0.85rem;
    color: var(--ink);
}

/* Sections */
.docs-section {
    padding-top: var(--s-8);
    scroll-margin-top: calc(var(--topbar-h) + var(--s-5));
}
.docs-section > h2 { margin-bottom: var(--s-3); }
.docs-section > h3 { margin: var(--s-6) 0 var(--s-2); }
.docs-section > p { color: var(--ink-2); max-width: 68ch; margin: var(--s-3) 0; }
.docs-section + .docs-section { border-top: 1px solid var(--rule); }

/* Endpoint reference block */
.endpoint {
    border: 1px solid var(--rule);
    border-radius: 10px;
    overflow: hidden;
    margin: var(--s-4) 0;
    background: var(--surface);
}
.endpoint__bar {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    background: var(--elevated);
    border-bottom: 1px solid var(--rule);
}
.endpoint__path {
    font-family: var(--type-mono);
    font-size: 0.9rem;
    color: var(--ink);
    word-break: break-all;
}
.endpoint__body { padding: var(--s-4) var(--s-5); }
.endpoint__body > p { color: var(--ink-2); margin: 0 0 var(--s-3); }
.endpoint__body > p:last-child { margin-bottom: 0; }

/* HTTP method badge */
.method {
    flex-shrink: 0;
    font-family: var(--type-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 5px;
    color: #fff;
}
.method--get { background: var(--info); }
.method--post { background: var(--ok); }
.method--delete { background: var(--err); }
.method--put, .method--patch { background: var(--warn); }

/* Parameter table */
.params-table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--s-3) 0 var(--s-4);
    font-size: 0.9rem;
}
.params-table th {
    text-align: left;
    font-family: var(--type-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 0 var(--s-4) var(--s-2) 0;
    border-bottom: 1px solid var(--rule);
}
.params-table td {
    padding: var(--s-3) var(--s-4) var(--s-3) 0;
    border-bottom: 1px solid var(--rule);
    color: var(--ink-2);
    vertical-align: top;
    line-height: 1.5;
}
.params-table tr:last-child td { border-bottom: 0; }
.params-table td:first-child {
    color: var(--ink);
    font-family: var(--type-mono);
    font-size: 0.82rem;
    white-space: nowrap;
}
.params-table .req {
    color: var(--warn);
    font-family: var(--type-mono);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: var(--s-1);
}

/* Code block with header bar + copy button */
.codeblock {
    border: 1px solid var(--rule);
    border-radius: 8px;
    overflow: hidden;
    margin: var(--s-4) 0;
    background: var(--bg);
}
.codeblock__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4);
    background: var(--elevated);
    border-bottom: 1px solid var(--rule);
}
.codeblock__lang {
    font-family: var(--type-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.codeblock__copy {
    font-family: var(--type-mono);
    font-size: 0.72rem;
    color: var(--ink-2);
    padding: 3px 9px;
    border: 1px solid var(--rule);
    border-radius: 5px;
    transition: color 140ms ease, border-color 140ms ease;
}
.codeblock__copy:hover { color: var(--ink); border-color: var(--rule-strong); }
.codeblock__copy.is-copied { color: var(--ok); border-color: var(--ok); }
.codeblock pre { margin: 0; padding: var(--s-4); overflow-x: auto; }
.codeblock code {
    font-family: var(--type-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--ink);
}

/* Callout */
.callout {
    display: flex;
    gap: var(--s-3);
    padding: var(--s-4) var(--s-5);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--ink-3);
    border-radius: 8px;
    background: var(--surface);
    margin: var(--s-4) 0;
    color: var(--ink-2);
    font-size: 0.92rem;
    line-height: 1.6;
}
.callout strong { color: var(--ink); }
.callout--info { border-left-color: var(--info); }
.callout--warn { border-left-color: var(--warn); }
.callout--ok { border-left-color: var(--ok); }

/* Compact status-code list */
.status-list { display: flex; flex-direction: column; gap: var(--s-2); margin: var(--s-3) 0; }
.status-list > div { font-size: 0.9rem; color: var(--ink-2); }
.status-list code { color: var(--ink); margin-right: var(--s-2); }

@media (max-width: 900px) {
    .docs { grid-template-columns: 1fr; gap: var(--s-5); }
    .docs__toc { display: none; }
}
