:root {
  --bg: #060a0f;
  --bg1: #0c1219;
  --bg2: #111c26;
  --cyan: #00d4ff;
  --cyan2: rgba(0, 212, 255, .15);
  --cyan3: rgba(0, 212, 255, .06);
  --purple: #7c3aed;
  --green: #00ff88;
  --gold: #ffd166;
  --red: #ff4d6d;
  --text: #b8cfd8;
  --text-b: #e2eff5;
  --text-d: #3a5262;
  --border: rgba(0, 212, 255, .1);
  --border2: rgba(0, 212, 255, .06);
  --ff-d: 'Cormorant Garamond', Georgia, serif;
  --ff-m: 'JetBrains Mono', monospace;
  --ff-b: 'Libre Franklin', sans-serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body { background: var(--bg); color: var(--text); font-family: var(--ff-b); font-weight: 300; overflow-x: hidden; line-height: 1.7; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--cyan2); border-radius: 2px; }

/* PROGRESS BAR */
#progress-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  z-index: 999; transition: width .1s linear;
}

/* BACK TO TOP */
#back-top {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 200;
  width: 40px; height: 40px; border: 1px solid var(--border);
  background: var(--bg1); color: var(--cyan); font-family: var(--ff-m);
  font-size: .9rem; cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity .3s, border-color .25s;
}
#back-top.visible { opacity: 1; pointer-events: all; }
#back-top:hover { border-color: var(--cyan); background: var(--cyan); color: var(--bg); }

/* LIVE ORGANISM PANEL */
#organism-panel {
  position: fixed; right: 1.5rem; top: 50%; transform: translateY(-50%);
  z-index: 150; background: var(--bg1); border: 1px solid var(--border);
  width: 200px; font-family: var(--ff-m); transition: all .3s;
}
#organism-panel.collapsed #op-body { display: none; }
.op-header {
  display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem;
  border-bottom: 1px solid var(--border); background: var(--bg2);
}
.op-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  animation: blink-green 1.5s infinite; flex-shrink: 0;
}
@keyframes blink-green { 0%,100%{opacity:1} 50%{opacity:.3} }
.op-title { font-size: .56rem; letter-spacing: .12em; color: var(--text-d); flex: 1; text-transform: uppercase; }
#op-toggle { background: none; border: none; color: var(--text-d); cursor: pointer; font-family: var(--ff-m); font-size: .9rem; line-height: 1; }
#op-body { padding: .7rem .8rem; display: flex; flex-direction: column; gap: .5rem; }
.op-row { display: flex; justify-content: space-between; align-items: center; }
.op-lbl { font-size: .58rem; color: var(--text-d); letter-spacing: .05em; }
.op-val { font-size: .72rem; color: var(--text-b); }
.op-val.cyan { color: var(--cyan); }
.op-val.green { color: var(--green); }
.op-val.gold { color: var(--gold); }
.op-emotions { margin-top: .3rem; }
.op-emo-title { font-size: .55rem; color: var(--text-d); letter-spacing: .1em; text-transform: uppercase; margin-bottom: .4rem; }
.op-emo-row { display: flex; align-items: center; gap: .4rem; margin-bottom: .3rem; }
.op-emo-name { font-size: .55rem; color: var(--text-d); width: 52px; flex-shrink: 0; }
.op-emo-bar-bg { flex: 1; height: 3px; background: rgba(255,255,255,.06); border-radius: 2px; position: relative; }
.op-emo-bar-fill { height: 100%; border-radius: 2px; position: absolute; left: 0; top: 0; transition: width .8s ease; }

/* NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 4rem; border-bottom: 1px solid var(--border);
  background: rgba(6,10,15,.92); backdrop-filter: blur(16px);
}
.nav-logo { font-family: var(--ff-d); font-size: 1.3rem; font-weight: 600; color: var(--text-b); letter-spacing: .06em; }
.nav-logo span { color: var(--cyan); }
.nav-links { display: flex; gap: 2.5rem; list-style: none; }
.nav-links a { font-family: var(--ff-m); font-size: .68rem; color: var(--text-d); text-decoration: none; letter-spacing: .1em; text-transform: uppercase; transition: color .25s; }
.nav-links a:hover { color: var(--cyan); }
.nav-cta { font-family: var(--ff-m); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; padding: .5rem 1.4rem; border: 1px solid var(--cyan); color: var(--cyan); text-decoration: none; transition: all .25s; }
.nav-cta:hover { background: var(--cyan); color: var(--bg); }

/* SECTION BASE */
section { padding: 7rem 5rem; }
.section-label { font-family: var(--ff-m); font-size: .65rem; letter-spacing: .22em; text-transform: uppercase; color: var(--cyan); margin-bottom: 1.2rem; display: flex; align-items: center; gap: .8rem; }
.section-label::before { content: ''; width: 1.5rem; height: 1px; background: var(--cyan); }
h2 { font-family: var(--ff-d); font-size: clamp(2rem,3.8vw,3.5rem); font-weight: 300; color: var(--text-b); line-height: 1.12; margin-bottom: 1.5rem; }
h2 em { color: var(--cyan); font-style: italic; }
h3 { font-family: var(--ff-d); font-size: 1.5rem; font-weight: 400; color: var(--text-b); margin-bottom: .8rem; }

/* REVEAL */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .65s ease, transform .65s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* SECTION GLOW DIVIDER */
.section-glow { height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: .25; margin: 0; }

