/* GENERATED by scripts/gen-tokens.mjs from shared/tokens.json. Do not edit; run `npm run tokens`.
   EarthPane design tokens. City Lights: Earth's night side from orbit, sodium amber for
   selection, atmosphere-limb blue for live activity. Every raw value in the UI lives here; feature CSS
   uses var(--…) only. Mirrored for TypeScript in tokens.ts, and for SwiftUI/Compose in native/. */
:root {
  /* colour: surfaces */
  --bg: #0b0f13;
  --surface: rgba(18, 23, 28, 0.94);
  --surface-solid: #12171c;
  --surface-sunken: rgba(0, 0, 0, 0.25);
  --scrim: rgba(4, 6, 9, 0.6);
  --raise: rgba(200, 215, 230, 0.06);
  --line: rgba(200, 215, 230, 0.1);
  --line-strong: rgba(200, 215, 230, 0.22);
  /* colour: text */
  --text: #e8ecef;
  --text-dim: #c3cad1;
  --muted: #8f99a3;
  /* colour: roles */
  --accent: #f2a541;
  --accent-ink: #1a1206;
  --accent-soft: rgba(242, 165, 65, 0.14);
  --accent-press: rgba(242, 165, 65, 0.18);
  --accent-ghost: rgba(242, 165, 65, 0.45);
  --live: #7fd4ff;
  --good: #57c28a;
  --warn: #e7c24a;
  --bad: #ef5b5b;
  --bad-soft: rgba(239, 91, 91, 0.16);

  /* type */
  --font: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --fs-2xs: 10.5px;
  --fs-xs: 11.5px;
  --fs-sm: 12.5px;
  --fs-md: 13px;
  --fs-lg: 14px;
  --fs-xl: 15px;
  --fs-2xl: 18px;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 600;

  /* space (4px grid, plus the panel gutter) */
  --s-1: 4px;
  --s-2: 6px;
  --s-3: 8px;
  --s-4: 10px;
  --s-5: 12px;
  --s-6: 14px;
  --s-8: 16px;
  --gap: 12px;

  /* shape */
  --r-xs: 3px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-sheet: 14px;
  --r-pill: 999px;

  /* size */
  --control: 40px;
  --control-sm: 32px;
  --touch: 44px;
  --panel-w: 320px;
  --side-w: 320px;
  --dialog-w: 560px;
  --sheet-peek: 140px;
  --bp-phone: 720px;

  /* elevation and glass */
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --blur: blur(14px) saturate(1.2);

  /* motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-fast: 0.12s;
  --dur: 0.16s;
  --dur-slow: 0.22s;
}

/* Web-only tokens, hand-written: appended to the generated tokens.css by scripts/gen-tokens.mjs. */
:root {
  /* layers */
  --z-map-ui: 2;
  --z-panel: 3;
  --z-bar: 4;
  --z-sheet: 4;
  --z-tooltip: 5;
  --z-skip: 10;

  /* device: safe areas (notch, home indicator, Android cutouts); 0 on desktop */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  /* where panels start under the top bar */
  --top-offset: calc(var(--safe-top) + var(--gap) + var(--control) + var(--gap));

  /* the marketing pages (site/): display type, section rhythm and reading widths */
  --fs-3xl: 21px;
  --fs-4xl: clamp(26px, 3.4vw, 34px);
  --fs-display: clamp(38px, 6.4vw, 68px);
  --s-12: 24px;
  --s-16: 32px;
  --s-24: 48px;
  --s-32: 72px;
  --site-w: 1160px;
  --prose-w: 660px;

  color-scheme: dark;
}

/* Android GPUs redo a backdrop blur on every frame the map moves under it, which makes panning
   stutter on mid-range phones. There, glass surfaces are opaque instead (platform.ts sets this). */
:root[data-fx="lite"] {
  --blur: none;
  --surface: var(--surface-solid);
}

@media (max-width: 720px) {
  :root { --gap: 8px; }
}

/* Orbwatch primitives. Tokens only (ds/tokens.css). Feature CSS adds position and layout on top;
   it does not restyle these. Every interactive primitive grows to --touch on coarse pointers. */

/* ---- base ------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden;
  font: var(--fw-regular) var(--fs-md)/1.45 var(--font); -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
h2, h3 { margin: 0; }
.ds-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
/* touch: no grey tap flash, no double-tap zoom delay */
button, a, input, select, summary, [role='button'] { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
input[type='checkbox'], input[type='range'] { accent-color: var(--accent); }
input[type='checkbox'] { margin: 0; width: 15px; height: 15px; }

/* ---- glass surface: every floating panel, bar control and sheet ---------------------------- */
.ds-glass {
  background: var(--surface); border: 1px solid var(--line);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.ds-card { border-radius: var(--r-lg); box-shadow: var(--shadow); }
.ds-popover { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); }

/* ---- chip: 40px top-bar control --------------------------------------------------------- */
.ds-chip {
  display: flex; align-items: center; gap: 7px; height: var(--control); padding: 0 var(--s-5) 0 13px; border-radius: var(--r-md);
  color: var(--text); text-decoration: none; cursor: pointer; font-weight: var(--fw-medium);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.ds-chip[aria-expanded='true'] { border-color: var(--line-strong); }
.ds-chip:active { transform: scale(0.97); }
@media (hover: hover) { .ds-chip:hover { border-color: var(--line-strong); } }
/* quiet: no box, just icon and label over the map (top-bar tools). The text shadow keeps it legible on
   bright imagery; hover and open get a faint fill rather than a border. */
.ds-chip--quiet { background: none; border: 0; color: var(--text-dim); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); }
.ds-chip--quiet[aria-expanded='true'] { color: var(--accent); background: var(--surface-solid); text-shadow: none; }
@media (hover: hover) { .ds-chip--quiet:hover { color: var(--text); background: var(--raise); } }
/* a mode the chip turned on is still running (e.g. a drawing tool is armed) */
.ds-chip--on, .ds-chip--on:hover { border-color: var(--accent-ghost); background: var(--accent-soft); color: var(--accent); }

/* ---- badge: small count ------------------------------------------------------------------ */
.ds-badge {
  min-width: 18px; padding: 0 var(--s-1); border-radius: var(--r-xs); background: var(--accent); color: var(--accent-ink);
  font: var(--fw-medium) 11px/16px var(--font-mono); text-align: center; font-variant-numeric: tabular-nums; text-shadow: none;
}
.ds-badge:empty { display: none; }

/* ---- dot: a layer's colour --------------------------------------------------------------- */
.ds-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--dot, var(--accent)); }

