/* ============================================================
   PeyLabs — Experimental Grid Design System
   ============================================================ */

:root {
  --lab-black: #080A0D;
  --graphite: #151A20;
  --research-white: #F4F6F2;
  --precision-gray: #87919A;
  --electric-lime: #C8FF4A;
  --research-cyan: #63E6E2;
  --warm-titanium: #B8B6A8;
  --deep-green: #12251F;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --border: 1px solid rgba(184, 182, 168, 0.22);
  --container: min(1240px, calc(100% - 3rem));
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

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

body {
  font-family: var(--font-display);
  background: var(--lab-black);
  color: var(--research-white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

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

ul, ol { list-style: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: var(--electric-lime);
  color: var(--lab-black);
  font-weight: 600;
}

.skip-link:focus { top: 1rem; }

.container {
  width: var(--container);
  margin-inline: auto;
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--precision-gray);
}

.section-index {
  margin-bottom: 1.25rem;
}

.lime { color: var(--electric-lime); }
.cyan { color: var(--research-cyan); }

/* Typography */
.headline-xl {
  font-size: clamp(2.6rem, 7vw, 5.5rem);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: -0.03em;
  max-width: 14ch;
}

.headline-lg {
  font-size: clamp(2rem, 4.8vw, 3.75rem);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.025em;
  max-width: 18ch;
  margin-bottom: 2.5rem;
}

.headline-display {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}

.headline-cinematic {
  font-size: clamp(2.2rem, 5.5vw, 4.8rem);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.03em;
  max-width: 16ch;
}

.headline-cinematic em {
  font-style: normal;
  color: var(--electric-lime);
}

.subhead {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  color: var(--warm-titanium);
  max-width: 36ch;
  margin: 1rem 0 2.5rem;
}

.lead-text {
  font-size: 1.15rem;
  color: var(--warm-titanium);
  max-width: 42ch;
  margin: 1.5rem 0 2rem;
}

.section {
  padding: clamp(5rem, 12vw, 9rem) 0;
  position: relative;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.35rem;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn-primary {
  background: var(--electric-lime);
  color: var(--lab-black);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #d8ff7a;
  outline: none;
}

.btn-ghost {
  border-color: rgba(184, 182, 168, 0.35);
  color: var(--research-white);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  border-color: var(--research-cyan);
  color: var(--research-cyan);
  outline: none;
}

.btn-tech {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(99, 230, 226, 0.45);
  color: var(--research-cyan);
  background: rgba(8, 10, 13, 0.7);
  backdrop-filter: blur(6px);
}

.btn-tech:hover,
.btn-tech:focus-visible {
  border-color: var(--electric-lime);
  color: var(--electric-lime);
  outline: none;
}

/* ============================================================
   NAVIGATION — Instrument Panel
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 10, 13, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: var(--border);
}

.nav {
  width: var(--container);
  margin-inline: auto;
  min-height: var(--header-h);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-wordmark {
  display: flex;
  flex-direction: column;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  line-height: 1.15;
  font-weight: 500;
}

.nav-links {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 2vw, 1.75rem);
}

.nav-links-cta {
  display: none;
}

.nav-links a {
  font-size: 0.82rem;
  color: var(--precision-gray);
  letter-spacing: 0.02em;
  position: relative;
  padding: 0.25rem 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--electric-lime);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--research-white);
  outline: none;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  transform: scaleX(1);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.lab-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--precision-gray);
}

.lab-status-label {
  display: none;
}

@media (min-width: 1100px) {
  .lab-status-label { display: inline; }
}

.lab-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--electric-lime);
  box-shadow: 0 0 0 0 rgba(200, 255, 74, 0.5);
  animation: pulse-dot 2.4s ease-out infinite;
}

.lab-status-dot.exploring {
  background: var(--research-cyan);
  box-shadow: 0 0 0 0 rgba(99, 230, 226, 0.5);
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(200, 255, 74, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(200, 255, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 255, 74, 0); }
}

.nav-cta {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--electric-lime);
  white-space: nowrap;
}

.nav-cta:hover,
.nav-cta:focus-visible {
  color: #d8ff7a;
  outline: none;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  gap: 6px;
  flex-direction: column;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--research-white);
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  width: var(--container);
  margin-inline: auto;
  padding: 3rem 0 4rem;
  position: relative;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(135, 145, 154, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(135, 145, 154, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 70% 50%, black 20%, transparent 75%);
  pointer-events: none;
  animation: grid-drift 40s linear infinite;
}

@keyframes grid-drift {
  from { background-position: 0 0; }
  to { background-position: 48px 48px; }
}

.hero-content {
  position: relative;
  z-index: 1;
  padding-right: 1rem;
}

.hero-content .mono-label {
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.8rem, 6.5vw, 5.2rem);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--warm-titanium);
  max-width: 38ch;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--precision-gray);
}

.hero-tags li {
  position: relative;
  padding-left: 0.9rem;
}

.hero-tags li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  background: var(--research-cyan);
  transform: translateY(-50%);
}

.hero-viz {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 480px;
}

#prototype-canvas {
  width: min(100%, 520px);
  height: auto;
  aspect-ratio: 1;
  cursor: crosshair;
}

.proto-labels {
  position: absolute;
  inset: 8% 4%;
  pointer-events: none;
}

.proto-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--precision-gray);
  border-left: 1px solid rgba(99, 230, 226, 0.5);
  padding-left: 0.55rem;
  transition: transform 0.4s var(--ease);
}

.proto-label strong {
  display: block;
  color: var(--research-white);
  font-weight: 500;
  margin-top: 0.15rem;
}

.proto-label-a { top: 6%; left: 8%; }
.proto-label-b { top: 18%; right: 4%; }
.proto-label-c { bottom: 22%; left: 2%; }
.proto-label-d { bottom: 12%; right: 10%; color: var(--electric-lime); }

#rotate-system {
  margin-top: -1rem;
  position: relative;
  z-index: 2;
}

/* ============================================================
   01 — THE QUESTION
   ============================================================ */
.section-question {
  background: linear-gradient(180deg, var(--lab-black) 0%, var(--graphite) 50%, var(--lab-black) 100%);
}

.what-if-stage {
  position: relative;
  margin-top: 4rem;
  min-height: 420px;
  border: var(--border);
  background: rgba(18, 37, 31, 0.25);
  overflow: hidden;
}

.experimental-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 230, 226, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 230, 226, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
}

.what-if-core {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(3rem, 12vw, 8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: rgba(244, 246, 242, 0.06);
  pointer-events: none;
}

.what-if-list {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 420px;
}

.wif {
  position: absolute;
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.4vw, 0.9rem);
  letter-spacing: 0.06em;
  color: var(--warm-titanium);
  border: 1px solid rgba(184, 182, 168, 0.2);
  padding: 0.65rem 0.9rem;
  background: rgba(8, 10, 13, 0.65);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), border-color 0.3s;
}

.wif.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.wif:hover {
  border-color: var(--electric-lime);
  color: var(--research-white);
}

.wif-1 { top: 12%; left: 6%; }
.wif-2 { top: 28%; right: 8%; }
.wif-3 { top: 48%; left: 18%; }
.wif-4 { top: 62%; right: 14%; }
.wif-5 { bottom: 12%; left: 28%; }

/* ============================================================
   02 — RESEARCH MODEL
   ============================================================ */
.pathway {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  position: relative;
  margin-top: 1rem;
}

.pathway-line {
  position: absolute;
  top: 1.1rem;
  left: 4%;
  right: 4%;
  height: 1px;
  background: rgba(184, 182, 168, 0.2);
  z-index: 0;
}

.pathway-glow {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--electric-lime), var(--research-cyan));
  box-shadow: 0 0 12px rgba(200, 255, 74, 0.35);
  transition: width 1.8s var(--ease);
}

