:root {
  --bg: #040404;
  --ink: #e8e4da;
  --dim: rgba(232, 228, 218, 0.52);
  --faint: rgba(232, 228, 218, 0.28);
  --hairline: rgba(232, 228, 218, 0.16);
  --moss: #94a878;
  --ember: #e05a3a;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* ---------- chrome ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  font-size: 10px;
  letter-spacing: 0.22em;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  letter-spacing: 0.34em;
}

.mark {
  width: 9px;
  height: 9px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(232, 228, 218, 0.5);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-links a { color: var(--dim); transition: color 0.25s; }
.nav-links a:hover { color: var(--ink); }

.pill {
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 9px 16px;
  color: var(--ink) !important;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}

.pill:hover { border-color: var(--ink); }

.pill.solid {
  background: var(--ink);
  color: #0a0a08 !important;
}

.pill.solid:hover { background: #fff; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  cursor: none;
}

#scene, #veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#scene { z-index: 1; }
#cards { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
#veil  { z-index: 3; pointer-events: none; }

.hero-copy {
  position: absolute;
  z-index: 4;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 900px);
  text-align: center;
  pointer-events: none;
  animation: rise 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both 0.3s;
}

@keyframes rise {
  from { opacity: 0; transform: translate(-50%, 18px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.kicker {
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--dim);
}

.hero-copy h1 {
  margin-top: 22px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 6.2vw, 84px);
  line-height: 1.04;
  letter-spacing: -0.01em;
}

.hero-copy h1 span { display: block; }
.hero-copy h1 em { font-style: italic; color: #fdfbf4; }

.sub {
  margin-top: 26px;
  font-size: 9.5px;
  letter-spacing: 0.34em;
  color: var(--dim);
}

.hint {
  margin-top: 14px;
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--faint);
  animation: pulse 2.4s ease-in-out infinite;
  transition: opacity 1.2s;
}

.hint.gone { opacity: 0; }

@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.9; }
}

.corner {
  position: absolute;
  z-index: 4;
  bottom: 26px;
  font-size: 8.5px;
  letter-spacing: 0.22em;
  line-height: 1.9;
  color: var(--faint);
}

.corner-bl { left: 28px; }
.corner-br { right: 28px; text-align: right; }

.scroll-cue {
  position: absolute;
  z-index: 4;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 8px;
  letter-spacing: 0.34em;
  color: var(--faint);
}

.scroll-cue .line {
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--faint), transparent);
  animation: drip 2.6s ease-in-out infinite;
  transform-origin: top;
}

@keyframes drip {
  0% { transform: scaleY(0); }
  45% { transform: scaleY(1); }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- signal cards ---------- */

.sig-card {
  position: absolute;
  width: 178px;
  padding: 7px 8px 8px;
  border: 1px solid rgba(232, 228, 218, 0.2);
  background: rgba(4, 4, 4, 0.6);
  backdrop-filter: blur(2px);
  font-size: 8px;
  letter-spacing: 0.08em;
  line-height: 1.75;
  color: var(--dim);
  opacity: 0;
  will-change: opacity;
}

.sig-card .spec {
  display: block;
  width: 100%;
  height: 24px;
  margin-bottom: 6px;
  opacity: 0.9;
}

.sig-card .r1 { color: var(--ink); letter-spacing: 0.12em; }

.sig-card.anomaly { border-color: rgba(224, 90, 58, 0.55); }
.sig-card.anomaly .r1 { color: var(--ember); }

/* ---------- cursor light ---------- */

.cursor {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  pointer-events: none;
  will-change: transform;
}

.cursor i {
  position: absolute;
  top: -14px;
  left: -14px;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(232, 228, 218, 0.4);
  border-radius: 50%;
}

.cursor::after {
  content: "";
  position: absolute;
  top: -1.5px;
  left: -1.5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 244, 214, 0.9);
}

/* ---------- sections ---------- */

.section {
  padding: 140px 28px 120px;
  max-width: 1060px;
  margin: 0 auto;
}

.section h2, .band h2 {
  margin-top: 26px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 4.6vw, 58px);
  line-height: 1.08;
}

.lede {
  margin-top: 26px;
  max-width: 560px;
  font-size: 12px;
  line-height: 2.1;
  color: var(--dim);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
  margin-top: 90px;
}

.cell {
  border-top: 1px solid var(--hairline);
  padding-top: 22px;
}

.cell .idx {
  font-size: 8.5px;
  letter-spacing: 0.28em;
  color: var(--faint);
}

.cell h3 {
  margin-top: 16px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
}

.cell p:last-child {
  margin-top: 14px;
  font-size: 10.5px;
  line-height: 2;
  color: var(--dim);
}

/* ---------- demo ---------- */

.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  margin-top: 70px;
  align-items: start;
}

