/* =========================================================================
   ERNOS SHOWCASE — design system
   A single source of truth for color, type, spacing, and shared components.
   Dark, luminous, mesh-native. Built to scale across pillars.
   ========================================================================= */

:root {
  /* --- Palette -------------------------------------------------------- */
  --bg-0: #06080d;          /* deepest background */
  --bg-1: #0a0e16;          /* page background */
  --bg-2: #0f1420;          /* raised surface */
  --bg-3: #161d2c;          /* card / panel */
  --bg-4: #1d2638;          /* hover surface */
  --line: #222c40;          /* hairline borders */
  --line-soft: #1a2233;

  --ink-0: #eef3fb;         /* primary text */
  --ink-1: #b7c2d6;         /* secondary text */
  --ink-2: #7e8aa3;         /* muted text */
  --ink-3: #515d75;         /* faint text */

  --glow: #4ff0c4;          /* signature ernos glow (cyan-green) */
  --glow-dim: #2bbf9b;
  --accent: #7c8cff;        /* indigo accent */
  --accent-2: #ff8a6b;      /* warm secondary (literary) */
  --gold: #f5c45e;

  --good: #4ff0c4;
  --warn: #f5c45e;
  --bad: #ff6b81;

  /* --- Type ----------------------------------------------------------- */
  --font-display: "Space Grotesk", "SF Pro Display", system-ui, sans-serif;
  --font-body: "Inter", "SF Pro Text", system-ui, -apple-system, sans-serif;
  --font-read: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;

  /* --- Geometry ------------------------------------------------------- */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-pill: 999px;

  --maxw: 1180px;
  --readw: 720px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --shadow: 0 18px 50px -22px rgba(0,0,0,.8);
  --ring: 0 0 0 1px var(--line), 0 0 28px -10px rgba(79,240,196,.25);
}

/* --- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-1);
  color: var(--ink-1);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { max-width: 100%; display: block; }
a { color: var(--glow); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: #8ff7da; }
::selection { background: rgba(79,240,196,.28); color: #fff; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink-0);
  line-height: 1.12;
  letter-spacing: -.02em;
  font-weight: 600;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1.1em; }

/* --- Layout ----------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 48px); }
.section { padding-block: clamp(64px, 10vw, 130px); position: relative; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--glow-dim);
  margin: 0 0 1rem;
}
.lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--ink-1); max-width: 60ch; }

/* --- Background field (shared mesh canvas) ---------------------------- */
#mesh {
  position: fixed; inset: 0; z-index: -2;
  width: 100%; height: 100%;
  pointer-events: none;
}
.bg-veil {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 75% -10%, rgba(124,140,255,.12), transparent 60%),
    radial-gradient(900px 600px at 5% 10%, rgba(79,240,196,.10), transparent 55%),
    linear-gradient(180deg, transparent, var(--bg-1) 80%);
}

/* --- Top navigation --------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(14px) saturate(140%);
  background: rgba(8,11,18,.66);
  border-bottom: 1px solid var(--line-soft);
}
.nav__in { display: flex; align-items: center; gap: 22px; height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-weight: 600; color: var(--ink-0); letter-spacing: -.01em; }
.brand .mark {
  width: 26px; height: 26px; flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(79,240,196,.6));
}
.nav__links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav__links a {
  color: var(--ink-1); font-size: .92rem; padding: 8px 13px; border-radius: var(--r-pill);
  transition: background .2s, color .2s;
}
.nav__links a:hover { color: var(--ink-0); background: var(--bg-3); }
.nav__links a.active { color: var(--glow); background: rgba(79,240,196,.08); }
.nav__burger { display: none; background: none; border: 0; color: var(--ink-0); font-size: 1.5rem; cursor: pointer; margin-left: auto; }

/* global read-aloud player, centred in the nav */
.navplayer { flex: 1; display: flex; align-items: center; justify-content: center; gap: 11px; min-width: 0; max-width: 360px; margin-inline: auto; }
.navplayer__btn {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--glow); font-size: .82rem;
  display: flex; align-items: center; justify-content: center; transition: background .2s, border-color .2s, transform .15s;
}
.navplayer__btn:hover { background: var(--bg-4); border-color: var(--glow-dim); transform: scale(1.06); }
.navplayer__bar { flex: 1; height: 4px; min-width: 40px; background: var(--bg-4); border-radius: var(--r-pill); overflow: hidden; }
.navplayer__fill { width: 0; height: 100%; background: linear-gradient(90deg, var(--glow-dim), var(--glow)); border-radius: var(--r-pill); transition: width .25s var(--ease); }
.navplayer__fill.np-indet { width: 40% !important; background: linear-gradient(90deg, transparent, var(--glow), var(--accent), transparent); border-radius: var(--r-pill); transition: none; animation: np-sweep 1.0s ease-in-out infinite; }
@keyframes np-sweep { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.navplayer__btn.np-load { animation: np-pulse 0.9s ease-in-out infinite; color: var(--gold); }
@keyframes np-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(245,196,94,.0); transform: scale(1); } 50% { box-shadow: 0 0 14px -2px rgba(245,196,94,.7); transform: scale(1.08); } }
.navplayer__status { flex: 0 0 auto; font-family: var(--font-mono); font-size: .72rem; color: var(--ink-2); white-space: nowrap; min-width: 58px; }