.pathway.is-active .pathway-glow {
  width: 100%;
}

.pathway-step {
  position: relative;
  z-index: 1;
  padding-top: 2.5rem;
}

.pathway-num {
  position: absolute;
  top: 0;
  left: 0;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--electric-lime);
  background: var(--lab-black);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  display: grid;
  place-items: center;
  color: var(--electric-lime);
}

.pathway-step h3 {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.pathway-step p {
  font-size: 0.85rem;
  color: var(--precision-gray);
}

/* ============================================================
   03 — DOMAINS
   ============================================================ */
.domains-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(184, 182, 168, 0.18);
  border: var(--border);
}

.domain-panel {
  background: var(--lab-black);
  padding: 2rem 1.75rem;
  min-height: 220px;
  transition: background 0.35s var(--ease);
}

.domain-panel:hover {
  background: var(--graphite);
}

.domain-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--electric-lime);
  display: block;
  margin-bottom: 1.25rem;
}

.domain-panel h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.domain-panel p {
  font-size: 0.92rem;
  color: var(--precision-gray);
}

/* ============================================================
   04 — EXPERIMENT
   ============================================================ */
.experiment-chamber {
  border: var(--border);
  background:
    linear-gradient(rgba(135, 145, 154, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(135, 145, 154, 0.05) 1px, transparent 1px),
    var(--graphite);
  background-size: 32px 32px, 32px 32px, auto;
  padding: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: 1.1fr 0.7fr 1.2fr;
  gap: 2rem;
  align-items: start;
}

.exp-hypothesis p {
  font-size: 1.35rem;
  margin-top: 0.75rem;
  max-width: 22ch;
  line-height: 1.35;
}

.exp-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.exp-node {
  width: 100%;
  text-align: center;
  padding: 0.7rem;
  border: 1px solid rgba(184, 182, 168, 0.25);
  color: var(--precision-gray);
}

.exp-node.active {
  border-color: var(--research-cyan);
  color: var(--research-cyan);
  box-shadow: inset 0 0 20px rgba(99, 230, 226, 0.08);
}

.exp-arrow {
  color: var(--precision-gray);
  opacity: 0.6;
}

.param-note {
  margin-bottom: 1rem;
}

.param {
  margin-bottom: 1.25rem;
}

.param > span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--precision-gray);
}

