:root {
  color-scheme: dark; /* fixed dark theme, like the logo: white on black */
  --bg: #000000;
  --panel: #0B0B0C;   /* secondary surface / cards */
  --border: #2A2A2E;
  --ink: #FFFFFF;     /* main text */
  --ink-2: #A3A7AE;   /* secondary text — 8.6:1 on black */
  --muted: #8B9099;   /* 6.4:1 on black */
  --accent: #38BDF8;  /* live dots, glints: sky (bid = white, ask = black with a white rim) */
  --accent-text: #FFFFFF;
  --line: #2A2A2E;
  --line-2: rgba(255, 255, 255, 0.04);
  /* up / down market data ONLY (candles, volume, ticker, net Δ) */
  --up: #22C55E;
  --down: #EF4444;
  --up-text: #4ADE80;
  --down-text: #F87171;
  --logo: "Outfit", "Inter", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
main, header { position: relative; z-index: 1; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  font: 500 15px/1 var(--sans);
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .35s var(--ease), background .3s, box-shadow .35s var(--ease), border-color .3s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* like the book: bid = solid white, ask = black with a white rim */
.btn-ink { background: #FFFFFF; color: #000000; box-shadow: 0 8px 26px -12px rgba(255,255,255,.45); }
.btn-ink:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -12px rgba(255,255,255,.6); }
.btn-ghost { color: var(--ink); border-color: rgba(255,255,255,.85); background: #000000; }
.btn-ghost:hover { border-color: #FFFFFF; background: #0B0B0C; transform: translateY(-2px); }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(56,189,248,.22), 0 0 12px 2px rgba(56,189,248,.65); animation: live 1.8s ease-in-out infinite; }
@keyframes live { 50% { box-shadow: 0 0 0 6px rgba(56,189,248,.08), 0 0 16px 4px rgba(56,189,248,.8); } }

/* ---------------- nav ---------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center;
  padding: 8px clamp(10px, 2.6vw, 36px);
  z-index: 50;
  transition: opacity .8s, transform .8s var(--ease);
}
.intro .nav { opacity: 0; transform: translateY(-12px); }

/* ---------------- hero ---------------- */
.hero {
  position: relative;
  height: 100vh; height: 100svh;
  min-height: 600px;
  overflow: hidden;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#type-canvas { pointer-events: none; z-index: 3; }
#grid-canvas { z-index: 0; transition: opacity 1.4s; }
#flow-canvas { z-index: 1; }
.hero-copy {
  position: absolute; left: 0; right: 0;
  bottom: clamp(58px, 9vh, 104px);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 0 24px;
  pointer-events: none;
  z-index: 4;
}
.hero-copy > * { pointer-events: auto; transition: opacity 1s var(--ease), transform 1s var(--ease); }
.intro .hero-copy > * { opacity: 0; transform: translateY(16px); }
.hero-copy > *:nth-child(2) { transition-delay: .12s; }
.hero-copy > *:nth-child(3) { transition-delay: .24s; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 14px;
  font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2);
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); position: relative; box-shadow: 0 0 10px 1px rgba(56,189,248,.7); }
.pulse::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid var(--accent); animation: ping 2s var(--ease) infinite;
}
@keyframes ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.hero-sub { max-width: 560px; margin: 0 0 26px; color: var(--ink-2); font-size: clamp(15px, 1.25vw, 17px); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ticker tape */
.tape {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  height: 40px; overflow: hidden;
  border-top: 1px solid var(--border);
  background: rgba(8,8,9,.88);
  backdrop-filter: blur(6px);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  transition: opacity 1.2s;
}
.intro .tape { opacity: 0; }
.tape-track {
  display: flex; gap: 38px; align-items: center; height: 100%;
  white-space: nowrap; width: max-content;
  animation: tape 60s linear infinite;
  font: 500 12px/1 var(--mono); color: var(--ink-2);
}
.tape-track b { font-weight: 500; color: var(--ink); margin-right: 8px; }
.tape-track .up { color: var(--up-text); }
.tape-track .dn { color: var(--down-text); }
.tape-track .sim { color: var(--muted); letter-spacing: .12em; }
.tape-track .tk { position: relative; padding: 4px 6px; margin: 0 -6px; border-radius: 6px; }
.tape-track .tk.fl-up { animation: fl-up .9s ease-out; }
.tape-track .tk.fl-dn { animation: fl-dn .9s ease-out; }
@keyframes fl-up { from { background: rgba(34,197,94,.22); } to { background: transparent; } }
@keyframes fl-dn { from { background: rgba(239,68,68,.22); } to { background: transparent; } }
/* a big move: the symbol bobs once and a ripple spreads beneath it */
.tape-track .tk.big.fl-up { animation: fl-up .9s ease-out, fl-big 1.4s ease-out; }
.tape-track .tk.big.fl-dn { animation: fl-dn .9s ease-out, fl-big 1.4s ease-out; }
.tape-track .tk.big::after {
  content: ""; position: absolute; left: 10%; right: 10%; bottom: 1px; height: 2px; border-radius: 2px;
  background: currentColor; color: var(--accent); opacity: 0; animation: ripple 1.4s ease-out;
}
@keyframes fl-big { 0% { transform: translateY(0); } 25% { transform: translateY(-2px); } 55% { transform: translateY(1px); } 100% { transform: translateY(0); } }
@keyframes ripple { 0% { transform: scaleX(.2); opacity: .7; } 100% { transform: scaleX(1.6); opacity: 0; } }
@keyframes tape { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .tape-track { animation: none; }
}

/* very narrow phones: keep the eyebrow on one line with its live dot */
@media (max-width: 380px) {
  .eyebrow { font-size: 10.5px; letter-spacing: .1em; gap: 8px; white-space: nowrap; }
  .hero-copy { padding: 0 18px; }
}

/* ---------------- brand logo ---------------- */
.brand { display: inline-flex; align-items: center; }
.brand-logo { display: block; height: 80px; width: 165px; overflow: visible; }
.brand-word { font: 300 70px/1 var(--logo); letter-spacing: -.005em; stroke: none; }
@media (max-width: 700px) { .brand-logo { height: 62px; width: 128px; } }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }

/* intro skip hint */
.skip-hint {
  position: absolute; left: 0; right: 0; bottom: 22px; z-index: 4; margin: 0;
  text-align: center; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); opacity: 0; pointer-events: none; transition: opacity .6s;
}
.intro .skip-hint { opacity: .75; transition-delay: .8s; }

@media (prefers-reduced-motion: reduce) { .skip-hint { display: none; } }

/* ---------------- sections: alternate black / panel ---------------- */
main > section:nth-of-type(odd) { background: var(--bg); }
main > section:nth-of-type(even) { background: var(--panel); }
