/* Theme tokens. Dark is the default; [data-theme="light"] switches every page (the landing page has its own set in home.css). */
:root {
  --bg: #0b0b0f; --page: #050507; --page-rgb: 5, 5, 7;
  --card: #101015; --card-2: #16161c;
  --ink: #f2f0ea; --ink-rgb: 242, 240, 234;
  --dim: #8d8b86;
  --rule: rgba(var(--ink-rgb), 0.12);

  --mint: #84f5c8; --mint-rgb: 132, 245, 200; --on-mint: #04140e;
  --sky: #5bb8ff; --sky-rgb: 91, 184, 255;
  --violet: #9d7bff; --violet-rgb: 157, 123, 255;
  --rose: #ff7aa8; --rose-rgb: 255, 122, 168;
  --sand: #e8d3a6; --sand-rgb: 232, 211, 166;
  color-scheme: dark;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: Manrope, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
:root[data-theme="light"] {
  --bg: #f6f7f9; --page: #fbfbfd; --page-rgb: 251, 251, 253;
  --card: #ffffff; --card-2: #f1f3f6;
  --ink: #0e1116; --ink-rgb: 14, 17, 22;
  --dim: #5d6573;
  --mint: #0b8f6f; --mint-rgb: 11, 143, 111; --on-mint: #ffffff;
  --sky: #2a7de6; --sky-rgb: 42, 125, 230;
  --violet: #6a4fe0; --violet-rgb: 106, 79, 224;
  --rose: #d63a70; --rose-rgb: 214, 58, 112;
  --sand: #9a6f1c; --sand-rgb: 154, 111, 28;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--mint); color: var(--bg); }

.wrap { width: min(1200px, 100% - 40px); margin-inline: auto; }

/* ---------- NAV ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 40; transition: background .3s, border-color .3s; border-bottom: 1px solid transparent; }
.nav.scrolled { background: rgba(var(--page-rgb), .8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-color: var(--rule); }
.nav-inner { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.wordmark { font-family: var(--serif); font-size: 1.9rem; line-height: 1; letter-spacing: -.01em; }
.nav-links { display: flex; gap: 32px; font-size: .92rem; color: var(--dim); }
.nav-links a { transition: color .2s; }
.nav-links a:hover { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 22px; }
.only-mobile { display: none; }

.btn {
  display: inline-block; padding: 10px 18px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  font-weight: 600; font-size: .9rem; transition: background .2s, transform .2s;
}
.btn:hover { background: var(--mint); }
.btn:active { transform: scale(.98); }
.btn-lg { padding: 14px 24px; font-size: 1rem; }

.link { font-size: .95rem; color: var(--ink); border-bottom: 1px solid var(--rule); padding-bottom: 2px; transition: border-color .2s; }
.link:hover { border-color: var(--ink); }
.arrow { display: inline-block; transition: transform .2s; }
.link:hover .arrow { transform: translateX(3px); }
a[href="#protocol"].link:hover .arrow { transform: translateY(3px); }

.burger { display: none; width: 32px; height: 32px; background: none; border: 0; cursor: pointer; flex-direction: column; justify-content: center; gap: 7px; }
.burger span { height: 1.5px; background: var(--ink); transition: transform .3s; }

/* ---------- AURORA ---------- */
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.aurora .a {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .55; mix-blend-mode: screen;
  will-change: transform;
}
.a1 { width: 70vw; height: 40vw; left: -15vw; top: -10vw; background: var(--mint);   animation: drift1 18s ease-in-out infinite alternate; }
.a2 { width: 55vw; height: 35vw; right: -10vw; top: -5vw;  background: var(--violet); animation: drift2 22s ease-in-out infinite alternate; }
.a3 { width: 60vw; height: 30vw; left: 20vw; top: 15vw;   background: var(--sky);    animation: drift3 26s ease-in-out infinite alternate; opacity: .4; }
.a4 { width: 35vw; height: 25vw; right: 10vw; top: 22vw;  background: var(--rose);   animation: drift4 20s ease-in-out infinite alternate; opacity: .3; }

@keyframes drift1 { to { transform: translate(18vw, 8vw) rotate(25deg) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-20vw, 12vw) rotate(-20deg) scale(.9); } }
@keyframes drift3 { to { transform: translate(-12vw, -10vw) rotate(15deg) scale(1.2); } }
@keyframes drift4 { to { transform: translate(-25vw, -6vw) scale(1.3); } }

/* curtain streaks on top of the blobs */
.aurora::after {
  content: ""; position: absolute; inset: -20%;
  background: repeating-linear-gradient(100deg, transparent 0 6%, rgba(var(--ink-rgb), .05) 7%, transparent 9% 14%);
  filter: blur(14px);
  animation: curtain 30s linear infinite;
  mix-blend-mode: overlay;
}
@keyframes curtain { to { transform: translateX(14%); } }

.grain {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- HERO ---------- */
.hero { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding: 120px 0 0; overflow: hidden; }
.hero::after { /* fade aurora into page */
  content: ""; position: absolute; inset: auto 0 0; height: 40%; z-index: 1;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.hero-inner, .hero-foot { position: relative; z-index: 2; }
.kicker { font-size: .85rem; color: var(--ink); opacity: .75; margin-bottom: 24px; }
h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(3.2rem, 10vw, 9rem);
  line-height: .95; letter-spacing: -.035em;
}
h1 em { font-style: italic; color: var(--mint); }
.hero-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 40px; margin-top: 48px; }
.hero-copy { max-width: 460px; font-size: 1.08rem; color: rgba(var(--ink-rgb), .78); }
.hero-actions { display: flex; align-items: center; gap: 24px; flex-shrink: 0; }
.hero-foot {
  display: flex; gap: 36px; flex-wrap: wrap;
  margin-top: 80px; padding: 20px 0 28px; border-top: 1px solid var(--rule);
  font-size: .82rem; color: var(--dim);
}

/* ---------- SECTIONS ---------- */
.section { padding: 130px 0; border-top: 1px solid var(--rule); }
.two-col { display: grid; grid-template-columns: 220px 1fr; gap: 40px; }
.col-label { display: flex; gap: 12px; font-size: .85rem; color: var(--dim); position: sticky; top: 100px; align-self: start; }
.num { font-family: var(--mono); color: var(--ink); }
h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  line-height: 1.05; letter-spacing: -.02em; max-width: 16ch;
}
.section h2 { max-width: 20ch; }
.body { color: rgba(var(--ink-rgb), .72); max-width: 520px; margin-top: 24px; font-size: 1.05rem; }