/* ---- button ------------------------------------------------------------------------------ */
.ds-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); height: var(--control-sm); padding: 0 var(--s-5);
  border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: none; color: var(--text);
  text-decoration: none; cursor: pointer; font-weight: var(--fw-medium);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.ds-btn:hover { border-color: var(--accent); color: var(--accent); }
.ds-btn:active { transform: scale(0.97); }
.ds-btn:disabled { opacity: 0.5; cursor: default; }
.ds-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ds-btn--primary:hover { color: var(--accent-ink); filter: brightness(1.08); }

/* ---- icon button ------------------------------------------------------------------------- */
.ds-icon-btn {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none;
  color: var(--muted); font-size: var(--fs-xl); line-height: 1; cursor: pointer;
}
.ds-icon-btn:hover { background: var(--raise); color: var(--text); }
.ds-icon-btn[hidden] { display: none; }
.ds-icon-btn--danger { width: 24px; height: 24px; font-size: 17px; }
.ds-icon-btn--danger:hover { background: var(--bad-soft); color: var(--bad); }
/* the × that closes a panel or sheet */
.ds-close { width: 28px; height: 28px; margin: -4px -6px -4px 0; border-radius: var(--r-sm); font-size: 20px; }

/* ---- link button ------------------------------------------------------------------------- */
.ds-link {
  background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-size: var(--fs-sm);
  transition: color var(--dur) var(--ease);
}
.ds-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- pill: small selectable option (radius, view, compare) -------------------------------- */
.ds-pill {
  padding: 3px var(--s-4); border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: none;
  color: var(--muted); font-size: 12px; cursor: pointer; white-space: nowrap;
}
.ds-pill:hover { color: var(--text); }
.ds-pill.sel, .ds-pill[aria-pressed='true'], .ds-pill[aria-checked='true'] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---- tool: an icon over a short label, one of a row of modes (draw tools) ------------------ */
.ds-tool {
  display: grid; justify-items: center; align-content: center; gap: var(--s-1); min-width: 0; min-height: 56px; padding: var(--s-3) var(--s-1);
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-sunken); color: var(--muted);
  font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 1.15; text-align: center; cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.ds-tool svg { width: 20px; height: 20px; flex: none; }
