/* =========================================================
   SUBSTRATE — réinterprétation Ismoou
   Système de design : noir profond, glow vert, mono technique
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  /* LIGHT is the default theme (Substrate's off-white #fefdfb base). */
  --bg:        #fefdfb;
  --bg-soft:   #f5f4f0;
  --surface:   #f3f2ee;
  --surface-2: #ecebe5;
  --line:      rgba(20, 20, 14, 0.12);
  --line-soft: rgba(20, 20, 14, 0.07);

  --text:      #14140f;
  --muted:     #5c5c54;
  --muted-2:   #8e8e84;

  /* Accent — green. Light contexts use a deeper green for contrast; dark
     (.dark) sections re-declare these to the bright glow values. */
  --ember:     #10a043;
  --ember-hi:  #0a7c33;
  --ember-deep:#d8f6e2;
  --glow-rgb:  30, 180, 92;

  --max:       1240px;
  --gutter:    clamp(20px, 5vw, 64px);

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body:    "Inter", system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Dark (cinematic) contexts ---------- */
/* These sections flip locally to the dark palette so the luminous effects
   (particles, glows, iridescence) keep working on black. */
.dark,
html.hero-dark .hero,
html.hero-dark .page-head {
  --bg:        #050506;
  --bg-soft:   #0a0a0c;
  --surface:   #111114;
  --surface-2: #17171b;
  --line:      rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.06);
  --text:      #f5f5f6;
  --muted:     #9a9aa1;
  --muted-2:   #5d5d65;
  --ember:     #2ed760;
  --ember-hi:  #c2ffd4;
  --ember-deep:#0b3d1c;
  --glow-rgb:  60, 216, 110;
  background-color: #050506;
  color: var(--text);
}

/* THÈME SOMBRE GLOBAL : le toggle de la nav re-thème tout le site (pas juste le héros). */
html.hero-dark {
  --bg:        #050506;
  --bg-soft:   #0a0a0c;
  --surface:   #111114;
  --surface-2: #17171b;
  --line:      rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.06);
  --text:      #f5f5f6;
  --muted:     #9a9aa1;
  --muted-2:   #5d5d65;
  --ember:     #2ed760;
  --ember-hi:  #c2ffd4;
  --ember-deep:#0b3d1c;
  --glow-rgb:  60, 216, 110;
  background-color: #050506;
}

/* Hero / page-head: light by default. The particle field & veil are dark-only
   effects, shown only when the hero is toggled dark. */
.hero-fx { opacity: 1; transition: opacity .55s var(--ease); } /* particules visibles en clair ET sombre */
.hero-veil, .glow-side { opacity: 0; transition: opacity .55s var(--ease); }
html.hero-dark .hero-veil, html.hero-dark .glow-side { opacity: 1; }

/* Hero background toggle (light <-> dark) */
.hero-toggle {
  position: absolute; bottom: 26px; right: var(--gutter); z-index: 6;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .25s var(--ease), transform .25s var(--ease), color .25s var(--ease);
}
.hero-toggle:hover { border-color: var(--ember); transform: scale(1.06); }
.hero-toggle svg { width: 17px; height: 17px; transition: transform .4s var(--ease); }
html.hero-dark .hero-toggle svg { transform: rotate(180deg); }

/* Toggle de thème déplacé dans la nav */
.hero-toggle { display: none; }
.nav-theme {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: border-color .25s var(--ease), transform .25s var(--ease), color .25s var(--ease);
}
.nav-theme:hover { border-color: var(--ember); transform: scale(1.06); }
.nav-theme svg { width: 17px; height: 17px; transition: transform .4s var(--ease); }
html.hero-dark .nav-theme svg { transform: rotate(180deg); }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* (dark-theme vignette removed for the light base) */
body::before { display: none; }
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.section { position: relative; z-index: 3; padding-block: clamp(80px, 12vw, 160px); }
.divider { height: 1px; background: var(--line); border: 0; }

/* Eyebrow / mono label */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow .idx { color: var(--ember); }
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--ember);
  display: inline-block;
}

