/* ────────────────────────────────────────────────────────────────────────────
   parallaxfuture.io — PAPER & SIGNAL (v2, ripped from the Tresmares system,
   rebuilt as ours — see SITE-DESIGN-RULES.md §2–3).
   Ground: warm paper + film grain. Ink: #2B2B2B, never pure black. Signal:
   ONE red, used in drops. Type is the composition. Square corners, hairlines,
   whitespace — no cards-as-boxes, no background grid, no rounded bentos.
   NOTE: legacy var names (--bg, --fg, --blue…) are kept and remapped so the
   inner pages' inline styles restyle without markup surgery. --blue IS the
   red signal now — the semantic is "emphasis", the hue is the brand's.
   ──────────────────────────────────────────────────────────────────────────── */

:root {
  --paper: #F5F4F1;
  --paper-2: #ECEBE8;
  --line: #DEDDD9;
  --ink: #2B2B2B;
  --ink-soft: #6B6B68;
  --red: #D9291F;

  /* legacy remaps — old name, new system */
  --bg: var(--paper);
  --surface: #FBFAF8;
  --surface-2: var(--paper-2);
  --border: var(--line);
  --border-strong: #C9C8C3;
  --fg: var(--ink);
  --muted: var(--ink-soft);
  --faint: #9C9B97;
  --blue: var(--red);
  --violet: var(--ink);
  --warn: #8A6A1B;
  --danger: var(--red);

  --font-ui: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", monospace;
  --measure: 68ch;
  --pad: clamp(20px, 6vw, 96px);
}

/* ── Ink & Signal — the dark inversion. Same system, night paper. ─────── */
:root[data-theme="dark"] {
  --paper: #171716;
  --paper-2: #201F1E;
  --line: #2E2D2B;
  --ink: #F0EFEC;
  --ink-soft: #A5A4A0;
  --red: #E5352B;

  --bg: var(--paper);
  --surface: #1C1B1A;
  --surface-2: var(--paper-2);
  --border: var(--line);
  --border-strong: #3E3D3A;
  --fg: var(--ink);
  --muted: var(--ink-soft);
  --faint: #6E6D69;
  --blue: var(--red);
  --violet: var(--ink);
  --warn: #C9A227;
  --danger: var(--red);
}
:root[data-theme="dark"] body::after { opacity: 0.07; }
:root[data-theme="dark"] .viz-media { border-color: var(--line); }

/* the ink-spill reveal: we drive the circle ourselves */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: light; scroll-behavior: smooth; }
:root[data-theme="dark"] { color-scheme: dark; } /* UA bits (scrollbars, form controls) follow the ink theme */
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* film grain — what keeps the paper alive */
body::after {
  content: "";
  position: fixed; inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--ink); color: var(--paper); }

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }

/* ink flecks — the spill leaves droplets (a few letters go red on every flip) */
.ink-fleck { color: var(--red); }

:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--paper);
  background: var(--ink);
  padding: 2px 6px;
}

/* ── shell ─────────────────────────────────────────────────────────────── */

.shell { max-width: 1280px; margin: 0 auto; padding: 0 var(--pad); }

/* ── nav — tiny, quiet, one black block ────────────────────────────────── */

.site-nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-nav .shell {
  display: flex; align-items: center; gap: 26px;
  height: 60px;
}
.brand {
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
  color: var(--ink);
  text-decoration: none;
}
.brand::before { content: "●"; color: var(--red); font-size: 8px; margin-right: 9px; vertical-align: 2px; }
.brand:hover { color: var(--ink); }
.nav-links { display: flex; gap: 24px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--ink-soft); font-size: 13.5px; text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-links a:hover { color: var(--red); }