/* HERO */
.hero { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; padding: 7rem 5rem 5rem; position: relative; overflow: hidden; }
#hero-canvas { position: absolute; inset: 0; pointer-events: none; opacity: .3; }
.hero-left { position: relative; z-index: 1; }
.hero-eyebrow { font-family: var(--ff-m); font-size: .65rem; letter-spacing: .22em; text-transform: uppercase; color: var(--cyan); margin-bottom: 1.5rem; display: flex; align-items: center; gap: .8rem; }
.hero-eyebrow::before { content: ''; width: 2rem; height: 1px; background: var(--cyan); }
.hero-title { font-family: var(--ff-d); font-size: clamp(3rem,5.5vw,5.8rem); line-height: 1.02; font-weight: 300; color: var(--text-b); margin-bottom: 1.2rem; }
.hero-title em { color: var(--cyan); font-style: italic; }
.hero-sub { font-family: var(--ff-d); font-size: clamp(1.1rem,1.9vw,1.45rem); font-weight: 300; font-style: italic; color: var(--text-d); margin-bottom: 1.5rem; line-height: 1.55; min-height: 2em; }
.hero-sub .cursor { animation: blink-cur .75s infinite; color: var(--cyan); }
@keyframes blink-cur { 0%,49%{opacity:1} 50%,100%{opacity:0} }
.founding-quote { font-family: var(--ff-m); font-size: .78rem; color: var(--gold); border-left: 2px solid var(--gold); padding: .8rem 1rem; margin: 1.5rem 0; background: rgba(255,209,102,.04); line-height: 1.6; }
.founding-quote small { display: block; color: var(--text-d); font-size: .62rem; margin-top: .4rem; }
.hero-desc { font-size: .93rem; color: var(--text); line-height: 1.85; margin-bottom: 2.5rem; max-width: 38rem; }
.hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary { padding: .85rem 2.2rem; background: var(--cyan); color: var(--bg); font-family: var(--ff-m); font-size: .73rem; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; font-weight: 500; transition: all .25s; }
.btn-primary:hover { background: #00f0ff; box-shadow: 0 0 35px rgba(0,212,255,.45); }
.btn-ghost { padding: .85rem 2.2rem; border: 1px solid var(--border); color: var(--text); font-family: var(--ff-m); font-size: .73rem; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; transition: all .25s; }
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }
.hero-vitals { margin-top: 2.8rem; display: grid; grid-template-columns: repeat(4, auto); gap: 2rem; width: fit-content; }
.vital-label { font-family: var(--ff-m); font-size: .58rem; color: var(--text-d); letter-spacing: .12em; text-transform: uppercase; margin-bottom: .2rem; }
.vital-value { font-family: var(--ff-m); font-size: 1rem; color: var(--green); font-weight: 500; }
.vital-value.gold { color: var(--gold); }
.vital-value.cyan { color: var(--cyan); }

