/* ============================================================================
   macros.run — landing
   Editorial Console system (cyan on near-black, Inter + JetBrains Mono),
   pushed into a living, animated product story. No framework.
   ========================================================================== */

:root {
  --bg-base: #0a0c0d;
  --bg-surface: #0f1214;
  --bg-card: #14181b;
  --bg-elevated: #1b2024;
  --border-default: #23292e;
  --border-hover: #343c42;
  --text-primary: #f2f5f6;
  --text-secondary: #9aa2a9;
  --text-tertiary: #868e95;
  --accent: #22d3ee;
  --accent-hover: #4fdcf0;
  --accent-muted: rgba(34, 211, 238, 0.12);
  --accent-contrast: #06181c;
  --success: #22c55e;
  --error: #ef4444;

  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.625rem;
  --radius-xl: 0.875rem;
  --radius-2xl: 1.25rem;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --z-sticky: 100;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; }
::selection { background: var(--accent-muted); color: var(--text-primary); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 1000;
  padding: 0.5rem 0.875rem; background: var(--bg-elevated);
  border: 1px solid var(--border-hover); border-radius: var(--radius-md);
  font-size: 0.8125rem; text-decoration: none; transition: top 0.18s ease;
}
.skip-link:focus { top: 1rem; }

.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: clamp(1.25rem, 5vw, 2.5rem); }

