:root {
  --bg: #0f1420;
  --bg-deep: #0a0e17;
  --panel: rgba(11, 13, 16, 0.82);
  --panel-solid: #0b0d10;
  --line: #2a2f36;
  --line-soft: rgba(232, 228, 218, 0.09);
  --ink: #e8e4da;
  --mute: #9aa3b8;
  --gold: #d9a441;
  --green: #3fb27f;
  --red: #c8413b;
  --blue: #5b8def;
  --radius: 14px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --wrap: 1180px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Archivo, system-ui, -apple-system, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  background:
    radial-gradient(1200px 700px at 50% -8%, rgba(217, 164, 65, 0.10), transparent 62%),
    radial-gradient(900px 620px at 88% 22%, rgba(91, 141, 239, 0.07), transparent 60%),
    linear-gradient(180deg, transparent 0%, rgba(10, 14, 23, 0.9) 100%);
}

main, .nav, .foot { position: relative; z-index: 1; }

a { color: inherit; }

h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 700; margin: 0; letter-spacing: -0.01em; }

code, pre { font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.wrap.narrow { max-width: 860px; }

/* ── nav ───────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 32px;
  background: rgba(10, 13, 20, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.mark {
  width: 13px; height: 13px;
  background: var(--gold);
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow: 0 0 18px rgba(217, 164, 65, 0.55);
}
.brand-name { font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 21px; }
.nav-links { display: flex; gap: 26px; margin-left: auto; font-size: 16px; }
.nav-links a { color: var(--mute); text-decoration: none; transition: color 0.15s; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; gap: 10px; }

/* ── buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 600 18px/1 Archivo, sans-serif;
  padding: 15px 26px;
  border-radius: 10px;
  border: 1px solid var(--line);
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-sm { font-size: 15px; padding: 9px 15px; border-radius: 8px; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #16110a; }
.btn-gold:hover { background: #e8b95f; border-color: #e8b95f; transform: translateY(-1px); }
.btn-ghost { color: var(--ink); background: rgba(232, 228, 218, 0.03); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-1px); }

/* ── hero ──────────────────────────────────────────── */
.hero { position: relative; padding: 92px 0 40px; text-align: center; overflow: hidden; }
.hero .glow {
  position: absolute;
  top: -180px; left: 50%;
  width: min(1100px, 120vw); height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(217, 164, 65, 0.16), transparent 72%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 26px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 11px;
  vertical-align: 1px;
  background: var(--gold);
  transform: rotate(45deg);
}

.hero h1 {
  font-size: clamp(2.5rem, 6.2vw, 5rem);
  line-height: 1.02;
  margin: 0 auto;
  max-width: 15ch;
}

.lede {
  margin: 26px auto 0;
  max-width: 66ch;
  font-size: clamp(1.05rem, 1.35vw, 1.28rem);
  line-height: 1.62;
  color: #c3c8d6;
}
.lede strong { color: var(--gold); font-weight: 600; }

.cta-row { display: flex; gap: 14px; margin-top: 36px; flex-wrap: wrap; justify-content: center; }
.cta-row.center { justify-content: center; }

/* ── hero stage ────────────────────────────────────── */
.stage { margin: 56px auto 0; max-width: 1080px; }
.frame {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  box-shadow: var(--shadow), 0 0 0 1px rgba(217, 164, 65, 0.08), 0 0 90px rgba(217, 164, 65, 0.07);
  overflow: hidden;
  line-height: 0;
}
.frame video, .frame img { width: 100%; height: auto; display: block; }
.full-btn {
  position: absolute;
  right: 14px; bottom: 14px;
  font: 500 15px/1 Archivo, sans-serif;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.full-btn:hover { color: var(--gold); border-color: var(--gold); }
.stage figcaption { margin-top: 16px; font-size: 16px; color: var(--mute); line-height: 1.5; }

.chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
  margin: 40px 0 0;
  padding: 0;
}
.chips li {
  font-size: 15px;
  color: var(--mute);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  background: rgba(232, 228, 218, 0.02);
}
.chips b { color: var(--ink); font-weight: 600; }

/* ── sections ──────────────────────────────────────── */
.section { padding: 130px 0; }
.band { background: linear-gradient(180deg, rgba(10, 13, 20, 0.55), rgba(10, 13, 20, 0.55)); border-block: 1px solid var(--line-soft); }

.sec-head { max-width: 800px; margin-bottom: 72px; }
.kicker {
  margin: 0 0 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.sec-head h2 { font-size: clamp(1.85rem, 3.4vw, 2.9rem); line-height: 1.1; }
.sec-lede { margin: 20px 0 0; font-size: 1.06rem; color: var(--mute); line-height: 1.65; max-width: 68ch; }

/* ── steps ─────────────────────────────────────────── */
.step {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 64px;
  align-items: center;
  margin-bottom: 104px;
}
.step:last-child { margin-bottom: 0; }
.step.reverse .step-text { order: 2; }
.step-n {
  margin: 0 0 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--gold);
}
.step h3 { font-size: clamp(1.5rem, 2.2vw, 1.95rem); line-height: 1.15; }
.step-sub { margin: 12px 0 18px; font-size: 1.08rem; color: var(--ink); }
.step-text p { margin: 0 0 16px; color: var(--mute); font-size: 1.02rem; line-height: 1.68; }
.step-text em { color: var(--ink); font-style: italic; }

.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px !important; }
.tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid currentColor;
  line-height: 1.2;
}
.tag-gold { color: var(--gold); }
.tag-blue { color: var(--blue); }
.tag-green { color: var(--green); }
.tag-red { color: var(--red); }