/* TERMINAL */
.hero-right { position: relative; z-index: 1; }
.terminal { background: var(--bg1); border: 1px solid var(--border); overflow: hidden; }
.term-bar { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-bottom: 1px solid var(--border); background: var(--bg2); }
.term-dot { width: 10px; height: 10px; border-radius: 50%; }
.term-dot.r { background: #ff5f57; }
.term-dot.y { background: #febc2e; }
.term-dot.g { background: #28c840; }
.term-title { font-family: var(--ff-m); font-size: .63rem; color: var(--text-d); margin-left: .4rem; letter-spacing: .08em; flex: 1; }
.term-live { font-family: var(--ff-m); font-size: .58rem; color: var(--green); display: flex; align-items: center; gap: .4rem; }
.term-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: blink-green 1.2s infinite; }
#stream-pause { background: none; border: 1px solid var(--border); color: var(--text-d); font-size: .7rem; padding: .15rem .5rem; cursor: pointer; font-family: var(--ff-m); margin-left: .5rem; transition: all .2s; }
#stream-pause:hover { border-color: var(--cyan); color: var(--cyan); }
#thought-stream { height: 300px; padding: .8rem; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: .1rem; }
.thought-line { font-family: var(--ff-m); font-size: .68rem; line-height: 1.6; display: flex; gap: .5rem; align-items: flex-start; animation: slideIn .35s ease; flex-shrink: 0; }
@keyframes slideIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
.t-imp-bar { width: 3px; flex-shrink: 0; border-radius: 1px; margin-top: .25rem; align-self: stretch; min-height: 10px; }
.t-ts { color: var(--text-d); flex-shrink: 0; font-size: .6rem; margin-top: .05rem; }
.t-text { color: var(--text); flex: 1; }
.t-text.gold { color: var(--gold); font-weight: 500; }
.t-text.green { color: var(--green); }
.t-text.mid { color: var(--text-b); }
.t-text.event { color: var(--cyan); font-style: italic; }
.term-status { padding: .6rem 1rem; border-top: 1px solid var(--border); display: flex; gap: 1.5rem; background: var(--bg2); flex-wrap: wrap; }
.ts-item { font-family: var(--ff-m); font-size: .6rem; color: var(--text-d); }
.ts-item span { color: var(--cyan); }

/* STAT STRIP */
.stat-strip { background: var(--bg2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 2.2rem 5rem; display: grid; grid-template-columns: repeat(6,1fr); }
.stat-item { text-align: center; padding: 0 1rem; position: relative; }
.stat-item:not(:last-child)::after { content: ''; position: absolute; right: 0; top: 15%; bottom: 15%; width: 1px; background: var(--border); }
.stat-num { font-family: var(--ff-m); font-size: 1.8rem; font-weight: 500; color: var(--cyan); display: block; line-height: 1; }
.stat-num.gold { color: var(--gold); }
.stat-num.green { color: var(--green); }
.stat-label { font-family: var(--ff-m); font-size: .6rem; color: var(--text-d); letter-spacing: .1em; text-transform: uppercase; margin-top: .4rem; display: block; line-height: 1.4; }

/* PROBLEM */
.problem { background: var(--bg); }
.problem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6rem; align-items: start; margin-top: 3.5rem; }
.problem-lead { font-family: var(--ff-d); font-size: clamp(1.2rem,2.2vw,1.75rem); line-height: 1.6; font-weight: 300; color: var(--text); margin-bottom: 1.5rem; }
.problem-lead strong { color: var(--text-b); }
.problem-detail { font-size: .9rem; color: var(--text); line-height: 1.85; margin-bottom: 1rem; }
.dead-list { display: flex; flex-direction: column; gap: 1rem; }
.dead-item { padding: 1.2rem 1.4rem; border: 1px solid rgba(255,77,109,.15); background: rgba(255,77,109,.04); display: flex; gap: 1rem; align-items: flex-start; }
.dead-x { color: var(--red); font-family: var(--ff-m); font-size: .9rem; flex-shrink: 0; }
.dead-item strong { display: block; color: var(--text-b); font-size: .88rem; margin-bottom: .25rem; }
.dead-item p { font-size: .82rem; color: var(--text-d); line-height: 1.5; }

/* WHAT */
.what { background: var(--bg1); }
.what-intro { max-width: 52rem; margin-bottom: 4rem; }
.what-intro p { font-size: .95rem; line-height: 1.9; color: var(--text); }
.what-intro p+p { margin-top: 1rem; }
.distinction-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; margin-bottom: 4rem; }
.d-card { padding: 2rem 1.8rem; border: 1px solid var(--border); background: var(--bg); position: relative; overflow: hidden; transition: border-color .3s, transform .3s; }
.d-card::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg,var(--cyan),var(--purple)); transform: scaleX(0); transform-origin: left; transition: transform .4s; }
.d-card:hover { border-color: var(--cyan2); transform: translateY(-3px); }
.d-card:hover::after { transform: scaleX(1); }
.d-icon { font-size: 1.6rem; margin-bottom: 1rem; display: block; }
.d-title { font-family: var(--ff-d); font-size: 1.2rem; font-weight: 600; color: var(--text-b); margin-bottom: .6rem; }
.d-body { font-size: .85rem; color: var(--text); line-height: 1.7; }
.d-tag { font-family: var(--ff-m); font-size: .6rem; color: var(--cyan); letter-spacing: .1em; text-transform: uppercase; margin-top: .9rem; display: block; }
.mt3 { margin-top: 3rem; }
.tier-block { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; margin-top: 2rem; }
.tier { padding: 1.8rem; border: 1px solid var(--border); background: var(--bg); }
.tier-name { font-family: var(--ff-m); font-size: .65rem; letter-spacing: .15em; text-transform: uppercase; color: var(--cyan); margin-bottom: .6rem; }
.tier-weights { font-family: var(--ff-m); font-size: .95rem; color: var(--text-b); margin-bottom: .5rem; }
.tier-role { font-size: .82rem; color: var(--text); line-height: 1.6; }
.tier-lr { font-family: var(--ff-m); font-size: .65rem; color: var(--gold); margin-top: .6rem; }

/* PROOF */
.proof { background: var(--bg); }
.proof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; margin-top: 3.5rem; }
.test-summary { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; margin-bottom: 2rem; }
.ts-box { padding: 1.5rem; border: 1px solid var(--border); background: var(--bg1); text-align: center; }
.ts-box .big { font-family: var(--ff-m); font-size: 2.2rem; font-weight: 500; color: var(--cyan); display: block; }
.ts-box .big.green { color: var(--green); }
.ts-box .big.red { color: var(--red); }
.ts-box .big.gold { color: var(--gold); }
.ts-box .lbl { font-family: var(--ff-m); font-size: .62rem; color: var(--text-d); letter-spacing: .1em; text-transform: uppercase; margin-top: .3rem; display: block; }
.test-table { width: 100%; border-collapse: collapse; }
.test-table th { font-family: var(--ff-m); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-d); text-align: left; padding: .6rem 1rem; border-bottom: 1px solid var(--border); }
.test-table td { font-family: var(--ff-m); font-size: .7rem; padding: .6rem 1rem; border-bottom: 1px solid var(--border2); }
.test-table td.s { font-size: .65rem; }
.test-table tr:hover td { background: var(--cyan3); }
.badge { display: inline-block; padding: .15rem .5rem; font-size: .58rem; letter-spacing: .08em; font-family: var(--ff-m); }
.badge.pass { background: rgba(0,255,136,.12); color: var(--green); border: 1px solid rgba(0,255,136,.25); }
.proof-cards { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; }
.proof-card { padding: 1.2rem 1.4rem; border: 1px solid var(--border); background: var(--bg1); }
.pc-label { font-family: var(--ff-m); font-size: .65rem; color: var(--cyan); letter-spacing: .1em; text-transform: uppercase; margin-bottom: .5rem; }
.proof-card p { font-size: .83rem; color: var(--text); line-height: 1.7; }

