/* ==================================================================
   fold_ — paper design system
   ================================================================== */

:root {
  --paper: #f3ecdc;
  --paper-2: #ebe2cc;
  --paper-3: #e2d7bb;
  --sheet: #fbf6ea;
  --ink: #161412;
  --ink-2: #3b3630;
  --muted: #7a7266;
  --rule: rgba(22, 20, 18, 0.14);
  --seal: #c8381c;
  --seal-soft: rgba(200, 56, 28, 0.12);
  --mint: #2f7d5b;
  --mint-soft: rgba(47, 125, 91, 0.14);
  --hl: #f5d547;
  --ember: #ff7a2f;

  /* papertrade uses Inter for everything; "mono" is Inter + tabular numerals + tracked uppercase */
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'Inter', system-ui, -apple-system, sans-serif;

  --max: 1180px;
  --radius: 3px;
  --shadow-sheet: 0 10px 18px -8px rgba(22, 20, 18, 0.28);
  --tape-h: 30px;
  --nav-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
/* no CSS scroll-behavior: smooth — it breaks ScrollTrigger pin measurement; anchors smooth-scroll via JS */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; line-height: 1.05; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
mark { background: none; color: inherit; }
b, strong { font-weight: 600; }

.wrap { max-width: var(--max); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.display em { font-style: normal; color: var(--seal); }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.seal-text { color: var(--seal); }
.small { font-size: 12px; }
.perspective { perspective: 1400px; }

/* grain ---------------------------------------------------------- */
.grain {
  position: fixed; inset: -50%; width: 200%; height: 200%;
  pointer-events: none; z-index: 60; opacity: 0.32; will-change: transform;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.3 0 0 0 0 0.22 0 0 0 0.28 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.4s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-2%, 1%); } 40% { transform: translate(1%, -2%); }
  60% { transform: translate(-1%, 2%); } 80% { transform: translate(2%, 1%); } 100% { transform: translate(0, 0); }
}

/* halftone background canvas -------------------------------------- */
.matrix { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; opacity: 0.85; }
[data-theme='uwu'] .matrix { opacity: 0.72; }
.nav, main, .footer { position: relative; z-index: 1; }

/* waifus (uwu only) ------------------------------------------------- */
.waifu { display: none; pointer-events: none; user-select: none; -webkit-user-drag: none; }
[data-theme='uwu'] .waifu { display: block; }
.waifu-burn { position: absolute; left: -20px; bottom: -8px; width: 290px; z-index: 3; filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.45)); }
[data-theme='uwu'] .burn-stage { justify-content: flex-end; }
.waifu-footer { position: absolute; right: 16px; bottom: -4px; width: 440px; filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.45)); }
[data-theme='uwu'] .footer { padding-bottom: 210px; }

