/* PSI: a dark lab instrument measuring something alive.
   Layout: one full-bleed observation field as the hero; the page below is a quiet instrument panel on a 12-column grid;
   a terminal feed docked to the bottom edge of the screen, always on. Single dark theme by design.
   Motion: superposition (blur, jitter, layered) → collapse (snap, sharp, a brief Cherenkov flare). Nothing else moves. */
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --void: #050507;
  --panel: #0C0D10;
  --line: #1A1D22;
  --ink: #E8ECEF;
  --muted: #7A808A;
  --dim: #4A4F57;
  --cherenkov: #2EE6FF;
  --cherenkov-glow: rgba(46, 230, 255, .55);
  --ok: #8BE8A5;
  --warn: #F2B866;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 6px; /* the one corner radius */
  --snap: cubic-bezier(.2, .9, .1, 1);
  --t-snap: 160ms;
  --t-drift: 900ms;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1320px;
  --feedbar: 44px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--void); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--void); color: var(--ink); font: 400 16px/1.55 var(--sans); letter-spacing: -0.005em; -webkit-font-smoothing: antialiased; padding-bottom: calc(var(--feedbar) + env(safe-area-inset-bottom, 0px)); overflow-x: hidden; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--cherenkov); color: var(--void); }
:focus-visible { outline: 1px solid var(--cherenkov); outline-offset: 3px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "zero" 1; }
.tail { color: var(--cherenkov); text-shadow: 0 0 18px var(--cherenkov-glow); }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }

/* ---- Nav ------------------------------------------------------------------------------------------------------- */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 40; padding-top: env(safe-area-inset-top, 0px); transition: background var(--t-drift), border-color var(--t-drift); border-bottom: 1px solid transparent; }
.nav.solid { background: rgba(5, 5, 7, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: var(--line); }
.nav .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .02em; font-size: 15px; }
.brand svg { width: 26px; height: 26px; display: block; }
.nav-links { display: flex; gap: 24px; font-size: 14px; color: var(--muted); }
.nav-links a { transition: color var(--t-snap) var(--snap); }
.nav-links a:hover, .nav-links a.on { color: var(--ink); }
.nav-links a.first { color: var(--ink); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---- Buttons and chips (the collapse on press) ------------------------------------------------------------------ */
.btn { --b: var(--line); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--b); background: transparent; font-size: 14px; font-weight: 500; letter-spacing: .005em; cursor: pointer; white-space: nowrap; transition: border-color var(--t-snap) var(--snap), background var(--t-snap) var(--snap), transform var(--t-snap) var(--snap), box-shadow var(--t-snap) var(--snap); }
.btn:hover { --b: #2C3038; background: rgba(232, 236, 239, .03); }
.btn:active { transform: scale(.975); }
.btn.primary { --b: var(--cherenkov); background: var(--cherenkov); color: var(--void); font-weight: 600; }
.btn.primary:hover { box-shadow: 0 0 0 1px var(--cherenkov), 0 0 28px -4px var(--cherenkov-glow); background: #5BEDFF; }
.btn.big { height: 52px; padding: 0 26px; font-size: 16px; }
.btn.icon { width: 40px; padding: 0; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn .lbl { display: inline-block; }
.btn.flare { animation: flare 520ms var(--snap); }
@keyframes flare { 0% { box-shadow: 0 0 0 0 var(--cherenkov-glow); } 30% { box-shadow: 0 0 0 4px rgba(46,230,255,.35), 0 0 40px 0 var(--cherenkov-glow); } 100% { box-shadow: 0 0 0 0 transparent; } }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); font: 500 13px/1 var(--mono); color: var(--muted); background: rgba(12, 13, 16, .6); cursor: pointer; transition: border-color var(--t-snap) var(--snap), color var(--t-snap) var(--snap); }
.chip:hover { border-color: #2C3038; color: var(--ink); }
.chip b { font-weight: 500; color: var(--ink); }
.chip .k { color: var(--dim); letter-spacing: .06em; font-size: 11px; }
.chip.copied { border-color: var(--cherenkov); }

/* ---- Hero: the observation field ------------------------------------------------------------------------------- */
.hero { position: relative; height: clamp(640px, 100svh, 980px); overflow: hidden; isolation: isolate; background: var(--void); touch-action: pan-y; }
.hero canvas#field { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 32%; background: linear-gradient(to bottom, transparent, var(--void)); pointer-events: none; z-index: 1; }
.hero-mark { position: absolute; z-index: 2; left: 50%; top: 45%; width: clamp(170px, 24vmin, 290px); aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; opacity: .96; transition: opacity var(--t-drift); }
.hero-mark svg, .hero-mark img { width: 100%; height: 100%; display: block; overflow: visible; }
.hero.collapsing .hero-mark { opacity: .08; }
html.resolve .hero-mark { animation: resolve 1100ms var(--snap) both; }
@keyframes resolve { 0% { opacity: 0; filter: blur(14px); transform: translate(-50%, -50%) scale(1.18); } 55% { opacity: 1; } 100% { opacity: .96; filter: none; transform: translate(-50%, -50%) scale(1); } }
html.resolve .hero-copy h1, html.resolve .hero-copy .sub, html.resolve .hero-cta { animation: settle 900ms 260ms var(--snap) both; }
@keyframes settle { 0% { opacity: 0; filter: blur(6px); transform: translateY(8px); } 100% { opacity: 1; filter: none; transform: none; } }
.hero-copy { position: absolute; z-index: 3; left: 0; right: 0; bottom: clamp(56px, 9vh, 104px); pointer-events: none; }
.hero-copy .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 32px; }
.hero-copy h1 { margin: 0; font-weight: 500; font-size: clamp(40px, 6.1vw, 92px); line-height: .98; letter-spacing: -0.045em; text-wrap: balance; max-width: 12ch; }
.hero-copy .sub { margin: 18px 0 0; color: var(--muted); font-size: clamp(15px, 1.25vw, 18px); max-width: 46ch; }
.hero-copy .sub .mono { color: var(--ink); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; pointer-events: auto; }
.hero-hint { position: absolute; z-index: 3; top: calc(64px + 22px + env(safe-area-inset-top, 0px)); right: var(--gutter); font: 500 11px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); text-align: right; pointer-events: none; }
.hero-hint b { color: var(--muted); font-weight: 500; }

