/* ============================================================
   spectroscope — landing page
   Brand rules (DESIGN-BRIEF.md): near-black ground, monochrome
   warm greys, COLOR ONLY ON SPECTRAL LINES. Lines are discrete —
   no fog, no soft blobs. Production fonts: Inter/Geist + JetBrains
   Mono (self-contained page uses the closest system stacks).
   ============================================================ */

/* tokens live in tokens.css — the single source for every surface */
@import url("tokens.css?v=20260720m");

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
html { background: var(--bg); /* the viewport itself: overscroll, the
  nav veil's base and any compositor gap stay paper, never browser-white */ }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}
::selection { background: rgba(45, 212, 167, .25); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* fixed background starfield (scene-bg.js) */
#bg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  opacity: var(--canvas-dim);
}
.nav, main, .footer { position: relative; z-index: 1; }

/* ------------------------------ nav ------------------------ */
.nav {
  display: flex; align-items: center; gap: 2rem;
  padding: 1.1rem clamp(1.2rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: var(--nav-veil);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 4;   /* above content, below the toggles */
}
.wordmark {
  font-weight: 640; font-size: 1.18rem; letter-spacing: .015em;
  display: inline-flex; align-items: center;
}
.wm-icon { width: 22px; height: 22px; margin-right: .55rem; }
.nav-links { display: flex; gap: 1.4rem; margin-left: auto; }
.nav-links a { color: var(--muted); font-size: .92rem; }
.nav-links a:hover { color: var(--ink); }
.nav-cta { display: flex; align-items: center; gap: .6rem; }

/* ---------------------------- buttons ---------------------- */
.btn {
  display: inline-block; padding: .62rem 1.15rem; border-radius: var(--radius);
  font-size: .93rem; font-weight: 560; border: 1px solid var(--line);
  cursor: pointer; background: none; color: var(--ink);
  transition: border-color .18s, background .18s, transform .18s;
}
.btn:hover { border-color: var(--faint); transform: translateY(-1px); }
.btn-accent { border-color: transparent; background: var(--accent); color: var(--accent-contrast); }
.btn-accent:hover { filter: brightness(1.12); border-color: transparent; }
.btn-ghost { color: var(--muted); }
.btn-sm { padding: .4rem .8rem; font-size: .85rem; }

/* ----------------------------- hero ------------------------ */
.hero { position: relative; min-height: 88vh; display: flex; align-items: center; overflow-x: clip; /* the hero-inner scrim reaches past the viewport on phones */ }
#hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block;
  opacity: var(--canvas-dim);
}
.hero-inner {
  position: relative; max-width: 680px;
  padding: clamp(3rem, 8vh, 6rem) clamp(1.2rem, 4vw, 3rem);
}
.hero-inner::before {
  /* scrim: dims the particle field behind the copy, fades out right */
  content: ""; position: absolute; inset: 0 -8% 0 0; z-index: -1;
  background: linear-gradient(90deg,
    var(--scrim) 0%,
    color-mix(in srgb, var(--scrim) 70%, transparent) 62%,
    transparent 100%);
}
.hero-brand {
  display: flex; align-items: center; gap: .7rem; margin-bottom: 1.6rem;
}
.hero-brand svg { width: 46px; height: 46px; }
.hero-brand span {
  font-size: clamp(1.6rem, 3.2vw, 2.2rem); font-weight: 680;
  letter-spacing: -.01em;
}
.eyebrow {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 1.1rem;
}
.hero h1 {
  font-size: clamp(2.3rem, 5.4vw, 3.9rem); line-height: 1.08;
  font-weight: 680; letter-spacing: -.015em; margin-bottom: 1.3rem;
}
.u-spectral {
  background-image: linear-gradient(90deg,
    var(--sp-red), var(--sp-amber) 34%, var(--sp-teal) 68%, var(--sp-cyan));
  background-repeat: no-repeat; background-size: 100% 3px;
  background-position: 0 100%; padding-bottom: 6px;
}
.lede { color: var(--muted); font-size: 1.06rem; max-width: 56ch; margin-bottom: 1.8rem; }
.lede strong { color: var(--ink); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; }
.cmd {
  font-family: var(--mono); font-size: .92rem; color: var(--accent);
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .62rem 1rem;
}
.hero-note { margin-top: 1.5rem; font-size: .82rem; color: var(--faint); font-family: var(--mono); }