.formula { margin-top: 22px !important; }
.formula code { font-size: 15px; color: var(--ink); background: rgba(232, 228, 218, 0.05); border: 1px solid var(--line); border-radius: 8px; padding: 9px 13px; display: inline-block; line-height: 1.5; }

.shot { margin: 0; }
.shot img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.shot figcaption { margin-top: 14px; font-size: 15px; color: var(--mute); line-height: 1.5; }

/* ── results ───────────────────────────────────────── */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}
.results { border-collapse: collapse; width: 100%; min-width: 940px; font-size: 16px; }
.results th, .results td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.results thead th {
  font: 500 13px/1.3 'IBM Plex Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  white-space: nowrap;
  background: rgba(232, 228, 218, 0.03);
}
.results tbody tr:last-child td { border-bottom: 0; }
.results td:nth-child(2) { white-space: nowrap; }
.results .num { text-align: right; font-family: 'IBM Plex Mono', monospace; font-size: 15px; white-space: nowrap; }
.results .muted { color: var(--mute); font-weight: 400; }
.results .ci { color: var(--mute); font-size: 13px; }
.results code { font-size: 13px; color: var(--mute); }
.results tr.hi { background: rgba(217, 164, 65, 0.07); }
.results tr.hi td { color: var(--gold); }
.results tr.hi .muted { color: rgba(217, 164, 65, 0.62); }
.results tr.hi code { color: rgba(217, 164, 65, 0.72); }
.results tr.hi .ci { color: rgba(217, 164, 65, 0.62); }

.scroll-hint { display: none; margin: 14px 2px 0; font-size: 14px; color: var(--mute); }

.found {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  margin-top: 64px;
}
.delay {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 24px 26px 26px;
  box-shadow: var(--shadow);
}
.delay-title { margin: 0 0 20px; font-size: 15px; color: var(--ink); line-height: 1.5; }
.delay-note { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 15px; color: var(--mute); line-height: 1.6; }
.delay-title .muted { color: var(--mute); }
.meters { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.meters li { display: flex; align-items: center; gap: 14px; }
.meters .lab { width: 92px; font-size: 15px; color: var(--mute); flex: none; }
.meters .track { flex: 1; height: 8px; border-radius: 4px; background: rgba(232, 228, 218, 0.07); overflow: hidden; }
.meters .fill { display: block; height: 100%; border-radius: 4px; background: var(--gold); }
.meters .val { width: 46px; text-align: right; font-family: 'IBM Plex Mono', monospace; font-size: 15px; flex: none; }
.meters .good .fill { background: var(--green); }
.meters .good .val { color: var(--green); }
.meters .bad .fill { background: var(--red); }
.meters .bad .val { color: var(--red); }

.findings { max-width: 66ch; }
.findings p { margin: 0 0 20px; font-size: 1.08rem; line-height: 1.72; color: #c3c8d6; }
.findings em { color: var(--ink); font-style: italic; }
.findings code { font-size: 0.92em; color: var(--ink); }
.findings blockquote {
  margin: 30px 0 0;
  padding: 20px 24px;
  border-left: 2px solid var(--blue);
  background: rgba(91, 141, 239, 0.07);
  border-radius: 0 10px 10px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--blue);
}
.callout {
  margin-top: 28px;
  padding: 22px 24px 20px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold);
  border-radius: 0 10px 10px 0;
  background: rgba(217, 164, 65, 0.05);
}
.callout p { margin: 0; font-size: 1rem; line-height: 1.68; color: #c3c8d6; }
.callout-punch { margin-top: 14px !important; color: var(--ink) !important; }
.callout-punch b { color: var(--gold); font-weight: 600; }

.q-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 72px; }

