/* DriftGuard apex landing — dark, precise, operational. */

@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/JetBrainsMono-var.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #0a0c10;
  --surface: #0e1218;
  --line: #1c232e;
  --line-soft: #151b24;
  --text: #e8eaed;
  --dim: #8a94a3;
  --faint: #5a6473;
  --steel: #7da2c9;
  --amber: #e8a13d;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.wrap.narrow { max-width: 780px; }

/* ---------- type ---------- */
h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.9rem);
  font-weight: 780;
  letter-spacing: -0.025em;
  line-height: 1.06;
}
h1 .dim { color: #aeb9c9; }  /* resolution line: brighter than body-dim so the promise reads, not just the threat */
h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 720;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 40px;
}
.kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 22px;
}
.kicker.num { color: var(--faint); }
.kicker.num::after {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  background: var(--line);
  margin-top: 14px;
}
.mono-inline { font-family: var(--mono); font-size: 0.9em; color: var(--steel); }
.link { color: var(--steel); text-decoration: none; border-bottom: 1px solid var(--line); }
.link:hover { color: var(--text); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner { display: flex; align-items: center; gap: 36px; height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.brand-mark { width: 26px; height: 26px; border-radius: 6px; }
.brand-name { font-family: var(--mono); font-weight: 700; font-size: 0.86rem; letter-spacing: 0.18em; }
.nav-links { display: flex; gap: 26px; margin-left: auto; }
.nav-links a {
  color: var(--dim); text-decoration: none;
  font-size: 0.88rem; font-weight: 500;
}
.nav-links a:hover { color: var(--text); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-weight: 600; font-size: 0.95rem;
  padding: 13px 24px; border-radius: 3px;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: #fff; }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--steel); }
.ext { color: var(--faint); font-size: 0.85em; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 110px 0 90px; border-bottom: 1px solid var(--line-soft); overflow: hidden; }
.grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 80% at 30% 20%, black 0%, transparent 70%);
  opacity: 0.5;
}
.chain-motif {
  position: absolute; right: -40px; top: 50%; transform: translateY(-50%);
  width: 460px; max-width: 44vw; pointer-events: none; opacity: 0.5;
}
.chain rect { stroke: var(--line); fill: color-mix(in srgb, var(--surface) 70%, transparent); }
.chain line { stroke: var(--line); }
.chain-t { font-family: var(--mono); font-size: 15px; fill: var(--faint); }
.chain-h { font-family: var(--mono); font-size: 13px; fill: #333d4b; }
.hero-inner { position: relative; max-width: 720px; }
.lede { color: var(--dim); font-size: 1.12rem; max-width: 600px; margin-top: 26px; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 38px; }
.stats-block { margin-top: 66px; border-top: 1px solid var(--line-soft); }
.stats-src {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint); padding-top: 16px;
}
.stats {
  display: flex; gap: 0; list-style: none;
}
.stats li {
  display: flex; flex-direction: column; gap: 3px;
  padding: 20px 34px 0 0; margin-right: 34px;
}
.stats li + li { border-left: 1px solid var(--line-soft); padding-left: 34px; }
.stat-n { font-family: var(--mono); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; white-space: nowrap; }
.stat-l { font-size: 0.78rem; color: var(--faint); letter-spacing: 0.04em; text-transform: uppercase; }

/* ---------- sections ---------- */
.section { padding: 100px 0; border-bottom: 1px solid var(--line-soft); }

.situation p {
  font-size: clamp(1.15rem, 2.1vw, 1.5rem);
  font-weight: 480; letter-spacing: -0.012em; line-height: 1.45;
  color: var(--text); max-width: 820px;
  padding: 22px 0;
}
.situation p + p { border-top: 1px solid var(--line-soft); }
.situation p:nth-child(2) { color: var(--dim); }
.situation p:nth-child(3) { color: var(--dim); }

/* loop + deployment grids */
.loop-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
}
.loop-cell {
  padding: 30px 26px 34px; border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.loop-cell:last-child { border-right: none; }
.loop-cell p:not(.cell-tag) { color: var(--dim); font-size: 0.94rem; line-height: 1.62; }
.cell-tag {
  font-family: var(--mono); font-weight: 700; font-size: 0.78rem;
  letter-spacing: 0.16em; color: var(--text); margin-bottom: 16px;
}
.cell-tag::before { content: "▪ "; color: var(--steel); }

/* ---------- console ---------- */
.console {
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  background: #07090d;
  box-shadow: 0 24px 80px -32px rgba(0,0,0,0.8);
}
.console-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}
.console-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.console-title { font-family: var(--mono); font-size: 0.78rem; color: var(--dim); letter-spacing: 0.04em; }
.console-body {
  font-family: var(--mono); font-size: 0.86rem; line-height: 1.75;
  padding: 22px 24px 26px; color: var(--dim);
  overflow-x: auto; white-space: pre;
  min-height: 300px;
}
.console-body .c-cmd { color: var(--text); font-weight: 600; }
.console-body .c-halt { color: var(--amber); font-weight: 700; }
/* Progressive enhancement: the static transcript IS the default content
   (visible with no JS, in prints, and in prerenders). app.js hides it and
   swaps in the typed version only once typing actually starts. */