/* ------------------------ spectrum strip -------------------- */
.strip { padding: clamp(3.5rem, 9vh, 6.5rem) clamp(1.2rem, 4vw, 3rem); border-top: 1px solid var(--line); }
.strip-head, .code-head, .fleet-head { max-width: 640px; margin-bottom: 2.2rem; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 660; letter-spacing: -.01em; margin-bottom: .7rem; }
.strip-head p, .code-head p, .fleet-head p, .cmp p { color: var(--muted); }
.strip-head strong, .fleet-head strong { color: var(--ink); }

.run-spectrum {
  height: 120px; display: flex; align-items: center; gap: 6px;
  padding: 0 .5rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-raise); overflow: hidden; justify-content: space-between;
}
.el {
  display: block; border-radius: 1px; flex: 0 0 auto;
  transform: scaleY(0); opacity: 0;
}
.live .el { animation: el-in .5s both; }
@keyframes el-in { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
.el-teal  { background: var(--sp-teal); }
.el-amber { background: var(--sp-amber); }
.el-red   { background: var(--sp-red); }
.el-cyan  { background: var(--sp-ocean); }
.el-ocean { background: var(--sp-ocean); }
.el-violet{ background: var(--sp-violet); }
.el-grey  { background: var(--faint); }
.legend { display: flex; flex-wrap: wrap; gap: 1.3rem; margin-top: 1rem; color: var(--muted); font-size: .84rem; font-family: var(--mono); }
.sw { display: inline-block; width: 3px; height: 12px; margin-right: .45rem; vertical-align: -1px; }
.sw-teal { background: var(--sp-teal); } .sw-amber { background: var(--sp-amber); }
.sw-red { background: var(--sp-red); }  .sw-cyan { background: var(--sp-ocean); }
.sw-ocean { background: var(--sp-ocean); } .sw-grey { background: var(--faint); }

/* ------------------------- capabilities --------------------- */
.caps {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem; padding: 0 clamp(1.2rem, 4vw, 3rem) clamp(3rem, 8vh, 5rem);
}
.cap {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-raise) 88%, transparent);
  padding: 1.6rem 1.5rem;
}
.cap h3 { font-size: 1.12rem; margin: .9rem 0 .5rem; }
.cap p { color: var(--muted); font-size: .95rem; }
.cap p strong { color: var(--ink); }
.cap code { font-family: var(--mono); font-size: .85em; color: var(--ink); }
.cap-glyph { width: 44px; height: 44px; }
.cap-glyph-wide { width: 88px; height: 44px; object-fit: contain; object-position: left; }
.cap-glyph rect, .cap-glyph circle { fill: var(--faint); }
.cap-glyph .g-accent { fill: var(--accent); }
.cap-glyph path { stroke: var(--faint); stroke-width: 1.6; fill: none; }
.cap-glyph .g-wedge { stroke: var(--muted); }
.cap-glyph .r1 { stroke: var(--sp-red); } .cap-glyph .r2 { stroke: var(--sp-amber); }
.cap-glyph .r3 { stroke: var(--sp-teal); } .cap-glyph .r4 { stroke: var(--sp-cyan); }

