@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&display=swap");
:root {
  --ink: #04060c;
  --surface: #0a0d16;
  --elev: #121622;
  --mint: #97fce4;
  --teal: #50d2c1;
  --text: rgba(255, 255, 255, 0.92);
  --text-body: rgba(255, 255, 255, 0.78);
  --muted: rgba(255, 255, 255, 0.62);
  --line: rgba(255, 255, 255, 0.1);
  --mint-line: rgba(151, 252, 228, 0.28);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scrollbar-color: rgba(151, 252, 228, 0.35) var(--ink); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: rgba(151, 252, 228, 0.35); }

body {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 12px;
  border: 1px solid var(--mint-line);
  pointer-events: none;
  z-index: 60;
}

::selection { background: var(--mint); color: var(--ink); }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}
.skip:focus {
  left: 16px;
  z-index: 80;
  background: var(--mint);
  color: var(--ink);
  padding: 8px 12px;
}

.nav,
.nav.is-compact {
  position: absolute;
  top: calc(100vh - 76px);
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  height: auto;
  padding: 0 7vw 28px;
  background: transparent;
  border: 0;
  backdrop-filter: none;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 22px; height: 22px; }
.brand-name {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 13px;
  letter-spacing: -0.02em;
}

.nav-links { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px;
}
.nav-links a:hover,
.nav-links a.is-active { color: var(--mint); }

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: 18vh 7vw 112px;
  overflow: hidden;
  background: var(--ink);
}

#trace {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0 28%, #000 48%);
  mask-image: linear-gradient(90deg, transparent 0 28%, #000 48%);
}

.hero-copy { position: relative; z-index: 2; max-width: 680px; }
.hero h1 {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-weight: 500;
  font-size: clamp(64px, 9.4vw, 128px);
  letter-spacing: -0.045em;
  line-height: 0.9;
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--mint);
  display: block;
  font-size: clamp(22px, 2.6vw, 36px);
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 0.45em 0 0.2em;
  max-width: 22em;
}
.hero-rule { width: min(180px, 30vw); height: 1px; background: var(--mint); margin-top: 28px; }

.section { padding: 88px 7vw; scroll-margin-top: 24px; background: var(--ink); }
.section.alt { background: var(--surface); }
.section-head { margin-bottom: 36px; max-width: 40rem; }
.section-head .lede { margin-top: 10px; }
.section h2, .display {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.section h2 { font-size: clamp(28px, 3vw, 40px); }
.display { font-size: clamp(28px, 3.4vw, 44px); color: var(--text); }
.lede, .note { color: var(--muted); }
.lede { font-size: 17px; max-width: 62ch; }
.note { font-size: 14px; }

.editorial { margin-top: 28px !important; display: grid; gap: 18px; max-width: 72ch; }
.copy-cols { display: grid; gap: 14px; color: var(--text-body); font-size: 16.5px; max-width: 68ch; }

.chapter {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.7fr);
  gap: 36px;
  align-items: center;
  padding: 36px 0;
  border-top: 1px solid var(--line);
}
.chapter.reverse { grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.2fr); }
.chapter.reverse .chapter-copy { order: 2; }
.chapter.reverse .chapter-viz { order: 1; }
.chapter-index {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--mint);
  margin-bottom: 8px;
}
.chapter h3 {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: clamp(24px, 2.4vw, 32px);
  letter-spacing: -0.03em;
  font-weight: 500;
}
.eyebrow {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.chapter-copy > p:last-child { margin-top: 14px; max-width: 62ch; color: var(--text-body); }
.chapter-viz { background: transparent; border: 0; min-height: 0; padding: 0; }
.diagram { width: 100%; height: auto; }

.cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.btn, .view, .status, .blog-kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--mint-line);
  color: var(--text);
}
.btn.solid { background: var(--mint); color: var(--ink); border-color: var(--mint); }
.btn.solid:hover { background: var(--teal); border-color: var(--teal); }
.btn.ghost { color: var(--mint); }
.btn.ghost:hover { background: rgba(151, 252, 228, 0.08); }
.status, .blog-kicker { color: var(--mint); }
.view { color: var(--mint); }