/* ── Brand ──────────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 0.625rem; text-decoration: none; }
.brand__mark { display: block; border-radius: 22%; }
.brand__word { font-family: var(--font-mono); font-weight: 600; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.18em; color: var(--text-primary); }
.brand--sm .brand__word { font-size: 0.75rem; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: var(--font-sans); font-weight: 500; font-size: 0.875rem; line-height: 1;
  text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; border-radius: var(--radius-md);
  padding: 0.625rem 1.1rem; cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s var(--ease-out), box-shadow 0.16s ease;
}
.btn--sm { padding: 0.45rem 0.85rem; font-size: 0.8125rem; }
.btn--lg { padding: 0.85rem 1.5rem; font-size: 0.9375rem; }
.btn--block { width: 100%; }
.btn--primary { background: var(--accent); color: var(--accent-contrast); font-weight: 600; box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
.btn--primary:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 10px 30px -10px rgba(34, 211, 238, 0.5); }
.btn--outline { border-color: var(--border-default); color: var(--text-primary); background: transparent; }
.btn--outline:hover { border-color: var(--border-hover); background: var(--bg-elevated); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn[disabled]:hover { transform: none; box-shadow: none; }

/* ── Top bar ────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: color-mix(in srgb, var(--bg-base) 78%, transparent);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--border-default);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.topbar__nav { display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 1.5rem); }
.navlink { font-size: 0.875rem; color: var(--text-secondary); text-decoration: none; transition: color 0.16s ease; }
.navlink:hover { color: var(--text-primary); }
.navlink--ghost { color: var(--text-primary); }

/* ── Kicker ─────────────────────────────────────────────────── */
.kicker {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent);
  padding: 0.3rem 0.7rem; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px; background: var(--accent-muted);
}
.kicker__dot { width: 6px; height: 6px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* ── Hero ───────────────────────────────────────────────────── */
.hero { position: relative; padding-block: clamp(3.5rem, 9vw, 7rem); overflow: hidden; }
/* WebGL flow-field paints the glow (motion.js); a faint blueprint grid sits on
   top for structure. Both fade at the edges so the copy stays clean. */
.hero__webgl { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 46px 46px, 46px 46px;
  -webkit-mask-image: radial-gradient(125% 115% at 68% 32%, #000 42%, transparent 88%);
  mask-image: radial-gradient(125% 115% at 68% 32%, #000 42%, transparent 88%);
}
/* Kinetic headline: each split line rises out of a clipped mask (motion.js). */
.hero__title .lineMask { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero__title .lineChild { display: block; }
.hero__grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.02fr 1fr; gap: clamp(2rem, 6vw, 4.5rem); align-items: center; }
.hero__copy { max-width: 35rem; min-width: 0; }
.hero__title { margin-top: 1.25rem; font-size: clamp(2.6rem, 6.4vw, 4.25rem); font-weight: 700; line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance; }
.hero__lede { margin-top: 1.35rem; max-width: 33rem; font-size: clamp(1rem, 1.4vw, 1.1875rem); line-height: 1.6; color: var(--text-secondary); text-wrap: pretty; }
.hero__actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero__note { margin-top: 1.75rem; font-size: 0.8125rem; color: var(--text-tertiary); max-width: 30rem; line-height: 1.55; }

/* ── Stage: the living run (hero centerpiece) ───────────────── */
.stage {
  position: relative; min-width: 0;
  border: 1px solid var(--border-default);
  background: linear-gradient(180deg, var(--bg-surface), var(--bg-base));
  border-radius: var(--radius-2xl); padding: clamp(1rem, 2vw, 1.5rem);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(34, 211, 238, 0.04);
}
.stage__bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.stage__state { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; font-weight: 500; color: var(--accent); }
.stage__state[data-done] { color: var(--success); }
.stage__pulse { width: 7px; height: 7px; border-radius: 999px; background: currentColor; animation: pulse 1.8s ease-in-out infinite; }
.stage__count { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.stage__progress { display: flex; height: 6px; width: 100%; overflow: hidden; border-radius: 999px; background: var(--bg-surface); border: 1px solid var(--border-default); margin-bottom: 1.1rem; }
.stage__ok { background: var(--success); transition: width 0.5s var(--ease-out); }
.stage__bad { background: var(--error); transition: width 0.5s var(--ease-out); }
.stage__cards { display: flex; align-items: stretch; gap: 0.625rem; }

.panel { flex: 1; min-width: 0; border: 1px solid var(--border-default); background: color-mix(in srgb, var(--bg-card) 92%, transparent); border-radius: var(--radius-lg); padding: 0.875rem; }
.panel__label { font-family: var(--font-mono); font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-tertiary); margin-bottom: 0.75rem; }
.trow { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 0 0.5rem; padding: 0.35rem 0.4rem; border-radius: var(--radius-sm); font-size: 0.75rem; color: var(--text-primary); transition: background-color 0.3s ease; }
.trow--head { font-size: 0.5625rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-tertiary); padding-bottom: 0.3rem; }
.trow.is-active { background: rgba(34, 211, 238, 0.08); }
.ralign { text-align: right; }
.mono { font-family: var(--font-mono); font-size: 0.6875rem; }
.dim { color: var(--text-tertiary); }
.accent-dim { color: color-mix(in srgb, var(--accent) 70%, transparent); }
.ok { color: var(--success); }

.run { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--text-tertiary); }
.run--done { color: var(--text-secondary); }
.run--fail { color: var(--error); }
.run--live { color: var(--accent); }
.check { width: 15px; height: 15px; border-radius: 999px; background: rgba(34, 197, 94, 0.16); position: relative; flex-shrink: 0; }
.check::after { content: ''; position: absolute; left: 5px; top: 3px; width: 3px; height: 6px; border: solid var(--success); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); }
.rdot { width: 7px; height: 7px; border-radius: 999px; flex-shrink: 0; }
.rdot--live { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
.rdot--fail { background: var(--error); }
.rdot--queued { border: 1px solid var(--border-hover); }
.cell-writing { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--accent); font-family: var(--font-mono); font-size: 0.6875rem; }
.spin { width: 9px; height: 9px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }

.stage__link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4rem; flex-shrink: 0; padding-top: 1.5rem; }
.stage__link-grp { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; font-size: 0.5625rem; text-transform: uppercase; letter-spacing: 0.1em; }
.stage__link-grp--read { color: var(--accent); }
.stage__link-grp--write { color: var(--success); }