/* The CA the field collapses into */
.collapse-ca { position: absolute; z-index: 4; left: 50%; top: 45%; transform: translate(-50%, -50%); font: 500 clamp(17px, 2.35vw, 34px)/1 var(--mono); letter-spacing: .02em; white-space: nowrap; color: var(--ink); pointer-events: none; text-align: center; }
.collapse-ca::before { content: ""; position: absolute; z-index: -1; inset: -60px -90px; background: radial-gradient(closest-side, rgba(5,5,7,.92), rgba(5,5,7,.75) 55%, transparent); }
.collapse-ca .v { text-shadow: 0 0 22px rgba(5,5,7,.9); }
.collapse-ca .meta { display: block; margin-top: 16px; font-size: 12px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.collapse-ca .meta .demo { color: var(--warn); }
.collapse-ca.fly { transition: transform 900ms cubic-bezier(.6, 0, .2, 1), opacity 900ms ease-in, font-size 900ms; opacity: 0; }

/* ---- Intro: the measurement ------------------------------------------------------------------------------------ */
.intro { position: fixed; inset: 0; z-index: 100; background: var(--void); cursor: pointer; }
.intro canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.intro.out { transition: opacity 520ms ease; opacity: 0; pointer-events: none; }
html.intro-on body { overflow: hidden; }

/* ---- Superposition text (scramble) ----------------------------------------------------------------------------- */
.sp { display: inline-block; }
.sp .q { display: inline-block; filter: blur(1.4px); opacity: .72; }
.sp .q.lock { filter: none; opacity: 1; }
.sp .q.hot { color: var(--cherenkov); text-shadow: 0 0 14px var(--cherenkov-glow); }

/* ---- Sections ---------------------------------------------------------------------------------------------------- */
section.block { padding-block: clamp(72px, 10vw, 140px); border-top: 1px solid var(--line); position: relative; }
.eyebrow { font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 6px; height: 6px; background: var(--cherenkov); border-radius: 50%; box-shadow: 0 0 10px var(--cherenkov-glow); }
h2 { font-weight: 500; font-size: clamp(30px, 3.6vw, 52px); line-height: 1.02; letter-spacing: -0.04em; margin: 18px 0 0; text-wrap: balance; max-width: 18ch; }
.lede { color: var(--muted); font-size: 17px; max-width: 58ch; margin: 18px 0 0; }

/* ---- Feed bar (always on screen) -------------------------------------------------------------------------------- */
.feedbar { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; height: calc(var(--feedbar) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: rgba(5, 5, 7, .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); font: 400 12.5px/1 var(--mono); color: var(--muted); }
.feedbar .wrap { display: flex; align-items: center; gap: 16px; height: var(--feedbar); }
.feedbar .live { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); letter-spacing: .12em; font-size: 11px; text-transform: uppercase; flex: none; }
.feedbar .live i { width: 7px; height: 7px; border-radius: 50%; background: var(--cherenkov); box-shadow: 0 0 10px var(--cherenkov-glow); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.feedbar .line { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: block; line-height: var(--feedbar); height: var(--feedbar); }
.feedbar .line .ln, .feedbar .line .ln * { white-space: nowrap; }
.feedbar a.all { flex: none; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.feedbar a.all:hover { color: var(--ink); }

/* A log line, shared by the bar and the full feed */
.ln { white-space: nowrap; }
.ln .ev { color: var(--ink); }
.ln .ca { color: var(--ink); }
.ln .ca .t { color: var(--cherenkov); }
.ln .bk { color: var(--muted); }
.ln .bits { color: var(--dim); letter-spacing: .04em; }
.ln .tag { display: inline-block; padding: 2px 5px; border: 1px solid #3a2f1c; color: var(--warn); border-radius: 3px; font-size: 10px; letter-spacing: .1em; margin-right: 8px; vertical-align: 1px; }
.ln .mc { color: var(--ink); }
.ln .burn { color: var(--cherenkov); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav .wrap { gap: 12px; height: 56px; }
  .hero-copy .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero-cta { justify-content: flex-start; }
  .hero-mark { top: 38%; width: clamp(150px, 42vw, 220px); }
  .collapse-ca { top: 38%; font-size: clamp(11px, 3.3vw, 18px); }
  .hero-hint { display: none; }
  .nav-right .chip { display: none; }
  .feedbar .all { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}