.param strong {
  display: block;
  font-size: 1.75rem;
  font-weight: 500;
  margin: 0.25rem 0 0.5rem;
  font-variant-numeric: tabular-nums;
}

.param-bar {
  height: 2px;
  background: rgba(184, 182, 168, 0.2);
  overflow: hidden;
}

.param-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--research-cyan), var(--electric-lime));
  transition: width 1.4s var(--ease);
}

.param.is-active .param-bar i {
  width: var(--w);
}

.exp-result {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-top: 1rem;
  border-top: var(--border);
}

.exp-result strong {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  color: var(--electric-lime);
}

/* ============================================================
   05 — PROTOTYPE LAB
   ============================================================ */
.proto-lab {
  border: var(--border);
  background: linear-gradient(160deg, #0d1210 0%, var(--lab-black) 45%, #10161c 100%);
  padding: 2rem;
}

.proto-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: var(--border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

.proto-meta span {
  display: block;
  color: var(--precision-gray);
  margin-bottom: 0.35rem;
}

.proto-meta strong {
  color: var(--research-cyan);
  font-weight: 500;
}

.proto-carousel {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.proto-item {
  flex: 0 0 min(220px, 70vw);
  scroll-snap-align: start;
  border: 1px solid rgba(184, 182, 168, 0.2);
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--precision-gray);
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}

.proto-item svg {
  width: 100px;
  height: 100px;
  margin: 0 auto 1rem;
}

.proto-item span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.proto-item:hover,
.proto-item:focus-visible {
  border-color: rgba(99, 230, 226, 0.5);
  color: var(--research-white);
  outline: none;
}

.proto-item.is-active {
  border-color: var(--electric-lime);
  color: var(--research-white);
  background: rgba(200, 255, 74, 0.04);
}

/* ============================================================
   06 — DIGITAL TWIN
   ============================================================ */
.twin-stage {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  border: var(--border);
  padding: 2rem;
  background: var(--graphite);
}

.twin-panel {
  text-align: center;
}

.twin-panel .mono-label {
  margin-bottom: 1rem;
  display: block;
}

.twin-object {
  border: 1px solid rgba(184, 182, 168, 0.18);
  aspect-ratio: 1;
  max-width: 220px;
  margin-inline: auto;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.twin-object.digital {
  border-color: rgba(99, 230, 226, 0.35);
  animation: twin-pulse 4s ease-in-out infinite;
}

@keyframes twin-pulse {
  0%, 100% { box-shadow: inset 0 0 0 rgba(99, 230, 226, 0); }
  50% { box-shadow: inset 0 0 40px rgba(99, 230, 226, 0.08); }
}

.twin-bridge {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--research-cyan);
  text-align: center;
  position: relative;
}

.twin-bridge::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -10%;
  bottom: -10%;
  width: 1px;
  background: linear-gradient(var(--research-cyan), transparent, var(--electric-lime));
  opacity: 0.4;
}

.twin-controls {
  border-left: var(--border);
  padding-left: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.twin-controls span {
  display: block;
  color: var(--precision-gray);
  margin-bottom: 0.25rem;
}

.twin-controls strong {
  font-size: 1rem;
  font-weight: 500;
  color: var(--research-white);
}

/* ============================================================
   07 — FAILURE
   ============================================================ */
.fail-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  font-size: clamp(1.5rem, 4vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 2rem 0 1.5rem;
}

.fail-arrow {
  color: var(--precision-gray);
  font-weight: 400;
}

.exp-log {
  margin-top: 2.5rem;
  border-top: var(--border);
}

.log-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 0;
  border-bottom: var(--border);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

.log-row span { color: var(--precision-gray); }

.status-fail { color: var(--warm-titanium); font-weight: 500; }
.status-partial { color: var(--research-cyan); font-weight: 500; }
.status-ok { color: var(--electric-lime); font-weight: 500; }

.log-row.breakthrough {
  background: linear-gradient(90deg, rgba(200, 255, 74, 0.06), transparent);
  padding-inline: 0.75rem;
  margin-inline: -0.75rem;
}

/* ============================================================
   08 — PHILOSOPHY
   ============================================================ */
.principles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem 4rem;
  margin-top: 3rem;
}

.prin-num {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.04em;
  color: rgba(200, 255, 74, 0.25);
  display: block;
  margin-bottom: 0.5rem;
}

.principles h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.principles p {
  color: var(--precision-gray);
  max-width: 28ch;
}

/* ============================================================
   09 — STACK MAP
   ============================================================ */
.stack-map {
  position: relative;
  min-height: 420px;
  border: var(--border);
  background: radial-gradient(ellipse at center, rgba(18, 37, 31, 0.5), transparent 70%), var(--graphite);
  overflow: hidden;
}

.stack-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stack-connectors line {
  stroke-dasharray: 6 4;
  animation: dash-flow 12s linear infinite;
}

@keyframes dash-flow {
  to { stroke-dashoffset: -100; }
}

.stack-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  padding: 1.1rem 1.4rem;
  border: 1px solid var(--electric-lime);
  background: var(--lab-black);
  color: var(--electric-lime);
  z-index: 2;
}