/* ── Scene scaffolding (Record / Map / Replay) ──────────────── */
.scene { padding-block: clamp(3.5rem, 8vw, 6.5rem); border-top: 1px solid var(--border-default); }
.scene--alt { background: linear-gradient(180deg, var(--bg-surface), var(--bg-base)); }
.scene__grid { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(2rem, 6vw, 4.5rem); align-items: center; }
.scene__grid--rev .scene__copy { order: 2; }
.scene__copy { min-width: 0; max-width: 30rem; }
.scene__step { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-mono); font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.scene__num { display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; border-radius: var(--radius-md); background: var(--accent-muted); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); font-size: 0.875rem; font-weight: 600; }
.scene__title { margin-top: 1rem; font-size: clamp(1.95rem, 4.4vw, 3rem); font-weight: 600; letter-spacing: -0.032em; line-height: 1.06; text-wrap: balance; }
.scene__body { margin-top: 1.1rem; color: var(--text-secondary); font-size: 1rem; line-height: 1.65; max-width: 40ch; }
.scene__list { margin-top: 1.4rem; list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.scene__list li { position: relative; padding-left: 1.5rem; color: var(--text-secondary); font-size: 0.9375rem; line-height: 1.5; }
.scene__list li::before { content: ''; position: absolute; left: 0; top: 0.5rem; width: 7px; height: 7px; border-radius: 999px; background: var(--accent); }

/* Step 2 · Map — centered focus (breaks the split rhythm). */
.scene--center .scene__lead { max-width: 44rem; margin-inline: auto; text-align: center; }
.scene--center .scene__body { margin-inline: auto; max-width: 54ch; }
.mapper--lg { max-width: 600px; margin: clamp(2rem, 5vw, 3.25rem) auto 0; }

/* Step 3 · Replay — full-width scale band (asymmetric header + wide dash). */
.scene__band { display: grid; grid-template-columns: 1.5fr 1fr; align-items: end; gap: 1.25rem 3rem; }
.scene__band-head { min-width: 0; }
.scene__band .scene__body { margin-top: 0; max-width: 46ch; }
.dash--wide { margin-top: clamp(2rem, 5vw, 3rem); }

/* ── Browser mock (Record) ──────────────────────────────────── */
.browser { min-width: 0; border: 1px solid var(--border-default); border-radius: var(--radius-xl); overflow: hidden; background: var(--bg-surface); box-shadow: 0 40px 90px -28px rgba(0, 0, 0, 0.7); }
.browser__chrome { display: flex; align-items: center; gap: 0.85rem; padding: 0.7rem 0.95rem; border-bottom: 1px solid var(--border-default); background: var(--bg-card); }
.browser__lights { display: flex; gap: 0.4rem; }
.browser__lights i { width: 11px; height: 11px; border-radius: 999px; background: var(--bg-elevated); }
.browser__url { flex: 1; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-tertiary); background: var(--bg-base); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 0.4rem 0.7rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browser__stage { position: relative; padding: 1.4rem; display: flex; align-items: stretch; gap: 1.25rem; }

.rectoolbar { position: absolute; top: -0.95rem; right: 1.4rem; z-index: 3; display: flex; align-items: center; gap: 0.7rem; background: var(--bg-elevated); border: 1px solid var(--border-hover); border-radius: 999px; padding: 0.45rem 0.8rem; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.75); }
.rectoolbar__dot { width: 10px; height: 10px; border-radius: 999px; background: var(--error); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); animation: recpulse 1.6s ease-out infinite; }
.rectoolbar__lbl { font-size: 0.8125rem; font-weight: 600; }
.rectoolbar__cnt { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.rectoolbar__stop { font-size: 0.75rem; font-weight: 600; color: var(--accent-contrast); background: var(--accent); border-radius: 999px; padding: 0.25rem 0.65rem; }

.steplist { width: 16rem; flex-shrink: 0; background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: 0.95rem; }
.steplist__label { font-family: var(--font-mono); font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-tertiary); margin-bottom: 0.5rem; }
.steplist__items { list-style: none; }
.capstep { display: flex; align-items: center; gap: 0.6rem; padding: 0.45rem 0.2rem; font-size: 0.8125rem; color: var(--text-secondary); border-top: 1px solid var(--border-default); opacity: 0; transform: translateY(4px); transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out); }
.capstep:first-child { border-top: 0; }
.capstep.is-in { opacity: 1; transform: none; }
.capstep__n { font-family: var(--font-mono); font-size: 0.6875rem; color: var(--text-tertiary); width: 0.9rem; }
.capstep__act { color: var(--text-primary); font-weight: 500; }
.capstep__var { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); }
.capstep__var--out { color: var(--success); }