.ind-layout { display: grid; gap: 0; border-top: 1px solid var(--line); }
.ind-stack { display: contents; }
.ind-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  min-height: 0;
}
.ind-thumb { height: 120px; overflow: hidden; background: #000; }
.ind-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ind-body { padding: 0; display: grid; gap: 6px; }
.ind-card h3 {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 22px;
  letter-spacing: -0.03em;
  font-weight: 500;
}
.ind-card p { color: var(--text-body); font-size: 15px; }

.research-lead {
  display: grid;
  grid-template-columns: 1.5fr 0.7fr;
  gap: 32px;
  padding: 28px 0 32px;
  border-top: 1px solid var(--mint-line);
  border-bottom: 1px solid var(--line);
}
.research-lead h3, .rail-card h3 {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.research-lead h3 { font-size: clamp(28px, 3vw, 40px); line-height: 1.08; margin: 10px 0 12px; }
.research-lead .excerpt, .rail-card p { color: var(--text-body); }
.research-lead .excerpt { font-size: 17px; max-width: 68ch; }
.research-aside { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
a.research-lead:hover h3, a.rail-card:hover h3 { color: var(--mint); }
.research-rail { display: grid; grid-template-columns: repeat(3, 1fr); }
.rail-card { padding: 28px 24px 28px 0; border-right: 1px solid var(--line); }
.rail-card:last-child { border-right: 0; padding-right: 0; padding-left: 24px; }
.rail-card:nth-child(2) { padding-left: 24px; }
.rail-card h3 { font-size: 20px; margin: 8px 0 10px; }
.blog-kicker { margin-bottom: 8px; }

.connect-block .lede { margin-top: 8px; }
.connect-block .note { margin-top: 12px; }

.disclaimer {
  padding: 36px 7vw 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.disclaimer h2 {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--text);
}
.disclaimer ul { padding-left: 16px; list-style: disc; }
.disclaimer li { margin: 6px 0; }

footer {
  padding: 18px 7vw 36px;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 13px;
  color: var(--muted);
}

.reveal { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .nav, .nav.is-compact {
    top: auto;
    position: relative;
    flex-wrap: wrap;
    padding: 18px 6vw 0;
  }
  .hero { min-height: 0; padding: 28px 6vw 48px; }
  .hero-copy { max-width: none; }
  .chapter, .chapter.reverse, .ind-card, .research-lead, .research-rail, .copy-cols {
    grid-template-columns: 1fr;
  }
  .chapter.reverse .chapter-copy, .chapter.reverse .chapter-viz { order: unset; }
  .ind-card { grid-template-columns: 1fr; }
  .rail-card, .rail-card:last-child, .rail-card:nth-child(2) {
    padding: 22px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .section { padding: 64px 6vw; }
  #trace { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: "IBM Plex Mono", "IBM Plex Sans", monospace;
  background: var(--ink);
}
body::before { display: none; }
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 70;
  background:
    repeating-linear-gradient(to bottom, rgba(151, 252, 228, 0.04) 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}
#trace { display: none; }
.nav, .nav.is-compact {
  position: sticky;
  top: 0;
  height: 64px;
  align-items: center;
  padding: 0 4vw;
  background: var(--ink);
  border-bottom: 1px solid var(--teal);
}
.nav-links a {
  border: 1px solid var(--teal);
  color: var(--mint);
}
.hero {
  align-items: center;
  background: transparent;
}
.hero h1, .display, .section h2, .chapter h3, .ind-card h3, .research-lead h3, .rail-card h3, .brand-name {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
}
.hero h1 { color: var(--mint); font-size: clamp(40px, 6vw, 72px); letter-spacing: -0.04em; }
.hero h1 em { color: var(--teal); font-style: normal; }
.hero h1::after,
.hero h1 .is-caret::after {
  content: "▍";
  color: var(--mint);
  margin-left: 4px;
  animation: blink 1s steps(1) infinite;
}
.hero h1.is-typing::after { content: none; }
@keyframes blink { 50% { opacity: 0; } }

.draw path,
.draw line,
.draw rect {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.draw .guide {
  stroke-dasharray: 6 5;
  stroke-dashoffset: 0;
}
.draw .fill-bar {
  transform-box: fill-box;
  transform-origin: left center;
  transform: scaleX(0);
}
.chapter.is-in .draw .stroke {
  animation: draw-stroke 900ms var(--ease) forwards;
}
.chapter.is-in .draw .fill-bar {
  animation: fill-bar 700ms var(--ease) forwards;
}
@keyframes draw-stroke { to { stroke-dashoffset: 0; } }
@keyframes fill-bar {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.ind-thumb img {
  transform: scale(1.04);
  clip-path: inset(0 100% 0 0);
  transition: transform 480ms var(--ease), clip-path 700ms var(--ease);
}
.ind-card.is-in .ind-thumb img { clip-path: inset(0 0 0 0); }
.ind-card:hover .ind-thumb img { transform: scale(1.08); }

@media (prefers-reduced-motion: reduce) {
  .draw path,
  .draw line,
  .draw rect,
  .draw .stroke { stroke-dashoffset: 0; stroke-dasharray: none; }
  .draw .fill-bar { transform: none; }
  .ind-thumb img { clip-path: none; transform: none; }
}

@media (max-width: 720px) {
  .nav, .nav.is-compact {
    height: auto;
    align-items: flex-start;
    flex-wrap: wrap;
    row-gap: 12px;
    padding: 14px 5vw 12px;
  }
  .nav-links { width: 100%; justify-content: flex-start; }
}