/* ── code ──────────────────────────────────────────── */
.code-stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.code-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--mute);
  background: rgba(232, 228, 218, 0.02);
}
.code-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.copy {
  margin-left: auto;
  font: 500 12px/1 'IBM Plex Mono', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.copy:hover { color: var(--gold); border-color: var(--gold); }
.copy.done { color: var(--green); border-color: var(--green); }
.code-card pre {
  margin: 0;
  padding: 22px 20px;
  overflow-x: auto;
  white-space: pre;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink);
  -webkit-overflow-scrolling: touch;
}
.code-card .k { color: var(--gold); }
.code-card .cl { color: var(--ink); font-weight: 500; }
.code-card .fn { color: var(--blue); }
.code-card .c { color: var(--mute); }
.code-card .s { color: var(--green); }
#install code { white-space: pre-wrap; word-break: break-word; }
.note { margin: 4px 2px 0; max-width: 82ch; font-size: 15px; color: var(--mute); line-height: 1.6; }
.note code { color: var(--ink); font-size: 0.92em; }

/* ── limitations ───────────────────────────────────── */
.limits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.limits li {
  position: relative;
  padding: 22px 8px 22px 40px;
  border-top: 1px solid var(--line);
  color: #c3c8d6;
  font-size: 1.04rem;
  line-height: 1.68;
}
.limits li:last-child { border-bottom: 1px solid var(--line); }
.limits li::before {
  content: '';
  position: absolute;
  left: 6px; top: 32px;
  width: 9px; height: 9px;
  border: 1.5px solid var(--gold);
  transform: rotate(45deg);
}
.limits code { font-size: 0.92em; color: var(--ink); }

/* ── closer + footer ───────────────────────────────── */
.closer { padding: 130px 0 120px; text-align: center; }
.closer h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); line-height: 1.1; max-width: 20ch; margin: 0 auto; }
.closer-hint { margin-top: 32px; font-size: 15px; color: var(--mute); line-height: 2; }
.closer-hint code { color: var(--ink); border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px; font-size: 13px; }

.foot { border-top: 1px solid var(--line-soft); padding: 34px 0 46px; }
.foot p { margin: 0; font-size: 15px; color: var(--mute); }
.foot a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.foot a:hover { color: var(--gold); border-color: var(--gold); }

/* ── lightbox ──────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 40px;
  background: rgba(6, 8, 11, 0.88);
  backdrop-filter: blur(8px);
}
.lightbox[hidden] { display: none; }
.lb-inner { width: min(1200px, 100%); }
.lb-inner video { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.lb-close {
  position: absolute;
  top: 22px; right: 26px;
  font-size: 20px;
  color: var(--mute);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 44px; height: 44px;
  cursor: pointer;
}
.lb-close:hover { color: var(--gold); border-color: var(--gold); }

/* ── reveal ────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1); }

/* ── responsive ────────────────────────────────────── */
@media (max-width: 1080px) {
  .step { grid-template-columns: minmax(0, 1fr); gap: 34px; margin-bottom: 84px; }
  .step.reverse .step-text { order: 0; }
  .code-row { grid-template-columns: minmax(0, 1fr); }
  .found { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}

@media (max-width: 820px) {
  body { font-size: 17px; }
  .wrap { padding: 0 20px; }
  .nav { padding: 12px 20px; gap: 14px; }
  .nav-links { display: none; }
  .nav-cta .btn-ghost { display: none; }
  .nav-cta { margin-left: auto; }
  .hero { padding: 58px 0 24px; }
  .hero h1 { max-width: 100%; }
  .eyebrow { font-size: 11.5px; letter-spacing: 0.12em; line-height: 1.8; }
  .stage { margin-top: 40px; }
  .full-btn { right: 10px; bottom: 10px; font-size: 13px; padding: 8px 13px; }
  .chips { margin-top: 30px; }
  .chips li { font-size: 14px; padding: 7px 13px; }
  .section { padding: 84px 0; }
  .sec-head { margin-bottom: 46px; }
  .pair { grid-template-columns: 1fr; gap: 34px; margin-top: 48px; }
  .found { grid-template-columns: 1fr; gap: 36px; margin-top: 44px; }
  .delay { padding: 20px 18px 22px; }
  .scroll-hint { display: block; }
  .delay .lab { width: 78px; font-size: 14px; }
  .code-card pre { font-size: 13.5px; padding: 18px 16px; }
  .limits li { padding: 20px 4px 20px 34px; }
  .closer { padding: 84px 0 78px; }
  .btn { font-size: 16.5px; padding: 14px 22px; }
  .lightbox { padding: 20px; }
  .lb-close { top: 12px; right: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}
