/* Nixon — landing page theme.
   Implements specs/0057 (reel-to-reel deck design language) using the tokens the
   app actually ships in frontend/src/app/globals.css. Faceplate (light) is the
   default; Deck (dark) follows the system setting, exactly as the app does.

   Standalone: these pages do NOT load site.css. The geometry differs from the
   company/Babai identity at every level (4px radius, no capsules, bevels instead
   of blurs), so overriding it would be fighting it.

   House rules, from the brief:
     · One function, one control, one label.
     · State is emitted, not described — a lamp is on or off.
     · Hierarchy is material (size + plane), not color.
     · The panel is quiet so the signal is loud: the lamps are the only
       saturated color on the page.
     · Elevation is a 1px bevel, not a blur. Nothing is a pill. No serif.
     · No rendered hardware, no photographic texture, no fake wear, no blinking. */

/* ---- FACEPLATE (light, default) — brushed putty aluminum ---- */
:root {
  --bg: #E6E1D8;
  --fg: #201D1A;
  --card: #F3EFE7;
  --panel: #DED8CE;
  --muted: #D9D2C7;
  --muted-fg: #665F58;
  --accent: #CFC7BB;
  --border: #C4BCB0;
  --engrave: #5C5650;
  --paper: #F7F2E7;
  --paper-ink: #2A2521;
  --key: #ECE7DE;
  --well: #F8F5EF;
  --walnut: #5A3A28;

  --brand: #8C4E0C;
  --lamp-amber: #F2A20D;
  --lamp-red: #E8281A;
  --lamp-ink: #241B12;
  --success: #2F6B3A;

  --bevel-hi: rgba(255, 255, 255, 0.85);
  --bevel-lo: rgba(0, 0, 0, 0.14);
  --brushed: rgba(0, 0, 0, 0.022);
  --engrave-shadow: 0 -1px 0 rgba(255, 255, 255, 0.75);

  --radius: 4px;
  --maxw: 1080px;
  --doc: 720px;
  --rail: 56px;

  --font-ui: "Archivo", "Helvetica Neue", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "IBM Plex Sans", "Helvetica Neue", -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-type: "Courier Prime", ui-monospace, Courier, monospace;

  color-scheme: light;
}

/* ---- DECK (dark) — anodized charcoal, cream silkscreen ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1816;
    --fg: #EAE3D6;
    --card: #242120;
    --panel: #2C2826;
    --muted: #2A2624;
    --muted-fg: #9C9388;
    --accent: #383331;
    --border: #3B3634;
    --engrave: #A69E92;
    --paper: #26221F;
    --paper-ink: #E3DACB;
    --key: #292421;
    --well: #121010;
    --walnut: #4A3021;

    --brand: #F0A72A;
    --lamp-amber: #F0A72A;
    --lamp-red: #F24638;
    --lamp-ink: #17130E;
    --success: #5AA362;

    --bevel-hi: rgba(255, 255, 255, 0.06);
    --bevel-lo: rgba(0, 0, 0, 0.45);
    --brushed: rgba(255, 255, 255, 0.012);
    --engrave-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);

    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The walnut cheek — 6px of flat color at the window's left edge. Flat, no
   grain, no texture. The one warm, non-functional element in the design. */
body::before {
  content: "";
  position: fixed;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--walnut);
  z-index: 100;
}
@media (max-width: 720px) { body::before { width: 4px; } }

/* ---- Layout ---- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}
section { padding: 72px 0; }
@media (max-width: 720px) { section { padding: 52px 0; } .wrap { padding: 0 22px; } }

.rule { height: 1px; background: var(--border); border: 0; margin: 0; }

/* ---- Materials ---------------------------------------------------------- */

/* Brushed aluminum panel: flat fill + 1px bevel pair + a 1px-period streak. */
.brushed {
  background-color: var(--panel);
  background-image: repeating-linear-gradient(
    90deg, transparent 0 2px, var(--brushed) 2px 3px
  );
  box-shadow: inset 0 1px 0 var(--bevel-hi), inset 0 -1px 0 var(--bevel-lo);
}

/* Engraved silkscreen label — everywhere a 1970 panel would have printed caps. */
.engrave {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--engrave);
  text-shadow: var(--engrave-shadow);
}
.engrave-lg { font-size: 11px; letter-spacing: 0.16em; }