/* ---------- Typography ---------- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.04; letter-spacing: -0.02em; }
.display {
  font-size: clamp(2.4rem, 6.1vw, 4.9rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}
.h2 { font-size: clamp(1.9rem, 4vw, 3.2rem); }
.h3 { font-size: clamp(1.3rem, 2.2vw, 1.8rem); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.35rem); color: var(--muted); max-width: 60ch; }
.mono { font-family: var(--font-mono); }
.ember { color: var(--ember); }

/* Iridescent text — spectral wafer sheen, applied selectively */
.iris-text {
  background: linear-gradient(100deg, #7c4dff, #2f7fff, #00b3b3, #1aa84a, #d98a00, #2f7fff, #7c4dff);
  background-size: 230% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: irisShift 9s linear infinite;
}
@keyframes irisShift { to { background-position: 230% 0; } }
@media (prefers-reduced-motion: reduce) { .iris-text { animation: none; } }

/* Iridescent silicon-wafer illustration */
.wafer-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.wafer { width: 100%; max-width: 340px; height: auto; }
.wafer-sheen { animation: waferShimmer 11s linear infinite; transform-box: fill-box; }
@keyframes waferShimmer { from { transform: translateX(0); } to { transform: translateX(-180px); } }
.wafer-cap { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .wafer-sheen { animation: none; } }

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: border-color .4s var(--ease), background .4s var(--ease);
  /* default: over the light hero / light content → dark text */
  --text: #14140f; --muted: #5c5c54; --line: rgba(20,20,14,0.12); --bg-soft: #0a0a0c;
  color: var(--text);
}
.nav.scrolled {
  background: rgba(254, 253, 251, 0.82);
  backdrop-filter: blur(14px);
  border-bottom-color: rgba(20, 20, 14, 0.10);
  --text: #14140f; --muted: #5c5c54; --line: rgba(20,20,14,0.12);
  color: var(--text);
}
/* when the hero is toggled dark, the nav over it goes light */
html.hero-dark .nav:not(.scrolled) {
  --text: #f5f5f6; --muted: #b9b9c0; --line: rgba(255,255,255,0.12);
  color: var(--text);
}
.nav .brand .mark { filter: invert(1); }                         /* dark logo on light nav */
html.hero-dark .nav:not(.scrolled) .brand .mark { filter: none; } /* white logo over dark hero */
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.005em;
  text-transform: lowercase;
  display: flex; align-items: center; gap: 10px;
}
/* Substrate mark — loaded from assets/img/logo.svg (swap that file for the
   official logo anytime; it inherits the text colour via currentColor). */
.brand .mark {
  width: 21px; height: 21px;
  flex: none;
  background: url(../img/logo.svg) center / contain no-repeat;
}

.nav-links { display: flex; gap: 34px; align-items: center; position: absolute; left: 50%; transform: translateX(-50%); }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  transition: color .25s var(--ease);
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1px; background: var(--ember);
}
.nav-cta {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  transition: all .25s var(--ease);
}
.nav-cta:hover { background: var(--text); color: var(--bg); border-color: var(--text); }

.nav-burger { display: none; background: none; border: 0; color: var(--text); font-size: 22px; }

/* ---------- Hero glow (signature) ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 150px;
  padding-bottom: 96px;
  overflow: hidden;
}
.hero-inner { position: relative; z-index: 4; }
.hero .display { max-width: 16ch; margin-inline: auto; }
.hero .lead { margin: 28px auto 0; text-align: center; }

/* Hero fractured-green-light field (canvas) + readability veil */
.hero-fx {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
/* inner page heads: particles sit behind the heading text */
.page-head .hero-fx { z-index: 1; }
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 50% 44%, rgba(5,5,6,0.62) 0%, rgba(5,5,6,0.25) 38%, transparent 68%),
    linear-gradient(180deg, rgba(5,5,6,0.5) 0%, transparent 22%, transparent 78%, rgba(5,5,6,0.7) 100%);
}

.scroll-hint {
  position: absolute;
  bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 5;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-2);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-hint .line { width: 1px; height: 36px; background: linear-gradient(var(--ember), transparent); }