/* ----------------------------- code ------------------------- */
.code { padding: clamp(3rem, 8vh, 5.5rem) clamp(1.2rem, 4vw, 3rem); border-top: 1px solid var(--line); }
.listing {
  font-family: var(--mono); font-size: .95rem; line-height: 1.75;
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.5rem 1.7rem; overflow-x: auto;
  max-width: 760px;
}
.code-tabs { display: flex; gap: .4rem; margin-bottom: .55rem; }
.code-tabs button {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .04em;
  color: var(--muted); background: none; border: 1px solid var(--line);
  border-radius: 7px; padding: .32rem .7rem; cursor: pointer;
}
.code-tabs button[aria-selected="true"] { color: var(--accent); border-color: var(--accent); }
.code-tabs .tab-note { font-size: .68rem; opacity: .7; margin-left: .25rem; }
.listing .k { color: var(--sp-cyan); }
.listing .t { color: var(--ink); font-weight: 600; }
.listing .s { color: var(--sp-amber); }
.listing .c { color: var(--faint); }

/* ----------------------------- fleet ------------------------ */
.fleet { padding: clamp(3rem, 8vh, 5.5rem) clamp(1.2rem, 4vw, 3rem); border-top: 1px solid var(--line); }
.fleet-view {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-raise); padding: 1.6rem 1.4rem;
  display: grid; gap: 1.35rem; max-width: 860px;
}
.lane { position: relative; height: 2px; background: var(--line); border-radius: 1px; }
.lane-hi { background: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.lane-label {
  position: absolute; left: 0; top: -1.35rem;
  font-family: var(--mono); font-size: .74rem; color: var(--muted); letter-spacing: .04em;
}
.pulse {
  position: absolute; top: -2px; width: 26px; height: 6px; border-radius: 3px;
  animation: travel 6.5s linear infinite;
}
.p-teal  { background: var(--sp-teal); }
.p-amber { background: var(--sp-amber); animation-delay: -1.6s; animation-duration: 7.4s; }
.p-red   { background: var(--sp-red);   animation-delay: -3.4s; animation-duration: 8.6s; }
.p-cyan, .p-ocean { background: var(--sp-ocean); animation-delay: -2.4s; animation-duration: 7s; }
.p-grey  { background: var(--muted);    animation-delay: -5s;   animation-duration: 9.5s; }
@keyframes travel { from { left: 0; } to { left: calc(100% - 28px); } }

/* ---------------------------- compare ----------------------- */
.compare { padding: clamp(3rem, 8vh, 5.5rem) clamp(1.2rem, 4vw, 3rem); border-top: 1px solid var(--line); }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; margin-top: 1.8rem; max-width: 900px; }
.cmp { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 1.5rem; }
.cmp h4 { font-family: var(--mono); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); margin-bottom: .6rem; }
.cmp-hi { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 4%, var(--bg-raise)); }
.cmp-hi h4 { color: var(--accent); }
.cmp code { font-family: var(--mono); font-size: .88em; }
.cmp strong { color: var(--ink); }

/* -------------------------- get started --------------------- */
.get { padding: clamp(3rem, 8vh, 5.5rem) clamp(1.2rem, 4vw, 3rem); border-top: 1px solid var(--line); }
.get-head { max-width: 640px; margin-bottom: 2rem; }
.get-head p { color: var(--muted); }
.get-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; max-width: 900px; }
.get-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raise); padding: 1.3rem 1.4rem; }
.get-card h4 { font-family: var(--mono); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); margin-bottom: .8rem; }
.get-guide { color: var(--muted); font-size: .92rem; line-height: 1.9; }
.get-code { font-family: var(--mono); font-size: .88rem; line-height: 1.7; overflow-x: auto; color: var(--ink); }
.get-code .c { color: var(--faint); }
.get-note { margin-top: 1.2rem; font-family: var(--mono); font-size: .8rem; color: var(--faint); }

/* ----------------------------- quote ------------------------ */
.quote { padding: clamp(4rem, 12vh, 7rem) clamp(1.2rem, 4vw, 3rem); text-align: center; border-top: 1px solid var(--line); }
.quote-line {
  width: 130px; height: 3px; margin: 0 auto 1.6rem;
  background: linear-gradient(90deg, var(--sp-red), var(--sp-amber) 34%, var(--sp-teal) 68%, var(--sp-cyan));
}
.quote blockquote { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 620; letter-spacing: -.01em; }