.pagemock { position: relative; flex: 1; min-width: 0; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-base); padding: 1.1rem; display: flex; flex-direction: column; justify-content: center; gap: 0.65rem; }
.pm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.15rem; }
.pm-title { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); }
.pm-tag { font-family: var(--font-mono); font-size: 0.5625rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-tertiary); border: 1px solid var(--border-default); border-radius: 999px; padding: 0.15rem 0.5rem; }
.pm-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 0.6rem; }
.pm-field { position: relative; display: flex; flex-direction: column; gap: 0.2rem; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-surface); padding: 0.45rem 0.6rem; transition: border-color 0.25s ease, box-shadow 0.25s ease; }
.pm-field.is-focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18); }
.pm-label { font-size: 0.5625rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-tertiary); }
.pm-value { font-size: 0.8125rem; color: var(--text-primary); }
.pm-chev { position: absolute; right: 0.5rem; bottom: 0.55rem; color: var(--text-tertiary); }
.pm-btn { margin-top: 0.1rem; align-self: stretch; font-size: 0.8125rem; font-weight: 600; color: var(--accent-contrast); background: var(--accent); border: 0; border-radius: var(--radius-md); padding: 0.55rem 1rem; cursor: default; transition: transform 0.12s var(--ease-out); }
.pm-btn.is-press { transform: scale(0.97); }
.pm-result { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.65rem; border: 1px solid color-mix(in srgb, var(--success) 30%, var(--border-default)); border-radius: var(--radius-md); background: rgba(34, 197, 94, 0.07); opacity: 0; transform: translateY(4px); transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out); }
.pm-result.is-in { opacity: 1; transform: none; }
.pm-result-k { font-size: 0.75rem; color: var(--text-secondary); }
.pm-result-v { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--success); }
.cursor { position: absolute; left: 0; top: 0; width: 18px; height: 18px; z-index: 4; pointer-events: none; opacity: 0; transition: opacity 0.3s ease; }
.cursor::before { content: ''; position: absolute; inset: 0; background: var(--text-primary); clip-path: polygon(0 0, 0 75%, 22% 56%, 40% 92%, 56% 84%, 38% 50%, 70% 50%); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
.cursor.is-on { opacity: 1; }

/* ── Mapper (Map) ───────────────────────────────────────────── */
.mapper { position: relative; min-width: 0; display: grid; grid-template-columns: 1fr 7.5rem 1fr; gap: 0; align-items: center; border: 1px solid var(--border-default); background: var(--bg-card); border-radius: var(--radius-xl); padding: clamp(1.25rem, 3vw, 2rem) clamp(1rem, 2vw, 1.5rem); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.65); }
.mapper__col { display: flex; flex-direction: column; gap: 1.6rem; }
.mapper__col--cols { align-items: flex-end; text-align: right; }
.mapper__label { font-family: var(--font-mono); font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-tertiary); margin-bottom: -0.4rem; }
.chip { display: inline-flex; align-items: center; gap: 0.5rem; align-self: flex-start; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent); background: var(--accent-muted); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: var(--radius-md); padding: 0.5rem 0.75rem; transition: box-shadow 0.3s ease, border-color 0.3s ease; }
.chip.is-lit { box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18); border-color: var(--accent); }
.chip--out { color: var(--success); background: rgba(34, 197, 94, 0.12); border-color: color-mix(in srgb, var(--success) 32%, transparent); }
.chip--out.is-lit { box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); border-color: var(--success); }
.chip--col { align-self: flex-end; color: var(--text-primary); background: var(--bg-elevated); border-color: var(--border-default); }
.chip--col.chip--out { color: var(--text-primary); }
.chip__a { font-weight: 600; color: var(--text-tertiary); }
.mapper__wires { width: 100%; height: 100%; min-height: 180px; align-self: stretch; }
.wire { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 1 0; opacity: 0.55; }
.wire--out { stroke: var(--success); }
.wire.is-flow { stroke-dasharray: 5 6; animation: wireflow 0.9s linear infinite; opacity: 1; }
.wire--out.is-flow { animation-direction: reverse; }