.rows { margin-top: 64px; }
.row { display: grid; grid-template-columns: 200px 1fr; gap: 32px; padding: 28px 0; border-top: 1px solid var(--rule); }
.row:last-child { border-bottom: 1px solid var(--rule); }
.row h3 { font-size: 1.05rem; font-weight: 600; }
.row p { color: rgba(var(--ink-rgb), .72); max-width: 560px; }

/* numbers */
.numbers { border-top: 1px solid var(--rule); }
.numbers-inner { display: grid; grid-template-columns: repeat(4, 1fr); }
.numbers-inner > div { padding: 44px 0 44px 24px; border-left: 1px solid var(--rule); }
.numbers-inner > div:first-child { border-left: 0; padding-left: 0; }
.numbers strong { display: block; font-family: var(--serif); font-weight: 400; font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1; letter-spacing: -.02em; }
.numbers span { display: block; margin-top: 10px; font-size: .88rem; color: var(--dim); }

/* code */
.code { margin: 40px 0 28px; max-width: 620px; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); overflow: hidden; }
.code-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--rule); font-family: var(--mono); font-size: .78rem; color: var(--dim); }
.copy { background: none; border: 1px solid var(--rule); color: var(--dim); font: inherit; padding: 3px 10px; border-radius: 5px; cursor: pointer; }
.copy:hover { color: var(--ink); border-color: var(--dim); }
pre { padding: 20px; overflow-x: auto; font-family: var(--mono); font-size: .86rem; line-height: 1.75; color: rgba(var(--ink-rgb), .85); }
.k { color: var(--violet); } .s { color: var(--mint); } .n { color: var(--sand); } .c { color: var(--dim); }

/* token */
.bar { display: flex; height: 14px; margin-top: 56px; border-radius: 3px; overflow: hidden; gap: 3px; }
.bar span { width: 0; background: var(--c); transition: width 1.2s cubic-bezier(.2, .7, .2, 1); }
.bar.in span { width: var(--w); }
.alloc { list-style: none; margin-top: 28px; max-width: 560px; }
.alloc li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: .95rem; }
.alloc i { width: 10px; height: 10px; border-radius: 2px; background: var(--c); }
.alloc b { margin-left: auto; font-family: var(--mono); font-weight: 400; }
.note { margin-top: 20px; font-size: .85rem; color: var(--dim); }

/* faq */
.faq { max-width: 760px; }
details { border-top: 1px solid var(--rule); }
details:last-child { border-bottom: 1px solid var(--rule); }
summary { list-style: none; cursor: pointer; padding: 26px 0; display: flex; justify-content: space-between; gap: 20px; font-size: 1.15rem; font-weight: 500; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--mono); color: var(--dim); transition: transform .25s; }
details[open] summary::after { transform: rotate(45deg); }
details p { padding: 0 40px 26px 0; color: rgba(var(--ink-rgb), .72); max-width: 620px; }