/* ---------- Demo / mockup badge ---------- */
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
  padding: 6px 15px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
}
.demo-badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 8px 1px rgba(var(--glow-rgb), 0.7);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: 0.04em;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid var(--line);
  transition: all .25s var(--ease);
}
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: var(--ember); border-color: var(--ember); color: var(--bg); }
.btn-ghost:hover { border-color: var(--ember); color: var(--ember); }
.btn .arr { transition: transform .25s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

/* ---------- Manifesto / numbered rows ---------- */
.creed { display: grid; gap: 0; border-top: 1px solid var(--line); }
.creed-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: clamp(20px, 5vw, 70px);
  padding-block: clamp(34px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.creed-row .num { font-family: var(--font-mono); color: var(--ember); font-size: 14px; padding-top: 8px; }
.creed-row p { font-size: clamp(1.25rem, 2.6vw, 2rem); font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.22; color: var(--text); }
.creed-row p em { color: var(--muted); font-style: normal; }

/* ---------- Big stat ---------- */
.stat-band { text-align: center; }
.stat-grid { display: flex; align-items: center; justify-content: center; gap: clamp(24px, 6vw, 80px); flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 8px; }
.stat .figure { font-family: var(--font-display); font-size: clamp(3rem, 9vw, 7rem); font-weight: 500; letter-spacing: -0.04em; line-height: 1; }
.stat .figure.down { color: var(--ember); }
.stat .label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stat-arrow { font-size: clamp(2rem, 6vw, 4rem); color: var(--muted-2); }

/* ---------- Cards / news ---------- */
.card-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.news-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: clamp(16px, 4vw, 48px);
  align-items: baseline;
  padding-block: 26px;
  border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease), padding-inline .3s var(--ease);
}
.news-row:hover { background: rgba(255,255,255,0.02); padding-inline: 16px; }
.news-row .date { font-family: var(--font-mono); font-size: 12px; color: var(--muted-2); letter-spacing: 0.05em; }
.news-row .title { font-family: var(--font-display); font-size: clamp(1.1rem, 2vw, 1.5rem); letter-spacing: -0.01em; }
.news-row .src { font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; white-space: nowrap; }
.news-row:hover .title { color: var(--ember); }

/* press logos strip */
.press-strip { display: flex; flex-wrap: wrap; gap: clamp(20px, 5vw, 56px); align-items: center; justify-content: center; opacity: 0.7; }
.press-strip span { font-family: var(--font-display); font-size: clamp(1rem, 2vw, 1.4rem); color: var(--muted); letter-spacing: 0.02em; }

/* ---------- Generic two-col + feature grid ---------- */
.lede-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(30px, 6vw, 90px); align-items: start; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.feature {
  background: var(--bg);
  padding: clamp(26px, 3vw, 40px);
  display: flex; flex-direction: column; gap: 14px; min-height: 220px;
}
.feature .k { font-family: var(--font-mono); font-size: 12px; color: var(--ember); letter-spacing: 0.1em; }
.feature h3 { font-size: 1.25rem; }
.feature p { color: var(--muted); font-size: 0.98rem; }

/* ---------- Backed-by carousel (gradient cards) ---------- */
.carousel-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; margin-bottom: clamp(28px, 4vw, 44px); }
.carousel-nav { display: flex; align-items: center; gap: 16px; }
.car-arrow {
  width: 42px; height: 42px; flex: none;
  border: 1px solid var(--line); border-radius: 50%;
  background: none; color: var(--text); font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .25s var(--ease), color .25s var(--ease), background-color .25s var(--ease);
}
.car-arrow:hover { border-color: var(--ember); color: var(--ember); }
.car-count { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; color: var(--muted-2); min-width: 56px; text-align: center; }
.car-count [data-car-current] { color: var(--text); }