.console-body[aria-hidden="true"] { display: none; }
.console.typing .console-body[aria-hidden="true"] { display: block; }
.console.typing .console-static { display: none; }
.caption { color: var(--faint); font-size: 0.92rem; max-width: 680px; margin-top: 26px; }

/* ---------- evidence cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card { background: var(--bg); padding: 34px 30px 40px; }
.card p:not(.cell-tag) { color: var(--dim); font-size: 0.95rem; }

/* ---------- independence ---------- */
.statement {
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  font-weight: 480; line-height: 1.5; letter-spacing: -0.012em;
  color: var(--dim);
}
.statement.strong { color: var(--text); font-weight: 660; margin-top: 30px; }

/* ---------- briefing form ---------- */
.cta-band { border-bottom: none; }
.brief-form { display: flex; flex-direction: column; gap: 18px; margin-top: 8px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.brief-form label {
  display: flex; flex-direction: column; gap: 7px;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint);
}
.brief-form input, .brief-form textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 3px;
  color: var(--text); font-family: var(--sans); font-size: 0.98rem;
  padding: 12px 14px; outline: none;
}
.brief-form input:focus, .brief-form textarea:focus { border-color: var(--steel); }
.brief-form .cta-row { margin-top: 14px; }
.brief-form button { border: none; }

/* ---------- verify section ---------- */
.verify-grid {
  display: grid; grid-template-columns: 5fr 7fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line); margin-top: 8px;
}
.verify-files { background: var(--bg); display: flex; flex-direction: column; }
.file-row {
  display: flex; flex-direction: column; gap: 3px;
  padding: 22px 24px; text-decoration: none;
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.15s;
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--surface); }
.file-name { font-family: var(--mono); font-weight: 600; font-size: 0.92rem; color: var(--steel); }
.file-row:hover .file-name { color: var(--text); }
.file-meta { font-size: 0.78rem; color: var(--faint); }
.verify-run { background: #07090d; padding: 22px 24px; }
.verify-cmd {
  font-family: var(--mono); font-size: 0.82rem; line-height: 1.8;
  color: var(--dim); white-space: pre-wrap; word-break: break-word;
}
.v-pass { color: #6dbf8b; font-weight: 700; }
.verify-run .caption { margin-top: 18px; }

/* ---------- where we are ---------- */
.where-we-are {
  margin-top: 46px; padding: 24px 26px;
  border: 1px solid var(--line); border-left: 2px solid var(--steel);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}
.where-we-are p:not(.cell-tag) { color: var(--dim); font-size: 0.95rem; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line-soft); padding: 30px 0; }
.foot-inner { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: var(--faint); }
.foot-inner nav { display: flex; gap: 22px; }
.foot-inner a { color: var(--faint); text-decoration: none; }
.foot-inner a:hover { color: var(--text); }

/* ---------- reveal motion ---------- */
/* Hidden-until-revealed ONLY when JS is running (html.js set inline in <head>)
   — with no JS the whole page renders; motion is enhancement, not gatekeeper. */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.d1 { transition-delay: 0.08s; }
.js .reveal.d2 { transition-delay: 0.16s; }
.js .reveal.d3 { transition-delay: 0.24s; }
.js .reveal.d4 { transition-delay: 0.32s; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .verify-grid { grid-template-columns: 1fr; }
  .loop-grid { grid-template-columns: 1fr 1fr; }
  .loop-cell:nth-child(2) { border-right: none; }
  .loop-cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .cards { grid-template-columns: 1fr; }
  .chain-motif { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { padding: 0 22px; }
  .nav-links { display: none; }
  .hero { padding: 76px 0 64px; }
  .section { padding: 72px 0; }
  .loop-grid { grid-template-columns: 1fr; }
  .loop-cell { border-right: none; border-bottom: 1px solid var(--line); }
  .loop-cell:last-child { border-bottom: none; }
  /* 2×2 grid on mobile — the flex+border pattern staircased (Rams finding) */
  .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
  .stats li { padding: 16px 12px 0 0; margin: 0; }
  .stats li + li { border-left: none; padding-left: 0; }
  .form-row { grid-template-columns: 1fr; }
  .console-body { font-size: 0.78rem; }
}
