/* ============================================================
   GENESIS — "Descent" design system
   A scroll-driven journey through a 3D scene.
   Palette: void black + amber/gold ("gold among slop") + ivory,
   with a single cold cyan accent. NO purple. NO AI-gradient.
   Type: refined serif display + mono labels.
   ============================================================ */

:root {
  --void:   #030304;
  --void-2: #060608;
  --ink:    #f3efe6;   /* warm ivory */
  --ink-dim:#a9a294;
  --ink-faint:#6b655a;
  --gold:   #d8a94e;   /* discovery gold */
  --gold-hi:#f0c873;
  --gold-lo:#8a6a2c;
  --cyan:   #4fd8e8;   /* single cold accent — used sparingly */
  --hairline: rgba(216, 169, 78, 0.16);
  --hairline-bright: rgba(216, 169, 78, 0.34);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, "SF Mono", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* --- subpage aliases (re-mapped onto the Descent palette) --- */
  --bg:     #030304;
  --bg-2:   #060608;
  --glass:  rgba(6, 6, 8, 0.5);
  --violet: #8b7bd0;   /* muted cold violet — never a gradient */
  --green:  #5fd08a;
  --amber:  #d8a94e;   /* alias of gold */
  --red:    #e0705f;
  --yellow: #e8c27a;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--void);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(216, 169, 78, 0.30); color: #fff; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); }

/* ============================================================
   THE SCROLL-JOURNEY SHELL
   A fixed full-viewport WebGL canvas sits behind; HTML sections
   scroll over it. The canvas camera flies through the scene
   driven by scroll progress (scene.js reads the scroll offset).
   ============================================================ */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;   /* text/links must stay clickable */
  display: block;
}

/* scroll content sits ABOVE the canvas */
.stage {
  position: relative;
  z-index: 2;
  pointer-events: none;
}
.stage > * { pointer-events: auto; }

/* fixed chrome */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  padding: 0 28px;
  height: 62px;
  display: flex; align-items: center; gap: 26px;
  background: linear-gradient(180deg, rgba(3,3,4,0.85), rgba(3,3,4,0));
}
.brand {
  display: flex; align-items: center; gap: 11px;
  font-weight: 700; letter-spacing: 0.04em; color: var(--ink);
  font-size: 17px; white-space: nowrap; flex-shrink: 0;
}
.brand:hover { color: var(--ink); }
.brand .orb {
  width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff3cf, var(--gold) 55%, var(--gold-lo));
  box-shadow: 0 0 14px rgba(216, 169, 78, 0.85);
  animation: orbPulse 3.4s ease-in-out infinite;
}
@keyframes orbPulse { 50% { box-shadow: 0 0 24px rgba(216, 169, 78, 1); } }

.nav-links { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
.nav-links a {
  color: var(--ink-dim); font-family: var(--mono); font-size: 12.5px;
  letter-spacing: 0.06em; padding: 7px 12px; border-radius: 999px;
  white-space: nowrap; transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--ink); background: rgba(216,169,78,0.08); }
.nav-links a.active { color: var(--gold); background: rgba(216,169,78,0.10); }

/* ============================================================
   SCROLL SECTIONS — each is a "leg" of the descent.
   Full-viewport-height panels with minimal centered copy.
   ============================================================ */

.leg {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 110px 24px 60px;
  position: relative;
}
.leg .inner { max-width: 820px; margin: 0 auto; width: 100%; }

/* leg alignment variants */
.leg.left .inner { margin-left: 0; }
.leg.right .inner { margin-left: auto; margin-right: 0; }

.kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.34em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 22px;
  display: flex; align-items: center; gap: 12px;
}
.kicker::before { content: ""; width: 34px; height: 1px; background: var(--gold); opacity: 0.6; }