@media (hover: hover) { .ds-tool:hover { border-color: var(--line-strong); color: var(--text); } }
.ds-tool:active { transform: scale(0.96); }
.ds-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ds-tool[aria-pressed='true'] { border-color: var(--accent-ghost); background: var(--accent-soft); color: var(--accent); }
.ds-tool:disabled { opacity: 0.5; cursor: default; }

/* ---- input ------------------------------------------------------------------------------- */
.ds-input {
  width: 100%; height: 34px; padding: 0 var(--s-4); border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface-sunken); color: var(--text); outline: none;
}
.ds-input:focus { border-color: var(--accent); }
.ds-input:focus-visible { outline-offset: 0; }
.ds-input::placeholder { color: var(--muted); }

/* ---- select: a .ds-input that picks one option; the browser's own chrome is replaced by a drawn caret ---- */
.ds-select {
  appearance: none; -webkit-appearance: none; padding-right: calc(var(--s-4) * 2 + var(--s-3)); cursor: pointer;
  text-overflow: ellipsis; white-space: nowrap;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right calc(var(--s-4) + var(--s-1)) center, right var(--s-4) center;
  background-size: var(--s-1) var(--s-1); background-repeat: no-repeat;
  transition: border-color var(--dur-fast) var(--ease);
}
@media (hover: hover) { .ds-select:hover { border-color: var(--line-strong); } }
.ds-select:focus { border-color: var(--accent); }
.ds-select:disabled { opacity: 0.5; cursor: default; }
.ds-select option { background: var(--surface-solid); color: var(--text); }

/* ---- segmented: one choice from a few, all visible (radio inputs inside labels) ------------ */
.ds-segmented {
  display: flex; margin: 0; padding: 2px; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-sunken);
}
.ds-segmented label {
  position: relative; flex: 1; display: grid; place-items: center; height: 28px; padding: 0 var(--s-3); border-radius: var(--r-xs);
  color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.ds-segmented input { position: absolute; opacity: 0; pointer-events: none; }
@media (hover: hover) { .ds-segmented label:hover { color: var(--text); } }
.ds-segmented label:has(:checked) { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-ghost); }
.ds-segmented label:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.ds-segmented label:active { transform: scale(0.97); }

/* ---- switch: an on/off checkbox drawn as a track and knob ---------------------------------- */
/* input.ds-switch outranks the plain checkbox size above */
input.ds-switch {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 34px; height: 20px; margin: 0;
  border-radius: var(--r-pill); background: var(--line-strong); cursor: pointer; transition: background-color var(--dur) var(--ease);
}
.ds-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text);
  transition: transform var(--dur) var(--ease);
}
.ds-switch:checked { background: var(--accent); }
.ds-switch:checked::after { transform: translateX(14px); background: var(--accent-ink); }
.ds-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ds-switch:disabled { opacity: 0.5; cursor: default; }