/* Indicator lamp: flat fill + a halo. No blur filters. */
.lamp {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted-fg);
  flex: 0 0 auto;
}
.lamp.lit-amber {
  background: var(--lamp-amber);
  box-shadow: 0 0 0 1px rgba(240, 167, 42, 0.25), 0 0 8px -1px rgba(240, 167, 42, 0.55);
}
.lamp.lit-red {
  background: var(--lamp-red);
  box-shadow: 0 0 0 1px rgba(242, 70, 56, 0.25), 0 0 8px -1px rgba(242, 70, 56, 0.55);
}
.lamp.lit-green {
  background: var(--success);
  box-shadow: 0 0 0 1px rgba(90, 163, 98, 0.25), 0 0 8px -1px rgba(90, 163, 98, 0.5);
}

/* ---- Typography --------------------------------------------------------- */
h1, h2, h3 {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: -0.011em;
  line-height: 1.1;
  margin: 0 0 16px;
  color: var(--fg);
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); }
h3 { font-size: 1.05rem; line-height: 1.3; }

.lead {
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  color: var(--muted-fg);
  max-width: 62ch;
  margin: 0 0 26px;
}
.muted { color: var(--muted-fg); }
p { margin: 0 0 16px; }

/* Machine strings — timecodes, versions, file paths, scopes. */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Typewriter on paper: what the deck produced, not what you authored. */
.paper {
  background: var(--paper);
  color: var(--paper-ink);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  font-family: var(--font-type);
  font-size: 13.5px;
  line-height: 1.55;
}
.paper .who {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-fg);
  margin-bottom: 2px;
}
.paper p:last-child { margin-bottom: 0; }

/* ---- Header rail -------------------------------------------------------- */
.rail {
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--border);
  background-color: var(--panel);
  background-image: repeating-linear-gradient(
    90deg, transparent 0 2px, var(--brushed) 2px 3px
  );
  box-shadow: inset 0 -1px 0 var(--bevel-lo);
}
.rail .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--rail);
  gap: 20px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: var(--engrave-shadow);
}
.nav { display: flex; gap: 26px; align-items: center; }
.nav a {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--engrave);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1.5px solid transparent;
}
.nav a:hover { color: var(--fg); border-bottom-color: var(--lamp-amber); }
@media (max-width: 620px) { .nav a.hide-sm { display: none; } .nav { gap: 18px; } }

/* ---- The reels mark ⊙—⊙ -------------------------------------------------- */
.reels {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}
.reels i {
  display: block;
  width: 13px;
  height: 13px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  position: relative;
}
.reels i::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: currentColor;
}
.reels .path {
  width: 5px;
  height: 1.5px;
  background: currentColor;
  border-radius: 0;
}
/* Constant angular velocity, 0.85 rev/s — the honest rate from the brief. */
.reels.turning i { animation: reel 1.176s linear infinite; }
@keyframes reel { to { transform: rotate(360deg); } }
.reels i::after {
  content: "";
  position: absolute;
  inset: 1.5px;
  border-radius: 50%;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid transparent;
  border-bottom: 1.5px solid transparent;
  border-left: 1.5px solid transparent;
}

/* ---- Transport keys (the CTAs) ------------------------------------------ */
.key {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 132px;
  padding: 11px 22px 9px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--key);
  box-shadow: inset 0 1px 0 var(--bevel-hi), inset 0 -1px 0 var(--bevel-lo);
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: transform 60ms cubic-bezier(.2, 0, 0, 1), box-shadow 60ms cubic-bezier(.2, 0, 0, 1);
}
/* The lamp bar: a 3px strip across the key's top edge, lit when engaged. */
.key::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--muted);
}
.key .legend {
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--engrave);
}
.key .glyph { font-size: 15px; line-height: 1; }
.key:hover { box-shadow: inset 0 1px 0 var(--bevel-hi), inset 0 -1px 0 var(--bevel-lo), 0 0 0 1px var(--border); }
/* Key press: 1px down, bevel inverts. No scale, no bounce. */
.key:active {
  transform: translateY(1px);
  box-shadow: inset 0 -1px 0 var(--bevel-hi), inset 0 1px 0 var(--bevel-lo);
}
.key--lit::before {
  background: var(--lamp-red);
  box-shadow: 0 0 8px -1px rgba(242, 70, 56, 0.55);
}
.key--lit .glyph { color: var(--lamp-red); }
.key--amber::before {
  background: var(--lamp-amber);
  box-shadow: 0 0 8px -1px rgba(240, 167, 42, 0.55);
}
.key-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }

/* ---- Panels (the card equivalent) --------------------------------------- */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: inset 0 1px 0 var(--bevel-hi);
}
.panel h3 { margin-bottom: 6px; }
.panel p { color: var(--muted-fg); font-size: 14px; margin: 0; }
.panel .idx {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--brand);
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 12px;
}

.grid { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid > .panel { border: 0; border-radius: 0; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* Two-column feature block */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: center;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 28px; } }

/* ---- Spec plate — engraved label / value rows, like a machine's data plate */
.plate {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: inset 0 1px 0 var(--bevel-hi);
  overflow: hidden;
}
.plate .row {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 20px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.plate .row:last-child { border-bottom: 0; }
.plate .row > div:last-child { color: var(--muted-fg); font-size: 14px; }
@media (max-width: 620px) {
  .plate .row { grid-template-columns: 1fr; gap: 4px; }
}

/* ---- Lamp rows (the privacy section) ------------------------------------ */
.lamprow {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.lamprow:last-child { border-bottom: 0; }
.lamprow .lamp { margin-top: 6px; }
.lamprow h3 { margin-bottom: 4px; }
.lamprow p { color: var(--muted-fg); margin: 0; font-size: 14px; }

/* ---- Screenshot frame --------------------------------------------------- */
.shot {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 var(--bevel-hi), 0 1px 2px var(--bevel-lo);
}
figure { margin: 0; }
figcaption { margin-top: 10px; }

/* ---- The deck strip — a real transport rail, as the hero's illustration -- */
.deck {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--panel);
  background-image: repeating-linear-gradient(90deg, transparent 0 2px, var(--brushed) 2px 3px);
  box-shadow: inset 0 1px 0 var(--bevel-hi), inset 0 -1px 0 var(--bevel-lo);
  flex-wrap: wrap;
}
.deck .sep { width: 1px; align-self: stretch; background: var(--border); }

/* Tape counter — mechanical odometer digits in recessed wells. */
.counter { display: inline-flex; align-items: center; gap: 2px; }
.counter span {
  display: grid;
  place-items: center;
  min-width: 15px;
  padding: 3px 0;
  background: var(--well);
  border-radius: 1px;
  box-shadow: inset 0 1px 0 var(--bevel-lo), inset 0 -1px 0 var(--bevel-hi);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.counter span.colon {
  min-width: 7px;
  background: none;
  box-shadow: none;
  color: var(--muted-fg);
}

/* Level ladder — 10 segments, over-zone in red. Static; it is an illustration. */
.ladder { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.ladder i {
  display: block;
  width: 4px;
  background: var(--accent);
  border-radius: 0;
}
.ladder i.on { background: var(--success); }
/* The over-0 zone: present on the scale, unlit. A lit red segment would be
   claiming the signal is clipping. */
.ladder i.over { background: var(--lamp-red); opacity: 0.3; }

/* ---- Reveal: mechanical motion — 140ms opacity only, no travel ----------- */
.js .reveal { opacity: 0; transition: opacity 140ms ease-out; }
.js .reveal.in { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reels.turning i { animation: none; }
  .js .reveal { opacity: 1; transition: none; }
  .key { transition: none; }
}

/* ---- Article (privacy policy) ------------------------------------------- */
.article { max-width: var(--doc); margin: 0 auto; }
.article h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin-bottom: 8px; }
.article h2 {
  font-size: 1.1rem;
  margin-top: 40px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.article h3 { font-size: 0.95rem; margin-top: 26px; color: var(--fg); }
.article p, .article li { color: var(--muted-fg); font-size: 14.5px; }
.article ul { padding-left: 20px; margin: 0 0 16px; }
.article li { margin-bottom: 7px; }
.article strong { color: var(--fg); font-weight: 600; }
.article a { color: var(--brand); text-underline-offset: 2px; }
.article code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--fg);
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1px 5px;
}
.effective {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--card);
  box-shadow: inset 0 1px 0 var(--bevel-hi);
  margin-bottom: 26px;
}

/* ---- Footer ------------------------------------------------------------- */
.foot {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: 24px;
}
.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  justify-content: space-between;
  align-items: center;
}
.foot a { color: var(--engrave); text-decoration: none; }
.foot a:hover { color: var(--fg); }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }

/* Focus is visible on a dark deck: 2px amber ring, 1px offset. */
a:focus-visible, .key:focus-visible {
  outline: 2px solid var(--lamp-amber);
  outline-offset: 1px;
}