@media (max-width: 720px) {
  .navplayer { max-width: 150px; gap: 8px; margin-right: 6px; }
  .navplayer__status { display: none; }
}

/* --- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body); font-weight: 550; font-size: .95rem;
  padding: 12px 20px; border-radius: var(--r-pill);
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .25s, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary {
  background: linear-gradient(180deg, var(--glow), var(--glow-dim));
  color: #04130e; box-shadow: 0 12px 34px -14px rgba(79,240,196,.7);
}
.btn--primary:hover { box-shadow: 0 18px 44px -14px rgba(79,240,196,.85); color: #04130e; }
.btn--ghost { background: var(--bg-3); color: var(--ink-0); border-color: var(--line); }
.btn--ghost:hover { background: var(--bg-4); border-color: var(--glow-dim); color: var(--ink-0); }

/* --- Cards & grid ----------------------------------------------------- */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px;
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
  overflow: hidden;
}
.card:hover { transform: translateY(-4px); border-color: var(--glow-dim); box-shadow: var(--shadow); }
.card__tag { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); }
.card h3 { margin: 12px 0 8px; }
.card p { color: var(--ink-1); font-size: .96rem; margin: 0; }

/* pillar cards link styling */
.pillar { display: flex; flex-direction: column; min-height: 230px; text-decoration: none; }
.pillar .pillar__glyph { font-size: 1.7rem; margin-bottom: auto; }
.pillar .go { margin-top: 18px; font-family: var(--font-mono); font-size: .8rem; letter-spacing: .12em; color: var(--glow); display: inline-flex; gap: 8px; align-items: center; }
.pillar:hover .go { gap: 12px; }

/* --- Chips / badges --------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .06em;
  padding: 5px 11px; border-radius: var(--r-pill);
  background: var(--bg-3); border: 1px solid var(--line); color: var(--ink-1);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 8px var(--glow); }

/* --- Code blocks ------------------------------------------------------ */
pre, code { font-family: var(--font-mono); }
pre {
  background: var(--bg-0); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 18px 20px; overflow-x: auto; font-size: .88rem; line-height: 1.6; color: #d6e2f0;
}
:not(pre) > code { background: var(--bg-3); padding: 2px 7px; border-radius: 6px; font-size: .86em; color: var(--glow); }

