/* =====================================================================
   TETNER USD — $UDST  |  docs.tetner.com
   The Royal Archive — whitepaper styling
   Same kingdom, slightly better manners.
   ===================================================================== */

:root {
  --bg: #0b0416;
  --bg2: #160b2a;
  --panel: #1a0f31;
  --panel2: #140b26;
  --panel3: #0e061d;
  --ink: #f4ecff;
  --body: #d8cdec;
  --muted: #b7a6d6;
  --stroke: rgba(255, 255, 255, .10);
  --stroke-strong: rgba(255, 255, 255, .18);
  --gold: #ffd42a;
  --gold2: #ffb800;
  --neon: #39ff14;
  --pink: #ff4dd8;
  --cyan: #4dd8ff;
  --purple: #8b5cf6;
  --red: #ff4d5e;
  --font-display: 'Luckiest Guy', 'Comic Sans MS', cursive;
  --font-pixel: 'Press Start 2P', monospace;
  --font-body: 'Rubik', system-ui, -apple-system, sans-serif;
  --font-hand: 'Caveat', 'Comic Sans MS', cursive;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header-h: 74px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

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

body {
  background:
    radial-gradient(1200px 820px at 8% -8%, rgba(74, 20, 140, .42), transparent 62%),
    radial-gradient(900px 700px at 102% 2%, rgba(0, 90, 90, .22), transparent 58%),
    linear-gradient(rgba(255, 255, 255, .016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .016) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 62px 62px, 62px 62px, auto;
  color: var(--body);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  overflow-x: clip;
}

::selection { background: var(--neon); color: #041600; }

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--gold), var(--pink));
  border-radius: 8px; border: 3px solid var(--bg);
}

a { color: inherit; text-decoration: none; }
b, strong { color: var(--ink); font-weight: 700; letter-spacing: .01em; }
img, svg { max-width: 100%; }

:focus-visible {
  outline: 3px dashed var(--cyan);
  outline-offset: 4px;
  border-radius: 6px;
}

.wrap { width: min(1180px, 92vw); margin-inline: auto; }

.skip {
  position: fixed; top: 10px; left: 10px; z-index: 300;
  transform: translateY(-180%);
  background: var(--neon); color: #041600;
  font-weight: 800; padding: 10px 16px; border-radius: 10px;
  transition: transform .2s;
}
.skip:focus { transform: none; }

/* ---------------------------------------------------------------------
   READING PROGRESS
   --------------------------------------------------------------------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 200;
  background: rgba(255, 255, 255, .04);
}
.progress__bar {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--pink), var(--cyan), var(--neon));
  transform: scaleX(0); transform-origin: 0 50%;
  box-shadow: 0 0 16px rgba(255, 212, 42, .5);
}

/* ---------------------------------------------------------------------
   LOUD LEGAL BAR
   --------------------------------------------------------------------- */
.alert {
  padding: 9px 16px; text-align: center;
  font-size: .76rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase;
  color: #180b2c;
  background: linear-gradient(90deg, #ff005c, #ff8a00, #ffe600, #39ff14, #00e0ff, #ff005c);
  background-size: 250% 100%;
  animation: hueSlide 7s linear infinite;
}
.alert span { display: inline-block; margin: 0 10px; }
.alert b { color: #180b2c; }
@keyframes hueSlide { to { background-position: 250% 0; } }

/* ---------------------------------------------------------------------
   HEADER
   --------------------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 60;
  background: rgba(11, 4, 22, .97);
  backdrop-filter: blur(14px);
  border-bottom: 2px solid var(--stroke);
}
.nav { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-coin {
  width: 36px; height: 36px; flex: none;
  filter: drop-shadow(0 0 8px rgba(255, 212, 42, .45));
}
.brand-name { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: .04em; color: var(--ink); }
.brand-tick {
  font-family: var(--font-pixel); font-size: .5rem; color: var(--gold);
  border: 2px solid rgba(255, 212, 42, .7); border-radius: 999px; padding: 5px 8px;
  background: rgba(255, 212, 42, .07);
}
.docnav { display: flex; gap: 20px; margin-left: auto; }
.nav-actions { margin-left: auto; }
.docnav a {
  font-size: .86rem; font-weight: 700; color: var(--muted);
  padding: 5px 2px; position: relative; transition: color .2s;
}
.docnav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--pink));
  border-radius: 4px; transition: right .25s;
}
.docnav a:hover { color: var(--ink); }
.docnav a:hover::after { right: 0; }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  cursor: pointer; border: 3px solid transparent;
  font-family: var(--font-display); font-size: 1.05rem; letter-spacing: .05em; line-height: 1;
  padding: 14px 22px; border-radius: 16px;
  transition: transform .15s, box-shadow .15s, filter .15s, border-color .15s, color .15s;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .16);
}
.btn:hover { transform: translateY(-3px) rotate(-1deg); }
.btn:active { transform: translateY(1px); }
.btn-sm { font-size: .82rem; padding: 10px 14px; border-width: 2px; border-radius: 12px; }

.btn-gold {
  background: linear-gradient(180deg, #ffe071, var(--gold2));
  color: #4a2e00; border-color: #8a5a00;
  box-shadow: 0 6px 0 #6b4400, 0 0 26px rgba(255, 212, 42, .3);
}
.btn-gold:hover { box-shadow: 0 9px 0 #6b4400, 0 0 36px rgba(255, 212, 42, .48); }

.btn-ghost {
  background: rgba(255, 255, 255, .04);
  color: var(--ink); border: 2px dashed rgba(255, 255, 255, .35);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 22px rgba(77, 216, 255, .22); }

.btn-neon {
  background: linear-gradient(180deg, #7bff4d, #1fd900);
  color: #041f00; border-color: #0a3d00;
  box-shadow: 0 6px 0 #0b3b00, 0 0 26px rgba(57, 255, 20, .3);
}
.btn-neon:hover { box-shadow: 0 9px 0 #0b3b00, 0 0 36px rgba(57, 255, 20, .44); }

/* ---------------------------------------------------------------------
   COVER
   --------------------------------------------------------------------- */
.cover {
  position: relative; overflow: hidden;
  padding: clamp(32px, 4vw, 54px) 0 clamp(46px, 6vw, 82px);
  border-bottom: 2px solid var(--stroke);
}
.cover::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 70% at 80% 35%, rgba(255, 212, 42, .08), transparent 70%),
    radial-gradient(50% 60% at 15% 20%, rgba(255, 77, 216, .07), transparent 70%);
}
.cover::after {
  content: "$UDST";
  position: absolute; right: -40px; bottom: -110px; z-index: 0;
  font-family: var(--font-display); font-size: clamp(12rem, 26vw, 24rem); line-height: .8;
  color: rgba(255, 255, 255, .022); pointer-events: none; user-select: none;
}
.cover-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.08fr .92fr;
  gap: clamp(30px, 5vw, 68px); align-items: center;
}
.kicker {
  display: inline-block;
  font-family: var(--font-pixel); font-size: .55rem; letter-spacing: .14em; line-height: 1.8;
  color: var(--gold); text-transform: uppercase;
  border: 2px solid rgba(255, 212, 42, .42); border-radius: 999px;
  padding: 9px 13px; background: rgba(255, 212, 42, .06);
}
.cover-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.9rem, 6.8vw, 5.8rem); line-height: .9; letter-spacing: .01em;
  margin: 22px 0 16px;
  background: linear-gradient(90deg, var(--gold), var(--pink), var(--cyan), var(--gold));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shineSlide 8s linear infinite;
  filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .5)) drop-shadow(0 0 32px rgba(255, 77, 216, .12));
}
.cover-title small {
  display: block; font-size: .42em; letter-spacing: .08em; margin-top: 14px;
  background: none; -webkit-text-fill-color: var(--ink); color: var(--ink);
  text-shadow: 0 3px 0 rgba(0, 0, 0, .45);
}
@keyframes shineSlide { to { background-position: 300% 0; } }