/* ── Dashboard (Replay) ─────────────────────────────────────── */
.dash { min-width: 0; border: 1px solid var(--border-default); background: var(--bg-card); border-radius: var(--radius-xl); padding: clamp(1.1rem, 2.5vw, 1.6rem); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.65); }
.dash__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.dash__title { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-secondary); }
.dash__live { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.8125rem; font-weight: 500; color: var(--accent); }
.dash__stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1.25rem; }
.stat { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 0.85rem 0.75rem; }
.stat__n { display: block; font-family: var(--font-mono); font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__n--ok { color: var(--success); }
.stat__n--bad { color: var(--error); }
.stat__n--accent { color: var(--accent); }
.stat__l { display: block; margin-top: 0.4rem; font-size: 0.6875rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; }
.dash__progress { height: 8px; width: 100%; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 999px; overflow: hidden; margin-bottom: 1.1rem; }
.dash__fill { display: block; height: 100%; background: linear-gradient(90deg, var(--success), color-mix(in srgb, var(--success) 60%, var(--accent))); border-radius: 999px; transition: width 1.4s var(--ease-out); }
.dash__rows { list-style: none; display: flex; flex-direction: column; gap: 0.2rem; }
.dash__rows li { display: grid; grid-template-columns: 3rem 1fr 5rem; align-items: center; gap: 0.5rem; padding: 0.45rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.8125rem; background: var(--bg-surface); }
.dash__rows li:first-child { background: rgba(34, 211, 238, 0.07); }
.dash__rows .mono:last-child { text-align: right; }

/* ── Privacy ────────────────────────────────────────────────── */
.privacy { padding-block: clamp(3.5rem, 8vw, 6.5rem); border-top: 1px solid var(--border-default); }
.privacy__head { max-width: 48rem; }
.privacy__eyebrow { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); }
.privacy__title { margin-top: 1rem; font-size: clamp(1.95rem, 4.4vw, 3rem); font-weight: 600; line-height: 1.08; letter-spacing: -0.032em; text-wrap: balance; }
.privacy__body { margin-top: 1.25rem; color: var(--text-secondary); font-size: 1.0625rem; line-height: 1.65; max-width: 62ch; }

/* Ledger: an honest two-column statement of what we store vs never store.
   Clearer than a network diagram and accurate (cell data does cross the
   network via Google; the point is we never keep it). */