.cmdk-hint {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--paper);
  background: var(--ink); border: 0;
  padding: 9px 16px; cursor: pointer;
}
.cmdk-hint:hover { background: var(--red); color: #fff; }

.theme-toggle {
  font-family: var(--font-mono); font-size: 14px; line-height: 1;
  color: var(--ink); background: transparent;
  border: 1px solid var(--ink);
  height: 34px; width: auto; padding: 0 12px; gap: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; letter-spacing: 0.16em;
}
/* launch pass 2026-07-10 (Beau: "easier to notice") — the switch reads as a
   labeled control, not a stray glyph: ink border + engraved LIGHTS label. */
.theme-toggle::after { content: "LIGHTS"; font-size: 10px; }
.theme-toggle:hover { border-color: var(--red); color: var(--red); }

/* ── hero — type as landscape ──────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 88vh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 4vh; padding-bottom: 4vh;
}
.eyebrow {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft);
}
.eyebrow-mark { font-family: var(--font-mono); font-weight: 700; margin-right: 2px; } /* per-page identity mark (launch pass) */
.hero h1 {
  margin: 22px 0 0;
  font-family: var(--font-display);
  font-size: clamp(58px, 10.5vw, 168px);
  font-weight: 600; line-height: 0.96; letter-spacing: -0.035em;
  color: var(--ink);
}
.hero h1 .stair { display: block; }
.hero h1 .stair:nth-child(2) { margin-left: 0.9em; }
.hero h1 .stair:nth-child(3) { margin-left: 1.8em; }
@keyframes settle-weight {
  from { font-variation-settings: "wght" 300; opacity: 0.25; }
  to   { font-variation-settings: "wght" 600; opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero h1 { animation: settle-weight 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
}
.hero .dek {
  position: absolute; right: var(--pad); bottom: 9vh;
  max-width: 300px;
  font-size: 15px; line-height: 1.65; color: var(--ink);
}
.hero .dek .cta-row { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.scroll-hint {
  position: absolute; left: var(--pad); bottom: 9vh;
  font-family: var(--font-mono); font-size: 11px; color: var(--faint);
  letter-spacing: 0.1em;
}

/* inner pages: the staircase drama belongs to the landing only */
.hero.compact { min-height: auto; padding: clamp(48px, 9vh, 90px) var(--pad) 8px; justify-content: flex-start; }
.hero.compact .dek { position: static; max-width: 58ch; margin-top: 18px; }

.btn {
  display: inline-block;
  font-size: 14px; font-weight: 500;
  color: var(--ink); background: transparent; border: 0;
  padding: 0; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
  font-family: var(--font-ui);
}
.btn:hover { color: var(--red); }
.btn.primary {
  background: var(--ink); color: var(--paper);
  padding: 12px 22px; text-decoration: none;
}
.btn.primary:hover { background: var(--red); color: #fff; }
.btn.violet { background: var(--ink); color: var(--paper); padding: 12px 22px; text-decoration: none; }
.btn.violet:hover { background: var(--red); }

/* ── chips — square, hairline, mono; red = signal ─────────────────────── */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 9px;
  border: 1px solid var(--line); color: var(--ink-soft);
  background: transparent;
}
.chip::before { content: "●"; font-size: 7px; }
.chip.live    { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.chip.shipped { color: var(--ink); }
.chip.seam    { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.chip.queued  { color: var(--faint); }
.chip.repair  { color: var(--red); border-color: var(--red); }
.chip.valid   { color: var(--paper); background: var(--ink); border-color: var(--ink); }
.chip.valid::before { content: "✓"; font-size: 10px; }

/* ── sections — space and hairlines, not boxes ────────────────────────── */

section { padding: clamp(56px, 10vh, 110px) 0; }
.section-head { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.4vw, 52px); font-weight: 600; letter-spacing: -0.02em;
}
.section-sub { color: var(--ink-soft); max-width: 58ch; }

/* ── catalog — an index, not a card wall ──────────────────────────────── */

.catalog {
  margin-top: 44px;
  display: grid; gap: 0 48px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.card {
  display: flex; flex-direction: column; gap: 12px;
  background: transparent;
  border: 0; border-top: 1px solid var(--ink);
  padding: 20px 0 40px;
  color: var(--ink);
  text-decoration: none;
}
a.card:hover { color: var(--ink); }
a.card:hover .card-title { color: var(--red); }
a.card:hover .card-title::after { content: " →"; }
.card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.card-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.card-body { color: var(--ink-soft); font-size: 14px; line-height: 1.6; flex: 1; }
.card-meta {
  padding-top: 10px;
  display: grid; gap: 3px;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--faint);
}
.card-meta b { color: var(--ink-soft); font-weight: 500; }
.card.queued-detail .card-title { color: var(--ink-soft); }
.card .queued-note { font-family: var(--font-mono); font-size: 10px; color: var(--faint); }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .card, .prose-block, .seam-slot {
      animation: rise-in linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 42%;
    }
  }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ── honest seams ─────────────────────────────────────────────────────── */

.seam-slot {
  border: 1px dashed var(--border-strong);
  background:
    linear-gradient(135deg, transparent 49.7%, var(--line) 49.7%, var(--line) 50.3%, transparent 50.3%),
    var(--surface);
  display: grid; place-items: center;
  min-height: 220px;
}
.seam-slot .seam-label {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft);
  background: var(--paper); border: 1px solid var(--line);
  padding: 6px 14px;
}
.seam-slot.hero-size { aspect-ratio: 2 / 1; min-height: 280px; }

.feature-shot { border: 1px solid var(--ink); overflow: hidden; background: var(--surface); }
.feature-shot img { display: block; width: 100%; height: auto; }
.feature-shot figcaption {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-soft);
  padding: 10px 14px; border-top: 1px solid var(--line);
}

/* ── detail page ──────────────────────────────────────────────────────── */

.crumbs { font-family: var(--font-mono); font-size: 12px; color: var(--faint); padding-top: 30px; }
.crumbs a { color: var(--faint); text-decoration: none; }
.crumbs a:hover { color: var(--red); }
.crumbs [aria-current] { color: var(--ink-soft); }

.detail-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 0 10px; }
.detail-head h1 { font-family: var(--font-display); font-size: clamp(44px, 7vw, 88px); font-weight: 600; letter-spacing: -0.03em; }

.detail-grid {
  display: grid; gap: clamp(24px, 4vw, 64px);
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  padding: 32px 0 56px;
}
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.prose-block { margin-bottom: 48px; max-width: var(--measure); }
.prose-block h2 {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 14px;
}
.prose-block p { color: var(--ink); }

.pipeline { display: flex; gap: 0; flex-wrap: wrap; margin: 6px 0 14px; }
.pipe {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  border: 1px solid var(--line); border-left: 0;
  padding: 8px 14px; color: var(--ink-soft); background: transparent;
}
.pipe:first-child { border-left: 1px solid var(--line); }
.pipe.here { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pipe-caption { font-size: 13.5px; color: var(--faint); }

blockquote {
  border-left: 2px solid var(--red);
  padding: 4px 0 4px 24px;
  margin: 48px 0;
  max-width: 56ch;
}
blockquote p { font-family: var(--font-display); font-size: clamp(20px, 2.6vw, 26px); font-weight: 500; line-height: 1.4; color: var(--ink); }
blockquote cite {
  display: block; margin-top: 10px;
  font-family: var(--font-mono); font-style: normal; font-size: 11px; color: var(--faint);
}

.spec {
  position: sticky; top: 84px;
  background: transparent; border: 1px solid var(--ink);
  padding: 22px;
  display: grid; gap: 18px;
}
.spec-header {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; color: var(--ink-soft);
}
.spec dl { display: grid; gap: 13px; }
.spec dt {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--faint);
}
.spec dd { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); margin-top: 3px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 24px 0 72px; border-top: 1px solid var(--ink); }
@media (max-width: 640px) { .pager { grid-template-columns: 1fr; } }
.pager a { padding: 24px 8px; color: var(--ink); text-decoration: none; }
.pager a:hover strong { color: var(--red); }
.pager .dir {
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; color: var(--faint); display: block; margin-bottom: 8px;
}
.pager .next { text-align: right; }
.pager strong { font-family: var(--font-display); font-size: 22px; font-weight: 600; }

