/* TRACER: night survey. One scene under everything; type floats on it. */
@font-face { font-family: 'Geist'; src: url(/assets/fonts/Geist.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(/assets/fonts/GeistMono.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --night: #07080a;
  --contour: #1c2024;
  --ash: #8a8f94;
  --cream: #ede6d6;
  --amber: #f2b33d;
  --signal: #ff5a45;
  --cleared: #6fd3e6;
  --edge: max(16px, 1.35vw);
  --head: clamp(42px, 5.3vw, 150px);
  --mono: 'Geist Mono', ui-monospace, monospace;
  --sans: 'Geist', system-ui, sans-serif;
  --cream-10: var(--cream-10);
  --cream-20: var(--cream-20);
  --cream-32: var(--cream-32);
  --cream-04: var(--cream-04);
  --night-55: var(--night-55);
  --ash-75: var(--ash-75);
  --amber-50: var(--amber-50);
  --amber-60: var(--amber-60);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}
* { box-sizing: border-box; }
html { background: var(--night); overflow-x: clip; }
body {
  margin: 0; color: var(--cream); background: var(--night);
  font: 400 16px/1.4 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
a { color: inherit; }
::selection { background: var(--amber); color: var(--night); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

#ground { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; display: block; z-index: 0; }
.letterbox { position: fixed; left: 0; right: 0; top: 0; height: 13vh; background: var(--night); transform: translateY(-101%); z-index: 3; pointer-events: none; }
.letterbox::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--contour); }

/* header rig */
.rig {
  position: fixed; z-index: 10; top: 0; left: 0; right: 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 16px var(--edge);
}
.mast { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; font-size: 20px; letter-spacing: -0.01em; justify-self: start; }
.mast img { width: 40px; height: 40px; display: block; }
.waypoint { margin: 0; display: flex; align-items: center; gap: 12px; font: 400 12px/1 var(--mono); color: var(--ash); white-space: nowrap; }
.tick { width: 74px; height: 6px; background: radial-gradient(circle, var(--ash) 0.9px, transparent 1.4px) 0 50% / 7px 6px repeat-x; opacity: 0.8; }
.tick:first-child { transform: scaleX(-1); }
#waypoint { color: var(--cream); min-width: 15ch; text-align: center; }
.kit { justify-self: end; display: flex; align-items: center; gap: 6px; }
.chip, .glyph {
  display: inline-flex; align-items: center; height: 32px; border: 0; border-radius: 8px;
  background: var(--cream-10); color: var(--cream); font: 500 13px/1 var(--sans);
  padding: 0 12px; text-decoration: none; cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.glyph { width: 32px; padding: 0; justify-content: center; }
.chip:hover, .glyph:hover { background: var(--cream-20); }
.ca-chip { font-family: var(--sans); font-size: 13px; color: var(--ash); }
.ca-chip:disabled { cursor: default; }
.ca-chip.is-live { color: var(--cream); }
.buy { background: var(--cream); color: var(--night); }
.buy:hover { background: var(--amber); }

/* hero */
main { position: relative; z-index: 2; }
.hero { position: relative; height: 100vh; height: 100svh; min-height: 620px; }
.headline {
  position: absolute; left: var(--edge); top: calc(64px + 4vh); margin: 0;
  font-weight: 500; font-size: var(--head); line-height: 0.98; letter-spacing: -0.035em;
  max-width: 8.6em; min-width: 0; overflow-wrap: anywhere; word-break: keep-all; hyphens: none;
  text-wrap: balance;
}
.headline .line { overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.headline.is-case { font-size: calc(var(--head) * 0.82); max-width: 9.5em; }

.dossier { position: absolute; left: var(--edge); bottom: calc(var(--edge) + 6px); width: min(560px, 42vw); }
.dossier-ask { display: block; font-size: 16px; font-weight: 500; color: var(--cream); margin-bottom: 12px; }
.dossier-row {
  display: flex; align-items: stretch; border: 2px solid var(--cream);
  background: var(--night);
  transition: border-color 0.3s var(--ease-out);
}
.dossier-row:focus-within { border-color: var(--amber); }
#ca {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--cream);
  font: 400 16px/1 var(--mono); padding: 22px 18px; outline: none;
}
#ca::placeholder { color: var(--cream); opacity: 0.62; }
.go {
  border: 0; margin: 0; padding: 0 34px; background: var(--amber); color: var(--night);
  font: 600 17px/1 var(--sans); white-space: nowrap; cursor: pointer; transition: background-color 0.25s var(--ease-out);
}
.go:hover { background: var(--cream); }
.go:focus-visible { background: var(--cream); outline: 2px solid var(--amber); outline-offset: 3px; }
.go:active { transform: translateY(1px); }
.go:disabled { background: var(--ash); cursor: default; }
body[data-trace="running"] .go { background: var(--cream); cursor: progress; }
body[data-trace="fail"] .go { background: var(--signal); }
body[data-trace="done"] .go { background: var(--cleared); }
.dossier-note { margin: 10px 0 0; font-size: 13px; line-height: 1.4; color: var(--ash); max-width: 52ch; }
.dossier-note.is-error { color: var(--signal); }

.brief {
  position: absolute; right: var(--edge); bottom: calc(var(--edge) + 92px); margin: 0;
  width: min(30vw, 400px); font-size: 19px; line-height: 1.28; letter-spacing: -0.01em;
  transition: opacity 0.5s var(--ease-out);
}
body:not([data-trace="idle"]) .brief { opacity: 0; pointer-events: none; }

.telemetry {
  position: absolute; right: var(--edge); bottom: calc(var(--edge) + 6px);
  display: grid; justify-items: end; gap: 3px; font: 400 11px/1.3 var(--mono); color: var(--ash);
  font-variant-numeric: tabular-nums;
}
.telemetry span:first-child { color: var(--cream); }

/* case log */
.ledger {
  position: absolute; right: var(--edge); top: 84px; width: min(390px, 29vw);
  max-height: calc(100svh - 84px - 150px); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--contour) transparent;
  opacity: 0; transform: translateY(12px); transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out); pointer-events: none;
}
body:not([data-trace="idle"]) .ledger { opacity: 1; transform: none; pointer-events: auto; }
.ledger-head { font-size: 14px; color: var(--ash); margin-bottom: 14px; }
.ledger-head a { color: var(--cream); }
.ledger-steps { list-style: none; margin: 0; padding: 0; }
.entry { padding: 10px 0 12px; border-top: 1px solid var(--contour); }
.entry-step { display: flex; justify-content: space-between; gap: 12px; font: 400 12px/1.3 var(--mono); color: var(--ash); }
.entry-ms { font-variant-numeric: tabular-nums; }
.entry-line { margin: 6px 0 0; font-size: 15px; line-height: 1.38; color: var(--cream); min-height: 1.38em; }
.entry.is-waiting { opacity: 0.38; }
.entry.is-live .entry-step { color: var(--amber); }
.entry.is-live .entry-step::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 8px; vertical-align: 1px; background: var(--amber); animation: blink 0.9s steps(2) infinite; }
.entry-line.is-pending { color: var(--ash); }
.proof { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 7px; }
.proof a { font: 400 11.5px/1.3 var(--mono); color: var(--amber); text-decoration: none; border-bottom: 1px dotted var(--amber-50); }
.proof a:hover { border-bottom-style: solid; }