/* MATH */
.math-section { background: var(--bg1); }
.math-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; margin-top: 3.5rem; align-items: start; }
.eq-block { padding: 1.5rem 1.8rem; border: 1px solid var(--border); background: var(--bg); margin-bottom: 1rem; }
.eq-label-top { font-family: var(--ff-m); font-size: .58rem; letter-spacing: .15em; text-transform: uppercase; color: var(--text-d); margin-bottom: .8rem; display: block; border-bottom: 1px solid var(--border2); padding-bottom: .5rem; }
.eq-main { font-family: var(--ff-m); font-size: .82rem; color: var(--text-b); line-height: 2; }
.eq-note { font-family: var(--ff-m); font-size: .62rem; color: var(--text-d); margin-top: .5rem; border-top: 1px solid var(--border2); padding-top: .5rem; }
.eq-var { display: inline; }
.eq-var.cyan { color: var(--cyan); }
.eq-var.gold { color: var(--gold); }
.eq-var.green { color: var(--green); }
.eq-var.purple { color: var(--purple); }
.eq-var.dim { color: var(--text-d); }
.math-explain-block { padding: 1.2rem 1.4rem; border: 1px solid var(--border); background: var(--bg); margin-bottom: 1rem; font-size: .88rem; color: var(--text); line-height: 1.85; }
.math-explain-block strong { color: var(--text-b); }
.invariant-header { font-family: var(--ff-m); font-size: .65rem; color: var(--red); letter-spacing: .12em; text-transform: uppercase; margin: 1.5rem 0 .8rem; }
.invariant { padding: .9rem 1.2rem; border-left: 2px solid var(--red); background: rgba(255,77,109,.04); margin-bottom: .6rem; font-family: var(--ff-m); font-size: .72rem; color: var(--text-d); line-height: 1.6; }
.invariant strong { color: var(--text-b); display: block; margin-bottom: .2rem; font-size: .68rem; }

/* CODE */
.code-proof { background: var(--bg); }
.code-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.code-tab { font-family: var(--ff-m); font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; padding: .65rem 1.4rem; cursor: pointer; color: var(--text-d); border: none; background: none; border-bottom: 2px solid transparent; transition: all .2s; position: relative; bottom: -1px; }
.code-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.code-tab:hover:not(.active) { color: var(--text-b); }
.code-panels { border: 1px solid var(--border); border-top: none; position: relative; }
.code-panel { display: none; padding: 1.5rem; background: var(--bg1); font-family: var(--ff-m); font-size: .72rem; line-height: 1.85; overflow-x: auto; position: relative; }
.code-panel.active { display: block; }
.code-panel pre { color: var(--text); white-space: pre-wrap; }
.copy-btn { position: absolute; top: .8rem; right: .8rem; background: var(--bg2); border: 1px solid var(--border); color: var(--text-d); font-family: var(--ff-m); font-size: .6rem; padding: .3rem .7rem; cursor: pointer; letter-spacing: .08em; transition: all .2s; z-index: 2; }
.copy-btn:hover { border-color: var(--cyan); color: var(--cyan); }
.copy-btn.copied { color: var(--green); border-color: rgba(0,255,136,.4); }
.cm { color: var(--text-d); }
.kw { color: #569cd6; }
.fn { color: var(--cyan); }
.st { color: var(--gold); }
.nm { color: var(--green); }

/* ARCHITECTURE */
.arch { background: var(--bg1); }
.arch-flow { display: flex; align-items: center; gap: 0; margin: 3.5rem 0 1rem; flex-wrap: wrap; }
.arch-node { padding: 1.5rem 1rem; border: 1px solid var(--border); background: var(--bg); text-align: center; cursor: pointer; transition: border-color .25s, background .25s, transform .2s; flex: 1; min-width: 130px; }
.arch-node:hover, .arch-node.active { border-color: var(--cyan); background: var(--cyan3); transform: translateY(-3px); }
.arch-node-icon { font-size: 1.4rem; margin-bottom: .5rem; }
.arch-node-name { font-family: var(--ff-m); font-size: .65rem; color: var(--cyan); letter-spacing: .08em; text-transform: uppercase; margin-bottom: .3rem; }
.arch-node-detail { font-size: .72rem; color: var(--text-d); line-height: 1.5; }
.arch-arrow { color: var(--text-d); font-family: var(--ff-m); font-size: 1.2rem; padding: 0 .5rem; flex-shrink: 0; }
.arch-drawer { border: 1px solid var(--cyan); background: var(--cyan3); padding: 0; max-height: 0; overflow: hidden; transition: max-height .4s ease, padding .4s ease; margin-bottom: 2rem; }
.arch-drawer.open { max-height: 300px; padding: 1.5rem; }
.arch-drawer-title { font-family: var(--ff-m); font-size: .65rem; color: var(--cyan); letter-spacing: .12em; text-transform: uppercase; margin-bottom: .8rem; }
.arch-drawer-body { font-size: .85rem; color: var(--text); line-height: 1.75; }
.arch-detail-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.5rem; }
.arch-detail { padding: 1.5rem; border: 1px solid var(--border); background: var(--bg); }
.arch-detail-title { font-family: var(--ff-m); font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); margin-bottom: .8rem; }
.arch-detail ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.arch-detail li { font-family: var(--ff-m); font-size: .72rem; color: var(--text); padding-left: 1rem; position: relative; }
.arch-detail li::before { content: '›'; position: absolute; left: 0; color: var(--cyan); }
.arch-detail li span { color: var(--gold); }