/* ── CTA band — a statement, not a box ────────────────────────────────── */

.cta-band {
  border: 0; border-top: 1px solid var(--ink);
  background: transparent;
  padding: clamp(36px, 6vw, 64px) 0;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 28px; flex-wrap: wrap;
}
.cta-band h2 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 48px); font-weight: 600; letter-spacing: -0.02em; }
.cta-band p { color: var(--ink-soft); margin-top: 8px; }

/* ── footer ───────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--ink);
  background: var(--paper);
  margin-top: 48px;
}
footer .shell {
  display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  padding-top: 44px; padding-bottom: 60px;
}
.foot-brand { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; }
.foot-brand::before { content: "●"; color: var(--red); font-size: 7px; margin-right: 8px; vertical-align: 2px; }
.foot-tag { color: var(--faint); font-size: 12.5px; margin-top: 8px; }
.foot-cols { display: flex; gap: 56px; }
.foot-cols nav { display: grid; gap: 8px; align-content: start; }
.foot-cols a { color: var(--ink-soft); font-size: 13.5px; text-decoration: none; }
.foot-cols a:hover { color: var(--red); }
.foot-cols .col-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 4px;
}

/* ── visuals registry ─────────────────────────────────────────────────── */

.viz-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--ink);
  border: 1px solid var(--ink);
}
.viz-media img, .viz-media canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.viz-media canvas { image-rendering: pixelated; }
.viz-badge {
  position: absolute; top: 0; right: 0; z-index: 2;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 9px;
}
.viz-badge.live { background: var(--red); color: #fff; }
.viz-badge.capture { background: var(--paper); color: var(--ink-soft); }
.viz-issues {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--warn);
  line-height: 1.5;
}
.viz-card.tier-c .viz-issues { color: var(--red); }

