/* ============================================================
   GOTCHA — design system.
   Instrument-grade noir: near-black field, one brand blue, mono
   for anything that is data, hairlines instead of boxes.
   ============================================================ */

:root {
  /* surfaces */
  --ink:        #05070B;
  --ink-2:      #090D14;
  --ink-3:      #0E141E;
  --paper:      #ECE7DD;

  /* ink on dark */
  --fg:         #E8EEF8;
  --fg-dim:     rgba(232,238,248,0.62);
  --fg-mute:    rgba(232,238,248,0.38);
  --line:       rgba(150,180,225,0.14);
  --line-2:     rgba(150,180,225,0.26);

  /* brand — sampled from the app icon */
  --blue:       #2E86FF;
  --blue-deep:  #0B4FA8;
  --cyan:       #67E8F9;
  --red:        #FF3B30;
  --ok:         #34D399;

  /* type */
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --serif: 'Fraunces', Georgia, serif;

  /* rhythm */
  --gut: clamp(20px, 5vw, 64px);
  --maxw: 1280px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light theme — chosen from the nav, remembered in localStorage.
   Not an inversion: the whole site is one night at 03:47. Light mode is
   DAWN — the morning the evidence holds up. Periwinkle night draining
   from the top of the sky, peach sunrise underneath, a gold-coral sun
   in the corner, ink with a violet cast. Dark stays the default. */
html[data-theme="light"] {
  --ink:        #F2F7FF;   /* ice white */
  --ink-2:      #E8F0FF;
  --ink-3:      #DBE7FC;
  --paper:      #FFFFFF;

  --fg:         #101A30;   /* deep navy ink */
  --fg-dim:     rgba(16,26,48,0.68);
  --fg-mute:    rgba(16,26,48,0.44);
  --line:       rgba(28,70,190,0.18);   /* ultramarine hairlines */
  --line-2:     rgba(28,70,190,0.34);
}
html[data-theme="light"] body { color-scheme: light; }

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;              /* clip, not hidden — hidden breaks sticky */
}
body.menu-open { overflow: hidden; }

img, svg, canvas { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.02;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 6.4vw, 5.4rem); }
h2 { font-size: clamp(2.1rem, 4.4vw, 3.9rem); }
h3 { font-size: clamp(1.05rem, 1.5vw, 1.32rem); letter-spacing: -0.018em; line-height: 1.24; }
h4 { font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-mute); font-weight: 700; }

/* the accent word — the only place a serif appears */
em, .serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 800;
  letter-spacing: -0.012em;
  color: var(--blue);
}

p { margin: 0; }
.lede {
  font-size: clamp(1rem, 1.25vw, 1.16rem);
  line-height: 1.66;
  color: var(--fg-dim);
  max-width: 46ch;
}
.body {
  font-size: clamp(0.96rem, 1.1vw, 1.06rem);
  line-height: 1.72;
  color: var(--fg-dim);
  max-width: 52ch;
}
.center { text-align: center; margin-inline: auto; }
.dim { color: var(--fg-mute); }
.mono {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  font-feature-settings: 'tnum';
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.skip {
  position: absolute; left: -9999px;
  background: var(--blue); color: #fff; padding: 10px 16px; z-index: 200;
}
.skip:focus { left: 12px; top: 12px; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- eyebrow / chapter tag / tech label ---------- */
.eyebrow, .chapter-tag {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.chapter-tag { margin-bottom: 26px; }
.chapter-tag span:first-child { color: var(--blue); font-weight: 700; }

.tech-k {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
}
.tech-v {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  line-height: 1.5;
  color: var(--fg-dim);
}

.dot-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(255,59,48,0.6);
  animation: live 2.4s var(--ease) infinite;
  flex: none;
}
@keyframes live {
  0%   { box-shadow: 0 0 0 0 rgba(255,59,48,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(255,59,48,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,59,48,0); }
}
@media (prefers-reduced-motion: reduce) { .dot-live { animation: none; } }

.meta-rule, .seal-line {
  width: 44px; height: 1px;
  background: linear-gradient(to right, transparent, var(--line-2));
  flex: none;
}

/* ---------- buttons ---------- */
.btn {
  --pad: 15px 28px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: var(--pad);
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform 240ms var(--ease), box-shadow 240ms var(--ease),
              border-color 240ms var(--ease), background 240ms var(--ease);
}
.btn-sm { --pad: 10px 18px; font-size: 0.86rem; }
.btn-lg { --pad: 18px 34px; font-size: 1rem; }
.btn-primary {
  background: linear-gradient(140deg, #4C95FF, #1C63D8);
  color: #fff;
  box-shadow: 0 10px 30px rgba(46,134,255,0.26), inset 0 1px 0 rgba(255,255,255,0.22);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(46,134,255,0.36), inset 0 1px 0 rgba(255,255,255,0.22); }
.btn-ghost { border-color: var(--line-2); color: var(--fg); }
.btn-ghost:hover { border-color: rgba(150,180,225,0.5); transform: translateY(-2px); background: rgba(150,180,225,0.05); }

.row { display: flex; flex-wrap: wrap; gap: 13px; align-items: center; }
.center-row { justify-content: center; }

/* ---------- reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- ambient field: the drifting light bodies ----------
   Two slow blurred bodies, ping-ponged forever. This is the only
   autoplaying motion on the page and it lives at low opacity
   behind everything — atmosphere, never the show.
------------------------------------------------------------- */
.field {
  position: absolute; inset: -14%;
  z-index: 1; pointer-events: none;
}
.field::before, .field::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(84px);
  will-change: transform, opacity;
}
.field::before {
  width: 60vw; height: 60vw; left: -6vw; top: -12vw;
  background: radial-gradient(circle, rgba(46,134,255,0.22), rgba(46,134,255,0.05) 45%, transparent 70%);
  animation: drift-a 36s ease-in-out infinite alternate;
}
.field::after {
  width: 52vw; height: 52vw; right: -10vw; bottom: -16vw;
  background: radial-gradient(circle, rgba(103,232,249,0.13), rgba(103,232,249,0.03) 45%, transparent 70%);
  animation: drift-b 45s ease-in-out infinite alternate;
}
.field--cool::before { background: radial-gradient(circle, rgba(46,134,255,0.17), transparent 70%); }
@keyframes drift-a {
  from { transform: translate3d(0,0,0) scale(1); opacity: .7; }
  to   { transform: translate3d(8vw,6vh,0) scale(1.15); opacity: 1; }
}
@keyframes drift-b {
  from { transform: translate3d(0,0,0) scale(1.1); opacity: .9; }
  to   { transform: translate3d(-7vw,-8vh,0) scale(1); opacity: .55; }
}
@media (prefers-reduced-motion: reduce) {
  .field::before, .field::after { animation: none; }
}

.grid-lines {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: clamp(80px, 9vw, 140px) clamp(80px, 9vw, 140px);
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 10%, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 45%, #000 10%, transparent 72%);
  opacity: 0.5;
}

.scan {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0.05;
  background: repeating-linear-gradient(to bottom,
    rgba(199,224,255,0.9) 0 1px, transparent 1px 4px);
  animation: scan 9s linear infinite;
}
@keyframes scan { from { transform: translateY(0); } to { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .scan { animation: none; } }