.demo-head {
  font-size: 8.5px;
  letter-spacing: 0.28em;
  color: var(--faint);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.clip-list { display: flex; flex-direction: column; }

.clip-row {
  display: flex;
  align-items: baseline;
  gap: 14px;
  width: 100%;
  padding: 13px 10px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--hairline);
  color: var(--dim);
  font-family: var(--mono);
  text-align: left;
  cursor: pointer;
  transition: background 0.25s, color 0.25s;
}

.clip-row:hover, .clip-row.active { background: rgba(232, 228, 218, 0.05); color: var(--ink); }
.clip-row.active .clip-run { color: var(--moss); }

.clip-idx { font-size: 9px; color: var(--faint); }
.clip-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.clip-title { font-size: 10px; letter-spacing: 0.14em; }
.clip-story { font-size: 9px; line-height: 1.7; color: var(--faint); letter-spacing: 0.04em; }
.clip-run { font-size: 8.5px; letter-spacing: 0.22em; color: var(--faint); }

.demo-inputs { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.demo-inputs .pill { font-size: 8.5px; letter-spacing: 0.2em; cursor: pointer; background: none; font-family: var(--mono); }
.file-label { display: inline-block; }

.demo-note {
  margin-top: 20px;
  font-size: 8px;
  letter-spacing: 0.16em;
  line-height: 2;
  color: var(--faint);
}

.demo-right {
  border: 1px solid var(--hairline);
  padding: 22px 22px 18px;
  background: rgba(232, 228, 218, 0.02);
}

#spec-canvas {
  width: 100%;
  height: 96px;
  image-rendering: pixelated;
  background: #070706;
  border: 1px solid var(--hairline);
}

.score-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
}

.score-big {
  font-family: var(--serif);
  font-size: 54px;
  line-height: 1;
}

.score-cap {
  margin-top: 8px;
  font-size: 8px;
  letter-spacing: 0.2em;
  color: var(--faint);
}

.verdict { font-size: 10px; letter-spacing: 0.24em; padding-bottom: 4px; }
.v-ok { color: var(--moss); }
.v-warn { color: #d8b45a; }
.v-flag { color: var(--ember); }

.meter {
  position: relative;
  height: 3px;
  margin-top: 20px;
  background: rgba(232, 228, 218, 0.1);
}

.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  transition: width 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.meter-fill.v-ok { background: var(--moss); }
.meter-fill.v-warn { background: #d8b45a; }
.meter-fill.v-flag { background: var(--ember); }

.meter-mark {
  position: absolute;
  left: 99%;
  top: -4px;
  width: 1px;
  height: 11px;
  background: var(--ember);
}

.meter-cap {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 7.5px;
  letter-spacing: 0.18em;
  color: var(--faint);
}

.lik-list { margin-top: 24px; display: flex; flex-direction: column; gap: 9px; }

.lik-row {
  display: grid;
  grid-template-columns: 110px 1fr 34px;
  gap: 12px;
  align-items: center;
  font-size: 8.5px;
  letter-spacing: 0.16em;
  color: var(--dim);
}

.lik-row.lik-unknown { color: var(--ink); }

.lik-bar { height: 2px; background: rgba(232, 228, 218, 0.08); position: relative; display: block; }
.lik-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--dim);
  transition: width 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.lik-unknown .lik-bar i { background: var(--ink); }
.lik-val { text-align: right; }

.band {
  padding: 150px 28px 160px;
  text-align: center;
  border-top: 1px solid var(--hairline);
}

.band h2 span { display: block; }
.band h2 em { font-style: italic; }

.cta-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 54px;
  font-size: 9.5px;
  letter-spacing: 0.24em;
}

/* ---------- footer ---------- */

.footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 44px 28px 52px;
  border-top: 1px solid var(--hairline);
  font-size: 8.5px;
  letter-spacing: 0.2em;
  line-height: 2.1;
}

.wordmark-sm { letter-spacing: 0.34em; font-weight: 500; font-size: 10px; }
.dim { color: var(--faint); }
.center { text-align: center; }
.right { text-align: right; }

/* ---------- reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1s cubic-bezier(0.2, 0.7, 0.2, 1), transform 1s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.in { opacity: 1; transform: none; }

/* ---------- grain ---------- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.05;
  /* background-image set at runtime from a small canvas-generated noise tile */
  background-repeat: repeat;
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .sig-card[data-slot="7"], .sig-card[data-slot="8"] { display: none; }
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; gap: 0; }
  .cell { padding: 26px 0; }
  .demo-grid { grid-template-columns: 1fr; }
  .sig-card[data-slot="4"], .sig-card[data-slot="5"], .sig-card[data-slot="6"] { display: none; }
}

@media (max-width: 640px) {
  .nav { padding: 18px 16px; }
  .nav-links { gap: 14px; }
  .nav-links a:not(.pill) { display: none; }
  .corner-bl { left: 16px; }
  .corner-br { right: 16px; }
  .sig-card { width: 148px; }
  .sig-card[data-slot="1"], .sig-card[data-slot="3"] { display: none; }
  .hero { cursor: auto; }
  .cursor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy, .hint, .scroll-cue .line { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