/* ---------- FOOTER ---------- */
.footer { position: relative; overflow: hidden; border-top: 1px solid var(--rule); padding-top: 130px; }
.aurora-soft { top: auto; height: 100%; }
.aurora-soft .a { opacity: .22; top: auto; bottom: -20vw; }
.footer .wrap { position: relative; z-index: 1; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 80px; font-size: .92rem; color: var(--dim); }
.footer-links a:hover { color: var(--ink); }
.footer-mark {
  font-family: var(--serif); font-size: clamp(7rem, 28vw, 26rem); line-height: .8; letter-spacing: -.05em;
  margin-top: 60px; color: transparent; -webkit-text-stroke: 1px rgba(var(--ink-rgb), .18);
  user-select: none;
}
.fine { padding: 24px 0 32px; font-size: .8rem; color: var(--dim); border-top: 1px solid var(--rule); }

/* ---------- MOTION ---------- */
.fade { opacity: 0; transform: translateY(18px); animation: up 1s cubic-bezier(.2, .7, .2, 1) forwards; }
.fade:nth-child(1) { animation-delay: .1s; }
.fade:nth-child(2) { animation-delay: .25s; }
.fade:nth-child(3) { animation-delay: .45s; }
.hero-foot.fade { animation-delay: .65s; }
@keyframes up { to { opacity: 1; transform: none; } }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .aurora .a, .aurora::after { animation: none; }
  .fade, .reveal { opacity: 1; transform: none; animation: none; transition: none; }
  .bar span { width: var(--w); transition: none; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; gap: 28px; }
  .col-label { position: static; }
  .row { grid-template-columns: 1fr; gap: 8px; }
  .hero-bottom { flex-direction: column; align-items: flex-start; }
  .numbers-inner { grid-template-columns: 1fr 1fr; }
  .numbers-inner > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .numbers-inner > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .aurora .a { filter: blur(60px); }
}
@media (max-width: 720px) {
  .burger { display: flex; }
  .hide-mobile { display: none; }
  .only-mobile { display: block; }
  .nav-links {
    position: fixed; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--rule);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  .nav-links a { padding: 16px 20px; border-top: 1px solid var(--rule); color: var(--ink); }
  .nav-links.open { max-height: 360px; }
  .burger.open span:first-child { transform: translateY(4.25px) rotate(45deg); }
  .burger.open span:last-child { transform: translateY(-4.25px) rotate(-45deg); }
  .section { padding: 90px 0; }
  .footer { padding-top: 90px; }
  .hero-foot { gap: 10px 24px; margin-top: 56px; }
  .a1 { width: 120vw; height: 70vw; }
  .a2 { width: 100vw; height: 60vw; }
  .a3 { width: 110vw; height: 60vw; top: 40vw; }
  .a4 { width: 70vw; height: 50vw; top: 60vw; }
}

/* =========================================================
   v2 additions
   ========================================================= */
.mono { font-family: var(--mono); font-weight: 400; }
.hero-foot > div { display: flex; align-items: center; gap: 8px; }
.hero-foot b { color: var(--ink); font-weight: 400; }
.live-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--mint); animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.flash { animation: flash .9s ease; }
@keyframes flash { 0% { color: var(--ink); text-shadow: 0 0 12px var(--mint); } }

/* architecture */
.diagram { margin-top: 48px; border: 1px solid var(--rule); border-radius: 10px; padding: 24px; background: rgba(var(--ink-rgb), .015); overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 620px; height: auto; }
.diagram .links path { fill: none; stroke: var(--rule); stroke-width: 1.5; }
.diagram .flows path { fill: none; stroke: url(#gFlow); stroke-width: 2; stroke-dasharray: 6 220; animation: flow 2.4s linear infinite; }
@keyframes flow { from { stroke-dashoffset: 226; } to { stroke-dashoffset: 0; } }
.diagram .node rect { fill: var(--bg); stroke: var(--rule); }
.diagram .node text { fill: var(--ink); font: 500 14px var(--sans); }
.diagram .router rect { fill: var(--card); stroke: var(--mint); stroke-opacity: .6; }
.diagram .r-title { fill: var(--ink); font: 400 22px var(--serif); }
.diagram .r-sub { fill: var(--dim); font: 400 11px var(--mono); }
.diagram .cap { fill: var(--dim); font: 400 10px var(--mono); letter-spacing: .12em; }
.specs { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: 32px; border-top: 1px solid var(--rule); }
.specs > div { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.specs > div:nth-child(odd) { padding-right: 24px; }
.specs dt { font-size: .8rem; color: var(--dim); }
.specs dd { margin-top: 4px; }

/* vaults table */
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--rule); border-radius: 8px; }
.tabs button, .code-tabs button {
  background: none; border: 0; color: var(--dim); font: 500 .85rem var(--sans);
  padding: 7px 12px; border-radius: 5px; cursor: pointer; transition: color .2s, background .2s;
}
.tabs button:hover, .code-tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--ink); color: var(--bg); }