/* ---- row: a tappable line in a list ------------------------------------------------------- */
.ds-row {
  width: 100%; border: 0; border-radius: var(--r-sm); background: none; color: inherit; text-align: left; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease);
}
.ds-row:hover { background: var(--raise); }

/* ---- layer row: lead · name · blurb · trailing control (a switch or ×) ----------------------
   <label class="ds-layer-row"> so the whole row flips its switch. Children: .lr-lead (swatch),
   .lr-name, .lr-blurb (one plain-language line), .lr-end (control + status). */
.ds-layer-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: var(--s-4); row-gap: 1px; align-items: center;
  padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease);
}
@media (hover: hover) { .ds-layer-row:hover { background: var(--raise); } }
.ds-layer-row:active { background: var(--accent-press); }
.ds-layer-row:has(:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.ds-layer-row .lr-lead { grid-row: 1 / span 2; display: grid; place-items: center; width: 16px; }
.ds-layer-row .lr-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-medium); }
.ds-layer-row .lr-blurb { grid-column: 2; min-width: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.35; }
.ds-layer-row .lr-end { grid-column: 3; grid-row: 1 / span 2; display: flex; align-items: center; gap: var(--s-3); }
.ds-layer-row:has(input:disabled) { cursor: default; opacity: 0.55; }
.ds-layer-row:has(input:disabled):active { background: none; }

/* ---- tabs: one view from several, as a scrolling row of text (buttons with aria-selected) ---- */
.ds-tabs { flex: none; display: flex; gap: var(--s-1); overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.ds-tabs::-webkit-scrollbar { display: none; }
.ds-tab {
  flex: none; height: var(--control-sm); padding: 0 var(--s-4); border: 0; background: none; color: var(--muted); cursor: pointer;
  font-weight: var(--fw-medium); white-space: nowrap; transition: color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
@media (hover: hover) { .ds-tab:hover { color: var(--text); } }
.ds-tab[aria-selected='true'] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.ds-tab:focus-visible { outline-offset: -2px; }

/* ---- dialog: a centred modal for browsing many things (a <dialog> opened with showModal) ----
   Phones get the same content as a full-height bottom sheet. Children: .ds-dialog-head, a body
   that scrolls (.ds-dialog-body). */
.ds-dialog {
  width: min(var(--dialog-w), calc(100vw - 2 * var(--gap))); max-width: none; max-height: 80vh; max-height: 80dvh; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow);
}
.ds-dialog[open] { display: flex; flex-direction: column; animation: ds-dialog-in var(--dur-slow) var(--ease); }
.ds-dialog::backdrop { background: var(--scrim); }
.ds-dialog-head { flex: none; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-5) var(--s-5) var(--s-3) var(--s-8); }
.ds-dialog-head h2 { flex: 1; font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -0.01em; }
.ds-dialog-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: var(--s-2) var(--s-3) var(--s-5); }
@keyframes ds-dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.99); } }
@media (max-width: 720px) {
  .ds-dialog {
    width: 100%; height: 92vh; height: 92dvh; max-height: none; margin: auto 0 0;
    border-radius: var(--r-sheet) var(--r-sheet) 0 0; border-bottom: 0; padding-bottom: var(--safe-bottom);
  }
  .ds-dialog[open] { animation-name: ds-sheet-in; }
  .ds-dialog-head { padding-left: var(--s-6); }
}

/* ---- section label ----------------------------------------------------------------------- */
.ds-label { font-size: 12px; font-weight: var(--fw-medium); color: var(--muted); }
.ds-empty { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
/* the next step from an empty state: one or two buttons under the sentence */
.ds-empty-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-5); }

/* ---- spinner ----------------------------------------------------------------------------- */
.ds-spinner {
  display: inline-block; width: 11px; height: 11px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--line-strong); border-top-color: var(--accent); animation: ds-spin 0.8s linear infinite;
}
@keyframes ds-spin { to { transform: rotate(360deg); } }