.stack-node {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(99, 230, 226, 0.35);
  background: rgba(8, 10, 13, 0.85);
  color: var(--research-white);
  z-index: 2;
}

.n1 { top: 12%; left: 12%; }
.n2 { top: 8%; left: 50%; transform: translateX(-50%); }
.n3 { top: 12%; right: 12%; }
.n4 { top: 50%; left: 6%; transform: translateY(-50%); }
.n5 { top: 50%; right: 6%; transform: translateY(-50%); }
.n6 { bottom: 12%; left: 14%; }
.n7 { bottom: 12%; right: 12%; }

/* ============================================================
   10 — HUMAN + MACHINE
   ============================================================ */
.hm-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
  margin-top: 1rem;
}

.hm-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.silhouette,
.machine-form {
  width: min(200px, 40vw);
  height: auto;
}

.hm-center {
  text-align: center;
  min-width: 140px;
}

.hm-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--electric-lime);
  display: block;
  margin-bottom: 1.5rem;
}

.hm-links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  color: var(--precision-gray);
  position: relative;
}

.hm-links::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(var(--research-cyan), var(--electric-lime));
  opacity: 0.35;
}

.hm-links li {
  position: relative;
  background: var(--lab-black);
  padding: 0.25rem 0.5rem;
}

/* ============================================================
   11 — METRICS
   ============================================================ */