/* sheet: torn paper surface --------------------------------------- */
.sheet {
  position: relative;
  padding: 26px 26px 24px;
  color: var(--ink);
  isolation: isolate;
  --sheet-bg: var(--sheet);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--sheet-bg);
  filter: url(#torn) drop-shadow(0 12px 16px rgba(22, 20, 18, 0.18));
  z-index: -1;
  transition: filter 0.3s;
}
.sheet.ink { --sheet-bg: var(--ink); color: var(--paper); }
.sheet.ink .mono { color: var(--paper-3); }
.sheet.charred::before {
  filter: url(#torn) drop-shadow(0 0 1.5px var(--seal)) drop-shadow(0 0 10px rgba(200, 56, 28, 0.35)) drop-shadow(0 12px 16px rgba(22, 20, 18, 0.25));
}
.sheet.hover:hover { transform: translateY(-4px) rotate(-0.35deg); }
.sheet.hover:hover::before { filter: url(#torn-2) drop-shadow(0 20px 22px rgba(22, 20, 18, 0.22)); }
.sheet.ink.charred.hover:hover::before {
  filter: url(#torn-2) drop-shadow(0 0 2px var(--seal)) drop-shadow(0 0 14px rgba(255, 122, 47, 0.45)) drop-shadow(0 20px 22px rgba(22, 20, 18, 0.3));
}
.sheet h3 { font-size: 26px; margin: 6px 0 10px; }
.sheet p { font-size: 14.5px; color: var(--ink-2); }
.sheet.ink p { color: var(--paper-2); }
.sheet mark { background: linear-gradient(transparent 55%, var(--hl) 55%, var(--hl) 92%, transparent 92%); padding: 0 4px; margin: 0 -4px; }
.step-no { color: var(--muted); }
.sheet.ink .step-no { color: var(--hl); }

/* buttons -------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500;
  border: 1.5px solid var(--ink); color: var(--ink);
  transition: transform 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-seal { background: var(--seal); border-color: var(--seal); color: #fff; box-shadow: 0 6px 14px -6px rgba(200, 56, 28, 0.6); }
.btn-seal:hover { background: #b22f15; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #000; }
.btn-ghost { border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink); }

/* tape (ticker) -------------------------------------------------- */
.tape {
  position: sticky; top: 0; z-index: 50;
  height: var(--tape-h);
  background: var(--ink); color: var(--paper);
  overflow: hidden;
  border-bottom: 2px dashed var(--paper-3);
  box-shadow: 0 2px 0 var(--ink);
}
.tape::before, .tape::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 60px; z-index: 2; pointer-events: none;
}
.tape::before { left: 0; background: linear-gradient(90deg, var(--ink), transparent); }
.tape::after { right: 0; background: linear-gradient(-90deg, var(--ink), transparent); }
.tape-track {
  display: inline-flex; align-items: center; height: 100%; gap: 44px; padding-left: 44px;
  white-space: nowrap; will-change: transform;
  animation: marquee 48s linear infinite;
}
.tape:hover .tape-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tape-item { display: inline-flex; gap: 10px; align-items: baseline; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.04em; }
.tape-sym { color: var(--paper-3); }
.tape-px { color: #fff; font-variant-numeric: tabular-nums; }
.tape-chg.up { color: #7fd6a4; }
.tape-chg.down { color: #ff8a73; }
.tape-tag { color: var(--hl); }

/* nav ------------------------------------------------------------ */
.nav {
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.brand { font-family: var(--font-display); font-weight: 500; font-size: 26px; letter-spacing: -0.045em; line-height: 1; display: inline-flex; align-items: baseline; }
.brand .caret { color: var(--seal); animation: caret 1.1s steps(2) infinite; margin-left: 1px; }
@keyframes caret { 50% { opacity: 0; } }
.nav-links { display: flex; gap: 6px; }
.nav-links a {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500;
  padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--rule);
  transition: border-color 0.2s, background 0.2s;
}
.nav-links a:hover { border-color: var(--ink); }
.nav-right { display: flex; gap: 10px; align-items: center; }
.uwu-toggle {
  font-family: var(--font-mono); font-size: 12px; padding: 7px 12px; border-radius: 999px;
  border: 1.5px dashed var(--rule); color: var(--muted); transition: all 0.2s;
}
.uwu-toggle:hover { border-color: var(--seal); color: var(--seal); }
.uwu-toggle .uwu-on { display: none; }
[data-theme='uwu'] .uwu-toggle .uwu-on { display: inline; }
[data-theme='uwu'] .uwu-toggle .uwu-off { display: none; }

/* hero ----------------------------------------------------------- */
.hero {
  position: relative;
  display: grid; grid-template-columns: 5fr 7fr; gap: 40px; align-items: center;
  padding-top: 32px; padding-bottom: 56px; min-height: calc(100vh - var(--tape-h) - var(--nav-h));
}
.hero-copy { position: relative; z-index: 2; }
.eyebrow { color: var(--muted); margin-bottom: 18px; }
.hero h1 { font-size: clamp(38px, 4.2vw, 56px); line-height: 1; margin-bottom: 22px; letter-spacing: -0.045em; }
.lede { font-size: 17px; max-width: 46ch; color: var(--ink-2); }
.lede a { border-bottom: 1.5px solid var(--seal); }
.hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.hero-facts { display: flex; flex-direction: column; gap: 6px; margin-top: 30px; color: var(--muted); }
.hero-facts li { display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.seal { background: var(--seal); } .dot.mint { background: var(--mint); } .dot.ink { background: var(--ink); }

/* revolve -------------------------------------------------------- */
.revolve {
  position: relative; z-index: 1;
  width: min(100%, 640px); aspect-ratio: 1; margin: 0 auto;
  --orbit: 40; /* orbit radius as % of container; read by main.js */
}
.revolve-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.orbit-shadow { fill: none; stroke: rgba(22, 20, 18, 0.07); stroke-width: 26; }
.orbit {
  fill: none; stroke: var(--ink); stroke-width: 1.6;
  stroke-dasharray: 7 9; stroke-linecap: round;
  animation: march 1.6s linear infinite;
}
@keyframes march { to { stroke-dashoffset: -32; } }
#arrows path { fill: var(--ink); }
.chip-bg { fill: var(--mint); stroke: var(--ink); stroke-width: 1.5; transition: fill 0.3s; }
.chip-text { font-family: var(--font-mono); font-size: 12px; fill: #fff; letter-spacing: 0.06em; }
.chip.is-paper .chip-bg { fill: var(--sheet); } .chip.is-paper .chip-text { fill: var(--ink); }
.chip.is-fold .chip-bg { fill: var(--seal); }
.chip { filter: drop-shadow(0 4px 6px rgba(22, 20, 18, 0.3)); }

.revolve-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
}
.center-ticker { font-size: clamp(44px, 5.6vw, 76px); line-height: 0.9; letter-spacing: -0.05em; }
.center-sub { color: var(--muted); margin-top: 8px; }

.node {
  position: absolute; left: 50%; top: 50%;
  width: 164px; padding: 14px 14px 12px; text-align: center;
  cursor: default; will-change: transform;
  transition: none;
}
.node .node-title { font-size: 20px; line-height: 1; letter-spacing: -0.03em; }
.node .node-sub { color: var(--muted); margin-top: 5px; }
.node.ink .node-sub { color: var(--paper-3); }
.node-detail {
  max-height: 0; overflow: hidden; opacity: 0; font-size: 12.5px; line-height: 1.45; color: var(--ink-2);
  transition: max-height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s, margin 0.3s;
}
.node.ink .node-detail { color: var(--paper-2); }
.node:hover .node-detail, .node:focus-within .node-detail { max-height: 120px; opacity: 1; margin-top: 10px; }
.node:hover::before { filter: url(#torn-2) drop-shadow(0 18px 22px rgba(22, 20, 18, 0.26)); }
.node:hover { z-index: 5; }

.tag-return {
  position: absolute; left: 50%; top: 50%;
  background: var(--hl); color: var(--ink); padding: 6px 10px;
  box-shadow: 2px 3px 0 var(--ink); white-space: nowrap;
  font-weight: 500; will-change: transform;
}

/* sections -------------------------------------------------------- */
.section { padding-top: 96px; padding-bottom: 32px; }
.h2 { font-size: clamp(34px, 4vw, 54px); letter-spacing: -0.045em; margin-bottom: 18px; }
.sub { font-size: 16.5px; color: var(--ink-2); max-width: 62ch; margin-bottom: 36px; }

.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 36px; }
.rev-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.fold-in { transform-style: preserve-3d; }

/* calculator --------------------------------------------------------- */
.calc-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 28px; align-items: start; }
.receipt {
  position: relative; background: var(--sheet); color: var(--ink); padding: 22px 24px 30px;
  box-shadow: var(--shadow-sheet); margin-bottom: 14px;
}
.receipt::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -9px; height: 10px;
  background: conic-gradient(from -45deg at 50% 100%, var(--sheet) 90deg, transparent 0) 0 0 / 18px 100%;
}
.receipt::before {
  content: ''; position: absolute; left: 0; right: 0; top: -9px; height: 10px;
  background: conic-gradient(from 135deg at 50% 0, var(--sheet) 90deg, transparent 0) 0 0 / 18px 100%;
}
.receipt-head { display: flex; justify-content: space-between; color: var(--muted); border-bottom: 1.5px dashed var(--rule); padding-bottom: 12px; margin-bottom: 18px; }
.field { display: block; }
.field > .mono { color: var(--muted); display: block; margin-bottom: 8px; }
.input-wrap { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--ink); background: #fff; padding: 10px 14px; border-radius: var(--radius); }
.input-wrap .prefix { font-size: 20px; color: var(--muted); }
.input-wrap input { flex: 1; border: 0; outline: none; background: transparent; font-family: var(--font-mono); font-size: 24px; width: 100%; -moz-appearance: textfield; }
.input-wrap input::-webkit-outer-spin-button, .input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 8px; }
.receipt-lines { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; }
.receipt-lines .line { display: flex; align-items: baseline; gap: 8px; }
.receipt-lines .dots { flex: 1; border-bottom: 1.5px dotted var(--rule); transform: translateY(-3px); }
.receipt-lines .total { border-top: 1.5px dashed var(--rule); padding-top: 10px; font-weight: 500; }
.receipt-foot { color: var(--muted); text-align: center; margin-top: 22px; }

.split-wrap { padding-top: 6px; }
.split { display: flex; height: 64px; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; background: var(--sheet); box-shadow: var(--shadow-sheet); }
.split-burn { background: var(--ink); color: var(--hl); display: flex; align-items: center; justify-content: center; width: 95%; transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.split-burn .display { font-size: 22px; }
.split-tax { background: var(--seal); color: #fff; display: flex; align-items: center; justify-content: center; width: 5%; min-width: 46px; transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.split-nums { display: flex; justify-content: space-between; margin-top: 22px; gap: 20px; }
.split-nums .label { color: var(--muted); margin-bottom: 4px; }
.split-nums .big { font-size: clamp(38px, 4.4vw, 60px); line-height: 1; font-variant-numeric: tabular-nums; }
.split-nums .right { text-align: right; }
.note { margin-top: 22px; color: var(--ink-2); font-size: 15px; max-width: 54ch; }

/* film strip ------------------------------------------------------ */
.film-section { padding-top: 96px; }
.film {
  position: relative; margin-top: 30px;
  background: var(--ink); padding: 54px 0; overflow: hidden;
}
.film::before, .film::after {
  content: ''; position: absolute; left: 0; right: 0; height: 22px;
  background: repeating-linear-gradient(90deg, transparent 0 18px, var(--paper) 18px 34px, transparent 34px 52px);
  mask: linear-gradient(#000, #000); opacity: 0.9;
}
.film::before { top: 14px; } .film::after { bottom: 14px; }
.film-track { display: flex; gap: 28px; padding: 0 max(24px, calc((100vw - var(--max)) / 2 + 24px)); width: max-content; }
.frame { width: 360px; flex: none; padding: 28px 28px 30px; }
.frame-no { font-size: 44px; line-height: 1; color: var(--seal); display: block; margin-bottom: 8px; }
.frame.ink .frame-no { color: var(--hl); }
.frame h3 { font-size: 30px; }
.frame-loop { width: 220px; display: flex; flex-direction: column; justify-content: center; align-items: center; color: var(--paper-3); }
.frame-loop .display { font-size: 90px; color: var(--paper); animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(-360deg); } }

/* burn ------------------------------------------------------------- */
.burn-section { padding-bottom: 100px; }
.burn-grid { display: grid; grid-template-columns: 6fr 6fr; gap: 48px; align-items: center; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 26px 0 28px; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.tile { padding: 16px 14px 16px 0; display: flex; flex-direction: column; gap: 4px; }
.tile + .tile { border-left: 1.5px dashed var(--rule); padding-left: 14px; }
.tile .label { color: var(--muted); }
.tile .val { font-size: clamp(26px, 2.6vw, 36px); line-height: 1; font-variant-numeric: tabular-nums; }
.tile .hint { color: var(--muted); }
.risk { color: var(--muted); margin-top: 22px; max-width: 52ch; }

.burn-stage { position: relative; display: flex; justify-content: center; align-items: flex-end; min-height: 460px; }
.burn-sheet {
  position: relative; width: min(100%, 380px); aspect-ratio: 3 / 4;
  --burn: 0;
}
.burn-paper {
  position: absolute; inset: 0; background: var(--sheet); color: var(--ink); padding: 26px;
  box-shadow: var(--shadow-sheet);
  display: flex; flex-direction: column;
  -webkit-mask-image: linear-gradient(to top, transparent calc(var(--burn) * 1%), #000 calc(var(--burn) * 1% + 7%));
  mask-image: linear-gradient(to top, transparent calc(var(--burn) * 1%), #000 calc(var(--burn) * 1% + 7%));
}
.burn-head { display: flex; justify-content: space-between; color: var(--muted); border-bottom: 1.5px dashed var(--rule); padding-bottom: 10px; }
.burn-big { font-size: 56px; line-height: 1; margin: 30px 0 18px; letter-spacing: -0.045em; }
.burn-lines { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.burn-lines div { height: 7px; background: var(--paper-3); border-radius: 2px; }
.burn-lines div:nth-child(2n) { width: 70%; }
.burn-lines div:nth-child(3n) { width: 85%; }
.burn-foot { color: var(--muted); margin-top: 14px; }
.burn-edge {
  position: absolute; left: -6px; right: -6px; height: 34px;
  bottom: calc(var(--burn) * 1% - 4px);
  background: linear-gradient(to top, transparent, var(--ember) 30%, var(--seal) 60%, #1a1210 85%, transparent);
  filter: blur(1.5px) url(#torn-soft);
  opacity: calc(min(var(--burn), 4) / 4);
  mix-blend-mode: multiply;
}
.burn-edge::after {
  content: ''; position: absolute; inset: -14px 0 auto 0; height: 24px;
  background: radial-gradient(60% 100% at 30% 100%, rgba(255, 122, 47, 0.6), transparent 70%),
              radial-gradient(40% 100% at 70% 100%, rgba(245, 213, 71, 0.5), transparent 70%);
  filter: blur(4px);
}
.ash {
  position: absolute; left: 50%; bottom: -14px; width: 70%; height: 24px; transform: translateX(-50%);
  background: radial-gradient(50% 100% at 50% 100%, rgba(22, 20, 18, 0.35), transparent 70%);
  filter: blur(4px);
}

/* footer ------------------------------------------------------------ */
.footer { position: relative; border-top: 1.5px solid var(--ink); padding: 42px 0 50px; margin-top: 40px; overflow: hidden; }
.footer-grid { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; flex-wrap: wrap; }
.footer .brand { font-size: 26px; }
.footer .small { color: var(--muted); margin-top: 8px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-2); border-bottom: 1.5px solid transparent; }
.footer-links a:hover { border-color: var(--seal); }
.disclaimer { margin-top: 36px; color: var(--muted); font-size: 12.5px; max-width: 90ch; line-height: 1.6; }
/* ==================================================================
   treasury page
   ================================================================== */
.page-head { padding-top: 40px; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(48px, 6.5vw, 88px); letter-spacing: -0.05em; line-height: 0.9; }
.live-badge {
  display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 999px;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(47, 125, 91, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(47, 125, 91, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 125, 91, 0); } }

.crumbs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 28px 0 30px; }
.crumb { padding: 6px 12px; border: 1.5px solid var(--ink); border-radius: 999px; transition: background 0.3s, color 0.3s; }
.crumb.active { background: var(--ink); color: var(--paper); }
.crumb-arrow { color: var(--muted); }

.stat-sheet { padding: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 22px 22px 20px; border-right: 1.5px dashed var(--rule); border-bottom: 1.5px dashed var(--rule); display: flex; flex-direction: column; gap: 6px; min-height: 124px; }
.stat:nth-child(4n) { border-right: 0; }
.stat:nth-child(n + 5) { border-bottom: 0; }
.stat .label { color: var(--muted); }
.stat .val { font-size: clamp(28px, 3vw, 40px); line-height: 1; font-variant-numeric: tabular-nums; }
.stat .hint { color: var(--muted); }

.burned-sheet { margin-top: 28px; padding: 28px 30px 26px; }
.burned-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; }
.burned-head .display { font-size: clamp(30px, 3.6vw, 44px); color: var(--hl); letter-spacing: -0.04em; }
.burned-pct { font-size: clamp(30px, 3.6vw, 48px); color: var(--hl); font-variant-numeric: tabular-nums; }
.ream { display: flex; gap: 3px; height: 54px; margin: 22px 0 12px; align-items: flex-end; }
.leaf {
  flex: 1; height: 100%; background: var(--sheet); border-radius: 1px;
  box-shadow: inset -1px 0 0 rgba(22, 20, 18, 0.25);
  transform-origin: bottom center; transition: transform 0.6s, background 0.6s, opacity 0.6s, box-shadow 0.6s;
}
.leaf:nth-child(odd) { height: 94%; }
.leaf.burnt {
  background: linear-gradient(to top, #2a2320, #4a3a33 70%, var(--seal)); opacity: 0.55; transform: scaleY(0.35) translateY(2px);
  box-shadow: 0 -2px 6px rgba(255, 122, 47, 0.4);
}
.burned-foot { display: flex; justify-content: space-between; color: var(--paper-3); }

.holdings { margin-top: 56px; }
.table-sheet { padding: 6px 0 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 22px; border-bottom: 1.5px dashed var(--rule); font-size: 14px; }
th { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; color: var(--muted); font-weight: 500; letter-spacing: 0.08em; }
tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
td.what { color: var(--ink-2); }
td b { font-weight: 600; }

.two-col { display: grid; grid-template-columns: 7fr 5fr; gap: 28px; margin-top: 56px; align-items: start; }
.buybacks .line { font-size: 12.5px; }
.buybacks .line .when { color: var(--muted); min-width: 92px; }
.buybacks .line .tx { color: var(--seal); border-bottom: 1px dotted var(--seal); }
.addr-list { display: flex; flex-direction: column; gap: 10px; }
.addr { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--rule); border-radius: var(--radius); background: rgba(255, 255, 255, 0.35); }
.addr:hover { border-color: var(--ink); }
.addr .chain-name { color: var(--muted); }
.addr .hash { font-variant-numeric: tabular-nums; }
.addr .ext { color: var(--seal); }
.section-h { font-size: clamp(28px, 3.2vw, 40px); margin-bottom: 18px; letter-spacing: -0.04em; }

/* on-chain sheet + badges ------------------------------------------ */
.badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.net-badge { padding: 7px 12px; border-radius: 999px; background: var(--ink); color: var(--paper); }
.net-badge.is-mock { background: var(--seal); color: #fff; }
.chain-sheet { margin-top: 28px; padding: 24px 28px 22px; }
.chain-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.chain-head .section-h { margin-bottom: 10px; }
.chain-sub { color: var(--muted); }
.chain-sub a { color: var(--seal); text-decoration: none; border-bottom: 1px dotted var(--seal); }
.chain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1.5px dashed var(--rule); }
.chain-grid .stat { padding: 18px 18px 16px 0; border-bottom: 1.5px dashed var(--rule); }
.chain-grid .stat .val { font-size: clamp(22px, 2.4vw, 30px); }
.chain-grid .stat:nth-child(n+4) { border-bottom: 0; }
.notes { list-style: none; margin-top: 16px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.notes li::before { content: '· '; color: var(--seal); }
.receipt-lines .kind { font-weight: 600; text-transform: uppercase; }
.receipt-lines .kind-burn { color: var(--seal); }
.receipt-lines .kind-collect { color: var(--mint); }
.receipt-lines .kind-buyback { color: var(--seal); }
.receipt-lines .kind-bridge, .receipt-lines .kind-bridged, .receipt-lines .kind-hl-deposit, .receipt-lines .kind-hl-withdraw, .receipt-lines .kind-swap { color: var(--ink-2); }
.receipt-lines .kind-pt-deposit, .receipt-lines .kind-pt-trade, .receipt-lines .kind-pt-claim, .receipt-lines .kind-gas { color: var(--ink-2); }
.receipt-lines .kind-pt-mint, .receipt-lines .kind-pt-stake { color: var(--mint); }
.receipt-lines a.tx { text-decoration: none; }
[data-theme='uwu'] .net-badge { background: #fbf4ff; color: #2a2440; }
[data-theme='uwu'] .chain-sheet .notes, [data-theme='uwu'] .chain-sub { color: var(--ink-2); }
@media (max-width: 820px) { .chain-grid { grid-template-columns: repeat(2, 1fr); } .chain-grid .stat:nth-child(n+4) { border-bottom: 1.5px dashed var(--rule); } .chain-grid .stat:nth-child(n+5) { border-bottom: 0; } }

/* ==================================================================
   docs
   ================================================================== */
.docs { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 36px; margin-top: 36px; align-items: start; }
.docs-toc { position: sticky; top: 84px; }
.toc-sheet { padding: 18px 20px 16px; }
.toc-head { color: var(--muted); padding-bottom: 10px; border-bottom: 1.5px dashed var(--rule); margin-bottom: 10px; }
.toc { display: flex; flex-direction: column; gap: 2px; }
.toc a { display: block; padding: 7px 10px; border-radius: 6px; color: var(--ink-2); text-decoration: none; border-left: 2px solid transparent; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.toc a:hover { color: var(--ink); background: rgba(22, 20, 18, 0.05); }
.toc a.active { color: var(--seal); border-left-color: var(--seal); border-radius: 0 6px 6px 0; }
.toc-foot { margin-top: 12px; padding-top: 12px; border-top: 1.5px dashed var(--rule); }
.toc-foot a { color: var(--seal); text-decoration: none; }
.docs-body { display: flex; flex-direction: column; gap: 28px; }
.doc { padding: 30px 34px 32px; scroll-margin-top: 84px; }
.doc .step-no { display: block; margin-bottom: 6px; }
.doc h2 { font-size: clamp(30px, 3.4vw, 42px); letter-spacing: -0.045em; line-height: 1; margin-bottom: 16px; }
.doc p { font-size: 15.5px; line-height: 1.6; max-width: 66ch; color: var(--ink-2); }
.doc p + p { margin-top: 12px; }
.doc p b { color: var(--ink); font-weight: 600; }
.doc a { color: var(--seal); text-decoration: none; border-bottom: 1px dotted var(--seal); }
.doc a:hover { border-bottom-style: solid; }
.doc .note { margin-top: 18px; padding: 12px 14px; border-left: 2px solid var(--hl); background: rgba(245, 213, 71, 0.12); font-size: 14px; color: var(--ink-2); }
.doc .facts { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; color: var(--ink-2); }
.doc .facts li { display: flex; align-items: center; gap: 10px; }
.dot.seal { background: var(--seal); } .dot.ink { background: var(--ink); } .dot.mint { background: var(--mint); }
.steps { counter-reset: s; list-style: none; margin-top: 20px; display: flex; flex-direction: column; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 34px 120px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1.5px dashed var(--rule); align-items: baseline; font-size: 15px; line-height: 1.55; }
.steps li:last-child { border-bottom: 0; }
.steps li::before { content: counter(s, decimal-leading-zero); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted); font-variant-numeric: tabular-nums; }
.steps li b { font-weight: 600; color: var(--ink); text-transform: lowercase; }
.steps li span { color: var(--ink-2); }
.kv { margin-top: 18px; }
.kv th { width: 200px; vertical-align: top; padding-left: 0; }
.kv td { padding-right: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.kv tr:first-child th, .kv tr:first-child td { padding-top: 4px; }
.doc-receipt { margin-top: 20px; max-width: 480px; }
.doc-receipt .receipt-lines { margin-top: 0; }
.risks { list-style: none; margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.risks li { font-size: 15px; line-height: 1.55; color: var(--paper-2); padding-left: 18px; position: relative; }
.risks li::before { content: ''; position: absolute; left: 0; top: 0.6em; width: 8px; height: 8px; background: var(--seal); transform: rotate(45deg); }
.risks li b { color: var(--paper); font-weight: 600; }
.doc.ink p { color: var(--paper-2); }
.doc details { border-bottom: 1.5px dashed var(--rule); padding: 14px 0; }
.doc details:last-of-type { border-bottom: 0; }
.doc summary { cursor: pointer; font-weight: 600; font-size: 16px; color: var(--ink); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after { content: '+'; font-family: var(--font-mono); color: var(--seal); font-size: 18px; transition: transform 0.25s; }
.doc details[open] summary::after { transform: rotate(45deg); }
.doc details p { margin-top: 10px; }
.doc .addr-list { margin-top: 18px; }
.link-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.link-grid a { display: block; padding: 12px 14px; border: 1.5px solid var(--rule); border-radius: var(--radius); background: rgba(255, 255, 255, 0.35); color: var(--ink); text-decoration: none; }
.link-grid a:hover { border-color: var(--ink); }
.doc p.risk { margin-top: 18px; font-size: 11px; line-height: 1.7; }

[data-theme='uwu'] .toc a:hover { background: rgba(42, 36, 64, 0.08); }
[data-theme='uwu'] .doc .note { background: rgba(255, 126, 182, 0.14); border-left-color: var(--seal); }
[data-theme='uwu'] .doc.ink .risks li { color: #d9d1f2; }
[data-theme='uwu'] .doc.ink .risks li b { color: #fbf4ff; }
[data-theme='uwu'] .doc.ink p { color: #d9d1f2; }
[data-theme='uwu'] .doc .kv th { color: var(--ink-2); }
[data-theme='uwu'] .doc .kv td, [data-theme='uwu'] .doc .facts { color: var(--ink-2); }
[data-theme='uwu'] .doc .addr, [data-theme='uwu'] .link-grid a { border-color: rgba(42, 36, 64, 0.2); background: rgba(255, 255, 255, 0.5); color: var(--ink); }
[data-theme='uwu'] .doc .addr:hover, [data-theme='uwu'] .link-grid a:hover { border-color: var(--ink); }
[data-theme='uwu'] .doc .risk { color: var(--ink-2); }

/* ==================================================================
   uwu mode
   ================================================================== */
[data-theme='uwu'] {
  --paper: #22203f;
  --paper-2: #2e2a52;
  --paper-3: #8f86c4;
  --sheet: #f7e9f3;
  --ink: #2a2440;
  --ink-2: #4a4268;
  --muted: #a89fcf;
  --rule: rgba(255, 255, 255, 0.18);
  --seal: #ff7eb6;
  --seal-soft: rgba(255, 126, 182, 0.18);
  --mint: #8fd3b9;
  --hl: #ffe08a;
  --ember: #ffb3d6;
  --radius: 12px;
}
[data-theme='uwu'] body {
  color: #fbf4ff;
  background:
    radial-gradient(60% 40% at 20% 10%, rgba(255, 126, 182, 0.22), transparent 60%),
    radial-gradient(50% 40% at 85% 30%, rgba(143, 211, 185, 0.16), transparent 60%),
    radial-gradient(70% 60% at 50% 100%, rgba(120, 100, 200, 0.35), transparent 70%),
    linear-gradient(180deg, #1b1a36 0%, #2a2650 50%, #3c3270 100%);
  background-attachment: fixed;
}
[data-theme='uwu'] .grain { opacity: 0.1; }
[data-theme='uwu'] .tape { background: #15132b; border-color: var(--seal); box-shadow: 0 2px 0 var(--seal); color: #fbf4ff; }
[data-theme='uwu'] .tape::before { background: linear-gradient(90deg, #15132b, transparent); }
[data-theme='uwu'] .tape::after { background: linear-gradient(-90deg, #15132b, transparent); }
[data-theme='uwu'] .nav-links a, [data-theme='uwu'] .uwu-toggle, [data-theme='uwu'] .btn-ghost, [data-theme='uwu'] .live-badge, [data-theme='uwu'] .crumb { border-color: rgba(255, 255, 255, 0.3); color: #fbf4ff; }
[data-theme='uwu'] .nav-links a:hover { border-color: var(--seal); }
[data-theme='uwu'] .uwu-toggle { border-style: solid; background: var(--seal); color: #2a2440; border-color: var(--seal); }
[data-theme='uwu'] .crumb.active { background: var(--seal); color: #2a2440; border-color: var(--seal); }
[data-theme='uwu'] .btn-ink { background: #fbf4ff; color: #2a2440; border-color: #fbf4ff; }
[data-theme='uwu'] .btn-seal { color: #2a2440; }
[data-theme='uwu'] .lede, [data-theme='uwu'] .sub, [data-theme='uwu'] .note, [data-theme='uwu'] .disclaimer, [data-theme='uwu'] .footer-links a { color: #d9d1f2; }
[data-theme='uwu'] .eyebrow, [data-theme='uwu'] .hero-facts, [data-theme='uwu'] .center-sub, [data-theme='uwu'] .tile .label, [data-theme='uwu'] .tile .hint, [data-theme='uwu'] .risk, [data-theme='uwu'] .footer .small { color: var(--muted); }
[data-theme='uwu'] .brand .caret { color: var(--seal); }
[data-theme='uwu'] .dot.ink { background: #fbf4ff; }
[data-theme='uwu'] .display em { color: var(--seal); }
[data-theme='uwu'] .orbit { stroke: #fbf4ff; }
[data-theme='uwu'] .orbit-shadow { stroke: rgba(255, 255, 255, 0.08); }
[data-theme='uwu'] #arrows path { fill: #fbf4ff; }
[data-theme='uwu'] .chip-bg { stroke: #fbf4ff; }
[data-theme='uwu'] .sheet.ink { --sheet-bg: #15132b; color: #fbf4ff; }
[data-theme='uwu'] .sheet.ink p { color: #d9d1f2; }
[data-theme='uwu'] .sheet.charred::before { filter: url(#torn) drop-shadow(0 0 2px var(--seal)) drop-shadow(0 0 14px rgba(255, 126, 182, 0.5)); }
[data-theme='uwu'] .tag-return { background: var(--hl); box-shadow: 2px 3px 0 #15132b; }
[data-theme='uwu'] .split { border-color: #fbf4ff; }
[data-theme='uwu'] .split-burn { background: #15132b; color: var(--hl); }
[data-theme='uwu'] .split-tax { color: #2a2440; }
[data-theme='uwu'] .input-wrap { background: #fff; border-color: var(--seal); }
[data-theme='uwu'] .tiles { border-color: rgba(255, 255, 255, 0.4); }
[data-theme='uwu'] .film { background: #15132b; }
[data-theme='uwu'] .film::before, [data-theme='uwu'] .film::after { background: repeating-linear-gradient(90deg, transparent 0 18px, var(--seal) 18px 34px, transparent 34px 52px); }
[data-theme='uwu'] .frame-loop .display { color: var(--seal); }
[data-theme='uwu'] .footer { border-color: rgba(255, 255, 255, 0.3); }
[data-theme='uwu'] .addr { background: rgba(255, 255, 255, 0.06); }
[data-theme='uwu'] .burned-foot { color: var(--paper-3); }
[data-theme='uwu'] .leaf { background: var(--sheet); }
[data-theme='uwu'] .live-dot { background: var(--mint); }
[data-theme='uwu'] .h2[data-uwu]::after, [data-theme='uwu'] .section-h[data-uwu]::after {
  content: attr(data-uwu); font-family: var(--font-mono); font-size: 0.32em; color: var(--seal); margin-left: 0.4em; vertical-align: middle;
}
[data-theme='uwu'] .burn-paper { background: var(--sheet); }
[data-theme='uwu'] .burn-edge { background: linear-gradient(to top, transparent, var(--hl) 30%, var(--seal) 60%, #5a3a6a 85%, transparent); mix-blend-mode: normal; }

/* ==================================================================
   responsive
   ================================================================== */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; gap: 24px; min-height: 0; }
  .revolve { width: min(100%, 560px); }
  .step-grid { grid-template-columns: repeat(2, 1fr); }
  .rev-grid { grid-template-columns: repeat(2, 1fr); }
  .calc-grid { grid-template-columns: 1fr; }
  .burn-grid { grid-template-columns: 1fr; }
  .burn-stage { min-height: 420px; }
  .two-col { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(4n) { border-right: 1.5px dashed var(--rule); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(n + 5) { border-bottom: 1.5px dashed var(--rule); }
  .stat:nth-child(n + 7) { border-bottom: 0; }
}
@media (max-width: 820px) {
  .docs { grid-template-columns: 1fr; gap: 24px; }
  .docs-toc { position: static; }
  .toc { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .toc a { border-left: 0; border-radius: 999px; padding: 6px 10px; }
  .toc a.active { background: var(--seal-soft); border-radius: 999px; }
  .doc { padding: 24px 22px 26px; }
  .steps li { grid-template-columns: 30px 1fr; }
  .steps li span { grid-column: 2; }
  .kv th { width: 120px; }
  .link-grid { grid-template-columns: 1fr; }
  .film-track { padding: 0 24px; }
  .film { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
  .frame { scroll-snap-align: start; width: 300px; }
}
@media (max-width: 640px) {
  .wrap { padding-left: 18px; padding-right: 18px; }
  .nav { height: 64px; }
  .nav-links { display: none; }
  .brand { font-size: 26px; }
  .hero { padding-top: 18px; }
  .hero h1 { font-size: 42px; }
  .lede { font-size: 15.5px; }
  .revolve { --orbit: 33; width: 100%; margin-top: 24px; }
  .node { width: 104px; padding: 10px 8px 9px; }
  .node .node-title { font-size: 16px; }
  .node .node-sub { font-size: 9.5px; }
  .node-detail { display: none; }
  .center-ticker { font-size: 30px; }
  .center-sub { display: none; }
  .tag-return { font-size: 10px; padding: 4px 7px; }
  .section { padding-top: 72px; }
  .step-grid, .rev-grid { grid-template-columns: 1fr; gap: 16px; }
  .tiles { grid-template-columns: 1fr; border: 0; }
  .tile { border-top: 1.5px dashed var(--rule); padding: 12px 0; }
  .tile + .tile { border-left: 0; padding-left: 0; }
  .split-nums { flex-direction: column; }
  .split-nums .right { text-align: left; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat { border-right: 0 !important; border-bottom: 1.5px dashed var(--rule) !important; min-height: 0; }
  .stat:last-child { border-bottom: 0 !important; }
  th, td { padding: 12px 14px; font-size: 13px; }
  th:nth-child(5), td:nth-child(5) { display: none; }
  .page-head h1 { font-size: 64px; }
  .burn-stage { min-height: 380px; }
  .waifu-footer { width: 260px; right: 8px; }
  [data-theme='uwu'] .footer { padding-bottom: 130px; }
  .waifu-burn { width: 190px; left: -10px; }
}

/* reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .grain, .orbit, .brand .caret, .tape-track, .frame-loop .display, .live-dot { animation: none !important; }
  .sheet, .leaf, .split-burn, .split-tax, .node-detail { transition: none !important; }
}