/* ernos syntax tints (used by playground + samples) */
.tok-kw { color: #7c8cff; }
.tok-fn { color: #4ff0c4; }
.tok-num { color: #f5c45e; }
.tok-str { color: #ff8a6b; }
.tok-com { color: #515d75; font-style: italic; }
.tok-op { color: #b7c2d6; }

/* --- Footer ----------------------------------------------------------- */
.foot { border-top: 1px solid var(--line-soft); padding-block: 54px; color: var(--ink-2); font-size: .9rem; }
.foot__in { display: flex; flex-wrap: wrap; gap: 26px; justify-content: space-between; align-items: flex-start; }
.foot a { color: var(--ink-1); }
.foot a:hover { color: var(--glow); }
.foot__cols { display: flex; gap: 54px; flex-wrap: wrap; }
.foot__col h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .18em; color: var(--ink-3); font-family: var(--font-mono); margin-bottom: 12px; }
.foot__col a { display: block; margin-bottom: 8px; font-size: .9rem; }

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

/* --- Utility ---------------------------------------------------------- */
.center { text-align: center; }
.mx-auto { margin-inline: auto; }
.mt-s { margin-top: 14px; } .mt-m { margin-top: 28px; } .mt-l { margin-top: 48px; }
.glow-text { color: var(--glow); text-shadow: 0 0 22px rgba(79,240,196,.5); }
.divider { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); border: 0; margin: 0; }
.kbd { font-family: var(--font-mono); font-size: .8rem; background: var(--bg-3); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; color: var(--ink-1); }

/* --- Responsive ------------------------------------------------------- */
@media (max-width: 900px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .grid--2, .grid--4 { grid-template-columns: 1fr; }
  .nav__links { position: fixed; inset: 64px 0 auto; flex-direction: column; background: rgba(8,11,18,.97); border-bottom: 1px solid var(--line); padding: 14px; gap: 4px; transform: translateY(-130%); transition: transform .3s var(--ease); }
  .nav__links.open { transform: none; }
  .nav__links a { padding: 13px; }
  .nav__burger { display: block; }
}

/* =========================================================================
   LIBRARY READER
   ========================================================================= */
.hidden { display: none !important; }
.work-card { text-align: left; font: inherit; cursor: pointer; width: 100%; }

.reader__bar {
  position: sticky; top: 64px; z-index: 40;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px clamp(16px,4vw,40px);
  background: rgba(10,14,22,.86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.reader__bar .r-title { font-family: var(--font-display); color: var(--ink-0); font-weight: 600; margin-right: auto; font-size: 1.02rem; }
.r-btn {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--ink-1);
  border-radius: var(--r-pill); padding: 7px 13px; cursor: pointer; font: inherit; font-size: .86rem;
  transition: background .2s, color .2s, border-color .2s;
}
.r-btn:hover { background: var(--bg-4); color: var(--ink-0); border-color: var(--glow-dim); }
.r-search {
  background: var(--bg-0); border: 1px solid var(--line); color: var(--ink-0);
  border-radius: var(--r-pill); padding: 7px 14px; font: inherit; font-size: .86rem; width: 180px;
}
.r-search:focus { outline: none; border-color: var(--glow-dim); box-shadow: 0 0 0 3px rgba(79,240,196,.12); }
.r-count { font-family: var(--font-mono); font-size: .76rem; color: var(--ink-2); min-width: 70px; }

.reader__wrap { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 40px; max-width: 1100px; margin-inline: auto; padding: 36px clamp(16px,4vw,40px) 90px; }
.toc { position: sticky; top: 130px; align-self: start; max-height: calc(100vh - 160px); overflow-y: auto; border-right: 1px solid var(--line-soft); padding-right: 18px; }
.toc__title { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.toc__link { display: block; color: var(--ink-2); font-size: .86rem; padding: 4px 0; cursor: pointer; line-height: 1.4; transition: color .15s; }
.toc__link:hover { color: var(--glow); }
.toc__lvl1 { color: var(--ink-1); font-weight: 600; margin-top: 8px; }
.toc__lvl2 { padding-left: 12px; }
.toc__lvl3 { padding-left: 24px; font-size: .82rem; }
.toc__lvl4 { padding-left: 36px; font-size: .8rem; }

.doc {
  font-family: var(--font-read); color: var(--ink-1); line-height: 1.75;
  max-width: 40em; font-size: 19px;
}
.doc h1, .doc h2, .doc h3 { font-family: var(--font-display); color: var(--ink-0); margin-top: 1.6em; scroll-margin-top: 140px; }
.doc h1 { font-size: 1.9em; } .doc h2 { font-size: 1.45em; } .doc h3 { font-size: 1.18em; }
.doc p { margin: 0 0 1.1em; }
.doc blockquote { border-left: 3px solid var(--glow-dim); padding-left: 18px; margin: 1.4em 0; color: var(--ink-2); font-style: italic; }
.doc a { color: var(--glow); } .doc code { font-family: var(--font-mono); font-size: .85em; color: var(--glow); background: var(--bg-3); padding: 1px 6px; border-radius: 5px; }
.doc pre { font-family: var(--font-mono); }
.doc mark { background: rgba(245,196,94,.32); color: #fff; border-radius: 3px; padding: 0 2px; }
.doc .loading { color: var(--ink-2); font-style: italic; }

@media (max-width: 820px) {
  .reader__wrap { grid-template-columns: 1fr; }
  .toc { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line-soft); padding-bottom: 16px; margin-bottom: 8px; }
  .toc__lvl3, .toc__lvl4 { display: none; }
}

/* =========================================================================
   ERNOSPLAIN PLAYGROUND
   ========================================================================= */
.pg { display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 22px; align-items: start; }
.pg__gallery { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 86px; }
.ex-btn {
  text-align: left; background: var(--bg-3); border: 1px solid var(--line); color: var(--ink-1);
  border-radius: var(--r-md); padding: 12px 14px; cursor: pointer; font: inherit;
  display: flex; flex-direction: column; gap: 3px; transition: border-color .2s, background .2s, transform .15s;
}
.ex-btn:hover { border-color: var(--glow-dim); transform: translateX(3px); }
.ex-btn.active { border-color: var(--glow); background: rgba(79,240,196,.07); }
.ex-btn strong { color: var(--ink-0); font-family: var(--font-display); font-weight: 600; font-size: .95rem; }
.ex-btn span { color: var(--ink-2); font-size: .8rem; }

.pg__main { display: grid; grid-template-rows: auto auto; gap: 14px; }
.pg__editor-wrap { position: relative; }
.pg__label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
/* syntax-highlighted editor: a coloured layer behind a transparent textarea */
.editor {
  display: flex; background: var(--bg-0); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden; transition: border-color .2s, box-shadow .2s;
}
.editor:focus-within { border-color: var(--glow-dim); box-shadow: 0 0 0 3px rgba(79,240,196,.1); }
.editor__gutter { flex: 0 0 46px; padding: 18px 10px 18px 0; text-align: right; color: var(--ink-3); background: var(--bg-1); border-right: 1px solid var(--line-soft); overflow: hidden; }
.editor__code { position: relative; flex: 1; min-width: 0; }
.editor__gutter, .editor__hl, .editor__ta { font-family: var(--font-mono); font-size: .92rem; line-height: 1.65; tab-size: 4; -moz-tab-size: 4; }
.editor__hl { position: absolute; inset: 0; margin: 0; padding: 18px; white-space: pre; overflow: auto; pointer-events: none; color: #d6e2f0; }
.editor__ta {
  position: relative; display: block; width: 100%; min-height: 340px; margin: 0; padding: 18px;
  white-space: pre; overflow: auto; border: 0; outline: none; resize: vertical;
  background: transparent; color: transparent; caret-color: var(--glow);
}
.editor__ta::selection { background: rgba(79,240,196,.28); }
.pg__bar { display: flex; align-items: center; gap: 14px; }
.run-status { font-family: var(--font-mono); font-size: .82rem; color: var(--glow); }
.run-status.err { color: var(--bad); }
.output {
  background: #040a0c; border: 1px solid var(--line); border-radius: var(--r-md);
  color: #bdf5e4; font-family: var(--font-mono); font-size: .9rem; line-height: 1.6;
  padding: 18px 20px; min-height: 130px; white-space: pre-wrap; overflow-x: auto; margin: 0;
}
.output.err { color: #ffb3bf; border-color: rgba(255,107,129,.4); background: #160a0d; }
@keyframes out-flash { 0% { box-shadow: 0 0 0 2px var(--glow) inset; } 100% { box-shadow: 0 0 0 0 transparent inset; } }
.output.flash { animation: out-flash .55s var(--ease); }

/* demo game console */
.game { display: flex; flex-direction: column; gap: 14px; }
.game__bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.game__out {
  background: #040a0c; border: 1px solid var(--line); border-radius: var(--r-md);
  color: #bdf5e4; font-family: var(--font-mono); font-size: .86rem; line-height: 1.55;
  padding: 18px 20px; min-height: 160px; max-height: 460px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word; margin: 0;
}
.game__out strong { color: var(--ink-0); font-weight: 600; }

/* live REPL terminal */
.term { background: #040a0c; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; font-family: var(--font-mono); }
.term__log { padding: 16px 18px; max-height: 280px; min-height: 90px; overflow-y: auto; font-size: .88rem; line-height: 1.6; }
.term__log:empty::before { content: "the session is empty — type below and press Enter"; color: var(--ink-3); }
.term-line { white-space: pre-wrap; word-break: break-word; }
.term-line.term-in { color: var(--ink-1); }
.term-line.term-out { color: var(--glow); }
.term-line.term-err { color: var(--bad); }
.term-line.term-dim { color: var(--ink-3); }
.term-line.term-help { color: var(--ink-1); border-left: 2px solid var(--glow-dim); padding-left: 12px; margin: 6px 0; }
.term__row { display: flex; align-items: flex-start; gap: 10px; border-top: 1px solid var(--line); padding: 12px 18px; }
.term__prompt { color: var(--glow); font-weight: 600; padding-top: 3px; }
.term__input { flex: 1; background: transparent; border: 0; outline: none; resize: vertical; color: #d6e2f0; font-family: var(--font-mono); font-size: .9rem; line-height: 1.55; min-height: 2.6em; tab-size: 4; }
.term__input::placeholder { color: var(--ink-3); }

/* language comparison (ErnosPlain vs the rest) */
.compare { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; align-items: start; }
.compare__col { background: var(--bg-0); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.compare__col.is-ep { border-color: var(--glow-dim); box-shadow: 0 0 34px -16px rgba(79,240,196,.55); }
.compare__head { display: flex; justify-content: space-between; align-items: center; padding: 11px 15px; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-weight: 600; font-size: .92rem; color: var(--ink-1); }
.compare__col.is-ep .compare__head { color: var(--glow); }
.compare__head .tag { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.compare pre { border: 0; border-radius: 0; margin: 0; background: transparent; font-size: .82rem; line-height: 1.55; }
@media (max-width: 820px) { .compare { grid-template-columns: 1fr; } }

/* horizontal pipeline chips */
.pipeline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pipe-step { font-family: var(--font-mono); font-size: .82rem; padding: 9px 14px; border-radius: var(--r-pill); background: var(--bg-3); border: 1px solid var(--line); color: var(--ink-1); }
.pipe-step.is-edge { border-color: var(--glow-dim); color: var(--glow); }
.pipe-arrow { color: var(--ink-3); }

@media (max-width: 820px) {
  .pg { grid-template-columns: 1fr; }
  .pg__gallery { position: static; flex-direction: row; flex-wrap: wrap; }
  .pg__gallery .ex-btn { flex: 1 1 140px; }
}

/* =========================================================================
   SMITHIAN FOLD (SFTOM)
   ========================================================================= */
.mono { font-family: var(--font-mono); }
.fold-tool { display: grid; grid-template-columns: 360px 1fr; gap: 32px; align-items: center; }
#fold-canvas { background: radial-gradient(circle at center, rgba(124,140,255,.06), transparent 70%); border: 1px solid var(--line); border-radius: var(--r-lg); margin-inline: auto; }
.fold-controls { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 20px; }
.fold-field { display: flex; flex-direction: column; gap: 6px; }
.fold-field label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.fold-field input { width: 90px; background: var(--bg-0); border: 1px solid var(--line); color: var(--ink-0); border-radius: var(--r-sm); padding: 9px 12px; font: inherit; font-family: var(--font-mono); }
.fold-field input:focus { outline: none; border-color: var(--glow-dim); }
.fold-stat { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.fold-stat span { color: var(--ink-2); } .fold-stat b { color: var(--ink-0); font-family: var(--font-mono); }
.fold-seq { margin-top: 16px; font-family: var(--font-mono); font-size: .9rem; color: var(--glow); line-height: 1.9; word-break: break-word; }

.grand { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: start; }
.big-eq { font-family: var(--font-mono); font-size: 1.15rem; color: var(--ink-0); line-height: 1.7; }
.big-eq b { font-size: 1.5rem; }
.eq-cmp { color: var(--ink-2); font-family: var(--font-mono); font-size: .86rem; margin-top: 10px; }
.g-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); align-items: baseline; }
.g-row span { color: var(--ink-1); } .g-row b { color: var(--glow); font-family: var(--font-mono); }
.g-row em { grid-column: 1 / -1; color: var(--ink-3); font-style: normal; font-size: .8rem; }
.grand-slider { width: 100%; margin: 10px 0 4px; accent-color: var(--glow); }
.grand-cval { font-family: var(--font-mono); color: var(--ink-0); font-size: 1.1rem; }

.census { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.sector { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; background: linear-gradient(180deg,var(--bg-3),var(--bg-2)); position: relative; }
.sector.pred { border-color: rgba(245,196,94,.4); }
.sector__p { font-family: var(--font-mono); font-size: .8rem; color: var(--ink-3); }
.sector h4 { margin: 8px 0 6px; }
.sector p { color: var(--ink-2); font-size: .88rem; margin: 0 0 16px; }
.sector__nums { display: flex; flex-direction: column; gap: 8px; font-family: var(--font-mono); font-size: .82rem; color: var(--ink-1); }
.sector__nums b { color: var(--glow); }
.pill { align-self: flex-start; padding: 3px 10px; border-radius: var(--r-pill); font-size: .72rem; letter-spacing: .04em; }
.pill.known { background: rgba(79,240,196,.12); color: var(--glow); }
.pill.pred { background: rgba(245,196,94,.14); color: var(--gold); }

/* universal game solver */
.game-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.game-controls label { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.game-controls input { width: 70px; background: var(--bg-0); border: 1px solid var(--line); color: var(--ink-0); border-radius: var(--r-sm); padding: 8px 10px; font-family: var(--font-mono); }
.game-controls input:focus { outline: none; border-color: var(--glow-dim); }
.g-verdict { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; padding: 10px 14px; border-radius: var(--r-sm); }
.g-verdict.g-win { background: rgba(79,240,196,.1); color: var(--glow); }
.g-verdict.g-loss { background: rgba(255,107,129,.1); color: var(--bad); }
.g-move { color: var(--ink-1); font-size: .9rem; margin: 10px 0; }
.g-move b { color: var(--ink-0); font-family: var(--font-mono); }
.g-strip { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; }
.g-cell { font-family: var(--font-mono); font-size: .72rem; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 5px; }
.g-cell.g-n { background: var(--bg-3); color: var(--ink-2); }
.g-cell.g-p { background: rgba(255,107,129,.18); color: #ffb3bf; }
.g-oracle { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-2); margin-top: 10px; }
.g-oracle b { color: var(--ink-0); } .g-oracle .g-zero { color: var(--glow); }

/* playable games (you vs the fold) */
.play-heap { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; min-height: 18px; }
.gtok { width: 14px; height: 14px; border-radius: 4px; background: linear-gradient(180deg, var(--glow), var(--glow-dim)); box-shadow: 0 0 8px -2px rgba(79,240,196,.6); }
.play-count { font-family: var(--font-mono); font-size: .8rem; color: var(--ink-2); margin-bottom: 12px; }
.play-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.play-btns .btn { padding: 8px 14px; font-size: .85rem; }
.play-msg { margin-top: 14px; font-size: .92rem; color: var(--ink-1); min-height: 1.4em; }
.nim-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.nim-name { font-family: var(--font-display); font-weight: 600; color: var(--ink-0); width: 18px; flex: 0 0 18px; }
.nim-row .play-heap { flex: 1; margin: 0; min-width: 80px; }
.nim-cnt { font-family: var(--font-mono); font-size: .78rem; color: var(--ink-2); width: 22px; text-align: right; }
.nim-amt { width: 54px; background: var(--bg-0); border: 1px solid var(--line); color: var(--ink-0); border-radius: var(--r-sm); padding: 5px 8px; font-family: var(--font-mono); font-size: .82rem; }
.nim-take { padding: 5px 12px !important; font-size: .8rem !important; }

/* full periodic table */
.ptable { display: flex; flex-direction: column; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.pt-row { display: flex; align-items: center; gap: 12px; }
.pt-plabel { flex: 0 0 96px; font-family: var(--font-mono); font-size: .72rem; color: var(--ink-3); display: flex; flex-direction: column; line-height: 1.3; }
.pt-plabel em { color: var(--ink-2); font-style: normal; font-size: .68rem; }
.pt-cells { display: flex; gap: 4px; }
.pt-cell { width: 34px; height: 38px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-3); color: var(--ink-1); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; transition: transform .12s, border-color .12s, background .12s; }
.pt-cell:hover { transform: translateY(-2px); border-color: var(--glow-dim); z-index: 1; }
.pt-z { font-family: var(--font-mono); font-size: .56rem; color: var(--ink-3); line-height: 1; }
.pt-sym { font-family: var(--font-display); font-weight: 600; font-size: .82rem; color: var(--ink-0); line-height: 1.1; }
.pt-cell.pt-pred { background: rgba(245,196,94,.08); border-color: rgba(245,196,94,.28); }
.pt-cell.pt-pred .pt-sym { color: var(--gold); }
.pt-cell.pt-smith { background: rgba(245,196,94,.22); border-color: var(--gold); box-shadow: 0 0 16px -4px rgba(245,196,94,.6); }
.pt-cell.pt-smith .pt-sym { color: #ffe2a0; }
.pt-cell.pt-end { background: rgba(79,240,196,.18); border-color: var(--glow); box-shadow: 0 0 16px -4px rgba(79,240,196,.6); }
.pt-cell.pt-end .pt-sym { color: var(--glow); }
.pt-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px; font-family: var(--font-mono); font-size: .74rem; }
.pt-key { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); }
.pt-key::before { content: ""; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); }
.pt-key.pt-known::before { background: var(--bg-3); }
.pt-key.pt-pred::before { background: rgba(245,196,94,.2); border-color: rgba(245,196,94,.4); }
.pt-key.pt-smith::before { background: var(--gold); }
.pt-key.pt-end::before { background: var(--glow); }
.pt-info { margin-top: 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 18px; color: var(--ink-1); font-size: .92rem; line-height: 1.6; }
.pt-info b { color: var(--ink-0); } .pt-info-sym { font-family: var(--font-display); font-size: 1.2rem; color: var(--glow); }

/* the grand-lock web */
.lw-gens { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.lw-lab { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px; }
.lw-gen { font-family: var(--font-mono); font-size: .92rem; padding: 10px 18px; border-radius: var(--r-pill); background: var(--bg-3); border: 1px solid var(--line); color: var(--ink-1); cursor: pointer; transition: all .18s; }
.lw-gen:hover { border-color: var(--glow-dim); color: var(--ink-0); }
.lw-gen.active { background: var(--glow); color: #04130e; border-color: var(--glow); box-shadow: 0 0 22px -6px rgba(79,240,196,.7); }
.lw-consts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.lw-const { background: linear-gradient(180deg, var(--bg-3), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; transition: opacity .2s, border-color .2s, box-shadow .2s, transform .2s; }
.lw-const.dim { opacity: .28; }
.lw-const.lit { border-color: var(--glow); box-shadow: 0 0 24px -8px rgba(79,240,196,.6); transform: translateY(-2px); }
.lw-name { font-family: var(--font-display); font-weight: 600; color: var(--ink-0); font-size: .98rem; }
.lw-val { font-family: var(--font-mono); color: var(--glow); font-size: 1.05rem; margin: 4px 0 10px; }
.lw-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.lw-chip { font-family: var(--font-mono); font-size: .64rem; padding: 3px 7px; border-radius: var(--r-pill); background: var(--bg-0); border: 1px solid var(--line); color: var(--ink-2); }
.lw-hint { color: var(--ink-2); font-size: .9rem; margin-top: 18px; max-width: 60ch; }

/* falsification ledger */
.lg-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.lg-fbtn { font-family: var(--font-mono); font-size: .8rem; padding: 8px 15px; border-radius: var(--r-pill); background: var(--bg-3); border: 1px solid var(--line); color: var(--ink-2); cursor: pointer; transition: all .18s; }
.lg-fbtn:hover { color: var(--ink-0); border-color: var(--glow-dim); }
.lg-fbtn.active { background: rgba(79,240,196,.1); border-color: var(--glow); color: var(--glow); }
.lg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.lg-card { background: linear-gradient(180deg, var(--bg-3), var(--bg-2)); border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--r-md); padding: 16px 18px; }
.lg-card.lg-settled { border-left-color: var(--glow); }
.lg-card.lg-now { border-left-color: var(--accent); }
.lg-card.lg-frontier { border-left-color: var(--gold); }
.lg-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.lg-cat { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.lg-badge { font-family: var(--font-mono); font-size: .64rem; padding: 2px 8px; border-radius: var(--r-pill); }
.lg-settled .lg-badge { background: rgba(79,240,196,.14); color: var(--glow); }
.lg-now .lg-badge { background: rgba(124,140,255,.14); color: var(--accent); }
.lg-frontier .lg-badge { background: rgba(245,196,94,.14); color: var(--gold); }
.lg-name { font-family: var(--font-display); font-weight: 600; color: var(--ink-0); font-size: 1.02rem; margin-bottom: 6px; }
.lg-val { font-family: var(--font-mono); font-size: .84rem; color: var(--glow); line-height: 1.5; margin-bottom: 12px; }
.lg-kill { font-size: .82rem; color: var(--ink-2); border-top: 1px solid var(--line-soft); padding-top: 10px; line-height: 1.5; }
.lg-kill.lg-ok { color: var(--glow); }

@media (max-width: 860px) {
  .fold-tool { grid-template-columns: 1fr; }
  .grand { grid-template-columns: 1fr; }
  .census { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) { .census { grid-template-columns: 1fr; } }

/* =========================================================================
   ERNOSDECENT DEMOS
   ========================================================================= */
.subs { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.sub-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; background: var(--bg-2); }
.sub-card code { color: var(--glow); font-size: .9rem; }
.sub-card p { color: var(--ink-2); font-size: .86rem; margin: 8px 0 0; }

.demo-row { display: grid; grid-template-columns: 380px 1fr; gap: 32px; align-items: center; }
.demo-canvas { background: radial-gradient(circle at center, rgba(124,140,255,.05), transparent 70%); border: 1px solid var(--line); border-radius: var(--r-lg); margin-inline: auto; cursor: pointer; }
.demo-side h3 { margin-top: 0; }
.demo-status { font-family: var(--font-mono); font-size: .86rem; color: var(--ink-1); background: var(--bg-0); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 16px; margin: 16px 0; }
.demo-status b { color: var(--glow); }
.demo-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.raft-nodes { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.raft-node { flex: 1 1 90px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; text-align: center; background: var(--bg-2); transition: border-color .3s, background .3s; }
.raft-node .rn-id { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink-0); font-weight: 600; }
.raft-node .rn-state { font-family: var(--font-mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; margin: 6px 0 3px; }
.raft-node .rn-term { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-3); }
.raft-node.leader { border-color: var(--glow); background: rgba(79,240,196,.08); }
.raft-node.leader .rn-state { color: var(--glow); }
.raft-node.candidate { border-color: var(--gold); }
.raft-node.candidate .rn-state { color: var(--gold); }
.raft-node.follower .rn-state { color: var(--ink-2); }
.raft-node.down { opacity: .45; border-style: dashed; }
.raft-node.down .rn-state { color: var(--bad); }
.raft-log { background: var(--bg-0); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; font-family: var(--font-mono); font-size: .82rem; color: var(--ink-1); white-space: pre-wrap; min-height: 130px; margin: 0; line-height: 1.7; }

@media (max-width: 860px) {
  .subs { grid-template-columns: 1fr 1fr; }
  .demo-row { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .subs { grid-template-columns: 1fr; } }

/* =========================================================================
   ERNOSDECENT — stats banner
   ========================================================================= */
.stats-banner {
  display: flex; gap: 18px; justify-content: center; flex-wrap: wrap;
  padding: 22px 0 10px;
}
.stat-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px 32px; min-width: 140px;
  transition: border-color .3s var(--ease), transform .25s var(--ease), box-shadow .3s;
}
.stat-item:hover { transform: translateY(-3px); border-color: var(--glow-dim); box-shadow: 0 8px 30px -12px rgba(79,240,196,.35); }
.stat-num {
  font-family: var(--font-display); font-size: 2.2rem; font-weight: 700;
  color: var(--glow); text-shadow: 0 0 18px rgba(79,240,196,.45);
  line-height: 1.1;
}
.stat-label {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-2);
}

/* =========================================================================
   ERNOSDECENT — architecture diagram
   ========================================================================= */
.arch-layout {
  display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 28px; align-items: start;
}
#arch-canvas {
  background: radial-gradient(circle at center, rgba(124,140,255,.05), transparent 70%);
  border: 1px solid var(--line); border-radius: var(--r-lg); cursor: pointer;
  width: 100%; height: auto;
}
.arch-detail {
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 24px; position: sticky; top: 90px;
  transition: border-color .3s;
}
.arch-detail:hover { border-color: var(--glow-dim); }
.arch-detail h3 {
  font-family: var(--font-mono); color: var(--glow); margin: 0 0 12px;
  font-size: 1.05rem; letter-spacing: .02em;
}
.arch-detail p {
  color: var(--ink-1); font-size: .92rem; line-height: 1.6; margin: 0;
}

@media (max-width: 860px) {
  .arch-layout { grid-template-columns: 1fr; }
  .arch-detail { position: static; }
}

/* =========================================================================
   ERNOSDECENT — protocol flow animation
   ========================================================================= */
.flow-vis {
  display: flex; align-items: stretch; gap: 0; flex-wrap: wrap;
  justify-content: center;
}
.flow-stage {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px 16px; min-width: 120px; flex: 1 1 120px; max-width: 170px;
  text-align: center;
  transition: border-color .4s var(--ease), background .4s, box-shadow .4s, transform .3s var(--ease);
}
.flow-stage:hover { transform: translateY(-2px); }
.flow-stage.active {
  border-color: var(--glow);
  background: rgba(79,240,196,.08);
  box-shadow: 0 0 28px -6px rgba(79,240,196,.45);
  transform: translateY(-4px);
}
.flow-stage-num {
  font-family: var(--font-display); font-size: 1.6rem; font-weight: 700;
  color: var(--ink-3); line-height: 1;
  transition: color .4s;
}
.flow-stage.active .flow-stage-num { color: var(--glow); text-shadow: 0 0 14px rgba(79,240,196,.5); }
.flow-stage-label {
  font-family: var(--font-display); font-weight: 600; font-size: .95rem;
  color: var(--ink-0); margin-top: 2px;
}
.flow-stage-desc {
  font-size: .78rem; color: var(--ink-2); line-height: 1.4;
}
.flow-stage-sub {
  font-family: var(--font-mono); font-size: .72rem; color: var(--accent);
  background: var(--bg-0); padding: 2px 8px; border-radius: 6px; margin-top: auto;
}
.flow-arrow {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: var(--ink-3); padding: 0 6px;
  font-family: var(--font-mono);
}

@media (max-width: 700px) {
  .flow-vis { flex-direction: column; align-items: center; }
  .flow-arrow { transform: rotate(90deg); padding: 6px 0; }
  .flow-stage { max-width: 260px; }
}

/* =========================================================================
   ERNOSDECENT — enhanced sub-card hover
   ========================================================================= */
.sub-card {
  cursor: pointer;
  transition: border-color .3s var(--ease), transform .25s var(--ease), box-shadow .3s, background .3s;
}
.sub-card:hover {
  transform: translateY(-4px);
  border-color: var(--glow-dim);
  box-shadow: 0 12px 34px -14px rgba(79,240,196,.3);
  background: var(--bg-3);
}

/* respects reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* =========================================================================
   SMITHIAN FOLD — The Axiom Section
   ========================================================================= */
.axiom-grid { margin-bottom: 0; }

.axiom-card { text-align: center; padding: 36px 26px 30px; }
.axiom-card:hover { border-color: var(--glow-dim); }
.axiom-icon {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 16px;
  color: var(--glow);
  text-shadow: 0 0 28px rgba(79,240,196,.5);
}
.axiom-card h3 { font-size: 1.15rem; }
.axiom-card p { font-size: .92rem; color: var(--ink-2); }

/* Equation breakdown card */
.axiom-eq-card {
  padding: 30px 34px;
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2) 60%, rgba(79,240,196,.04));
  border-color: rgba(79,240,196,.2);
}
.axiom-eq-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
}
.axiom-eq-block {
  flex: 1 1 200px;
  padding: 14px 22px;
}
.axiom-eq-sep {
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line), transparent);
  align-self: stretch;
  flex-shrink: 0;
}
.axiom-eq-label {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.axiom-eq-result {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--glow);
  line-height: 1.6;
}

/* =========================================================================
   SMITHIAN FOLD — The Derivation Steps
   ========================================================================= */
.derivation-steps {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-left: 40px;
}
/* connecting vertical line */
.derivation-steps::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: linear-gradient(180deg, var(--glow-dim), var(--accent), var(--gold));
  border-radius: 2px;
  opacity: .5;
}

.step-card {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  position: relative;
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 26px;
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.step-card:hover {
  transform: translateY(-3px);
  border-color: var(--glow-dim);
  box-shadow: var(--shadow);
}

.step-num {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--bg-0);
  background: linear-gradient(135deg, var(--glow), var(--accent));
  box-shadow: 0 0 18px -4px rgba(79,240,196,.6);
  position: relative;
  z-index: 1;
}
.step-body { flex: 1; }
.step-body h3 { margin: 0 0 6px; font-size: 1.1rem; }
.step-body p { color: var(--ink-2); font-size: .92rem; margin: 0; line-height: 1.65; }

/* =========================================================================
   SMITHIAN FOLD — Lepton Mass Ratios
   ========================================================================= */
.lepton-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.lepton-row {
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  transition: border-color .25s, box-shadow .25s, transform .25s var(--ease);
}
.lepton-row:hover {
  border-color: var(--glow-dim);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.lepton-label {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}
.lepton-particle {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink-0);
  letter-spacing: -.01em;
}
.lepton-name {
  font-family: var(--font-mono);
  font-size: .76rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.lepton-vals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 16px;
}
.lepton-vals .fold-stat {
  border-bottom: none;
  padding: 6px 0;
}
.lepton-agree {
  color: var(--glow) !important;
  text-shadow: 0 0 14px rgba(79,240,196,.4);
}
.lepton-bar-wrap {
  height: 6px;
  background: var(--bg-0);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.lepton-bar {
  height: 100%;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--glow-dim), var(--glow));
  box-shadow: 0 0 12px rgba(79,240,196,.5);
  transition: width 1.2s var(--ease);
}

/* =========================================================================
   SMITHIAN FOLD — Element 137 Visualisation
   ========================================================================= */
.e137-wrap {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 34px;
  align-items: start;
}
.e137-text {
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 24px;
}
.e137-bar { position: relative; }
.e137-scale {
  position: relative;
  height: 48px;
  border-radius: var(--r-md);
  overflow: visible;
}
.e137-track {
  position: absolute;
  inset: 0;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.e137-safe {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  background: linear-gradient(90deg, rgba(79,240,196,.08), rgba(79,240,196,.18));
  border-radius: var(--r-md) 0 0 var(--r-md);
  z-index: 1;
}
.e137-danger {
  position: absolute;
  top: 0; bottom: 0;
  background: linear-gradient(90deg, rgba(255,107,129,.15), rgba(255,107,129,.3));
  border-radius: 0 var(--r-md) var(--r-md) 0;
  z-index: 1;
}
.e137-marker {
  position: absolute;
  top: -8px; bottom: -8px;
  z-index: 3;
  transform: translateX(-50%);
}
.e137-marker-line {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--glow);
  box-shadow: 0 0 12px rgba(79,240,196,.8);
  border-radius: 2px;
}
.e137-marker-label {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: .76rem;
  font-weight: 600;
  color: var(--glow);
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(79,240,196,.6);
  letter-spacing: .06em;
}
.e137-labels {
  position: relative;
  margin-top: 14px;
  height: 40px;
}
.e137-labels span {
  position: absolute;
  font-family: var(--font-mono);
  font-size: .7rem;
  color: var(--ink-3);
  line-height: 1.3;
  transform: translateX(-50%);
}
.e137-labels span:first-child { transform: none; }
.e137-labels span:last-child { transform: translateX(-100%); }
.e137-labels em { font-style: normal; color: var(--ink-2); }
.e137-cutoff-label { color: var(--glow) !important; }
.e137-cutoff-label em { color: var(--glow) !important; }
.e137-caption {
  grid-column: 1 / -1;
  color: var(--ink-2);
  font-size: .88rem;
  margin-top: 22px;
  line-height: 1.65;
}

@media (max-width: 860px) {
  .e137-wrap { grid-template-columns: 1fr; }
  .axiom-eq-sep { display: none; }
  .derivation-steps { padding-left: 0; }
  .derivation-steps::before { display: none; }
  .lepton-vals { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .axiom-eq-row { flex-direction: column; }
  .axiom-eq-block { padding: 10px 0; }
}