.carousel { overflow: hidden; }
.carousel-track {
  display: flex; gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding-bottom: 4px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.inv-card {
  flex: 0 0 clamp(258px, 31%, 340px);
  scroll-snap-align: start;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--surface);
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.inv-card:hover { border-color: rgba(255,255,255,0.22); transform: translateY(-3px); }
.inv-card-art { height: 152px; display: flex; align-items: center; justify-content: center; padding: 20px; }
.inv-card-art.g1 { background: linear-gradient(135deg, #0b3d1c, #2ed760 55%, #bdf7cf); }
.inv-card-art.g2 { background: linear-gradient(135deg, #04322f, #1fb6a6 55%, #8ff0d8); }
.inv-card-art.g3 { background: linear-gradient(140deg, #16361a, #6fcf3f 55%, #dcff9a); }
.inv-card-art.g4 { background: linear-gradient(135deg, #08302b, #2ed760 50%, #1f8f6a); }
.inv-card-art.g5 { background: linear-gradient(135deg, #1a3a10, #4fd06a 55%, #c6ffa6); }
.inv-logo { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.01em; color: #07210e; text-align: center; line-height: 1.1; }
.inv-card-body { padding: 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.inv-card-title { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: -0.01em; }
.inv-card-desc { color: var(--muted); font-size: 0.92rem; line-height: 1.5; flex: 1; }
.inv-card-link { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: var(--ember); display: inline-flex; gap: 6px; align-items: center; }
.inv-card-link:hover { text-decoration: underline; }
@media (max-width: 700px) { .inv-card { flex-basis: 80%; } }

/* ---------- Careers ---------- */
.role-list { border-top: 1px solid var(--line); }
.role {
  display: grid; grid-template-columns: 1fr auto auto; gap: 24px; align-items: center;
  padding-block: 24px; border-bottom: 1px solid var(--line);
  transition: padding-inline .3s var(--ease), background .3s var(--ease);
}
.role:hover { padding-inline: 16px; background: rgba(255,255,255,0.02); }
.role .pos { font-family: var(--font-display); font-size: clamp(1.05rem, 2vw, 1.4rem); }
.role .meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.05em; }
.role .go { color: var(--ember); font-family: var(--font-mono); font-size: 13px; }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; position: relative; overflow: hidden; }
.cta-band .glow-floor {
  position: absolute; left: 50%; bottom: -60%; transform: translateX(-50%);
  width: 120vw; height: 120vw; border-radius: 50%; z-index: 0;
  background: radial-gradient(circle at 50% 0%, rgba(var(--glow-rgb),0.3) 0%, rgba(var(--glow-rgb),0.08) 18%, transparent 36%);
  filter: blur(10px);
}
.cta-band .wrap { position: relative; z-index: 2; }

/* ---------- Footer ---------- */
.footer { position: relative; z-index: 3; border-top: 1px solid var(--line); padding-block: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ember); margin-bottom: 18px; font-weight: 400; }
.footer .brand .mark { filter: invert(1); }
.footer ul { list-style: none; display: grid; gap: 12px; }
.footer a { color: var(--muted); font-size: 14px; transition: color .2s var(--ease); }
.footer a:hover { color: var(--ember); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 50px; padding-top: 26px; border-top: 1px solid var(--line-soft); font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; flex-wrap: wrap; gap: 14px; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .08s; }
.reveal[data-d="2"] { transition-delay: .16s; }
.reveal[data-d="3"] { transition-delay: .24s; }
.reveal[data-d="4"] { transition-delay: .32s; }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding-top: clamp(150px, 20vh, 220px); position: relative; overflow: hidden; }
.page-head .glow-side {
  position: absolute; right: -20%; top: -30%; width: 70vw; height: 70vw; border-radius: 50%; z-index: 0;
  background: radial-gradient(circle, rgba(var(--glow-rgb),0.22), transparent 60%); filter: blur(20px);
}
.page-head .wrap { position: relative; z-index: 2; }
.page-head .display { max-width: 18ch; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: block; }
  .nav.open .nav-links {
    display: flex; flex-direction: column; gap: 22px;
    position: fixed; inset: 64px 0 auto 0; padding: 30px var(--gutter);
    background: var(--bg-soft); border-bottom: 1px solid var(--line);
  }
  .nav.open .nav-cta { display: inline-flex; position: fixed; top: 80px; right: var(--gutter); }
  .diagram, .lede-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .news-row { grid-template-columns: 1fr; gap: 6px; }
  .news-row .src { white-space: normal; }
  .role { grid-template-columns: 1fr; gap: 8px; }
  .creed-row { grid-template-columns: 1fr; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
  .wm-particle, .wm-glow, .lattice, .wm-node { animation: none !important; }
  .d3d { transform: none !important; }
}

/* =========================================================
   ENRICHMENTS — custom cursor, page transitions, wormhole
   ========================================================= */


/* ---------- Custom cursor ---------- */
.cursor-on { cursor: none; }
.cursor-on a, .cursor-on button { cursor: none; }
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .3s var(--ease);
  margin-left: 0; margin-top: 0;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--ember);
  margin: -3px 0 0 -3px;
}
.cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,0.45);
  margin: -17px 0 0 -17px;
  transition: opacity .3s var(--ease), width .25s var(--ease), height .25s var(--ease),
              border-color .25s var(--ease), background-color .25s var(--ease);
}
.cursor-active .cursor-dot, .cursor-active .cursor-ring { opacity: 1; }
.cursor-hover .cursor-ring {
  width: 56px; height: 56px;
  margin: -28px 0 0 -28px;
  border-color: var(--ember);
  background: rgba(var(--glow-rgb),0.10);
}
.cursor-hover .cursor-dot { opacity: 0; }
.cursor-down .cursor-ring { width: 26px; height: 26px; margin: -13px 0 0 -13px; }

/* ---------- Wormhole diagram ---------- */
/* wormhole sits to the RIGHT of the text (two columns); static, no tilt */
.wm-grid {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.wm-head { max-width: 46ch; }
.wm-stage { display: flex; justify-content: center; }
.wormhole { width: 100%; height: auto; display: block; overflow: visible; }
.d3d { width: 100%; max-width: 760px; }
@media (max-width: 900px) {
  .wm-grid { grid-template-columns: 1fr; gap: clamp(24px, 6vw, 48px); }
  .wm-head { max-width: none; }
}

/* wireframe strokes */
.wm-line  { fill: none; stroke: rgba(20,20,14,0.16); stroke-width: 1; }
.wm-ring  { fill: none; stroke: rgba(20,20,14,0.26); stroke-width: 1; }
.wm-accent{ fill: none; stroke: var(--ember); stroke-width: 1.4; }
.wm-dot   { fill: rgba(20,20,14,0.32); }
.wm-node  { fill: var(--ember); animation: nodePulse 3s ease-in-out infinite; }
.wm-node.n2 { animation-delay: .8s; fill: #0a93a8; }
.wm-node.n3 { animation-delay: 1.6s; fill: #2a5fd0; }
/* iridescent wafer sheen on the silicon lattice (subtle) */
.lattice .wm-line { stroke: url(#wmIris); }
.wm-divider { stroke: rgba(255,255,255,0.10); stroke-width: 1; }
.wm-num   { fill: var(--ember); font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; }
.wm-label { fill: var(--text); font-family: var(--font-mono); font-size: 13px; letter-spacing: .12em; }
.wm-sub   { fill: var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; }

/* throat glow */
.wm-glow { fill: url(#wmGlow); animation: throatPulse 4s ease-in-out infinite; transform-box: view-box; transform-origin: 300px 380px; }
@keyframes throatPulse {
  0%, 100% { opacity: .55; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.18); }
}
@keyframes nodePulse {
  0%, 100% { opacity: .35; }
  50%      { opacity: 1; }
}

/* lattice float */
.lattice { animation: latticeFloat 7s ease-in-out infinite; transform-box: view-box; transform-origin: 300px 150px; }
@keyframes latticeFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* particles rising through the funnel: information -> atoms */
.wm-particle {
  fill: var(--ember);
  animation: rise 4.6s linear infinite;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes rise {
  0%   { transform: translateY(0) scale(1);   opacity: 0; }
  8%   { opacity: 1; }
  48%  { transform: translateY(-235px) scale(.4); opacity: 1; }  /* squeeze at throat */
  92%  { opacity: 1; }
  100% { transform: translateY(-470px) scale(1.1); opacity: 0; }
}

@media (max-width: 640px) {
  .wm-sub { display: none; }
  .wm-label { font-size: 11px; }
}

/* ---------- Language switcher (dropdown) ---------- */
.nav-right { display: flex; align-items: center; gap: 20px; }
.lang { position: relative; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: 0; padding: 4px 2px;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .04em;
  color: var(--text); transition: color .2s var(--ease);
}
.lang-caret { font-size: 9px; color: var(--muted); transition: transform .25s var(--ease); }
.lang.open .lang-caret { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 12px); right: 0;
  display: flex; flex-direction: column; min-width: 150px;
  padding: 6px; z-index: 60;
  background: rgba(12, 12, 14, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 12px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
}
.lang.open .lang-menu { opacity: 1; visibility: visible; transform: none; }
.lang-menu .lang-btn {
  background: none; border: 0; text-align: left;
  padding: 9px 12px; border-radius: 7px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: .02em;
  color: rgba(255,255,255,0.62); transition: color .2s var(--ease), background-color .2s var(--ease);
}
.lang-menu .lang-btn:hover { color: #fff; background: rgba(255,255,255,0.06); }
.lang-menu .lang-btn.active { color: #fff; }
.lang-menu .lang-btn.active::after { content: " ·"; color: #2ed760; }

/* ---------- Cost divergence chart (our-purpose) ---------- */
.chart-wrap { margin-top: clamp(28px, 5vw, 54px); display: flex; justify-content: center; }
.chart { width: 100%; max-width: 620px; height: auto; overflow: visible; }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-grid { stroke: var(--line-soft); stroke-width: 1; }
.chart-line { fill: none; stroke-width: 2.2; stroke-dasharray: 640; stroke-dashoffset: 640; }
.chart-line.industry { stroke: var(--muted); }
.chart-line.substrate { stroke: var(--ember); }
.in .chart-line { animation: draw 1.8s var(--ease) forwards; }
.in .chart-line.substrate { animation-delay: .35s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart-dot { fill: var(--muted); opacity: 0; }
.chart-dot.hot { fill: var(--ember); }
.in .chart-dot { animation: dotIn .4s var(--ease) 1.6s forwards; }
@keyframes dotIn { to { opacity: 1; } }
.chart-lab { fill: var(--muted); font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; }
.chart-lab.hot { fill: var(--ember); }
.chart-axlab { fill: var(--muted-2); font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; }
/* filled area under chart lines */
.chart-area { opacity: 0; }
.in .chart-area { animation: areaIn 1.3s var(--ease) .5s forwards; }
@keyframes areaIn { to { opacity: 1; } }
/* declining-share chart extras */
.chart-line.us { stroke: var(--muted); }
.chart-proj { fill: none; stroke: var(--ember); stroke-width: 2.2; stroke-dasharray: 5 6; opacity: 0; }
.in .chart-proj { animation: areaIn 1s var(--ease) 1.4s forwards; }
.chart-cap { text-align: center; font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin-top: 22px; }
@media (prefers-reduced-motion: reduce) { .chart-area, .chart-proj { opacity: 1; animation: none; } }

/* heritage timeline */
.timeline-svg { width: 100%; height: auto; overflow: visible; }
.tl-line { stroke: var(--line); stroke-width: 1.5; }
.tl-line.us { stroke: var(--ember); }
.tl-dot { fill: var(--ember); }
.tl-dot.off { fill: var(--muted-2); }
.tl-year { fill: var(--text); font-family: var(--font-mono); font-size: 11px; letter-spacing: .05em; }
.tl-lab { fill: var(--muted); font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .06em; }
.tl-lab.g { fill: var(--ember); }

/* AI <-> silicon loop */
.loop-stage { display: flex; justify-content: center; }
.loop { width: 100%; max-width: 400px; height: auto; overflow: visible; }
.loop-node { fill: none; stroke: var(--muted-2); stroke-width: 1.4; }
.loop-label { fill: var(--text); font-family: var(--font-display); font-size: 15px; }
.loop-arc { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-dasharray: 5 6; animation: loopFlow 1.5s linear infinite; }
.loop-arc.g { stroke: var(--ember); }
@keyframes loopFlow { to { stroke-dashoffset: -22; } }
.loop-cap { fill: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; }
.loop-sub { fill: var(--ember); font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em; }
@media (prefers-reduced-motion: reduce) { .loop-arc { animation: none; } }

/* ---------- Synchrotron / accelerator (about) ---------- */
.accel-stage { display: flex; justify-content: center; }
.accel { width: 100%; max-width: 440px; height: auto; overflow: visible; }
.accel-ring { fill: none; stroke: rgba(20,20,14,0.22); stroke-width: 1.5; }
.accel-ring.inner { stroke: rgba(20,20,14,0.1); }
.accel-node { fill: none; stroke: rgba(20,20,14,0.18); stroke-width: 1; }
.accel-beam { stroke: var(--ember); stroke-width: 1.4; opacity: .4; animation: beamPulse 3s ease-in-out infinite; }
.accel-beam.b2 { animation-delay: 1s; stroke: #3cd8d8; }
.accel-beam.b3 { animation-delay: 2s; stroke: #5b9bff; }
.accel-lab { fill: var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; }
.electron {
  fill: var(--ember);
  offset-path: path('M50 165 A150 56 0 1 0 350 165 A150 56 0 1 0 50 165');
  animation: orbit 4.5s linear infinite;
}
.electron-halo {
  fill: var(--ember-hi); opacity: .25;
  offset-path: path('M50 165 A150 56 0 1 0 350 165 A150 56 0 1 0 50 165');
  animation: orbit 4.5s linear infinite;
}
@keyframes orbit { to { offset-distance: 100%; } }
@keyframes beamPulse { 0%, 100% { opacity: .2; } 50% { opacity: .65; } }

@media (prefers-reduced-motion: reduce) {
  .electron, .electron-halo, .accel-beam { animation: none !important; }
  .chart-line { stroke-dashoffset: 0 !important; animation: none !important; }
  .chart-dot { opacity: 1 !important; }
}

@media (max-width: 900px) {
  .nav.open .nav-right { display: flex; position: static; }
}