.table { margin-top: 40px; border-top: 1px solid var(--rule); }
.t-head, .t-row { display: grid; grid-template-columns: 2.2fr 1fr .8fr .8fr 1.2fr .5fr; gap: 16px; align-items: center; }
.t-head { padding: 12px 0; font-size: .78rem; color: var(--dim); border-bottom: 1px solid var(--rule); }
.sort { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-align: left; padding: 0; }
.sort:hover, .sort.on { color: var(--ink); }
.sort i { font-style: normal; opacity: .6; }
.t-row { padding: 18px 0; border-bottom: 1px solid var(--rule); transition: background .2s; animation: rowIn .45s ease both; }
.t-row:hover { background: rgba(var(--ink-rgb), .02); }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }
.v-name b { display: block; font-weight: 600; }
.v-name small { color: var(--dim); font-size: .82rem; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chips span { font: 400 .7rem var(--mono); padding: 2px 6px; border: 1px solid var(--rule); border-radius: 4px; color: var(--dim); }
.t-apy { font-family: var(--mono); color: var(--mint); }
.t-tvl { font-family: var(--mono); }
.capc { display: flex; align-items: center; gap: 10px; font: .78rem var(--mono); color: var(--dim); }
.cap-bar { flex: 1; height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.cap-bar i { display: block; height: 100%; background: var(--ink); }
.cap-bar i.hot { background: var(--sand); }
.risk { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 5px; font: 500 .8rem var(--mono); border: 1px solid; }
.risk-A { color: var(--mint); border-color: rgba(var(--mint-rgb), .35); }
.risk-B { color: var(--sky); border-color: rgba(var(--sky-rgb), .35); }
.risk-C { color: var(--sand); border-color: rgba(var(--sand-rgb), .35); }
.t-label { display: none; }
.v-risk-m { display: none; }

/* calculator */
.calc { display: grid; grid-template-columns: 300px 1fr; gap: 48px; margin-top: 48px; padding: 32px; border: 1px solid var(--rule); border-radius: 10px; background: rgba(var(--ink-rgb), .015); }
.calc-inputs { display: grid; gap: 24px; align-content: start; }
.calc label > span { display: flex; justify-content: space-between; font-size: .82rem; color: var(--dim); margin-bottom: 8px; }
.calc label b { color: var(--ink); font-weight: 500; }
.field { display: flex; align-items: center; border: 1px solid var(--rule); border-radius: 7px; transition: border-color .2s; }
.field:focus-within { border-color: var(--dim); }
.field input, .field select {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink);
  font: 500 1.05rem var(--sans); padding: 12px 14px;
}
.field select { font-size: .95rem; cursor: pointer; appearance: none; -webkit-appearance: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238d8b86' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 34px; }
.field select option { background: var(--card); }
.field em { font: normal .8rem var(--mono); color: var(--dim); padding-right: 14px; }
input[type="range"] { width: 100%; accent-color: var(--mint); }
.calc-figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.calc-figs span { display: block; font-size: .8rem; color: var(--dim); }
.calc-figs strong { display: block; margin-top: 4px; font: 400 clamp(1.6rem, 3vw, 2.4rem)/1.1 var(--serif); letter-spacing: -.01em; }
.calc-figs div:first-child strong { color: var(--mint); }
#calcChart { width: 100%; height: 160px; margin-top: 24px; display: block; }

/* security */
.sec-grid { display: grid; grid-template-columns: 1fr 1fr; margin-top: 48px; border-top: 1px solid var(--rule); }
.sec { padding: 28px 28px 28px 0; border-bottom: 1px solid var(--rule); }
.sec:nth-child(even) { padding: 28px 0 28px 28px; border-left: 1px solid var(--rule); }
.sec .mono { font-size: .8rem; color: var(--mint); }
.sec h3 { font-size: 1.05rem; font-weight: 600; margin: 10px 0 6px; }
.sec p { color: rgba(var(--ink-rgb), .72); font-size: .95rem; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 40px; }
.tiers div { display: flex; gap: 12px; align-items: flex-start; }
.tiers .risk { flex-shrink: 0; }
.tiers p { font-size: .88rem; color: var(--dim); }

/* code tabs */
.code-bar { padding: 6px 10px 6px 6px; }
.code-tabs { display: flex; gap: 2px; overflow-x: auto; }
.code-tabs button { font: .78rem var(--mono); padding: 6px 10px; white-space: nowrap; }
.code-tabs button.on { color: var(--ink); background: rgba(var(--ink-rgb), .06); }
.code pre[hidden] { display: none; }
.link-row { display: flex; gap: 28px; flex-wrap: wrap; }

/* token extras */
.rows-tight { margin-top: 48px; }

/* governance */
.flow { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); margin-top: 48px; border-top: 1px solid var(--rule); }
.flow li { padding: 22px 16px 22px 0; }
.flow li + li { padding-left: 16px; border-left: 1px solid var(--rule); }
.flow .mono { font-size: .78rem; color: var(--mint); }
.flow h4 { font-size: 1rem; font-weight: 600; margin: 10px 0 2px; }
.flow p { font-size: .85rem; color: var(--dim); }
.flow small { display: block; margin-top: 10px; font: .75rem var(--mono); color: var(--ink); opacity: .7; }
.sub { font: 400 1.8rem var(--serif); margin: 80px 0 16px; }
.rm { display: grid; grid-template-columns: 110px 1fr auto; gap: 24px; align-items: center; padding: 18px 0; border-top: 1px solid var(--rule); }
.rm:last-child { border-bottom: 1px solid var(--rule); }
.rm .mono { font-size: .82rem; color: var(--dim); }
.tag { font: normal .72rem var(--mono); padding: 3px 8px; border-radius: 4px; border: 1px solid var(--rule); color: var(--dim); white-space: nowrap; }
.tag.done { color: var(--ink); }
.tag.now { color: var(--bg); background: var(--mint); border-color: var(--mint); }

@media (prefers-reduced-motion: reduce) {
  .diagram .flows path, .live-dot, .t-row { animation: none; }
}

@media (max-width: 900px) {
  .calc { grid-template-columns: 1fr; gap: 32px; padding: 24px; }
  .tiers { grid-template-columns: 1fr; gap: 16px; }
  .flow { grid-template-columns: 1fr; }
  .flow li, .flow li + li { padding: 16px 0; border-left: 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 28px 1fr auto; column-gap: 12px; align-items: baseline; }
  .flow li .mono { grid-row: 1 / 3; }
  .flow li h4 { margin: 0; }
  .flow li p { grid-column: 2; }
  .flow li small { grid-column: 3; grid-row: 1; margin: 0; }

  /* table -> stacked rows */
  .t-head { display: none; }
  .t-row { grid-template-columns: repeat(3, 1fr); row-gap: 14px; padding: 22px 0; }
  .t-row .v-name { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
  .t-row .chips { grid-column: 1 / -1; }
  .t-row .chips { order: 5; }
  .t-label { display: block; font: .7rem var(--sans); color: var(--dim); margin-bottom: 2px; }
  .t-risk-cell { display: none; }
  .v-risk-m { display: inline-grid; flex-shrink: 0; }
}
@media (max-width: 720px) {
  .specs { grid-template-columns: 1fr; }
  .specs > div:nth-child(odd) { padding-right: 0; }
  .sec-grid { grid-template-columns: 1fr; }
  .sec, .sec:nth-child(even) { padding: 24px 0; border-left: 0; }
  .calc-figs { grid-template-columns: 1fr 1fr; }
  .calc-figs div:last-child { display: none; }
  .rm { grid-template-columns: 1fr auto; gap: 6px 16px; }
  .rm .mono { grid-column: 1 / -1; }
  .diagram { padding: 16px; }
}

/* =========================================================
   v3 — Robinhood Chain explorer concept
   ========================================================= */
.status {
  display: inline-block; margin-right: 10px; padding: 2px 8px; border-radius: 4px;
  font: 500 .72rem var(--mono); color: var(--bg); background: var(--sand); vertical-align: 1px;
}

/* comparison preview */
.cmp { margin-top: 48px; border-top: 1px solid var(--rule); }
.cmp-row { display: grid; grid-template-columns: 160px 1fr 1.2fr 80px; gap: 20px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.cmp-net { font-weight: 600; }
.cmp-src { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--dim); }
.cmp-src .risk { width: 20px; height: 20px; font-size: .7rem; }
.cmp-bar { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.cmp-bar i { display: block; height: 100%; width: 0; background: var(--dim); border-radius: 3px; transition: width 1.2s cubic-bezier(.2, .7, .2, 1); }
.cmp.in .cmp-bar i { width: var(--w); }
.cmp-apy { font-family: var(--mono); text-align: right; }
.cmp-row.is-rh .cmp-net { color: var(--mint); }
.cmp-row.is-rh .cmp-bar i { background: var(--mint); }
.cmp-row.is-rh .cmp-apy { color: var(--mint); }
.cmp + .note .link { margin-left: 8px; font-size: .85rem; }

/* audience */
.audience { display: grid; grid-template-columns: 1fr 1fr; margin-top: 48px; border-top: 1px solid var(--rule); }
.aud { padding: 28px 32px 28px 0; }
.aud + .aud { padding: 28px 0 28px 32px; border-left: 1px solid var(--rule); }
.aud .mono { font-size: .8rem; color: var(--mint); }
.aud ul { list-style: none; margin-top: 18px; display: grid; gap: 18px; }
.aud li { color: rgba(var(--ink-rgb), .72); font-size: .95rem; }
.aud li b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 2px; }

/* stages */
.stages { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 48px; border-top: 1px solid var(--rule); }
.stage { padding: 28px 24px 28px 0; display: flex; flex-direction: column; gap: 8px; }
.stage + .stage { padding-left: 24px; border-left: 1px solid var(--rule); }
.stage .mono { font-size: .78rem; color: var(--dim); }
.stage h3 { font: 400 1.7rem/1.1 var(--serif); }
.stage p { color: rgba(var(--ink-rgb), .72); font-size: .93rem; flex: 1; }
.stage .tag { align-self: flex-start; margin-top: 8px; }
.stage.now .mono { color: var(--mint); }

/* doc pages (methodology, terms) */
.doc-body { background: var(--bg); }
.doc-nav { position: sticky; top: 0; z-index: 30; background: rgba(var(--page-rgb), .8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--rule); }
.doc-nav-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.doc { max-width: 720px; padding: 80px 0 120px; }
.doc-kicker { font-size: .8rem; color: var(--mint); }
.doc-title { font-size: clamp(2.6rem, 6vw, 4.2rem); margin: 16px 0 20px; }
.doc-lead { font-size: 1.15rem; color: rgba(var(--ink-rgb), .78); }
.doc h2 { font-size: 1.7rem; margin: 56px 0 14px; max-width: none; }
.doc p { color: rgba(var(--ink-rgb), .78); margin-bottom: 14px; }
.doc ul { margin: 0 0 14px 20px; color: rgba(var(--ink-rgb), .78); display: grid; gap: 8px; }
.doc li b, .doc p b { color: var(--ink); }
.doc-callout { margin-top: 36px; padding: 16px 18px; border: 1px solid rgba(var(--sand-rgb), .3); border-radius: 8px; background: rgba(var(--sand-rgb), .05); color: var(--sand); font-size: .92rem; }
.doc-callout b { color: var(--sand); }
.tier-table { margin: 20px 0; border-top: 1px solid var(--rule); font-size: .92rem; }
.tt-row { display: grid; grid-template-columns: 56px 1.4fr 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); color: rgba(var(--ink-rgb), .78); }
.tt-head { font-size: .75rem; color: var(--dim); }
.doc-updated { margin-top: 56px; font-size: .8rem; color: var(--dim) !important; }
.doc-foot { border-top: 1px solid var(--rule); padding: 24px 0 32px; font-size: .82rem; color: var(--dim); }
.doc-foot-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.doc-foot nav { display: flex; gap: 20px; flex-wrap: wrap; }
.doc-foot a:hover { color: var(--ink); }
.nf { justify-content: center; padding-bottom: 80px; }
@media (max-width: 720px) {
  .tt-row { grid-template-columns: 40px 1fr; }
  .tt-row > span:last-child { grid-column: 2; font-size: .82rem; color: var(--dim); }
  .tt-head > span:last-child { display: none; }
  .doc { padding: 56px 0 80px; }
}

.official { margin-top: 32px; padding: 20px 22px; border: 1px solid rgba(var(--mint-rgb), .25); border-radius: 10px; background: rgba(var(--mint-rgb), .04); }
.official .mono { font-size: .75rem; color: var(--mint); }
.official p { margin-top: 6px; color: rgba(var(--ink-rgb), .85); }

/* landing: mini IL widget + tool list */
.mini-il { margin-top: 48px; border: 1px solid var(--rule); border-radius: 12px; padding: 28px; background: rgba(var(--ink-rgb), .015); display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.mini-q .mono { font-size: .75rem; color: var(--mint); }
.mini-q p { margin: 8px 0 18px; font-size: 1.1rem; }
.mini-q b { font-weight: 600; }
#miMoveTxt { font-family: var(--mono); font-weight: 500; color: var(--mint); }
.mini-q input[type="range"] { width: 100%; }
.mini-scale { display: flex; justify-content: space-between; font-size: .7rem; color: var(--dim); margin-top: 4px; }
.mini-a { display: grid; gap: 2px; border-left: 1px solid var(--rule); padding-left: 32px; }
.mini-a div { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.mini-a div:last-child { border-bottom: 0; }
.mini-a span { font-size: .85rem; color: var(--dim); }
.mini-a strong { font: 400 1.9rem/1 var(--serif); transition: color .3s; }
.mi-neg { color: var(--rose); }
.mini-foot { grid-column: 1 / -1; font-size: .85rem; color: var(--dim); border-top: 1px solid var(--rule); padding-top: 16px; }
.mini-foot .link { margin-left: 6px; }

.tool-list { margin-top: 32px; border-top: 1px solid var(--rule); }
.tl { display: grid; grid-template-columns: 40px 220px 1fr auto; gap: 16px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--rule); transition: padding .25s, color .25s; }
.tl::after { content: "→"; color: var(--dim); transition: transform .25s, color .25s; }
.tl:hover { padding-left: 8px; }
.tl:hover::after { transform: translateX(4px); color: var(--mint); }
.tl .mono { font-size: .75rem; color: var(--dim); }
.tl b { font-weight: 600; }
.tl em { font-style: normal; color: var(--dim); font-size: .9rem; }

@media (max-width: 720px) {
  .mini-il { grid-template-columns: 1fr; padding: 22px; gap: 20px; }
  .mini-a { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 8px; }
  .tl { grid-template-columns: 32px 1fr auto; row-gap: 2px; }
  .tl em { grid-column: 2; grid-row: 2; font-size: .82rem; }
  .tl::after { grid-column: 3; grid-row: 1 / 3; }
}

/* landing: category cards */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 48px; }
.cat-card { position: relative; display: block; padding: 22px 22px 20px; border: 1px solid var(--rule); border-radius: 12px; background: rgba(var(--ink-rgb), .015); overflow: hidden; transition: border-color .3s, transform .3s, background .3s; }
.cat-card::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 70%; height: 120%; background: radial-gradient(closest-side, var(--c), transparent); opacity: 0; filter: blur(30px); transition: opacity .4s; }
.cat-card:hover { border-color: var(--c); transform: translateY(-3px); }
.cat-card:hover::before { opacity: .18; }
.cat-card > * { position: relative; }
.cc-dot { display: block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); box-shadow: 0 0 12px var(--c); }
.cat-card h3 { font: 400 1.7rem/1.1 var(--serif); margin-top: 14px; }
.cat-card p { color: var(--dim); font-size: .9rem; margin-top: 4px; }
.cc-items { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.cc-items span { font-size: .78rem; padding: 3px 9px; border-radius: 10px; border: 1px solid var(--rule); color: rgba(var(--ink-rgb), .85); }
.cat-grid .cat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* landing: start here */
.start-grid { display: grid; grid-template-columns: repeat(2, 1fr); margin-top: 40px; border-top: 1px solid var(--rule); }
.sg { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 20px 20px 20px 0; border-bottom: 1px solid var(--rule); transition: padding .25s; }
.sg:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--rule); }
.sg::after { content: "→"; grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--dim); transition: transform .25s, color .25s; }
.sg:hover::after { transform: translateX(4px); color: var(--mint); }
.sg:hover b { color: var(--mint); }
.sg b { font: 400 1.45rem/1.2 var(--serif); transition: color .2s; }
.sg span { font-size: .82rem; color: var(--dim); }
.start-grid .sg:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* landing: safety teaser */
.safe-teaser { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 40px; }
.st { display: flex; flex-direction: column; gap: 6px; padding: 22px; border: 1px solid var(--rule); border-radius: 12px; background: rgba(var(--ink-rgb), .015); transition: border-color .25s, transform .25s; }
.st:hover { border-color: rgba(var(--rose-rgb), .45); transform: translateY(-3px); }
.st .mono { font-size: .72rem; color: var(--rose); }
.st b { font: 400 1.5rem/1.15 var(--serif); }
.st em { font-style: normal; font-size: .88rem; color: var(--dim); }