.cover-sub {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.3rem, 2.6vw, 1.8rem); letter-spacing: .04em;
  color: var(--pink); text-shadow: 0 0 24px rgba(255, 77, 216, .3);
  margin-bottom: 18px;
}
.cover-lede {
  max-width: 600px; font-size: clamp(1rem, 1.5vw, 1.1rem);
  color: var(--muted); margin-bottom: 24px;
}
.cover-lede b { color: var(--ink); }

.cover-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 26px; }
.metachip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .74rem; font-weight: 700; color: var(--ink);
  border: 2px solid var(--stroke-strong); border-radius: 999px;
  padding: 7px 12px; background: rgba(255, 255, 255, .025);
}
.metachip b {
  font-family: var(--font-pixel); font-size: .43rem; letter-spacing: .08em;
  color: var(--gold); font-weight: 400;
}
.cover-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.cover-hint { font-size: .78rem; color: var(--muted); opacity: .85; }

.cover-warning {
  max-width: 620px; margin-top: 22px; padding: 13px 16px;
  font-size: .8rem; line-height: 1.6; color: var(--muted);
  border: 2px dashed rgba(255, 212, 42, .4); border-radius: 14px;
  background: rgba(255, 212, 42, .045);
}
.cover-warning b { color: var(--gold); }
.cover-warning a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }

/* ---- official contract address: top-of-page banner ---- */
.cover-ca {
  position: relative; z-index: 2;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.ca-strip {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 20px 16px;
  border: 2px solid rgba(255, 212, 42, .55); border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 212, 42, .08), rgba(255, 212, 42, .015)), var(--panel2);
  box-shadow: 0 0 0 1px rgba(255, 212, 42, .08) inset, 0 0 40px rgba(255, 212, 42, .1);
  break-inside: avoid;
}
.ca-strip::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--pink), var(--neon), var(--gold));
  background-size: 220% 100%;
  animation: caSlide 6s linear infinite;
  opacity: .95;
}
@keyframes caSlide { to { background-position: 220% 0; } }
.ca-strip.is-live {
  border-color: var(--neon);
  background: linear-gradient(180deg, rgba(57, 255, 20, .08), rgba(57, 255, 20, .015)), var(--panel2);
  box-shadow: 0 0 0 1px rgba(57, 255, 20, .16) inset, 0 0 48px rgba(57, 255, 20, .18);
  animation: caPulse 3.4s ease-in-out infinite;
}
@keyframes caPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(57, 255, 20, .16) inset, 0 0 34px rgba(57, 255, 20, .14); }
  50% { box-shadow: 0 0 0 1px rgba(57, 255, 20, .28) inset, 0 0 62px rgba(57, 255, 20, .24); }
}
.ca-main { min-width: 0; }
.ca-label {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-family: var(--font-pixel); font-size: .52rem; letter-spacing: .1em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 8px;
}
.ca-chain {
  display: inline-block;
  font-family: var(--font-pixel); font-size: .38rem; letter-spacing: .04em;
  color: var(--cyan); border: 2px solid rgba(77, 216, 255, .4);
  border-radius: 999px; padding: 4px 7px; text-transform: uppercase;
  background: rgba(77, 216, 255, .06);
}
.ca-code {
  display: block; max-width: 100%;
  font-family: var(--font-mono); font-size: .95rem; line-height: 1.6;
  color: var(--gold); overflow-wrap: anywhere; user-select: all;
}
.ca-strip.is-live .ca-code {
  color: var(--neon); text-shadow: 0 0 18px rgba(57, 255, 20, .35);
}
.ca-note { font-size: .8rem; color: var(--muted); }
.ca-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: none; }
.ca-actions .btn { padding: 9px 13px; font-size: .8rem; }
.ca-inline {
  font-family: var(--font-mono); font-size: .78rem; line-height: 1.6;
  color: var(--gold); overflow-wrap: anywhere;
}
.ca-mini {
  display: inline-flex; align-items: center; gap: 4px;
  margin-left: 6px; padding: 4px 7px;
  font-family: var(--font-pixel); font-size: .36rem; letter-spacing: .04em;
  color: var(--cyan); background: rgba(77, 216, 255, .05);
  border: 2px solid rgba(77, 216, 255, .35); border-radius: 999px;
  cursor: pointer; vertical-align: middle;
}
.ca-mini[data-copy-ca] { color: var(--neon); border-color: rgba(57, 255, 20, .4); background: rgba(57, 255, 20, .05); }
.ca-mini:hover { border-color: var(--gold); color: var(--gold); }
.faq-a code, .ca-faq-code {
  font-family: var(--font-mono); font-size: .82em; color: var(--gold);
  background: rgba(255, 212, 42, .08); border: 1px solid rgba(255, 212, 42, .25);
  border-radius: 6px; padding: 2px 6px; overflow-wrap: anywhere;
}

/* ---- cover art: the folio ---- */
.cover-art {
  position: relative; display: grid; place-items: center;
  min-height: 480px; padding: 34px 10px 24px;
}
.peek-king {
  position: absolute; top: -20px; right: 4%; z-index: 1;
  width: clamp(92px, 12vw, 132px); height: auto;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .55));
  transform: rotate(7deg);
}
.folio {
  position: relative; z-index: 2;
  width: min(350px, 76vw); aspect-ratio: 3 / 4;
  padding: clamp(20px, 3vw, 30px);
  color: #2a1f10;
  background:
    repeating-linear-gradient(0deg, rgba(90, 70, 40, .04) 0 1px, transparent 1px 4px),
    linear-gradient(155deg, #f8f1df, #eadfc4 68%, #ddcfad);
  border-radius: 5px;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, .5) inset,
    0 30px 60px -18px rgba(0, 0, 0, .75),
    0 0 0 1px rgba(42, 31, 16, .18);
  transform: rotate(-4deg);
}
.folio::before {
  content: ""; position: absolute; inset: 10px; pointer-events: none;
  border: 1px solid rgba(42, 31, 16, .18);
}
.folio-top {
  display: flex; justify-content: space-between; gap: 10px;
  font-family: var(--font-pixel); font-size: .4rem; letter-spacing: .08em;
  color: rgba(42, 31, 16, .7);
  border-bottom: 2px solid rgba(42, 31, 16, .35); padding-bottom: 9px;
}
.folio-kicker {
  margin-top: 20px; font-family: var(--font-pixel); font-size: .48rem;
  letter-spacing: .16em; color: #7c4f00;
}
.folio-title {
  margin: 10px 0 14px;
  font-family: var(--font-display); font-size: clamp(2.4rem, 5.2vw, 3.2rem);
  line-height: .86; letter-spacing: .01em; color: #241a10;
}
.folio-sub {
  font-family: var(--font-hand); font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  line-height: 1.05; color: #5a4526; margin-bottom: 14px;
}
.folio-rule { width: 54px; height: 4px; background: #b38200; margin-bottom: 14px; }
.folio-lines { display: grid; gap: 7px; margin-bottom: 16px; }
.folio-lines i {
  display: block; height: 5px; border-radius: 2px;
  background: rgba(42, 31, 16, .14);
}
.folio-lines i:nth-child(2) { width: 88%; }
.folio-lines i:nth-child(3) { width: 94%; }
.folio-lines i:nth-child(4) { width: 72%; }
.folio-lines i:nth-child(5) { width: 84%; }
.folio-foot {
  position: absolute; left: clamp(20px, 3vw, 30px); right: clamp(20px, 3vw, 30px); bottom: clamp(20px, 3vw, 30px);
  display: flex; justify-content: space-between;
  font-family: var(--font-pixel); font-size: .4rem; letter-spacing: .1em;
  color: rgba(42, 31, 16, .65);
}
.folio-coin {
  position: absolute; right: 16px; bottom: 48px;
  width: clamp(74px, 12vw, 100px); height: auto;
  transform: rotate(12deg);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .35));
}
.folio-seal {
  position: absolute; right: -26px; bottom: -26px; z-index: 3;
  width: clamp(84px, 12vw, 110px); aspect-ratio: 1;
  display: grid; place-items: center; text-align: center;
  border-radius: 50%;
  font-family: var(--font-pixel); font-size: clamp(.34rem, .55vw, .42rem); line-height: 1.9;
  letter-spacing: .06em; color: #ffd9df;
  background:
    radial-gradient(circle at 34% 28%, #ff6b7d, #c8102e 55%, #7f0718 100%);
  border: 3px solid #ffb3be;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .55), 0 0 0 6px rgba(200, 16, 46, .16);
  transform: rotate(12deg);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
}

.fcoin {
  position: absolute; width: clamp(38px, 5vw, 62px); height: auto;
  filter: drop-shadow(0 0 14px rgba(255, 212, 42, .4));
  animation: bob 5.5s ease-in-out infinite;
}
.fa { top: 5%; left: 1%; animation-delay: .2s; }
.fb { top: 38%; right: 1%; width: clamp(30px, 4vw, 46px); animation-delay: 1.4s; }
.fc { bottom: 10%; left: 5%; width: clamp(28px, 3.6vw, 42px); animation-delay: 2.4s; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}
.figcap {
  position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%) rotate(-1.5deg);
  width: max-content; max-width: 90%;
  font-family: var(--font-hand); font-size: 1.05rem; color: var(--muted);
  text-align: center;
}