/* ----------------------------- footer ----------------------- */
.footer {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  padding: 1.6rem clamp(1.2rem, 4vw, 3rem) 7rem;
  border-top: 1px solid var(--line); color: var(--faint); font-size: .88rem;
}
.wordmark-sm { font-weight: 640; color: var(--muted); }
.foot-sep { margin: 0 .4rem; }
.foot-links { display: flex; gap: 1.3rem; }
.foot-links a { color: var(--faint); }
.foot-links a:hover { color: var(--muted); }

/* ------------------- particle settings ---------------------- */
.quick-prefs {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 5;
  display: flex; gap: .5rem;
}
.quick-prefs .seg { flex: none; padding: .45rem .9rem; background: var(--bg-raise); }
.seg {
  flex: 1; padding: .35rem 0; font-family: var(--mono); font-size: .78rem;
  background: none; border: 1px solid var(--line); border-radius: 7px;
  color: var(--muted); cursor: pointer;
}
.seg:hover { border-color: var(--faint); }
.seg-on { border-color: var(--accent); color: var(--ink); }
.prefs-btns { display: flex; gap: .6rem; justify-content: flex-end; margin-top: .2rem; }

/* ------------------- new one-pager sections ----------------- */
.kicker {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .24em;
  text-transform: uppercase; color: var(--sp-violet); margin-bottom: .6rem;
}
.watch, .gate, .trace, .replay, .explain, .trust, .shots { padding: clamp(3rem, 8vh, 5.5rem) clamp(1.2rem, 4vw, 3rem); border-top: 1px solid var(--line); }

/* --------------------- real app captures -------------------- */
.shots .strip-head { max-width: 720px; }
.shot { margin: 2.2rem auto 0; max-width: 1180px; }
.shot a { display: block; }
.shot img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--line); border-radius: 12px;
}
.shot figcaption {
  margin-top: .65rem; font-family: var(--mono); font-size: .78rem;
  color: var(--muted);
}
.shot-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem;
  max-width: 1180px; margin: 0 auto;
}
.shot-grid .shot { min-width: 0; margin: 2.2rem 0 0; }
@media (max-width: 860px) { .shot-grid { grid-template-columns: 1fr; } }
.watch-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.4rem; align-items: center; max-width: 1100px;
}
.watch-grid .strip-head { margin-bottom: 0; }
.demo-note { margin-top: .8rem; font-family: var(--mono); font-size: .76rem; color: var(--faint); }

/* iris: aperture over a steady stream */
.iris-window {
  position: relative; height: 190px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-raise);
}
.iris-stream {
  display: grid; gap: .55rem; padding: .9rem 1.1rem;
  font-family: var(--mono); font-size: .78rem; color: var(--muted);
  white-space: pre; animation: iris-scroll 14s linear infinite;
}
@keyframes iris-scroll { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.iris-lid {
  position: absolute; inset: 0; pointer-events: none;
  background: var(--bg);
  clip-path: inset(0 0 100% 0);
  animation: iris-blink 7s ease-in-out infinite;
  opacity: .85;
}
@keyframes iris-blink {
  0%, 42%, 100% { clip-path: inset(0 0 100% 0); }
  50%, 72% { clip-path: inset(0 0 18% 0); }
  80% { clip-path: inset(0 0 100% 0); }
}

/* gate: one pending line collapses into one outcome */
.gate-stage {
  height: 150px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-raise); margin-bottom: 1rem;
}
.gate-line {
  display: block; width: 7px; height: 72%; border-radius: 2px;
  background: var(--sp-violet);
  filter: blur(5px); opacity: .8;
  animation: gate-waver 2.2s ease-in-out infinite;
  transition: filter .45s, background .45s, opacity .45s, width .45s;
}
@keyframes gate-waver { 0%, 100% { transform: translateX(-13px); } 50% { transform: translateX(13px); } }
.gate-line.gate-ok { background: var(--sp-teal); filter: blur(0); opacity: 1; animation: none; }
.gate-line.gate-no { background: var(--sp-red); filter: blur(0); opacity: .35; width: 2px; animation: none; }
.gate-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; }
.gate-call { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.gate-btns { display: flex; gap: .5rem; }
.gate-out { display: block; margin-top: .8rem; font-family: var(--mono); font-size: .76rem; color: var(--faint); }

/* fingerprint: barcode + JSONL row */
.fp-bars {
  height: 120px; display: flex; align-items: center; gap: 5px;
  justify-content: space-between; padding: 0 .6rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-raise);
}
.fp-bars .el { cursor: crosshair; transition: transform .12s; }
.fp-bars .el:hover { transform: scaleY(1.12); }
.fp-row {
  display: block; margin-top: .8rem; font-family: var(--mono);
  font-size: .78rem; color: var(--accent); min-height: 1.4em;
  overflow-x: auto; white-space: nowrap;
}