/* ---- sheet: a side panel on desktop, a bottom sheet on phones ------------------------------
   Desktop placement is the feature's job. On phones every .ds-sheet docks to the bottom edge,
   clears the home indicator and shows a grab handle. The doubled class outranks feature CSS;
   !important beats the inline position a dragged desktop panel leaves behind. A feature sets
   --sheet-pad-b for its own bottom padding. */
@media (max-width: 720px) {
  .ds-sheet.ds-sheet {
    position: fixed; top: auto !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: auto !important; height: auto !important; max-height: 70vh; max-height: 70dvh; resize: none;
    border-radius: var(--r-sheet) var(--r-sheet) 0 0; border-bottom: 0;
    padding-bottom: calc(var(--sheet-pad-b, 0px) + var(--safe-bottom)); animation: ds-sheet-in var(--dur-slow) var(--ease);
  }
  /* the grab handle; sheet.ts makes the top strip tap- and drag-able between three heights */
  .ds-sheet::before {
    content: ''; display: block; flex: none; width: 36px; height: 4px; margin: var(--s-2) auto 0; border-radius: 2px; background: var(--line-strong);
    box-shadow: 0 0 0 12px transparent; cursor: grab;
  }
  .ds-sheet.ds-sheet[data-snap='peek'] { max-height: var(--sheet-peek); overflow: hidden; }
  .ds-sheet.ds-sheet[data-snap='half'] { max-height: 50vh; max-height: 50dvh; }
  .ds-sheet.ds-sheet[data-snap='full'] { max-height: 90vh; max-height: 90dvh; }
  @keyframes ds-sheet-in { from { transform: translateY(24px); opacity: 0; } }
}