/* hero ambience — the ghost layer: our own work, dissolved into paper */
.hero-ambient {
  position: absolute; inset: 0; z-index: -1;
  opacity: 0.55;
  mask-image: radial-gradient(130% 110% at 62% 45%, black 25%, transparent 80%);
  -webkit-mask-image: radial-gradient(130% 110% at 62% 45%, black 25%, transparent 80%);
}
.hero-ambient canvas { width: 100%; height: 100%; display: block; }

/* ── command palette — paper edition ──────────────────────────────────── */

.cmdk[hidden] { display: none; }
.cmdk {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: start center;
  padding-top: clamp(60px, 16vh, 160px);
  background: color-mix(in srgb, var(--ink) 18%, transparent);
  backdrop-filter: blur(3px);
}
.cmdk-panel {
  width: min(620px, calc(100vw - 32px));
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 0 24px 80px rgba(43, 43, 43, 0.25);
  overflow: hidden;
}
.cmdk-input {
  width: 100%;
  font: 500 16px/1 var(--font-ui);
  color: var(--ink);
  background: transparent; border: 0; outline: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.cmdk-input::placeholder { color: var(--faint); }
.cmdk-list { max-height: 320px; overflow-y: auto; padding: 8px; }
.cmdk-group-label {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint);
  padding: 10px 12px 4px;
}
.cmdk-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  color: var(--ink-soft); font-size: 14px;
  cursor: pointer;
}
.cmdk-item .glyph { font-family: var(--font-mono); font-size: 12px; color: var(--faint); width: 18px; text-align: center; }
.cmdk-item .hint { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }
.cmdk-item[aria-selected="true"] {
  background: var(--paper-2);
  color: var(--ink);
}
.cmdk-item[aria-selected="true"]::after {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; background: var(--red);
}
.cmdk-empty { padding: 28px 16px; text-align: center; color: var(--faint); font-size: 14px; }
.cmdk-foot {
  display: flex; gap: 16px; align-items: center;
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--faint);
}

@media (max-width: 640px) {
  .nav-links > a { display: none; }
  .foot-cols { gap: 32px; }
  .hero .dek { position: static; margin-top: 40px; max-width: 100%; }
  .scroll-hint { display: none; }
}