.display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-size: clamp(40px, 7.2vw, 96px);
  color: var(--ink);
}
.display em {
  font-style: normal;
  background: linear-gradient(100deg, var(--gold-hi), var(--gold) 60%, var(--gold-lo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.lede {
  font-size: clamp(16px, 1.9vw, 21px); color: var(--ink-dim);
  max-width: 560px; line-height: 1.6; margin-top: 26px;
}
.lede b { color: var(--ink); font-weight: 500; }

.cta { display: flex; gap: 14px; margin-top: 40px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 13.5px; letter-spacing: 0.03em; font-weight: 600;
  padding: 14px 26px; border-radius: 999px;
  border: 1px solid var(--hairline-bright); color: var(--ink);
  background: rgba(216, 169, 78, 0.04);
  transition: transform 0.25s var(--ease), box-shadow 0.25s, background 0.25s, border-color 0.25s;
  cursor: pointer;
}
.btn:hover {
  transform: translateY(-2px);
  background: rgba(216, 169, 78, 0.12);
  border-color: var(--gold);
  box-shadow: 0 12px 34px rgba(0,0,0,0.5);
  color: var(--ink);
}
.btn.primary {
  background: linear-gradient(135deg, var(--gold-hi), var(--gold));
  color: #1a1204; border: none;
  box-shadow: 0 10px 34px rgba(216, 169, 78, 0.28);
}
.btn.primary:hover { box-shadow: 0 14px 44px rgba(216, 169, 78, 0.45); color: #1a1204; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-dim); }
.btn.ghost:hover { color: var(--gold-hi); background: transparent; box-shadow: none; }

/* scroll hint (bottom of first leg) */
.scroll-hint {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.34em;
  color: var(--ink-faint); text-transform: uppercase; white-space: nowrap;
}
.scroll-hint::after {
  content: ""; display: block; width: 1px; height: 40px; margin: 12px auto 0;
  background: linear-gradient(var(--gold), transparent);
  animation: drip 2s var(--ease) infinite;
}
@keyframes drip {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ============================================================
   MINIMAL CONTENT CARDS — float over the 3D scene with glass
   ============================================================ */

.glass {
  background: rgba(6, 6, 8, 0.5);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 30px 30px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mode-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.mode-chip {
  flex: 1 1 200px;
  padding: 22px 20px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: rgba(6, 6, 8, 0.42);
  backdrop-filter: blur(8px);
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.mode-chip:hover { transform: translateY(-4px); border-color: var(--hairline-bright); box-shadow: 0 18px 40px rgba(0,0,0,0.5); }
.mode-chip .m { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.mode-chip h3 { font-family: var(--serif); font-size: 22px; font-weight: 400; margin: 8px 0 8px; color: var(--ink); }
.mode-chip p { color: var(--ink-dim); font-size: 14.5px; line-height: 1.55; }
.mode-chip .drv { display: block; margin-top: 14px; font-family: var(--mono); font-size: 11px; color: var(--ink-faint); letter-spacing: 0.08em; }

/* final leg — CTA panel */
.cta-panel {
  max-width: 720px; text-align: center;
  padding: 56px 40px;
  border-radius: 24px;
  border: 1px solid var(--hairline-bright);
  background: radial-gradient(120% 120% at 50% 0%, rgba(216,169,78,0.10), rgba(6,6,8,0.6) 60%);
  backdrop-filter: blur(12px);
}
.cta-panel .display { font-size: clamp(30px, 4.6vw, 54px); }
.cta-panel .cta { justify-content: center; }

footer {
  position: relative; z-index: 2;
  border-top: 1px solid var(--hairline);
  padding: 36px 28px 44px;
  color: var(--ink-faint); font-size: 13px;
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
  max-width: 1180px; margin: 0 auto;
}
footer a { color: var(--ink-dim); }
footer a:hover { color: var(--gold-hi); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .brand .orb { animation: none; }
}

/* ============================================================
   SUBPAGE CONTENT SYSTEM
   The four subpages (memory / modes / genesis / honesty) carry
   rich, interactive content. These classes style it within the
   Descent palette so the pages look intentional, not orphaned.
   ============================================================ */

/* --- shell --- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; background:
  radial-gradient(120% 90% at 50% 0%, rgba(216,169,78,0.05), transparent 55%),
  radial-gradient(80% 70% at 50% 100%, rgba(79,216,232,0.04), transparent 55%),
  var(--void); }

/* --- subpage hero with 3D scene (CDN Three.js, scene inlined per page) --- */
.hero3d { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 46vw); gap: 40px; align-items: center; min-height: 100svh; padding: 120px 0 60px; }
.hero3d .hero-copy { position: relative; z-index: 3; }
.hero3d .hero-visual { position: relative; height: min(72svh, 740px); min-height: 420px; z-index: 1; }
.hero3d .hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero3d .hero-fallback {
  position: absolute; inset: 0; display: none;
  background: radial-gradient(circle at 50% 42%, rgba(216,169,78,0.16), transparent 62%),
              radial-gradient(circle at 52% 58%, rgba(79,216,232,0.08), transparent 62%);
}
.hero3d .hero-fallback.show { display: block; }
.hero3d .hero-tag {
  position: absolute; bottom: 14px; left: 0; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: 0.28em; text-transform: uppercase; color: var(--ink-faint);
  display: flex; align-items: center; gap: 10px;
}
.hero3d .hero-tag::before { content: ""; width: 26px; height: 1px; background: var(--gold); opacity: 0.6; }
@media (max-width: 900px) {
  .hero3d { grid-template-columns: 1fr; min-height: auto; padding-top: 130px; }
  .hero3d .hero-visual { order: -1; height: min(50svh, 460px); min-height: 340px; margin-bottom: 10px; }
  .hero3d .hero-tag { position: static; margin-top: 2px; }
}

main { position: relative; z-index: 2; }
section { padding: 90px 0; position: relative; }
section.tight { padding: 56px 0; }
.hr-glow { border: none; height: 1px; margin: 0;
  background: linear-gradient(90deg, transparent, var(--hairline-bright), transparent); }

/* --- subpage nav (matches the Descent chrome) --- */
.nav-inner { display: flex; align-items: center; gap: 26px; max-width: 1180px; margin: 0 auto; }
.nav-inner .brand { font-family: var(--sans); }
.nav-inner .dot { width: 11px; height: 11px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff3cf, var(--gold) 55%, var(--gold-lo));
  box-shadow: 0 0 14px rgba(216,169,78,0.85); }
.nav-links a.active { color: var(--gold); background: rgba(216,169,78,0.10); }

/* --- headings & copy --- */
h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em;
  line-height: 1.08; font-size: clamp(28px, 4vw, 48px); color: var(--ink); margin-top: 6px; }
h3 { font-family: var(--serif); font-weight: 400; color: var(--ink); }
.lede { font-size: 17px; color: var(--ink-dim); max-width: 640px; line-height: 1.6; margin-top: 18px; }
.lede b { color: var(--ink); font-weight: 500; }
.dim { color: var(--ink-dim); }
.mono { font-family: var(--mono); font-size: 0.9em; }

/* hero (subpages) */
.hero { min-height: 78svh; display: flex; align-items: center; padding: 130px 0 70px; }
.hero h1 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em;
  line-height: 1.02; font-size: clamp(44px, 7vw, 90px); color: var(--ink); }
.hero h1 .grad, .display em { font-style: normal;
  background: linear-gradient(100deg, var(--gold-hi), var(--gold) 60%, var(--gold-lo));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .tagline { font-size: clamp(17px, 2vw, 21px); color: var(--ink-dim);
  max-width: 680px; margin-top: 22px; line-height: 1.6; }
.hero .tagline b { color: var(--ink); font-weight: 500; }
.hero-meta { display: flex; gap: 10px; flex-wrap: wrap; }

/* --- pills / chips --- */
.pill { display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--hairline);
  color: var(--ink-dim); background: rgba(6,6,8,0.4); }
.pill .sw { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }

/* --- cards & frames --- */
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 820px) { .grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }

.card { background: rgba(6,6,8,0.45); border: 1px solid var(--hairline);
  border-radius: 16px; padding: 26px 26px; backdrop-filter: blur(8px); }
.card h3 { font-size: 19px; margin-bottom: 10px; }
.card p { color: var(--ink-dim); font-size: 14.5px; line-height: 1.6; }
.card .num { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 12px; }

.frame { background: rgba(6,6,8,0.5); border: 1px solid var(--hairline);
  border-radius: 18px; padding: 22px 22px; backdrop-filter: blur(10px); position: relative; }
.frame-label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.facts { display: flex; flex-direction: column; gap: 12px; }
.fact { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 13.5px; }
.fact .fk { font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: 0.08em; padding-top: 2px; }
.fact .fv { color: var(--ink-dim); }

.bigquote { font-family: var(--serif); font-size: clamp(22px, 3vw, 34px); line-height: 1.4;
  color: var(--ink); max-width: 880px; }
.bigquote em { font-style: italic; color: var(--gold-hi); }

.spec { font-family: var(--mono); font-size: 13px; line-height: 1.9; color: var(--ink-dim);
  background: rgba(0,0,0,0.3); border-radius: 12px; padding: 18px 20px; overflow-x: auto; }
.spec .c { color: var(--ink-faint); } .spec .k { color: var(--gold); } .spec .n { color: var(--cyan); }

.badge-note { display: inline-block; font-family: var(--mono); font-size: 12px;
  color: var(--ink-dim); border: 1px solid var(--hairline); border-radius: 999px; padding: 8px 16px; }
.section-link { display: inline-block; margin-top: 28px; font-family: var(--mono); font-size: 13px; color: var(--gold); }
.section-link:hover { color: var(--gold-hi); }

/* --- reveal on scroll --- */
.reveal { opacity: 0; transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* --- shared simulation chrome --- */
.sim-log { font-family: var(--mono); font-size: 12px; color: var(--ink-dim);
  background: rgba(0,0,0,0.28); border-top: 1px solid var(--hairline);
  padding: 12px 18px; height: 118px; overflow-y: auto; line-height: 1.75; }
.sim-log .ok { color: var(--green); } .sim-log .warn { color: var(--amber); } .sim-log .info { color: var(--cyan); }
.sim-controls { display: flex; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--hairline); flex-wrap: wrap; }
.sim-controls .btn { padding: 9px 18px; font-size: 13.5px; }

canvas { display: block; width: 100%; }