/* ---- coarse pointers: everything tappable is at least --touch ------------------------------ */
@media (pointer: coarse) {
  .ds-chip, .ds-input { min-height: var(--touch); }
  .ds-btn { min-height: var(--touch); padding: 0 var(--s-6); }
  .ds-icon-btn, .ds-link { min-width: var(--touch); min-height: var(--touch); }
  .ds-pill { min-height: 36px; padding: 0 var(--s-5); }
  .ds-row, .ds-layer-row { min-height: var(--touch); }
  .ds-tab { height: var(--touch); }
  .ds-segmented label { height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* earthpane.com pages (site/build.mjs). Loaded after ds/tokens.css and ds/components.css; tokens
   only. The app pins the body to the viewport for the map; these pages scroll. */

html, body { height: auto; overflow: visible; overflow-x: hidden; }
body { font-size: var(--fs-xl); line-height: 1.6; color: var(--text-dim); }
h1, h2, h3 { color: var(--text); font-weight: var(--fw-bold); line-height: 1.15; letter-spacing: -0.01em; margin: 0; }
p { margin: 0 0 var(--s-8); }
a { color: var(--accent); }
strong { color: var(--text); font-weight: var(--fw-medium); }
img { display: block; max-width: 100%; height: auto; }
.muted { color: var(--muted); }

.wrap { width: 100%; max-width: var(--site-w); margin: 0 auto; padding: 0 var(--s-12); }
@media (max-width: 720px) { .wrap { padding: 0 var(--s-8); } }

.skip { position: absolute; left: var(--s-3); top: calc(-1 * var(--s-32)); z-index: var(--z-skip); padding: var(--s-3) var(--s-5); background: var(--accent); color: var(--accent-ink); border-radius: var(--r-sm); }
.skip:focus { top: var(--s-3); }

/* ---- top bar ---------------------------------------------------------------------------- */
.bar { position: sticky; top: 0; z-index: var(--z-bar); background: var(--surface); border-bottom: 1px solid var(--line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); padding-top: var(--safe-top); }
.bar-in { display: flex; align-items: center; gap: var(--s-12); min-height: calc(var(--control) + var(--s-8)); }
.logo { display: inline-flex; align-items: center; gap: var(--s-3); color: var(--text); text-decoration: none; font-weight: var(--fw-bold); font-size: var(--fs-2xl); }
.nav { display: flex; gap: var(--s-1); margin-right: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { display: inline-flex; align-items: center; height: var(--control-sm); padding: 0 var(--s-4); border-radius: var(--r-sm); color: var(--muted); text-decoration: none; font-size: var(--fs-lg); font-weight: var(--fw-medium); white-space: nowrap; transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.nav a[aria-current='page'] { color: var(--text); background: var(--raise); }
@media (hover: hover) { .nav a:hover { color: var(--text); } }
.cta-sm { flex: none; }
/* Phones: the nav moves to its own scrolling row under the logo, so every link stays reachable. */
@media (max-width: 720px) {
  .bar-in { flex-wrap: wrap; gap: 0 var(--s-5); padding-top: var(--s-3); }
  .logo { margin-right: auto; }
  .nav { order: 3; width: 100%; margin: var(--s-1) calc(-1 * var(--s-4)) var(--s-2); }
}

/* ---- hero ------------------------------------------------------------------------------- */
.hero { padding-top: var(--s-32); text-align: center; }
.hero--topic { padding-top: var(--s-16); }
.hero h1 { font-size: var(--fs-display); max-width: 14em; margin: 0 auto var(--s-12); letter-spacing: -0.025em; }
.hero--topic h1 { font-size: var(--fs-4xl); max-width: 22em; margin-bottom: var(--s-8); }
.lede { font-size: var(--fs-3xl); line-height: 1.5; max-width: var(--prose-w); margin: 0 auto var(--s-12); color: var(--text-dim); }
.hero--topic .lede { font-size: var(--fs-2xl); }
.eyebrow { display: inline-flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-8); padding: var(--s-1) var(--s-5); border: 1px solid var(--line-strong); border-radius: var(--r-pill); color: var(--text-dim); font-size: var(--fs-sm); font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; }
.live-dot { width: var(--s-3); height: var(--s-3); flex: none; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--live); } 70%, 100% { box-shadow: 0 0 0 var(--s-2) transparent; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-5); }
.cta { height: var(--touch); padding: 0 var(--s-12); font-size: var(--fs-xl); border-radius: var(--r-md); }
.fine { margin: var(--s-8) 0 0; color: var(--muted); font-size: var(--fs-sm); }
.frame { margin: var(--s-24) 0 0; border: 1px solid var(--line-strong); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); background: var(--surface-solid); }
.hero .frame { margin-top: var(--s-16); }

/* ---- sections --------------------------------------------------------------------------- */
.sec { padding-top: var(--s-32); }
.sec h2 { font-size: var(--fs-4xl); margin-bottom: var(--s-5); }
.sub { color: var(--muted); margin-bottom: var(--s-16); }
.sec > h2 + .faq, .sec > h2 + .layers, .sec > h2 + .steps { margin-top: var(--s-12); }
.end { text-align: center; padding-bottom: var(--s-8); }
.end h2 { margin-bottom: var(--s-12); }

.split { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--s-24); align-items: center; }
.split .frame { margin: 0; }
@media (max-width: 720px) { .split { grid-template-columns: 1fr; gap: var(--s-12); } }