.dash-note {
  margin: -1.5rem 0 2rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  background: rgba(184, 182, 168, 0.18);
  border: var(--border);
}

.metric {
  background: var(--graphite);
  padding: 2rem 1.25rem;
  text-align: center;
}

.metric span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--precision-gray);
  display: block;
  margin-bottom: 0.75rem;
}

.metric strong {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--research-white);
}

.metric strong::before {
  content: "";
}

/* zero-pad via JS; visual accent */
.metric:nth-child(odd) strong {
  color: var(--electric-lime);
}

/* ============================================================
   12 — WORLD PATH
   ============================================================ */
.world-path {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  counter-reset: world;
}

.world-path li {
  position: relative;
  padding: 1.5rem 1rem;
  border-top: 2px solid rgba(184, 182, 168, 0.25);
  counter-increment: world;
}

.world-path li::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--electric-lime);
}

.world-path li:not(:last-child)::after {
  content: "↓";
  position: absolute;
  top: -0.15rem;
  right: -0.35rem;
  color: var(--precision-gray);
  font-size: 0.75rem;
  display: none;
}

.world-path h3 {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.65rem;
  color: var(--research-cyan);
}

.world-path p {
  font-size: 0.95rem;
  color: var(--warm-titanium);
}

/* ============================================================
   13 — COLLAB
   ============================================================ */
.collab-web {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 2.5rem;
  max-width: 720px;
}

.collab-node {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  padding: 0.85rem 1.15rem;
  border: 1px solid rgba(184, 182, 168, 0.28);
  transition: border-color 0.3s, color 0.3s;
}

.collab-node:hover {
  border-color: var(--electric-lime);
  color: var(--electric-lime);
}

/* ============================================================
   14 — NOTES
   ============================================================ */
.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.note-card {
  border: var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  background: transparent;
  transition: background 0.3s;
}

.note-card:hover {
  background: var(--graphite);
}

.note-card .mono-label {
  margin-bottom: 1.25rem;
}

.note-card h3 {
  font-size: 1.2rem;
  line-height: 1.25;
  margin-bottom: 0.75rem;
  letter-spacing: -0.015em;
}

.note-card p {
  font-size: 0.92rem;
  color: var(--precision-gray);
  flex: 1;
  margin-bottom: 1.25rem;
}

.note-card a {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--electric-lime);
}

.note-card a:hover,
.note-card a:focus-visible {
  color: #d8ff7a;
  outline: none;
}

.notes-grid .note-card:nth-child(4),
.notes-grid .note-card:nth-child(5) {
  grid-column: span 1;
}

/* ============================================================
   15 — DIFFERENCE
   ============================================================ */
.diff-stages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(184, 182, 168, 0.18);
  border: var(--border);
  margin: 2rem 0 3rem;
}

.diff-stages article {
  background: var(--lab-black);
  padding: 2.5rem 1.75rem;
}

.diff-stages h3 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--precision-gray);
}

.diff-stages p {
  color: var(--warm-titanium);
}

.diff-pey {
  background: var(--deep-green) !important;
}

.diff-pey h3 {
  color: var(--electric-lime);
}

.diff-pey p {
  color: var(--research-white);
}

.diff-statement {
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  letter-spacing: 0.14em;
  color: var(--electric-lime);
}

/* ============================================================
   16 — FUTURE
   ============================================================ */
.section-future {
  min-height: 90vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 6rem;
  overflow: hidden;
}

.future-horizon {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#horizon-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.future-copy {
  position: relative;
  z-index: 1;
}

.future-chain {
  display: flex;
  gap: 0.75rem;
  margin-top: 2.5rem;
  color: var(--warm-titanium);
}

/* ============================================================
   MANIFESTO
   ============================================================ */