/* replay: scrub the spectrum back in time */
.rp-strip {
  height: 110px; display: flex; align-items: center; gap: 5px;
  justify-content: space-between; padding: 0 .6rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-raise);
  transition: filter .15s, opacity .15s;
  overflow: hidden; /* the generated event lines must not widen the page */
}
.rp-demo input[type="range"] { width: 100%; margin-top: 1rem; accent-color: var(--sp-violet); }
.rp-time { display: block; margin-top: .5rem; font-family: var(--mono); font-size: .76rem; color: var(--faint); }

/* fleet prism illustration */
.fleet-prism { display: block; margin: 0 0 1.4rem; max-width: 300px; height: auto; opacity: .92; }

/* dev section */
.dev { padding: clamp(3rem, 8vh, 5.5rem) clamp(1.2rem, 4vw, 3rem); border-top: 1px solid var(--line); }
.mod-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem; margin-top: 2rem; max-width: 1100px;
}
.mod {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg-raise) 88%, transparent);
  padding: 1.2rem 1.3rem;
}
.mod h4 { font-family: var(--mono); font-size: .85rem; color: var(--accent); margin-bottom: .5rem; }
.mod p { color: var(--muted); font-size: .9rem; }
.mod code { font-family: var(--mono); font-size: .85em; color: var(--ink); }

/* architecture diagrams (dev section) */
.arch { display: grid; gap: 1.4rem; margin-top: 2.4rem; max-width: 1100px; }
.arch img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.guide-thumb {
  display: inline-flex; flex-direction: column; gap: .5rem; align-items: center;
  text-decoration: none; color: var(--muted); font-size: .88rem; font-weight: 600;
}
.guide-thumb img { width: 128px; height: auto; border: 1px solid var(--line); border-radius: 8px; }
.guide-thumb:hover img { border-color: var(--accent); }
.guide-thumb:hover span { color: var(--accent); }
.img-light { display: none; }
:root[data-design="light"] .img-dark { display: none; }
:root[data-design="light"] .img-light { display: block; }

/* quote star */
.quote-star { display: block; margin: 0 auto 1.4rem; width: 84px; height: auto; }

/* scroll reveals */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* --------------------------- mobile ------------------------- */
@media (max-width: 832px) {  /* 640 + 30% (owner 2026-07-20): particles leave earlier */
  .nav-links { display: none; }
  /* keep the dev-portal ad; drop the disabled GitHub stub */
  .nav-cta { margin-left: auto; }
  .nav-cta .btn-ghost[aria-disabled] { display: none; }
  .hero { min-height: 74vh; }
  /* no hero particles on mobile (owner 2026-07-20); the observer
     sees the hidden canvas as offscreen, so rendering pauses too */
  #hero-canvas { display: none; }
  .hero-inner::before {
    inset: 0 -8%;
    background: color-mix(in srgb, var(--scrim) 76%, transparent);
  }
  .run-spectrum { height: 90px; gap: 4px; }
  .lane-label { font-size: .68rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pulse, .el { animation: none !important; }
  .el { transform: none; opacity: 1; }
  html { scroll-behavior: auto; }
}