.crumbs { display: flex; gap: var(--s-3); padding-top: var(--s-12); font-size: var(--fs-md); color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
@media (hover: hover) { .crumbs a:hover { color: var(--text); } }

/* ---- topic cards ------------------------------------------------------------------------ */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, calc(var(--side-w) - var(--s-16))), 1fr)); gap: var(--gap); }
.card { position: relative; display: block; padding: var(--s-12) var(--s-12) var(--s-12); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-solid); text-decoration: none; color: var(--text-dim); transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.card h3 { font-size: var(--fs-2xl); margin-bottom: var(--s-3); padding-right: var(--s-16); }
.card p { margin: 0; font-size: var(--fs-lg); color: var(--muted); }
.card-go { position: absolute; top: var(--s-12); right: var(--s-12); color: var(--accent); font-size: var(--fs-2xl); transition: transform var(--dur) var(--ease); }
@media (hover: hover) { .card:hover { border-color: var(--accent-ghost); } .card:hover .card-go { transform: translateX(var(--s-1)); } }
.card:active { transform: scale(0.99); }

/* ---- categories ------------------------------------------------------------------------- */
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); margin-bottom: var(--s-12); }
.cat { padding: var(--s-12); border: 1px solid var(--line); border-radius: var(--r-lg); }
.cat h3 { font-size: var(--fs-2xl); }
.cat-n { margin: var(--s-1) 0 var(--s-5); color: var(--live); font-size: var(--fs-md); font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; }
.cat .muted { margin: 0; font-size: var(--fs-lg); }
@media (max-width: 960px) { .cats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cats { grid-template-columns: 1fr; } }
.sources { max-width: 52em; color: var(--text-dim); line-height: 1.9; }

/* ---- layer rows ------------------------------------------------------------------------- */
.layers { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.layer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: var(--s-1) var(--s-12); padding: var(--s-8) 0; border-bottom: 1px solid var(--line); }
.layer-name { color: var(--text); font-weight: var(--fw-medium); }
.layer-blurb { color: var(--text-dim); }
.layer-meta { grid-column: 2; display: flex; align-items: center; gap: var(--s-3); color: var(--muted); font-size: var(--fs-md); }
.layer-meta .live-dot { animation: none; width: var(--s-2); height: var(--s-2); }
@media (max-width: 720px) { .layer { grid-template-columns: 1fr; } .layer-meta { grid-column: 1; } }

/* ---- steps and questions ---------------------------------------------------------------- */
.steps { counter-reset: step; list-style: none; margin: 0 0 var(--s-12); padding: 0; display: grid; gap: var(--s-8); max-width: var(--prose-w); }
.steps li { counter-increment: step; position: relative; padding-left: var(--s-24); min-height: var(--control-sm); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: var(--control-sm); height: var(--control-sm); border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: var(--fw-bold); font-size: var(--fs-lg); }

.faq { max-width: calc(var(--prose-w) + var(--s-32)); border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s-8); min-height: var(--touch); padding: var(--s-6) 0; cursor: pointer; color: var(--text); font-weight: var(--fw-medium); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; color: var(--accent); font-size: var(--fs-2xl); transition: transform var(--dur) var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 var(--s-8); max-width: var(--prose-w); }

.prose { text-align: left; max-width: calc(var(--prose-w) + var(--s-24)); }
.prose h1, .prose .lede { margin-left: 0; }
.prose h2 { font-size: var(--fs-3xl); margin: var(--s-16) 0 var(--s-5); }

/* ---- footer ----------------------------------------------------------------------------- */
.foot { margin-top: var(--s-32); padding: var(--s-24) 0 calc(var(--s-24) + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--surface-sunken); font-size: var(--fs-lg); }
.foot-in { display: grid; grid-template-columns: 1.2fr 2fr 1fr; gap: var(--s-16); }
.foot h2 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: var(--s-5); }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot nav:first-of-type ul { columns: 2; column-gap: var(--s-12); }
.foot li { margin-bottom: var(--s-2); break-inside: avoid; }
.foot li a { color: var(--text-dim); text-decoration: none; }
@media (hover: hover) { .foot li a:hover { color: var(--accent); } }
.foot .logo { margin-bottom: var(--s-5); }
@media (max-width: 720px) { .foot-in { grid-template-columns: 1fr; } }
@media (pointer: coarse) { .foot li a { display: inline-block; padding: var(--s-2) 0; } }