/* ---------------------------------------------------------------------
   DOCS LAYOUT / TOC
   --------------------------------------------------------------------- */
.docs {
  display: grid; grid-template-columns: 248px minmax(0, 800px);
  justify-content: center; align-items: start;
  gap: clamp(30px, 4.5vw, 64px);
  padding: clamp(38px, 5vw, 64px) 0 90px;
}
.toc {
  position: sticky; top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto; overscroll-behavior: contain;
  padding-right: 8px; scrollbar-width: thin;
  scrollbar-color: rgba(255, 212, 42, .35) transparent;
}
.toc::-webkit-scrollbar { width: 6px; }
.toc::-webkit-scrollbar-thumb { background: rgba(255, 212, 42, .3); border: none; }
.toc-title {
  font-family: var(--font-pixel); font-size: .5rem; letter-spacing: .14em;
  color: var(--muted); margin-bottom: 14px;
}
.toc-list { list-style: none; display: grid; gap: 2px; }
.toc-group {
  font-family: var(--font-pixel); font-size: .43rem; letter-spacing: .12em;
  color: rgba(183, 166, 214, .6); margin: 18px 0 7px;
}
.toc-group:first-child { margin-top: 0; }
.toc-link {
  display: flex; gap: 10px; align-items: baseline;
  padding: 6px 8px 6px 10px; border-radius: 8px;
  font-size: .86rem; line-height: 1.35; color: var(--muted);
  border-left: 2px solid transparent;
  transition: color .18s, background .18s, border-color .18s;
}
.toc-link span {
  font-family: var(--font-pixel); font-size: .43rem; color: rgba(183, 166, 214, .55);
  flex: none; width: 16px; transition: color .18s;
}
.toc-link:hover { color: var(--ink); background: rgba(255, 255, 255, .035); }
.toc-link.active {
  color: var(--gold); border-left-color: var(--gold);
  background: rgba(255, 212, 42, .055);
}
.toc-link.active span { color: var(--gold); }

.toc-card {
  margin-top: 24px; padding: 16px 16px 14px;
  border: 2px solid var(--stroke); border-radius: 16px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
}
.toc-card-kicker {
  font-family: var(--font-pixel); font-size: .43rem; letter-spacing: .12em;
  color: var(--gold); display: block; margin-bottom: 8px;
}
.toc-card p { font-size: .78rem; line-height: 1.6; color: var(--muted); margin-bottom: 12px; }
.toc-card .btn { width: 100%; }

.mobile-toc { display: none; grid-column: 1 / -1; }
.mobile-toc details {
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border: 2px solid var(--stroke); border-radius: 18px;
  padding: 16px 18px; margin: 0;
}
.mobile-toc summary {
  font-family: var(--font-display); font-size: 1.1rem; letter-spacing: .04em;
  color: var(--ink); cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.mobile-toc summary::-webkit-details-marker { display: none; }
.mobile-toc summary::after {
  content: "＋"; font-family: var(--font-body); color: var(--gold);
  font-size: 1.4rem; line-height: 1; transition: transform .2s;
}
.mobile-toc details[open] summary::after { transform: rotate(135deg); }
.mobile-toc-body { padding-top: 12px; }
.mobile-toc-body .toc-list { grid-template-columns: 1fr 1fr; column-gap: 12px; }
.mobile-toc-body .toc-group { grid-column: 1 / -1; }

/* ---------------------------------------------------------------------
   ARTICLE BASICS
   --------------------------------------------------------------------- */
.paper { min-width: 0; max-width: 800px; }
.doc-sec {
  padding-top: clamp(42px, 5vw, 60px);
  border-top: 1px dashed rgba(255, 255, 255, .1);
  scroll-margin-top: calc(var(--header-h) + 22px);
}
.doc-sec:first-of-type { border-top: none; padding-top: 0; }
.doc-sec + .doc-sec { margin-top: clamp(42px, 5vw, 60px); }

.sec-kicker {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-pixel); font-size: .5rem; letter-spacing: .13em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 15px;
}
.doc-sec .sec-kicker { color: var(--gold); }
.sec-kicker::after {
  content: ""; height: 1px; flex: 1;
  background: linear-gradient(90deg, rgba(255, 212, 42, .35), transparent);
}
.sec-num {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 28px; padding: 0 6px;
  border: 2px solid rgba(255, 212, 42, .42); border-radius: 8px;
  background: rgba(255, 212, 42, .055);
  color: var(--gold); font-size: .48rem;
}
.doc-sec h2 {
  position: relative;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2rem, 4.2vw, 2.85rem); line-height: 1;
  letter-spacing: .01em; color: var(--ink);
  text-shadow: 0 4px 0 rgba(0, 0, 0, .45), 0 0 30px rgba(139, 92, 246, .14);
  margin-bottom: 22px;
}
.doc-sec h2 .g { color: var(--gold); text-shadow: 0 0 22px rgba(255, 212, 42, .35); }
.doc-sec h2 .n { color: var(--neon); text-shadow: 0 0 22px rgba(57, 255, 20, .35); }
.doc-sec h2 .p { color: var(--pink); text-shadow: 0 0 22px rgba(255, 77, 216, .35); }
.doc-sec h2 .c { color: var(--cyan); text-shadow: 0 0 22px rgba(77, 216, 255, .35); }

.hlink {
  margin-left: 10px; font-family: var(--font-body); font-size: .75em;
  color: rgba(183, 166, 214, .35); text-decoration: none; vertical-align: middle;
  transition: color .2s;
}
.hlink:hover { color: var(--gold); }