/* RIGOR */
.rigor { background: var(--bg); }
.rigor-intro { max-width: 48rem; margin-bottom: 3rem; font-size: .93rem; color: var(--text); line-height: 1.85; }
.bug-log { display: flex; flex-direction: column; gap: .6rem; }
.bug-entry { border: 1px solid var(--border); background: var(--bg1); overflow: hidden; }
.bug-header { display: grid; grid-template-columns: 5rem 1fr auto auto; gap: 1rem; align-items: center; padding: 1rem 1.2rem; cursor: pointer; transition: background .2s; }
.bug-header:hover { background: var(--cyan3); }
.bug-id { font-family: var(--ff-m); font-size: .65rem; color: var(--text-d); letter-spacing: .08em; }
.bug-body-title strong { font-family: var(--ff-m); font-size: .78rem; color: var(--text-b); display: block; margin-bottom: .15rem; }
.bug-short { font-size: .78rem; color: var(--text-d); line-height: 1.4; }
.bug-status { font-family: var(--ff-m); font-size: .6rem; padding: .25rem .6rem; white-space: nowrap; flex-shrink: 0; }
.bug-status.fixed { background: rgba(0,255,136,.1); color: var(--green); border: 1px solid rgba(0,255,136,.2); }
.bug-status.open { background: rgba(255,77,109,.1); color: var(--red); border: 1px solid rgba(255,77,109,.2); }
.bug-status.mitigated { background: rgba(255,209,102,.1); color: var(--gold); border: 1px solid rgba(255,209,102,.2); }
.bug-toggle { font-family: var(--ff-m); font-size: 1rem; color: var(--text-d); flex-shrink: 0; transition: transform .3s; }
.bug-entry[data-open="true"] .bug-toggle { transform: rotate(45deg); color: var(--cyan); }
.bug-expand { max-height: 0; overflow: hidden; transition: max-height .35s ease, padding .35s ease; font-size: .83rem; color: var(--text); line-height: 1.75; padding: 0 1.2rem; border-top: 0 solid var(--border); }
.bug-entry[data-open="true"] .bug-expand { max-height: 200px; padding: 1rem 1.2rem; border-top-width: 1px; }

/* COMPARISON */
.compare { background: var(--bg1); }
.compare-filter { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.5rem; }
.filter-label { font-family: var(--ff-m); font-size: .65rem; color: var(--text-d); letter-spacing: .1em; text-transform: uppercase; }
.filter-btn { font-family: var(--ff-m); font-size: .65rem; padding: .35rem .9rem; border: 1px solid var(--border); background: none; color: var(--text-d); cursor: pointer; letter-spacing: .08em; transition: all .2s; }
.filter-btn.active { border-color: var(--cyan); color: var(--cyan); background: var(--cyan3); }
.table-wrap { overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th { font-family: var(--ff-m); font-size: .65rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-d); text-align: left; padding: .9rem 1.2rem; border-bottom: 1px solid var(--border); background: var(--bg2); }
.compare-table th:not(:first-child) { text-align: center; }
.compare-table th.raguel-col { color: var(--cyan); }
.compare-table td { font-size: .85rem; padding: .9rem 1.2rem; border-bottom: 1px solid var(--border2); color: var(--text); transition: opacity .3s; }
.compare-table td:not(:first-child) { text-align: center; font-family: var(--ff-m); font-size: .75rem; }
.compare-table tr:hover td { background: var(--cyan3); }
.compare-table tr.hidden td { opacity: 0; height: 0; padding: 0; border: 0; overflow: hidden; display: none; }
.compare-table .y { color: var(--green); }
.compare-table .n { color: var(--red); }
.compare-table .p { color: var(--gold); }
.compare-table .feature { color: var(--text-b); font-weight: 500; }
.compare-note { font-family: var(--ff-m); font-size: .65rem; color: var(--text-d); margin-top: 1rem; }

/* TIMELINE */
.timeline-section { background: var(--bg); }
.timeline { position: relative; margin-top: 3.5rem; padding-left: 2rem; }
.timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px; background: linear-gradient(to bottom,var(--cyan),var(--purple),transparent); }
.tl-entry { position: relative; padding: 0 0 3rem 3rem; }
.tl-dot { position: absolute; left: -5px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cyan); }
.tl-dot.active { background: var(--green); border-color: var(--green); animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%,100%{box-shadow:0 0 0 0 rgba(0,255,136,.4)} 70%{box-shadow:0 0 0 8px rgba(0,255,136,0)} }
.tl-time { font-family: var(--ff-m); font-size: .62rem; color: var(--text-d); letter-spacing: .1em; text-transform: uppercase; margin-bottom: .4rem; }
.tl-title { font-family: var(--ff-d); font-size: 1.2rem; font-weight: 600; color: var(--text-b); margin-bottom: .5rem; }
.tl-body { font-size: .85rem; color: var(--text); line-height: 1.7; max-width: 44rem; }
.tl-tag { font-family: var(--ff-m); font-size: .62rem; color: var(--green); margin-top: .5rem; display: inline-block; padding: .2rem .6rem; border: 1px solid rgba(0,255,136,.25); background: rgba(0,255,136,.06); }