.verdictless { border-top: 1px solid var(--ash); padding-top: 14px; margin-top: 4px; }
.verdictless-text { margin: 0 0 12px; font-size: 17px; line-height: 1.32; letter-spacing: -0.01em; }
.findings { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.finding { display: grid; grid-template-columns: 9px 1fr; gap: 10px; font-size: 13.5px; line-height: 1.35; color: var(--cream); }
.finding::before { content: ''; width: 9px; height: 9px; margin-top: 4px; background: var(--amber); }
.finding.is-signal::before { background: var(--signal); }
.finding.is-clear::before { background: var(--cleared); }
.finding a { color: var(--ash); font-family: var(--mono); font-size: 11.5px; margin-left: 6px; }
.case-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.case-actions a, .case-actions button { font: 500 13px/1 var(--sans); }
.byline { margin: 12px 0 0; font: 400 11px/1.4 var(--mono); color: var(--ash); }

/* detection marks pinned to wallets on the terrain */
.marks { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.mark {
  --c: var(--amber);
  position: absolute; left: 0; top: 0; width: 40px; height: 40px; margin: -20px 0 0 -20px;
  color: var(--c); will-change: transform; opacity: 0; transition: opacity 0.4s var(--ease-out);
}
.mark.is-on { opacity: 1; }
.mark.is-signal { --c: var(--signal); }
.mark.is-clear { --c: var(--cleared); }
.mark.is-quiet { --c: var(--cream); width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.mark-frame {
  position: absolute; inset: 0;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / 9px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 0 / 1.5px 9px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 9px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 0 / 1.5px 9px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 9px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) 0 100% / 1.5px 9px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 9px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) 100% 100% / 1.5px 9px no-repeat;
  animation: lock 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.mark-pip { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; background: var(--c); border-radius: 50%; }
.mark-pip::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--c); animation: breathe 2.2s var(--ease-out) infinite; }
.mark-tag {
  position: absolute; left: -0.75px; bottom: calc(100% + 4px); white-space: nowrap;
  background: var(--c); color: var(--night); font: 500 11px/1 var(--mono); padding: 4px 6px 3px;
  clip-path: inset(0 100% 0 0); animation: wipe 0.45s 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.mark.is-quiet .mark-tag { display: none; }
@keyframes lock { from { transform: scale(1.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wipe { to { clip-path: inset(0 0 0 0); } }
@keyframes breathe { 0% { transform: scale(1); opacity: 0.6; } 70%, 100% { transform: scale(3.8); opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }

/* chapters */
.chapter { position: relative; height: 100vh; height: 100svh; min-height: 560px; }
.chapter-title {
  position: absolute; left: var(--edge); top: calc(64px + 13vh); margin: 0; max-width: 9em;
  font-weight: 500; font-size: var(--head); line-height: 0.98; letter-spacing: -0.035em;
  min-width: 0; overflow-wrap: anywhere; word-break: keep-all; text-wrap: balance;
}
.chapter-title .line { overflow: hidden; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.chapter-copy { position: absolute; left: var(--edge); bottom: calc(var(--edge) + 6px); margin: 0; max-width: 40ch; font-size: 20px; line-height: 1.28; letter-spacing: -0.01em; }
.readout { position: absolute; right: var(--edge); bottom: calc(var(--edge) + 6px); margin: 0; text-align: right; font: 400 11px/1.55 var(--mono); color: var(--ash); }

/* recent cases */
.casefiles { position: relative; padding: 22vh var(--edge) 12vh; background: linear-gradient(to bottom, transparent, var(--night) 24vh); }
.casefiles .chapter-title { position: static; margin-bottom: 18px; }
.casefiles-copy { margin: 0 0 40px; color: var(--ash); font-size: 18px; }
.casefile-list { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--contour); }
.casefile a {
  display: grid; grid-template-columns: 44px minmax(120px, 1.1fr) 3fr auto auto; align-items: center; gap: 22px;
  padding: 16px 0; border-top: 1px solid var(--contour); text-decoration: none; transition: background-color 0.3s var(--ease-out);
}
.casefile a:hover { background: var(--cream-04); }
.casefile a > * { transition: transform 0.3s var(--ease-out); }
.casefile a:hover > * { transform: translateX(10px); }
.casefile img, .casefile .noimg { width: 44px; height: 44px; object-fit: cover; background: var(--contour); display: block; }
.casefile-name { font-size: 20px; font-weight: 500; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.casefile-line { color: var(--ash); font-size: 15px; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.casefile-count { font: 400 12px/1 var(--mono); color: var(--amber); white-space: nowrap; }
.casefile-count.is-zero { color: var(--cleared); }
.casefile-when { font: 400 12px/1 var(--mono); color: var(--ash); white-space: nowrap; min-width: 9ch; text-align: right; }
.casefile-empty { padding: 26px 0; border-top: 1px solid var(--contour); color: var(--ash); font-size: 16px; }

.base { position: relative; z-index: 2; background: var(--night); display: flex; justify-content: space-between; gap: 30px; padding: 28px var(--edge) 34px; border-top: 1px solid var(--contour); color: var(--ash); font-size: 13px; }
.base p { margin: 0; max-width: 70ch; }
.base-links { display: flex; gap: 18px; }
.base-links a { text-decoration: none; color: var(--cream); }

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

@media (max-width: 1100px) {
  .brief { width: 36vw; font-size: 17px; }
  .ledger { width: 36vw; }
}

@media (max-width: 760px) {
  .rig { grid-template-columns: auto 1fr; padding: 12px 14px; }
  .waypoint { display: none; }
  .mast span { font-size: 18px; }
  .mast img { width: 34px; height: 34px; }
  .kit { gap: 4px; }
  .chip, .glyph { height: 30px; padding: 0 9px; font-size: 12px; }
  .glyph { width: 30px; padding: 0; }
  .ca-chip { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 30px; }
  .hero { height: auto; min-height: 100svh; display: flex; flex-direction: column; padding: 76px 14px 18px; }
  .headline, .headline.is-case { position: static; font-size: 12.4vw; max-width: none; }
  .brief { position: static; width: auto; font-size: 17px; margin-top: 22px; max-width: 34ch; }
  body:not([data-trace="idle"]) .brief { display: none; }
  .telemetry { display: none; }
  .ledger { position: static; width: auto; max-height: none; overflow: visible; margin-top: 22px; order: 3; }
  body[data-trace="idle"] .ledger { display: none; }
  .dossier { position: static; width: auto; margin-top: auto; padding-top: 28px; order: 2; }
  body:not([data-trace="idle"]) .dossier { margin-top: 24px; }
  .chapter { min-height: 100svh; height: auto; display: flex; flex-direction: column; justify-content: space-between; padding: 22vh 14px 22px; }
  .chapter-title { position: static; font-size: 11.2vw; }
  .chapter-copy { position: static; font-size: 17px; margin-top: 30vh; }
  .readout { position: static; text-align: left; margin-top: 14px; }
  .casefiles { padding: 16vh 14px 10vh; }
  .casefile a { grid-template-columns: 40px 1fr auto; gap: 12px; }
  .casefile img, .casefile .noimg { width: 40px; height: 40px; }
  .casefile-line, .casefile-when { display: none; }
  .base { flex-direction: column; padding: 24px 14px 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.brief-latest { margin: 14px 0 0; font: 400 14px/1.4 var(--sans); color: var(--ash); }
.brief-latest a { color: var(--amber); text-decoration: none; border-bottom: 1px dotted var(--amber-60); }
body[data-trace="idle"] .mark.k-holder .mark-tag,
body[data-trace="idle"] .mark.k-sniper .mark-tag { display: none; }
body[data-trace="idle"] .mark.k-sniper { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.marks { transition: opacity 0.6s var(--ease-out); }
.marks.is-away { opacity: 0.45; }
.marks.is-away .mark-tag { display: none; }