.ledger { margin-top: 2.75rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: stretch; }
.ledger__col { background: var(--bg-card); border: 1px solid var(--border-default); border-radius: var(--radius-lg); padding: clamp(1.25rem, 2.5vw, 1.75rem); }
.ledger__col--never { border-style: dashed; background: var(--bg-surface); }
.ledger__head { display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1.4rem; }
.ledger__head--keep { color: var(--accent); }
.ledger__head--never { color: var(--text-tertiary); }
.ledger__badge { width: 8px; height: 8px; border-radius: 999px; flex-shrink: 0; }
.ledger__badge--keep { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.ledger__badge--never { border: 1px solid var(--text-tertiary); }
.ledger__list { list-style: none; display: flex; flex-direction: column; gap: 1.15rem; }
.ledger__list > li { display: flex; gap: 0.8rem; align-items: flex-start; }
.ledger__list > li > span:last-child { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.ledger__list b { font-size: 0.9375rem; font-weight: 600; color: var(--text-primary); }
.ledger__list > li > span:last-child > span { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.45; }
.ledger__mark { position: relative; flex-shrink: 0; width: 20px; height: 20px; border-radius: 999px; margin-top: 0.1rem; }
.ledger__mark--yes { background: rgba(34, 211, 238, 0.14); }
.ledger__mark--yes::after { content: ''; position: absolute; left: 7px; top: 4px; width: 4px; height: 8px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ledger__mark--no { background: var(--bg-elevated); border: 1px solid var(--border-hover); }
.ledger__mark--no::after { content: ''; position: absolute; left: 5px; top: 8px; width: 9px; height: 2px; border-radius: 1px; background: var(--text-tertiary); }

/* ── FAQ ────────────────────────────────────────────────────── */
.faq { padding-block: clamp(3.5rem, 8vw, 6.5rem); border-top: 1px solid var(--border-default); }
.faq__inner { max-width: 760px; }
.faq__title { font-size: clamp(1.95rem, 4.4vw, 3rem); font-weight: 600; letter-spacing: -0.032em; line-height: 1.08; margin-bottom: 1.5rem; text-wrap: balance; }
.faq__list { border-top: 1px solid var(--border-default); }
.qa { border-bottom: 1px solid var(--border-default); }
.qa__q {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: 1.25rem; padding: 1.15rem 0.25rem;
  font-size: 1.0625rem; font-weight: 500; color: var(--text-primary);
  transition: color 0.16s ease;
}
.qa__q::-webkit-details-marker { display: none; }
.qa__q:hover { color: var(--accent); }
/* Plus → minus marker: hide the vertical bar when open. */
.qa__mark { position: relative; width: 14px; height: 14px; flex-shrink: 0; }
.qa__mark::before, .qa__mark::after { content: ''; position: absolute; background: var(--text-tertiary); border-radius: 1px; transition: transform 0.25s var(--ease-out), opacity 0.2s ease, background-color 0.2s ease; }
.qa__mark::before { left: 0; top: 6px; width: 14px; height: 2px; }
.qa__mark::after { left: 6px; top: 0; width: 2px; height: 14px; }
.qa[open] .qa__mark::before { background: var(--accent); }
.qa[open] .qa__mark::after { transform: scaleY(0); opacity: 0; }
.qa__q:hover .qa__mark::before, .qa__q:hover .qa__mark::after { background: var(--accent); }
/* No bottom padding on the animated box (border-box padding can't collapse to
   0, which would snap at the end of the close). The spacing lives on the
   paragraph's margin instead; overflow:hidden makes a BFC so it's contained. */
.qa__a { padding: 0 0.25rem; overflow: hidden; transition: height 0.34s var(--ease-out); }
.qa__a p { color: var(--text-secondary); font-size: 0.9375rem; line-height: 1.65; max-width: 64ch; margin-bottom: 1.3rem; }
.qa__a a { color: var(--accent); text-underline-offset: 3px; }

/* ── Request access ─────────────────────────────────────────── */
.request { padding-block: clamp(3.5rem, 8vw, 6.5rem); border-top: 1px solid var(--border-default); background: linear-gradient(180deg, var(--bg-surface), var(--bg-base)); }
.request__inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 4rem); align-items: start; }
.request__title { margin-top: 1.1rem; font-size: clamp(2.1rem, 4.8vw, 3.2rem); font-weight: 600; letter-spacing: -0.032em; line-height: 1.04; }
.request__lede { margin-top: 1rem; color: var(--text-secondary); font-size: 1.0625rem; line-height: 1.6; max-width: 38ch; }
.request__points { margin-top: 1.6rem; list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.request__points li { position: relative; padding-left: 1.6rem; color: var(--text-secondary); font-size: 0.9375rem; line-height: 1.5; }
.request__points li::before { content: ''; position: absolute; left: 0; top: 0.45rem; width: 8px; height: 8px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 8px rgba(34, 211, 238, 0.4); }

.form { background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-xl); padding: clamp(1.25rem, 3vw, 1.85rem); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.6); }
.field { margin-bottom: 1.1rem; }
.field__label { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.45rem; }
.req { color: var(--accent); }
.opt { color: var(--text-tertiary); font-weight: 400; font-size: 0.75rem; }
.input { width: 100%; font-family: var(--font-sans); font-size: 0.9375rem; color: var(--text-primary); background: var(--bg-base); border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 0.6rem 0.75rem; transition: border-color 0.16s ease, box-shadow 0.16s ease; }
.input::placeholder { color: var(--text-tertiary); }
.input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.22); }
.input--area { resize: vertical; min-height: 3.5rem; line-height: 1.5; }
.captcha-field:not([hidden]) { display: flex; justify-content: center; margin-bottom: 1.1rem; }
.form__status { margin-top: 0.85rem; font-size: 0.875rem; min-height: 1.2em; line-height: 1.4; }
.form__status[data-kind='error'] { color: var(--error); }
.form__status[data-kind='success'] { color: var(--success); }
.form__fineprint { margin-top: 0.85rem; font-size: 0.75rem; color: var(--text-tertiary); }