@media (max-width: 720px) {
  .safe-teaser { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .start-grid { grid-template-columns: 1fr; }
  .sg, .sg:nth-child(even) { padding: 18px 0; border-left: 0; }
}

.doc-nav-right { display: flex; align-items: center; gap: 10px; }
.start-more { margin-top: 24px; font-size: .92rem; color: var(--dim); }
.start-more .link { margin-left: 6px; }

/* quick search (palette.js) */
.pal-btn { display: inline-flex; align-items: center; gap: 10px; background: rgba(var(--ink-rgb), .04); border: 1px solid var(--rule); color: var(--dim); font: 500 .85rem var(--sans); padding: 7px 8px 7px 12px; border-radius: 8px; cursor: pointer; transition: border-color .2s, color .2s; }
.pal-btn:hover { color: var(--ink); border-color: var(--dim); }
.pal-btn kbd { font: .7rem var(--mono); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--rule); color: var(--dim); }
.pal { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(var(--page-rgb), .65); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pal[hidden] { display: none; }
.pal-card { width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--card-2); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); animation: palIn .2s ease; }
@keyframes palIn { from { opacity: 0; transform: translateY(-8px) scale(.99); } }
.pal-input { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.pal-input span { color: var(--dim); font-size: 1.2rem; }
.pal-input input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink); font: 500 1.05rem var(--sans); }
.pal-input input::placeholder { color: var(--dim); }
.pal-input input::-webkit-search-cancel-button { display: none; }
.pal-input kbd { font: .7rem var(--mono); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--rule); color: var(--dim); }
.pal-list { overflow-y: auto; padding: 6px 8px 10px; }
.pal-group { font: 500 .7rem var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 12px 10px 6px; }
.pal-item { display: grid; grid-template-columns: 10px auto 1fr; align-items: center; gap: 4px 12px; padding: 10px; border-radius: 8px; }
.pal-item i { width: 8px; height: 8px; border-radius: 2px; }
.pal-item b { font-weight: 600; font-size: .95rem; white-space: nowrap; }
.pal-item span { font-size: .82rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-item.on { background: rgba(var(--ink-rgb), .06); }
.pal-item.on b { color: var(--mint); }
.pal-empty { padding: 28px 12px; color: var(--dim); text-align: center; }
@media (max-width: 720px) {
  .pal-btn kbd { display: none; }
  .pal-btn { padding: 7px 10px; }
  .pal { padding-top: 8vh; }
  .pal-item { grid-template-columns: 10px 1fr; }
  .pal-item span { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) { .pal-card { animation: none; } }

/* glossary */
.gloss { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); margin-top: 40px; }
.gloss div { padding: 18px 24px 18px 0; border-bottom: 1px solid var(--rule); }
.gloss div:nth-child(even) { padding: 18px 0 18px 24px; border-left: 1px solid var(--rule); }
.gloss dt { font-weight: 600; }
.gloss dd { margin-top: 4px; font-size: .92rem; color: rgba(var(--ink-rgb), .72); }

@media (max-width: 720px) {
  .cat-grid { grid-template-columns: 1fr; }
  .gloss { grid-template-columns: 1fr; }
  .gloss div, .gloss div:nth-child(even) { padding: 16px 0; border-left: 0; }
}

/* never list */
.never { list-style: none; margin-top: 40px; border-top: 1px solid var(--rule); counter-reset: n; }
.never li { counter-increment: n; display: flex; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--rule); font-size: 1.1rem; }
.never li::before { content: "✕"; color: var(--rose); font-size: .9rem; line-height: 1.9; }