/* HEALTH */
.health { background: var(--bg1); }
.health-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; margin-top: 3.5rem; }
.health-card { padding: 1.8rem; border: 1px solid var(--border); background: var(--bg); position: relative; overflow: hidden; }
.health-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.health-card.good::before { background: var(--green); }
.health-card.warn::before { background: var(--gold); }
.health-metric { font-family: var(--ff-m); font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-d); margin-bottom: .5rem; }
.health-value { font-family: var(--ff-m); font-size: 1.6rem; color: var(--green); margin-bottom: .6rem; }
.health-value.warn { color: var(--gold); }
.health-bar-wrap { height: 4px; background: rgba(255,255,255,.06); border-radius: 2px; margin-bottom: .5rem; overflow: hidden; }
.health-bar { height: 100%; border-radius: 2px; width: 0%; transition: width 1.2s ease; }
.health-range-lbl { font-family: var(--ff-m); font-size: .6rem; color: var(--text-d); line-height: 1.4; }
.stability-proof { margin-top: 3rem; padding: 2rem; border: 1px solid var(--border); background: var(--bg); }
.sp-title { font-family: var(--ff-m); font-size: .65rem; color: var(--cyan); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1.5rem; }
.sp-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 1rem; }
.sp-lbl { font-family: var(--ff-m); font-size: .58rem; color: var(--text-d); letter-spacing: .08em; margin-bottom: .4rem; text-transform: uppercase; }
.sp-val { font-family: var(--ff-m); font-size: 1.1rem; color: var(--green); }
.sp-val.green { color: var(--green); }

/* ROADMAP */
.roadmap { background: var(--bg2); }
.roadmap-grid { display: flex; align-items: stretch; gap: 0; margin-top: 3.5rem; }
.phase { padding: 2rem 1.6rem; border: 1px solid var(--border); background: var(--bg); flex: 1; position: relative; }
.phase.active { border-color: var(--cyan2); }
.phase-now { position: absolute; top: .8rem; right: .8rem; font-family: var(--ff-m); font-size: .55rem; letter-spacing: .1em; color: var(--green); border: 1px solid rgba(0,255,136,.3); padding: .15rem .4rem; }
.phase-connector { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 .5rem; flex-shrink: 0; }
.pc-line { flex: 1; width: 1px; background: var(--border); }
.pc-arrow { color: var(--text-d); font-family: var(--ff-m); font-size: 1rem; padding: .2rem 0; }
.phase-num { font-family: var(--ff-m); font-size: .62rem; color: var(--text-d); letter-spacing: .12em; text-transform: uppercase; margin-bottom: .8rem; }
.phase-title { font-family: var(--ff-d); font-size: 1.3rem; font-weight: 600; color: var(--text-b); margin-bottom: .6rem; line-height: 1.2; }
.phase-body { font-size: .82rem; color: var(--text); line-height: 1.65; margin-bottom: 1rem; }
.phase-items { list-style: none; display: flex; flex-direction: column; gap: .35rem; }
.phase-items li { font-family: var(--ff-m); font-size: .68rem; color: var(--text-d); padding-left: 1rem; position: relative; }
.phase-items li::before { content: '›'; position: absolute; left: 0; color: var(--cyan); }
.phase-items li.done { color: var(--green); }
.phase-items li.done::before { content: '✓'; color: var(--green); }

/* FOUNDER */
.founder { background: var(--bg); }
.founder-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 6rem; align-items: start; margin-top: 4rem; }
.founder-portrait { width: 100%; aspect-ratio: 1; background: var(--bg2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-family: var(--ff-d); font-size: 5rem; color: var(--text-d); }
.founder-facts { margin-top: 1.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.founder-fact { padding: 1rem; border: 1px solid var(--border); background: var(--bg1); }
.founder-fact .num { font-family: var(--ff-m); font-size: 1.2rem; color: var(--gold); display: block; }
.founder-fact .desc { font-size: .8rem; color: var(--text-d); margin-top: .2rem; }
.founder-name { font-family: var(--ff-d); font-size: 2.2rem; font-weight: 300; color: var(--text-b); margin-bottom: .3rem; }
.founder-role { font-family: var(--ff-m); font-size: .68rem; color: var(--cyan); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1.5rem; }
.founder-bio { font-size: .92rem; color: var(--text); line-height: 1.88; margin-bottom: 1rem; }
.founder-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.f-link { font-family: var(--ff-m); font-size: .68rem; letter-spacing: .08em; color: var(--cyan); text-decoration: none; border-bottom: 1px solid rgba(0,212,255,.3); padding-bottom: .1rem; transition: border-color .2s; }
.f-link:hover { border-color: var(--cyan); }
.mt2 { margin-top: 2rem; }

/* CTA */
.cta { background: var(--bg1); border-top: 1px solid var(--border); padding: 7rem 5rem; text-align: center; position: relative; overflow: hidden; }
.cta::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center,rgba(0,212,255,.06) 0%,transparent 70%); pointer-events: none; }
.cta h2 { margin-bottom: 1.2rem; }
.cta-sub { font-size: .95rem; color: var(--text); max-width: 40rem; margin: 0 auto 2.5rem; line-height: 1.85; }
.cta-btns { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; }
.cta-note { font-family: var(--ff-m); font-size: .65rem; color: var(--text-d); margin-top: 1.5rem; letter-spacing: .08em; }