.section-manifesto {
  background: var(--research-white);
  color: var(--lab-black);
  padding: clamp(6rem, 14vw, 10rem) 0;
}

.manifesto-type {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: clamp(2rem, 7vw, 5rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 4rem;
}

.manifesto-brand {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.logo-invert {
  filter: invert(1) brightness(0.15);
}

.manifesto-brand strong {
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  font-family: var(--font-mono);
}

.manifesto-brand p {
  color: #4a5258;
}

/* ============================================================
   CTA
   ============================================================ */
.section-cta {
  position: relative;
  overflow: hidden;
  border-top: var(--border);
}

.cta-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(200, 255, 74, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 255, 74, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  animation: grid-drift 28s linear infinite;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.cta-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: var(--border);
  padding: 4rem 0 2rem;
  background: #06080b;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.1fr 2.5fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: var(--border);
}

.footer-brand p {
  margin: 1rem 0 1.25rem;
  color: var(--precision-gray);
  font-size: 0.95rem;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.footer-cols h3 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--warm-titanium);
  margin-bottom: 1rem;
}

.footer-cols a {
  display: block;
  font-size: 0.88rem;
  color: var(--precision-gray);
  padding: 0.3rem 0;
}

.footer-cols a:hover,
.footer-cols a:focus-visible {
  color: var(--research-white);
  outline: none;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--precision-gray);
}

.footer-bottom ul {
  display: flex;
  gap: 1.25rem;
}

.footer-bottom a:hover {
  color: var(--research-white);
}

/* ============================================================
   REVEAL / SCROLL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .nav {
    grid-template-columns: auto auto;
  }

  .nav-links,
  .nav-right .nav-cta {
    display: none;
  }

  .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .nav.is-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(8, 10, 13, 0.97);
    border-bottom: var(--border);
    padding: 1.5rem;
    gap: 1rem;
    z-index: 99;
  }

  .nav.is-open .nav-links-cta {
    display: block;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: var(--border);
  }

  .nav.is-open .nav-links-cta a {
    color: var(--electric-lime);
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 2rem;
  }

  .hero-viz {
    order: -1;
    min-height: 360px;
  }

  .pathway {
    grid-template-columns: repeat(2, 1fr);
  }

  .pathway-line { display: none; }

  .domains-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .experiment-chamber {
    grid-template-columns: 1fr;
  }

  .twin-stage {
    grid-template-columns: 1fr;
  }

  .twin-bridge {
    flex-direction: row;
    justify-content: center;
  }

  .twin-bridge::before { display: none; }

  .twin-controls {
    border-left: none;
    border-top: var(--border);
    padding-left: 0;
    padding-top: 1.25rem;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .world-path {
    grid-template-columns: 1fr;
  }

  .world-path li:not(:last-child)::after {
    display: block;
    right: auto;
    left: 0;
    top: auto;
    bottom: -0.85rem;
  }

  .notes-grid {
    grid-template-columns: 1fr 1fr;
  }

  .diff-stages {
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr;
  }

  .footer-cols {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  :root {
    --container: min(1240px, calc(100% - 2rem));
  }

  .domains-grid,
  .principles,
  .notes-grid,
  .hm-split,
  .metrics {
    grid-template-columns: 1fr;
  }

  .hm-split {
    gap: 2.5rem;
  }

  .hm-center {
    order: -1;
  }

  .hm-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .hm-links::before { display: none; }

  .stack-map {
    min-height: 520px;
  }

  .stack-lines { display: none; }

  .n1, .n2, .n3, .n4, .n5, .n6, .n7 {
    position: static;
    transform: none;
    display: inline-block;
    margin: 0.35rem;
  }

  .stack-map {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    padding: 5rem 1rem 2rem;
  }

  .stack-center {
    top: 1.5rem;
    transform: translateX(-50%);
  }

  .footer-cols {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-right .lab-status {
    display: none;
  }

  .wif {
    position: relative;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0.5rem;
    display: inline-block;
  }

  .what-if-list {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    min-height: auto;
  }

  .what-if-core {
    position: relative;
    min-height: 120px;
    color: rgba(244, 246, 242, 0.1);
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }
}