.confirm { background: var(--bg-surface); border: 1px solid color-mix(in srgb, var(--success) 35%, var(--border-default)); border-radius: var(--radius-xl); padding: clamp(1.5rem, 4vw, 2.25rem); }
.confirm__icon { display: inline-flex; width: 2.5rem; height: 2.5rem; border-radius: 999px; background: rgba(34, 197, 94, 0.15); position: relative; margin-bottom: 1rem; }
.confirm__icon::after { content: ''; position: absolute; left: 0.95rem; top: 0.6rem; width: 0.5rem; height: 0.95rem; border: solid var(--success); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.confirm__title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.confirm__body { margin-top: 0.6rem; color: var(--text-secondary); line-height: 1.6; }

/* ── Footer ─────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border-default); padding-block: 2.5rem; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer__copy { font-size: 0.8125rem; color: var(--text-tertiary); }

/* ── Reveal-on-scroll (enhances an already-visible default) ─── */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }

/* GSAP scroll reveals: hidden from first paint so they animate in without a
   flash. Scoped to .js-anim (set in <head>, removed by motion.js when it can't
   animate) so no-JS, reduced-motion, and CDN-failure all render visible. */
.js-anim .scene__copy,
.js-anim .privacy__head,
.js-anim .ledger,
.js-anim .request__copy,
.js-anim .faq__inner,
.js-anim .browser,
.js-anim .mapper,
.js-anim .dash { opacity: 0; }

/* ── Grain + custom cursor (motion layer) ───────────────────── */
.grain {
  position: fixed; inset: 0; z-index: 150; pointer-events: none;
  opacity: 0.04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cursor-ring {
  position: fixed; left: 0; top: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border: 1.5px solid var(--accent); border-radius: 999px;
  pointer-events: none; z-index: 200; opacity: 0;
  transition: width 0.22s var(--ease-out), height 0.22s var(--ease-out),
    margin 0.22s var(--ease-out), background-color 0.22s ease, opacity 0.3s ease;
}
.cursor-ring.is-active {
  width: 44px; height: 44px; margin: -22px 0 0 -22px;
  background: rgba(34, 211, 238, 0.12);
}

/* ── Keyframes ──────────────────────────────────────────────── */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes recpulse { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); } 70% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
@keyframes wireflow { to { stroke-dashoffset: -11; } }
@keyframes pipeflow { to { background-position: 14px 0; } }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 940px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__copy { max-width: 40rem; }
  .stage { max-width: 38rem; }
  .scene__grid, .scene__grid--rev { grid-template-columns: 1fr; }
  .scene__grid--rev .scene__copy { order: 0; }
  .scene__copy { max-width: 40rem; }
  .scene__band { grid-template-columns: 1fr; align-items: start; }
  .request__inner { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar__nav .navlink { display: none; }
  .topbar__nav .btn { display: inline-flex; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
  .stage__cards { flex-direction: column; }
  .stage__link { flex-direction: row; gap: 1.25rem; padding-top: 0; }
  /* Tighten the mapper so the right-aligned column chips don't overrun. */
  .mapper { grid-template-columns: 1fr 2.25rem 1fr; padding-inline: 0.85rem; }
  .mapper__col { min-width: 0; gap: 1.15rem; }
  .mapper .chip { font-size: 0.6875rem; padding: 0.4rem 0.5rem; gap: 0.35rem; }
  .browser__stage { flex-direction: column; }
  .steplist { width: 100%; }
  .dash__stats { grid-template-columns: repeat(2, 1fr); }
  .ledger { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage__pulse, .rdot--live, .spin, .rectoolbar__dot, .wire.is-flow { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}