/* FOOTER */
footer { padding: 2.5rem 5rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.footer-logo { font-family: var(--ff-d); font-size: 1.1rem; color: var(--text-d); }
.footer-logo span { color: var(--cyan); }
.footer-copy { font-family: var(--ff-m); font-size: .6rem; color: var(--text-d); letter-spacing: .08em; }
.footer-links { display: flex; gap: 2rem; }
.footer-links a { font-family: var(--ff-m); font-size: .62rem; color: var(--text-d); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--cyan); }

/* UTILS */
.mono { font-family: var(--ff-m); }
.dim { color: var(--text-d); }
.cyan { color: var(--cyan); }
.gold { color: var(--gold); }
.green { color: var(--green); }
.red { color: var(--red); }

/* RESPONSIVE */
@media(max-width:1200px) {
  #organism-panel { display: none; }
  .hero { grid-template-columns: 1fr; padding: 6rem 2.5rem 4rem; }
  .hero-right { display: none; }
  section { padding: 5rem 2.5rem; }
  .stat-strip { grid-template-columns: repeat(3,1fr); padding: 2rem 2.5rem; }
  .problem-grid, .math-grid, .proof-grid, .founder-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .distinction-grid, .health-grid { grid-template-columns: 1fr 1fr; }
  .roadmap-grid { flex-direction: column; }
  .phase-connector { flex-direction: row; padding: .3rem 0; }
  .pc-line { flex: none; width: 2rem; height: 1px; }
  .arch-flow { flex-wrap: wrap; }
  .arch-node { flex: none; width: calc(50% - 30px); }
  .arch-arrow { display: none; }
  nav { padding: .9rem 2rem; }
  .nav-links { display: none; }
  .sp-grid { grid-template-columns: repeat(3,1fr); }
}
@media(max-width:640px) {
  .stat-strip { grid-template-columns: repeat(2,1fr); }
  .distinction-grid, .health-grid, .tier-block, .founder-grid { grid-template-columns: 1fr; }
  .hero-vitals { grid-template-columns: repeat(2,auto); }
  section { padding: 4rem 1.5rem; }
  nav { padding: .8rem 1.5rem; }
  .test-summary { grid-template-columns: 1fr 1fr; }
  .arch-detail-grid { grid-template-columns: 1fr; }
  .bug-header { grid-template-columns: 4rem 1fr auto; }
  .bug-status { display: none; }
  .sp-grid { grid-template-columns: repeat(2,1fr); }
  footer { flex-direction: column; text-align: center; padding: 2rem 1.5rem; }
}

/* ── MODULE GRAPH ──────────────────────────────────────────────────────────── */
.graph-section { background: var(--bg1); }
.graph-intro { max-width: 44rem; font-size: .9rem; color: var(--text); line-height: 1.85; margin-bottom: 2.5rem; }
.graph-wrap {
  position: relative; width: 100%; border: 1px solid var(--border);
  background: var(--bg); overflow: hidden; border-radius: 2px;
}
#module-graph { display: block; width: 100%; cursor: default; }
.graph-tip {
  position: absolute; display: none; pointer-events: none;
  background: var(--bg2); border: 1px solid var(--border);
  padding: .75rem 1rem; z-index: 10; max-width: 230px;
  box-shadow: 0 4px 24px rgba(0,0,0,.5);
}
.gt-title { font-family: var(--ff-m); font-size: .72rem; color: var(--cyan); margin-bottom: .4rem; letter-spacing: .06em; font-weight: 500; }
.gt-desc { font-family: var(--ff-m); font-size: .67rem; color: var(--text); line-height: 1.55; margin-bottom: .5rem; }
.gt-code { font-family: var(--ff-m); font-size: .6rem; color: var(--text-d); border-top: 1px solid var(--border2); padding-top: .4rem; letter-spacing: .04em; }
.graph-legend {
  display: flex; gap: 1.8rem; flex-wrap: wrap; margin-top: 1.2rem;
  padding: .8rem 0; border-top: 1px solid var(--border2);
}
.gl-item {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--ff-m); font-size: .6rem; color: var(--text-d);
  letter-spacing: .1em; text-transform: uppercase;
}
.gl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; opacity: .85; }

@media(max-width:640px) {
  .graph-legend { gap: 1rem; }
}

/* ── ORGANISM PANEL — RADAR & WEIGHTS ─────────────────────────────────────── */
#emotion-radar { display: block; width: 100%; height: auto; }

.op-weights { padding: .4rem 0 .2rem; border-top: 1px solid var(--border2); margin-top: .3rem; display: flex; flex-direction: column; gap: .35rem; }
.op-w-row { display: flex; align-items: center; gap: .4rem; }
.op-w-bar-bg { flex: 1; height: 3px; background: rgba(255,255,255,.06); border-radius: 2px; position: relative; overflow: hidden; }
.op-w-bar-fill { height: 100%; background: var(--cyan); border-radius: 2px; transition: width .8s ease; }