@media (max-width: 900px) {
  .stages { grid-template-columns: 1fr; }
  .stage, .stage + .stage { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--rule); }
}
@media (max-width: 720px) {
  .cmp-row { grid-template-columns: 1fr auto; gap: 8px 16px; }
  .cmp-src { grid-column: 1 / -1; grid-row: 2; }
  .cmp-bar { grid-column: 1 / -1; grid-row: 3; }
  .audience { grid-template-columns: 1fr; }
  .aud, .aud + .aud { padding: 24px 0; border-left: 0; }
  .aud + .aud { border-top: 1px solid var(--rule); }
  .never li { font-size: 1rem; }
}

/* ---------- theme toggle (all pages but the landing page) ---------- */
.theme-toggle { display: inline-grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; border: 1px solid var(--rule); background: var(--card); color: var(--ink); cursor: pointer; transition: border-color .2s; }
.theme-toggle:hover { border-color: rgba(var(--mint-rgb), .5); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
.theme-toggle.floating { position: fixed; top: 16px; right: 16px; z-index: 50; }
.app .top .theme-toggle { margin-left: auto; margin-right: 8px; }

/* light theme: soften the parts that were tuned for a dark page */
:root[data-theme="light"] body { background: var(--page); }
:root[data-theme="light"] .doc-nav, :root[data-theme="light"] .map-nav { background: rgba(var(--page-rgb), .85); }
:root[data-theme="light"] .aurora .a { opacity: .16; }
:root[data-theme="light"] .grain { opacity: .25; }