.doc-sec h3 {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.28rem, 2.2vw, 1.5rem); line-height: 1.1;
  letter-spacing: .03em; color: var(--gold);
  margin: 38px 0 13px; text-shadow: 0 3px 0 rgba(0, 0, 0, .35);
}
.doc-sec h4 {
  font-family: var(--font-body); font-weight: 800;
  font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink); margin: 26px 0 10px;
}
.doc-sec p { margin-bottom: 17px; color: var(--body); }
.doc-sec .table-note,
.doc-sec .loop-cap,
.doc-sec .chart-cap,
.doc-sec .alloc-note { color: var(--muted); }
.doc-sec .table-hint,
.doc-sec .chart-hint { color: var(--gold); }
.doc-sec .lede {
  font-size: clamp(1.05rem, 1.7vw, 1.16rem); line-height: 1.7;
  color: #e9e1f7; margin-bottom: 22px;
}
.dropcap::first-letter {
  float: left; font-family: var(--font-display);
  font-size: 4.1rem; line-height: .78; color: var(--gold);
  padding: 8px 12px 0 0; text-shadow: 0 3px 0 rgba(0, 0, 0, .35);
}
.doc-sec a:not(.btn):not(.hlink) {
  color: var(--cyan); text-decoration: underline;
  text-decoration-color: rgba(77, 216, 255, .45); text-underline-offset: 3px;
  transition: color .18s, text-decoration-color .18s;
}
.doc-sec a:not(.btn):not(.hlink):hover {
  color: var(--gold); text-decoration-color: var(--gold);
}
.doc-sec ul, .doc-sec ol {
  list-style: none; display: grid; gap: 10px;
  margin: 0 0 20px; padding: 0;
}
.doc-sec li { position: relative; padding-left: 26px; color: var(--body); }
.doc-sec ul > li::before {
  content: "✦"; position: absolute; left: 2px; top: -.02em;
  color: var(--gold); font-size: .78rem;
}
.doc-sec ol { counter-reset: item; }
.doc-sec ol > li { counter-increment: item; }
.doc-sec ol > li::before {
  content: counter(item, decimal-leading-zero);
  position: absolute; left: 0; top: .34em;
  font-family: var(--font-pixel); font-size: .48rem; color: var(--gold);
}
.doc-sec li b { color: var(--ink); }
.doc-sec li > ul, .doc-sec li > ol { margin-top: 9px; margin-bottom: 0; }
.doc-sec li > ul > li::before { content: "·"; font-size: 1.3rem; top: -.25em; }

.pullquote {
  margin: 36px 0; padding: 4px 0 4px 24px;
  border-left: 6px solid var(--gold);
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.35rem, 2.7vw, 1.75rem); line-height: 1.15; letter-spacing: .02em;
  color: var(--ink); text-shadow: 0 0 26px rgba(255, 212, 42, .12);
}
.pullquote footer {
  margin-top: 12px; font-family: var(--font-body); font-size: .78rem;
  font-weight: 600; letter-spacing: .04em; color: var(--muted);
}

/* ---------------------------------------------------------------------
   CALLOUTS
   --------------------------------------------------------------------- */
.callout {
  position: relative; margin: 28px 0; padding: 20px 22px;
  border: 2px dashed rgba(255, 212, 42, .45);
  border-radius: 18px;
  background: rgba(255, 212, 42, .05);
}
.callout.co-label-gap { padding-top: 22px; }
.co-label {
  display: block; margin-bottom: 9px;
  font-family: var(--font-pixel); font-size: .46rem; letter-spacing: .13em;
  color: var(--gold); text-transform: uppercase;
}
.callout p { margin-bottom: 0; font-size: .94rem; color: var(--body); }
.callout p + p { margin-top: 10px; }
.callout b { color: var(--ink); }
.callout.warn {
  border-color: rgba(255, 77, 94, .55);
  background: rgba(255, 77, 94, .075);
}
.callout.warn .co-label { color: var(--red); }
.callout.legal {
  border: 3px double rgba(77, 216, 255, .5);
  background: rgba(77, 216, 255, .045);
}
.callout.legal .co-label { color: var(--cyan); }
.callout.neon {
  border-color: rgba(57, 255, 20, .42);
  background: rgba(57, 255, 20, .045);
}
.callout.neon .co-label { color: var(--neon); }
.callout.big p {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.25; letter-spacing: .03em;
  color: var(--ink);
}

/* ---------------------------------------------------------------------
   IS / IS NOT
   --------------------------------------------------------------------- */
.isnot {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin: 26px 0 30px;
}
.isbox { padding: 22px 22px 20px; border: 2px solid; border-radius: 18px; }
.isbox.is { border-color: rgba(57, 255, 20, .32); background: rgba(57, 255, 20, .04); }
.isbox.not { border-color: rgba(255, 77, 94, .35); background: rgba(255, 77, 94, .05); }
.isbox h4 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 1.2rem; letter-spacing: .04em; margin: 0 0 13px;
}
.isbox.is h4 { color: var(--neon); }
.isbox.not h4 { color: var(--red); }
.isbox ul { margin: 0; gap: 9px; }
.isbox li { font-size: .9rem; padding-left: 24px; }
.isbox.is li::before { content: "✓"; color: var(--neon); font-weight: 900; font-size: .9rem; }
.isbox.not li::before { content: "✕"; color: var(--red); font-weight: 900; font-size: .85rem; }

/* ---------------------------------------------------------------------
   DUEL
   --------------------------------------------------------------------- */
.duel {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 14px; align-items: stretch; margin: 28px 0 30px;
}
.duel-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: 18px;
  border: 2px solid var(--stroke); background: var(--panel2);
}
.duel-card.loser { border-color: rgba(255, 77, 94, .34); }
.duel-card.retard { border-color: rgba(57, 255, 20, .34); }
.duel-card svg { width: 66px; height: auto; flex: none; }
.duel-card h4 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 1.1rem; letter-spacing: .03em; margin: 0 0 3px;
}
.duel-card.loser h4 { color: var(--red); }
.duel-card.retard h4 { color: var(--neon); }
.duel-card p { margin: 0; font-size: .78rem; line-height: 1.45; color: var(--muted); }
.duel-vs {
  align-self: center; display: grid; place-items: center;
  width: 50px; height: 50px; border-radius: 50%;
  font-family: var(--font-display); font-size: 1.05rem; color: #fff;
  background: radial-gradient(circle at 30% 25%, #ff74a8, #ff005c 70%);
  border: 3px solid #ffd6e3; box-shadow: 0 0 24px rgba(255, 0, 92, .45);
  transform: rotate(-8deg); flex: none;
}

/* ---------------------------------------------------------------------
   TABLES
   --------------------------------------------------------------------- */
.table-wrap {
  margin: 24px 0 12px;
  border: 2px solid var(--stroke); border-radius: 18px;
  overflow-x: auto; overscroll-behavior-x: contain;
  background: rgba(0, 0, 0, .14);
}
table { width: 100%; border-collapse: collapse; min-width: 540px; font-size: .92rem; }
caption {
  caption-side: bottom; padding: 12px 16px 14px; text-align: left;
  font-family: var(--font-hand); font-size: 1rem; color: var(--muted);
}
th {
  text-align: left; vertical-align: bottom;
  font-family: var(--font-pixel); font-size: .46rem; letter-spacing: .08em;
  color: var(--gold); text-transform: uppercase;
  padding: 14px 18px; background: rgba(255, 212, 42, .055);
  border-bottom: 2px solid var(--stroke);
}
td {
  padding: 13px 18px; vertical-align: top;
  color: var(--body); border-bottom: 1px solid var(--stroke);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255, 255, 255, .018); }
td strong, td b { color: var(--ink); }
td .tick { color: var(--neon); font-weight: 900; }
td .nope { color: var(--red); font-weight: 900; }
.table-note { font-size: .78rem; color: var(--muted); margin: 8px 0 26px; }
.table-hint { display: none; }

/* ---------------------------------------------------------------------
   TOKENOMICS
   --------------------------------------------------------------------- */