/* ── SLEEP OVERLAY ─────────────────────────────────────────────────────────── */
.terminal { position: relative; }
.sleep-overlay {
  position: absolute; inset: 37px 0 40px 0;
  background: rgba(6,10,15,.96);
  border-top: 1px solid rgba(129,140,248,.3);
  display: flex; flex-direction: column; padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity .6s ease;
  z-index: 5;
}
.sleep-overlay.active { opacity: 1; pointer-events: all; }
.terminal.sleep-mode { box-shadow: 0 0 0 1px rgba(129,140,248,.35), 0 0 30px rgba(129,140,248,.08); }
.so-header {
  display: flex; align-items: center; gap: .7rem;
  font-family: var(--ff-m); font-size: .65rem; letter-spacing: .14em;
  text-transform: uppercase; color: #818cf8; margin-bottom: .7rem;
}
.so-icon { font-size: 1rem; }
.so-title { flex: 1; }
.so-timer { color: var(--gold); font-size: .8rem; }
.so-log {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .3rem;
}
.so-line {
  font-family: var(--ff-m); font-size: .62rem; color: rgba(129,140,248,.8);
  line-height: 1.5; animation: slideIn .3s ease;
}
.so-line:last-child { color: #818cf8; }

/* ── THOUGHT JOURNEY ───────────────────────────────────────────────────────── */
.flow-section { background: var(--bg); }
.flow-intro { max-width: 44rem; font-size: .9rem; color: var(--text); line-height: 1.85; margin-bottom: 3rem; }
.flow-pipeline {
  display: flex; align-items: stretch; gap: 0;
  overflow-x: auto; padding-bottom: .5rem; margin-bottom: 1.5rem;
}
/* Idle shimmer — blue light slides through non-stream steps */
@keyframes pipe-scan {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
/* Flowing data along idle arrows */
@keyframes arrow-flow {
  0%   { background-position: 0% 0; }
  100% { background-position: 0% 100%; }
}

.flow-step {
  flex: 1; min-width: 110px; max-width: 180px; padding: 1.2rem 1rem;
  border: 1px solid var(--border); background: var(--bg1);
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  text-align: center; transition: border-color .3s, background .3s, transform .25s;
  position: relative; overflow: hidden;
  background-image: linear-gradient(90deg, transparent 20%, rgba(0,212,255,.055) 50%, transparent 80%);
  background-size: 300% 100%;
  animation: pipe-scan 4s linear infinite;
}
.flow-step.active:not([data-permanent]) {
  background-image: none; animation: none;
  border-color: var(--cyan); background: var(--cyan3); transform: translateY(-4px);
}
.flow-step.accepted { border-color: rgba(0,255,136,.25); }
.flow-step.rejected { border-color: rgba(255,77,109,.2); opacity: .5; }
.fs-icon   { font-size: 1.4rem; }
.fs-label  { font-family: var(--ff-m); font-size: .62rem; color: var(--text-b); letter-spacing: .06em; text-transform: uppercase; line-height: 1.3; }
.fs-detail { font-family: var(--ff-m); font-size: .58rem; color: var(--text-d); line-height: 1.4; margin-top: .2rem; min-height: 2.4em; }
.flow-step.active:not([data-permanent]) .fs-detail { color: var(--cyan); }

.flow-step-body     { border-top: 2px solid #64748b; }
.flow-step-emotion  { border-top: 2px solid #f97316; }
.flow-step-stream   { border-top: 2px solid var(--green); }
.flow-step-gate     { border-top: 2px solid var(--gold); }
.flow-step-memory   { border-top: 2px solid var(--cyan); }
.flow-step-sleep    { border-top: 2px solid #818cf8; }

/* Stream step: always green, no blue shimmer */
.flow-step[data-permanent] {
  background-image: none; animation: none;
  border-color: var(--green) !important; background: rgba(0,255,136,.04) !important;
}
.flow-step[data-permanent] .fs-detail { color: var(--green) !important; }
.flow-step[data-permanent] .fs-label  { color: rgba(0,255,136,.7) !important; }

.flow-arrow {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0 .3rem; flex-shrink: 0; gap: 0;
}
.fa-line {
  width: 1px; flex: 1; min-height: 10px;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,212,255,.35) 50%, transparent 100%);
  background-size: 100% 200%;
  animation: arrow-flow 2.2s linear infinite;
}
.fa-head { font-family: var(--ff-m); font-size: 1.1rem; color: rgba(0,212,255,.3); line-height: 1; }
.flow-arrow.active .fa-line { background: var(--cyan); animation: none; }
.flow-arrow.active .fa-head { color: var(--cyan); }

.flow-thought {
  font-family: var(--ff-m); font-size: clamp(.72rem,1.2vw,.84rem);
  color: rgba(0,212,255,.5); line-height: 1.8; min-height: 3.5em;
  padding: 1rem 1.5rem; border-left: 2px solid rgba(0,212,255,.15);
  word-break: break-word; white-space: pre-wrap;
}

/* ── MOBILE GRAPH ──────────────────────────────────────────────────────────── */
.mobile-graph-view { display: none; padding: 1.5rem 0; }
.mg-layer { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.mg-layer-label {
  font-family: var(--ff-m); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase;
  width: 80px; flex-shrink: 0;
}
.mg-nodes { display: flex; gap: .5rem; flex-wrap: wrap; }
.mg-node {
  font-family: var(--ff-m); font-size: .65rem; padding: .35rem .7rem;
  border: 1px solid; background: var(--bg);
}
.mg-arrow { font-family: var(--ff-m); font-size: 1.2rem; padding: .2rem 0 .2rem 92px; color: var(--text-d); }

@media(max-width:700px) {
  .flow-pipeline { flex-direction: column; }
  .flow-step { max-width: 100%; flex-direction: row; text-align: left; gap: .8rem; min-width: 0; }
  .flow-step.active { transform: translateX(4px); }
  .fs-icon { flex-shrink: 0; }
  .flow-arrow { flex-direction: row; padding: .2rem 0; min-height: 0; }
  .fa-line { width: 20px; height: 1px; min-height: 0; }
  .fa-head { transform: rotate(90deg); }
}