.statgrid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 24px 0 28px;
}
.stat {
  padding: 18px 16px 16px; border: 2px solid var(--stroke); border-radius: 16px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
}
.stat b {
  display: block; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.65rem, 3.2vw, 2.2rem); line-height: 1; margin-bottom: 8px;
  color: var(--gold);
}
.stat:nth-child(2) b { color: var(--red); }
.stat:nth-child(3) b { color: var(--pink); }
.stat:nth-child(4) b { color: var(--neon); }
.stat span {
  font-family: var(--font-pixel); font-size: .41rem; line-height: 1.7;
  letter-spacing: .08em; color: var(--muted); text-transform: uppercase;
}

.alloc { margin: 28px 0 10px; }
.alloc-bar {
  display: flex; height: 46px; overflow: hidden;
  border: 2px solid rgba(255, 212, 42, .5); border-radius: 12px;
  background: rgba(0, 0, 0, .3);
}
.alloc-main {
  width: 100%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-pixel); font-size: .46rem; letter-spacing: .06em;
  color: #3a2600; text-align: center; padding: 0 10px;
  background: repeating-linear-gradient(135deg, #ffe071 0 14px, #ffd42a 14px 28px);
}
.alloc-legend {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.alloc-legend span {
  font-family: var(--font-pixel); font-size: .42rem; letter-spacing: .06em;
  color: var(--muted); border: 2px solid var(--stroke);
  border-radius: 999px; padding: 6px 9px;
}
.alloc-legend b { color: var(--red); font-weight: 400; }
.alloc-note {
  font-family: var(--font-hand); font-size: 1.05rem; color: var(--muted);
  margin-top: 10px;
}

/* ---------------------------------------------------------------------
   FLEX LOOP
   --------------------------------------------------------------------- */
.loop {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 28px 0 16px; counter-reset: loop;
}
.loop-step {
  position: relative; padding: 17px 15px 15px;
  border: 2px solid var(--stroke); border-radius: 16px;
  background: var(--panel2);
}
.loop-step::after {
  content: "→"; position: absolute; right: -13px; top: 50%;
  transform: translateY(-50%); color: var(--pink);
  font-size: 1.2rem; line-height: 1; z-index: 2;
}
.loop-step:last-child::after { content: "↺"; color: var(--neon); }
.loop-step .n {
  font-family: var(--font-pixel); font-size: .43rem; letter-spacing: .08em;
  color: var(--gold); display: block; margin-bottom: 8px;
}
.loop-step h4 {
  font-family: var(--font-display); font-weight: 400;
  font-size: .98rem; line-height: 1.08; letter-spacing: .03em;
  margin: 0 0 6px; color: var(--ink);
}
.loop-step p { margin: 0; font-size: .75rem; line-height: 1.45; color: var(--muted); }
.loop-cap { font-family: var(--font-hand); font-size: 1.02rem; color: var(--muted); margin-bottom: 28px; }

/* ---------------------------------------------------------------------
   RETARDIUM CHART
   --------------------------------------------------------------------- */
.chartcard {
  margin: 26px 0 28px; padding: 5px 16px 12px;
  border: 2px solid var(--stroke); border-radius: 20px;
  background: linear-gradient(180deg, var(--panel), var(--panel2));
}
.rdmchart { display: block; width: 100%; height: auto; overflow: visible; }
.rdmchart .gridlines line { stroke: rgba(255, 255, 255, .07); stroke-width: 1.4; }
.rdmchart .ylabs text { fill: var(--muted); font-family: var(--font-pixel); font-size: 9px; }
.rdmchart .axis-name { fill: var(--muted); font-family: var(--font-pixel); font-size: 9px; letter-spacing: .14em; }
.rdmchart .fillarea { fill: url(#chartFill); }
#rdmLine {
  stroke: var(--neon); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1000; stroke-dashoffset: 0;
  filter: drop-shadow(0 0 7px rgba(57, 255, 20, .5));
  transition: stroke-dashoffset 2.2s cubic-bezier(.5, 0, .2, 1);
}
.js .rdmchart:not(.drawn) #rdmLine { stroke-dashoffset: 1000; }
.rdmchart.drawn #rdmLine { stroke-dashoffset: 0; }
.rdmchart .dotr { fill: var(--neon); stroke: #062a00; stroke-width: 2.5; }
.rdmchart .mlines line { stroke: rgba(255, 212, 42, .45); stroke-width: 2; stroke-dasharray: 4 5; }
.rdmchart .mlab {
  fill: var(--gold); font-weight: 800; font-family: var(--font-body);
  font-size: 14px; letter-spacing: .03em; paint-order: stroke;
  stroke: #0b0416; stroke-width: 5;
}
.rdmchart .msub {
  fill: var(--neon); font-weight: 600; font-family: var(--font-body);
  font-size: 11.5px; paint-order: stroke; stroke: #0b0416; stroke-width: 4.5;
}
.chart-hint { display: none; }
.chart-scroll { min-width: 0; }
.chart-cap {
  text-align: center; font-family: var(--font-hand); font-size: 1.02rem;
  color: var(--muted); padding: 0 10px 6px;
}

.formula {
  margin: 22px 0 24px; padding: 18px 20px;
  border: 2px dashed rgba(57, 255, 20, .4); border-radius: 14px;
  background: rgba(0, 0, 0, .28);
  overflow-x: auto;
}
.formula code {
  display: block; width: max-content;
  font-family: var(--font-pixel); font-size: .5rem; line-height: 2.1;
  letter-spacing: .03em; color: var(--neon);
  text-shadow: 0 0 12px rgba(57, 255, 20, .25);
}
.formula .formula-cap {
  margin-top: 10px; font-family: var(--font-hand); font-size: 1rem;
  color: var(--muted); white-space: normal;
}

/* ---------------------------------------------------------------------
   STEPS
   --------------------------------------------------------------------- */
.steps { display: grid; gap: 13px; margin: 24px 0 28px; }
.step {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 18px 20px; border: 2px solid var(--stroke); border-radius: 18px;
  background: var(--panel2);
}
.stepno {
  flex: none; display: grid; place-items: center;
  min-width: 42px; height: 42px; padding: 0 7px;
  font-family: var(--font-pixel); font-size: .58rem; color: #3a2600;
  background: linear-gradient(180deg, #ffe071, var(--gold2));
  border: 2px solid #8a5a00; border-radius: 12px;
  transform: rotate(-4deg); box-shadow: 3px 3px 0 rgba(0, 0, 0, .4);
}
.step h4 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 1.13rem; letter-spacing: .03em; color: var(--gold);
  margin: 0 0 5px;
}
.step p { margin: 0; font-size: .9rem; color: var(--muted); }
.step p b { color: var(--ink); }

/* ---------------------------------------------------------------------
   RISKS
   --------------------------------------------------------------------- */
.risks { display: grid; gap: 12px; margin: 24px 0 28px; }
.risk-item {
  display: grid; grid-template-columns: 42px 1fr; gap: 14px;
  padding: 18px 20px; border: 2px solid var(--stroke); border-radius: 16px;
  background: var(--panel2); border-left: 4px solid rgba(255, 77, 94, .55);
}
.risk-no {
  font-family: var(--font-pixel); font-size: .54rem; color: var(--red);
  padding-top: 3px;
}
.risk-item h4 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 1.08rem; letter-spacing: .03em; color: var(--ink);
  margin: 0 0 5px;
}
.risk-item p { margin: 0; font-size: .89rem; color: var(--muted); }
.risk-item.high { border-left-color: var(--red); background: rgba(255, 77, 94, .055); }
.risk-item.high h4 { color: var(--red); }

/* ---------------------------------------------------------------------
   FAQ
   --------------------------------------------------------------------- */
.faq { display: grid; gap: 11px; margin: 24px 0; }
.faq details {
  padding: 16px 20px; margin: 0;
  border: 2px solid var(--stroke); border-radius: 16px;
  background: var(--panel2);
  transition: border-color .2s;
}
.faq details[open], .faq details:hover { border-color: rgba(77, 216, 255, .45); }
.faq summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  font-family: var(--font-display); font-weight: 400;
  font-size: 1.04rem; letter-spacing: .02em; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "＋"; flex: none; color: var(--gold); font-family: var(--font-body);
  font-size: 1.3rem; line-height: 1; transition: transform .22s;
}
.faq details[open] summary::after { transform: rotate(135deg); }
.faq-a { padding-top: 11px; font-size: .91rem; color: var(--muted); }
.faq-a p { margin: 0 0 10px; }
.faq-a p:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------------
   ROADMAP / NAPKIN
   --------------------------------------------------------------------- */
.phases {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin: 28px 0;
}
.phase {
  padding: 18px 15px 16px; border: 2px solid var(--stroke);
  border-top: 4px solid var(--accent, var(--gold));
  border-radius: 0 0 16px 16px;
  background: var(--panel2);
}
.phase:nth-child(1) { --accent: var(--neon); }
.phase:nth-child(2) { --accent: var(--gold); }
.phase:nth-child(3) { --accent: var(--pink); }
.phase:nth-child(4) { --accent: var(--cyan); }
.phase-kicker {
  font-family: var(--font-pixel); font-size: .4rem; letter-spacing: .08em;
  color: var(--accent); display: block; margin-bottom: 9px;
}
.phase h4 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 1.06rem; line-height: 1.05; letter-spacing: .03em;
  color: var(--ink); margin: 0 0 10px;
}
.phase ul { margin: 0; gap: 6px; }
.phase li { font-size: .78rem; line-height: 1.45; color: var(--muted); padding-left: 15px; }
.phase ul > li::before { content: "·"; font-size: 1.2rem; top: -.28em; color: var(--accent); }
.status {
  display: inline-block; margin-top: 12px; padding: 5px 8px;
  font-family: var(--font-pixel); font-size: .37rem; letter-spacing: .06em;
  border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 999px; color: var(--accent);
}

.napkin-wrap { margin: 30px 0 34px; display: grid; place-items: center; }
.napkin {
  position: relative;
  width: min(520px, 92%); padding: 34px clamp(22px, 4vw, 40px) 30px;
  color: #3b2c14;
  background:
    radial-gradient(70px 50px at 82% 20%, rgba(121, 82, 32, .14), transparent 70%),
    linear-gradient(150deg, #f6eed9, #ecdfc2);
  clip-path: polygon(1% 3%, 15% 1%, 31% 3%, 49% 0.5%, 67% 3%, 83% 1%, 99% 4%, 98% 26%, 100% 48%, 98% 69%, 99% 96%, 84% 99%, 68% 97%, 49% 100%, 31% 97%, 14% 99%, 1% 96%, 2% 72%, 0.5% 48%, 2% 24%);
  box-shadow: 0 20px 45px -16px rgba(0, 0, 0, .6);
  transform: rotate(-1.4deg);
}
.napkin::before {
  content: ""; position: absolute; inset: 14px;
  border: 1px dashed rgba(59, 44, 20, .25); pointer-events: none;
}
.napkin-title {
  font-family: var(--font-hand); font-size: 1.9rem; font-weight: 600;
  line-height: 1; color: #2f220f; margin-bottom: 12px;
}
.doc-sec .napkin-title { color: #2f220f; }
.napkin ol {
  counter-reset: nap; list-style: none; display: grid; gap: 8px;
  margin: 0; padding: 0;
}
.napkin ol > li {
  counter-increment: nap; position: relative; padding-left: 26px;
  font-family: var(--font-hand); font-size: 1.35rem; line-height: 1.15;
}
.napkin ol > li::before {
  content: counter(nap, decimal-leading-zero) ".";
  position: absolute; left: 0; top: .12em;
  font-family: var(--font-hand); font-size: 1.15rem; color: #8a5a00; font-weight: 600;
}
.napkin li:nth-child(3) { transform: rotate(1deg); }
.napkin-foot {
  margin-top: 14px; font-family: var(--font-hand); font-size: 1.15rem; color: #6b532c;
  text-align: right;
}
.doc-sec .napkin-foot { color: #6b532c; }
.napkin-stain {
  position: absolute; right: 10%; top: 12%;
  width: 64px; height: 50px; border-radius: 50%;
  border: 5px solid rgba(121, 82, 32, .13);
  transform: rotate(18deg);
}

/* ---------------------------------------------------------------------
   LEGAL
   --------------------------------------------------------------------- */
.legal-block + .legal-block { margin-top: 28px; }
.legal-block h3 { font-size: 1.18rem; margin-top: 0; }
.legal-block p, .legal-block li { font-size: .88rem; color: var(--muted); }
.legal-block b { color: var(--ink); }
.legal-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 26px;
}
.legal-meta span {
  font-family: var(--font-pixel); font-size: .4rem; letter-spacing: .06em;
  color: var(--muted); border: 2px solid var(--stroke);
  border-radius: 999px; padding: 6px 9px;
}

/* ---------------------------------------------------------------------
   GLOSSARY / COLOPHON
   --------------------------------------------------------------------- */
.glossary { display: grid; gap: 0; margin: 22px 0; border-top: 1px solid var(--stroke); }
.glossary div {
  display: grid; grid-template-columns: 150px 1fr; gap: 18px;
  padding: 13px 0; border-bottom: 1px solid var(--stroke);
}
.glossary dt {
  font-family: var(--font-display); font-weight: 400;
  font-size: 1rem; letter-spacing: .03em; color: var(--gold);
}
.glossary dd { font-size: .89rem; color: var(--muted); }
.glossary dd b { color: var(--ink); }

.cite {
  margin: 24px 0; padding: 20px 22px;
  border: 2px solid var(--stroke); border-radius: 16px;
  background: rgba(0, 0, 0, .18);
}
.cite p {
  font-family: var(--font-mono); font-size: .8rem; line-height: 1.7;
  color: var(--muted); margin: 0; overflow-wrap: anywhere;
}
.cite p b { color: var(--ink); }
.doc-history { width: 100%; min-width: 0; font-size: .85rem; }
.doc-history th, .doc-history td { padding: 11px 14px; }
.doc-history td { color: var(--muted); }

.doc-end {
  margin-top: 54px; padding-top: 34px;
  border-top: 2px dashed var(--stroke);
  text-align: center;
}
.doc-end svg {
  width: 54px; height: auto; margin-bottom: 10px;
  filter: drop-shadow(0 0 14px rgba(255, 212, 42, .35));
}
.doc-end p {
  font-family: var(--font-pixel); font-size: .48rem; letter-spacing: .14em;
  color: var(--muted); margin: 0;
}
.doc-end .end-note {
  margin-top: 8px; font-family: var(--font-hand); font-size: 1.05rem;
  letter-spacing: 0; color: var(--muted);
}

/* ---------------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------------- */
.footer {
  padding: 56px 0 46px;
  border-top: 2px solid var(--stroke);
  background: linear-gradient(180deg, transparent, rgba(255, 212, 42, .035));
}
.foot-grid {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 26px; align-items: flex-start; margin-bottom: 30px;
}
.foot-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.foot-brand svg { width: 44px; height: auto; filter: drop-shadow(0 0 10px rgba(255, 212, 42, .35)); }
.foot-brand p { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: .03em; color: var(--ink); }
.foot-tag { font-size: .86rem; color: var(--muted); max-width: 420px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.foot-links a, .foot-links button {
  font-size: .82rem; font-weight: 700; color: var(--muted);
  background: none; border: none; cursor: pointer; font-family: var(--font-body);
  transition: color .18s;
}
.foot-links a:hover, .foot-links button:hover { color: var(--gold); }
.disclbox {
  padding: 24px 26px;
  border: 3px double rgba(255, 212, 42, .48); border-radius: 20px;
  background: rgba(18, 10, 34, .9);
  font-size: .83rem; color: var(--muted); margin-bottom: 24px;
}
.disclbox h4 {
  font-family: var(--font-display); font-weight: 400;
  font-size: 1.02rem; letter-spacing: .05em; color: var(--gold);
  margin-bottom: 10px;
}
.disclbox p { margin-bottom: 8px; }
.disclbox p:last-child { margin-bottom: 0; }
.disclbox b { color: var(--ink); }
.footlegal {
  text-align: center; font-size: .72rem; color: var(--muted); opacity: .85;
  line-height: 1.8;
}
.footlegal a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }

/* ---------------------------------------------------------------------
   FLOATING / UTILITY
   --------------------------------------------------------------------- */
.backtop {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.2rem; color: var(--gold); cursor: pointer;
  background: rgba(20, 11, 38, .94);
  border: 2px solid rgba(255, 212, 42, .5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .2s, transform .2s, visibility .2s, border-color .2s;
}
.backtop.show { opacity: 1; visibility: visible; transform: none; }
.backtop:hover { border-color: var(--gold); color: var(--ink); }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 150;
  transform: translateX(-50%) translateY(140%);
  padding: 12px 20px; border-radius: 14px;
  background: #241436; color: var(--ink); font-weight: 700; font-size: .86rem;
  border: 2px solid rgba(255, 212, 42, .5);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55), 0 0 30px rgba(255, 212, 42, .15);
  transition: transform .35s cubic-bezier(.3, 1.4, .5, 1);
  pointer-events: none; max-width: 92vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.cfr {
  position: fixed; top: -70px; z-index: 140; pointer-events: none;
  animation: cfall linear forwards; user-select: none;
}
@keyframes cfall { to { transform: translateY(110vh) rotate(540deg); opacity: .2; } }

.print-only { display: none; }

/* ---------------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------------- */
@media (min-width: 1121px) {
  .docnav + .nav-actions { margin-left: 0; }
}
@media (max-width: 1120px) {
  .docnav { display: none; }
}
@media (max-width: 1000px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-top: 28px; }
  .toc { display: none; }
  .mobile-toc { display: block; }
  .paper { width: 100%; max-width: 800px; margin-inline: auto; }
  .table-wrap { max-width: 100%; }
  .cover-grid { grid-template-columns: 1fr; }
  .cover-art { order: 2; min-height: 430px; max-width: 560px; margin-inline: auto; width: 100%; }
  .cover-copy { text-align: left; }
  .cover-lede, .cover-warning { max-width: 650px; }
  .peek-king { right: 12%; }
}
@media (max-width: 820px) {
  body { font-size: 16px; }
  .brand-tick { display: none; }
  .cover-ca .ca-strip { flex-direction: column; align-items: stretch; }
  .cover-ca .ca-actions { width: 100%; }
  .cover-ca .ca-actions .btn { flex: 1 1 0; }
  .statgrid { grid-template-columns: 1fr 1fr; }
  .phases { grid-template-columns: 1fr 1fr; }
  .loop { grid-template-columns: 1fr 1fr; }
  .loop-step::after { display: none; }
  .duel { grid-template-columns: 1fr; }
  .duel-vs { justify-self: center; transform: rotate(-8deg); }
  .glossary div { grid-template-columns: 120px 1fr; }
  table { min-width: 440px; font-size: .86rem; }
  th, td { padding: 11px 12px; }
  .token-table { min-width: 0; }
  .token-table th { width: 38%; }
  .token-table th, .token-table td { padding: 10px 10px; }
  .token-table .ca-mini { margin-left: 0; margin-top: 4px; }
  .table-hint {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-pixel); font-size: .4rem; letter-spacing: .08em;
    color: var(--gold); margin: 18px 0 6px;
  }
}
@media (max-width: 700px) {
  .chart-scroll { overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 4px; }
  .rdmchart { min-width: 680px; }
  .chart-hint {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-pixel); font-size: .4rem; letter-spacing: .08em;
    color: var(--gold); margin: 0; padding: 14px 2px 2px;
  }
}
@media (max-width: 620px) {
  .formula code {
    width: auto; white-space: normal; overflow-wrap: anywhere;
    line-height: 1.9;
  }
}
@media (max-width: 620px) {
  :root { --header-h: 64px; }
  .nav { gap: 10px; }
  .brand-name { font-size: 1rem; }
  .nav-actions .btn span.btn-text { display: none; }
  .nav-actions .btn { padding: 10px 12px; }
  .alert { font-size: .61rem; letter-spacing: .05em; padding: 8px 10px; }
  .alert span { margin: 0 4px; }
  .cover { padding-top: 34px; }
  .cover-title { font-size: clamp(2.5rem, 11vw, 3.6rem); }
  .cover-sub { font-size: 1.15rem; }
  .cover-meta { gap: 6px; }
  .metachip { font-size: .68rem; padding: 6px 10px; }
  .cover-cta .btn { flex: 1 1 100%; }
  .cover-art { min-height: 380px; padding-top: 16px; }
  .folio { width: min(300px, 80vw); }
  .peek-king { width: 92px; top: -14px; right: 0; }
  .figcap { font-size: .95rem; }
  .ca-actions .btn { flex: 1 1 100%; }
  .ca-code { font-size: .7rem; }
  .ca-inline { font-size: .72rem; }
  .isnot { grid-template-columns: 1fr; }
  .mobile-toc-body .toc-list { grid-template-columns: 1fr; }
  .doc-sec h2 { font-size: clamp(1.8rem, 9vw, 2.3rem); }
  .pullquote { padding-left: 16px; font-size: 1.25rem; }
  .table-wrap { border-radius: 14px; }
  table { min-width: 500px; }
  .step { gap: 12px; padding: 16px 15px; }
  .stepno { min-width: 36px; height: 36px; }
  .risk-item { grid-template-columns: 32px 1fr; gap: 10px; padding: 16px 14px; }
  .glossary div { grid-template-columns: 1fr; gap: 3px; }
  .foot-grid { flex-direction: column; }
  .backtop { right: 14px; bottom: 14px; width: 44px; height: 44px; }
  .napkin { padding: 28px 20px 24px; }
  .napkin li { font-size: 1.2rem; }
}
@media (max-width: 420px) {
  .brand-coin { width: 30px; height: 30px; }
  .cover-art { min-height: 340px; }
  .folio { width: 260px; }
  .folio-title { font-size: 2.3rem; }
  .folio-coin { width: 64px; right: 10px; bottom: 42px; }
  .folio-seal { width: 78px; right: -14px; bottom: -18px; font-size: .3rem; }
  .phases { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  #rdmLine { stroke-dashoffset: 0 !important; }
  .fillarea { opacity: 1 !important; }
}

/* ---------------------------------------------------------------------
   PRINT / SAVE AS PDF
   --------------------------------------------------------------------- */
@media print {
  :root {
    --bg: #fff;
    --ink: #111;
    --body: #222;
    --muted: #4a4a4a;
    --stroke: #d0d0d0;
    --gold: #7a5b00;
    --gold2: #7a5b00;
    --neon: #0a5c00;
    --pink: #99004d;
    --cyan: #00536b;
    --red: #a40012;
    --panel: #fff;
    --panel2: #fff;
  }
  @page { size: A4; margin: 16mm 15mm; }

  html { scroll-behavior: auto; }
  body {
    background: #fff !important;
    color: #222;
    font-size: 10.5pt;
    line-height: 1.55;
    overflow: visible;
  }

  .progress, .alert, .top, .toc, .mobile-toc, .cover-art, .cover-cta,
  .cover-hint, .footer, .backtop, .toast, .hlink, .skip, .table-hint, .chart-hint { display: none !important; }

  .wrap {
    width: 100% !important;
    max-width: 660px;
    margin-inline: auto;
  }
  .cover {
    padding: 0 0 18pt; border: none; break-after: page;
    background: #fff !important;
  }
  .cover::before, .cover::after { display: none; }
  .cover-grid { display: block; }
  .cover-title {
    background: none; -webkit-background-clip: initial; background-clip: initial;
    color: #111; -webkit-text-fill-color: #111; animation: none;
    filter: none; text-shadow: none; font-size: 42pt; margin: 14pt 0 8pt;
  }
  .cover-title small { color: #333; -webkit-text-fill-color: #333; text-shadow: none; font-size: 17pt; }
  .kicker {
    color: #7a5b00; border-color: #999; background: #f6f6f6;
    font-size: 7pt; padding: 5pt 8pt;
  }
  .cover-sub { color: #99004d; text-shadow: none; font-size: 15pt; }
  .cover-lede { color: #222; font-size: 11pt; }
  .cover-lede b { color: #111; }
  .cover-meta { margin: 12pt 0; }
  .metachip { border-color: #bbb; background: #f7f7f7; color: #222; font-size: 8pt; padding: 4pt 7pt; }
  .metachip b { color: #7a5b00; font-size: 6pt; }
  .cover-warning {
    background: #f7f7f7; border: 1px solid #aaa; color: #222;
    font-size: 8.5pt; max-width: none;
    margin-top: 12pt;
  }
  .cover-warning b, .cover-warning a { color: #111; }
  .ca-strip {
    background: #f7f7f7 !important; border-color: #999 !important;
    box-shadow: none !important;
    break-inside: avoid;
  }
  .ca-strip::before { display: none; }
  .ca-strip.is-live { background: #f7f7f7 !important; border-color: #999 !important; animation: none; box-shadow: none !important; }
  .ca-label { color: #111; }
  .ca-chain { color: #111; border-color: #999; background: #eee; }
  .ca-code, .ca-strip.is-live .ca-code { color: #111; text-shadow: none; }
  .ca-note { color: #444; }
  .ca-actions { display: none !important; }
  .ca-inline, .faq-a code, .ca-faq-code {
    color: #111; background: #eee; border-color: #bbb;
  }
  .print-only { display: block; margin-top: 12pt; font-size: 8pt; color: #555; letter-spacing: .04em; }

  .docs { display: block; padding: 0; }
  .paper { max-width: 660px; margin-inline: auto; }
  .doc-sec { border-color: #ddd; padding-top: 20pt; margin-top: 20pt; }
  .doc-sec:first-of-type { padding-top: 0; margin-top: 0; }
  .sec-kicker { color: #7a5b00; font-size: 7pt; }
  .sec-num { border-color: #aaa; background: #f7f7f7; color: #7a5b00; }
  .sec-kicker::after { background: linear-gradient(90deg, #bbb, transparent); }
  .doc-sec h2 {
    color: #111; text-shadow: none; font-size: 24pt;
    break-after: avoid; margin-bottom: 10pt;
  }
  .doc-sec h2 .g, .doc-sec h2 .n, .doc-sec h2 .p, .doc-sec h2 .c {
    color: #111; text-shadow: none;
  }
  .doc-sec h3 { color: #7a5b00; text-shadow: none; font-size: 14pt; break-after: avoid; }
  .doc-sec h4 { color: #111; break-after: avoid; }
  .doc-sec p, .doc-sec li, .doc-sec .lede { color: #222; }
  .doc-sec .lede { font-size: 11.5pt; }
  .dropcap::first-letter { color: #7a5b00; text-shadow: none; }
  .doc-sec a:not(.btn):not(.hlink) { color: #111; text-decoration-color: #777; }
  .doc-sec a[href^="http"]::after {
    content: " (" attr(href) ")"; font-size: 7.5pt; color: #666;
    word-break: break-all;
  }
  .pullquote { color: #111; border-color: #7a5b00; text-shadow: none; break-inside: avoid; }
  .pullquote footer { color: #555; }

  .callout, .isbox, .duel-card, .stat, .step, .risk-item, .chartcard,
  .phase, .napkin, .cite, .faq details, .table-wrap, .alloc, .loop-step {
    background: #f7f7f7 !important; border-color: #aaa !important;
    break-inside: avoid;
  }
  .callout.legal, .callout.warn, .callout.neon { background: #f7f7f7 !important; }
  .co-label, .callout.warn .co-label, .callout.legal .co-label, .callout.neon .co-label { color: #111; }
  .callout.big p { color: #111; }
  .isbox.is h4, .isbox.not h4, .isbox.is li::before, .isbox.not li::before { color: #111; }
  .isbox li, .isbox p { color: #222; }
  .stat b { color: #111 !important; }
  .stat span { color: #444; }
  .alloc-bar { border-color: #999; }
  .alloc-main {
    background: #e8e8e8 !important; color: #111;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .alloc-legend span { border-color: #bbb; color: #333; }
  .alloc-note, .loop-cap, .figcap, .chart-cap, .napkin-foot { color: #555; }

  th { background: #eee; color: #111; border-color: #bbb; }
  td { color: #222; border-color: #ddd; }
  caption { color: #555; }
  .table-wrap { overflow: visible; }
  table { min-width: 0; font-size: 9pt; }

  .duel-card p, .step p, .risk-item p, .phase li, .loop-step p { color: #444; }
  .duel-card h4, .step h4, .risk-item h4, .phase h4, .loop-step h4 { color: #111; }
  .duel-vs { color: #111; background: #eee; border-color: #999; box-shadow: none; }
  .risk-item { border-left-color: #999; }
  .risk-item.high { border-left-color: #a40012; }
  .risk-no, .risk-item.high h4 { color: #a40012; }

  .faq summary { color: #111; }
  .faq summary::after { color: #7a5b00; }
  .faq-a { color: #333; }

  .napkin {
    background: #fff !important; color: #111;
    clip-path: none; border: 1px dashed #999; transform: none;
    box-shadow: none;
  }
  .napkin::before { border-color: #ccc; }
  .napkin-title, .napkin li, .napkin li::before, .napkin-foot { color: #111; }
  .napkin-stain { border-color: #ddd; }

  .rdmchart .gridlines line { stroke: #ddd; }
  .rdmchart .ylabs text, .rdmchart .axis-name { fill: #444; }
  .rdmchart .mlab { fill: #7a5b00; stroke: #fff; }
  .rdmchart .msub { fill: #0a5c00; stroke: #fff; }
  .rdmchart .dotr { fill: #0a5c00; stroke: #fff; }
  #rdmLine { stroke: #0a5c00; stroke-dashoffset: 0 !important; filter: none; }
  .rdmchart .fillarea { fill: #eef7ea; }
  .chartcard { background: #fff !important; }
  .chart-scroll {
    overflow: visible !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .rdmchart {
    width: 94% !important;
    min-width: 0 !important;
    max-width: 94% !important;
    margin-inline: auto;
    display: block;
  }

  .glossary { border-color: #ccc; }
  .glossary div { border-color: #ddd; }
  .glossary dt { color: #7a5b00; }
  .glossary dd { color: #333; }
  .doc-history th, .doc-history td { color: #333; }
  .doc-end { border-color: #ccc; }
  .doc-end p { color: #555; }
  .doc-end .end-note { color: #555; }

  .legal-meta span { border-color: #bbb; color: #444; }
  .footer, .disclbox { display: none !important; }
}
