:root {
  --bg: #08090b; --surface: #111317; --surface-2: #16191e;
  --ink: #f5f5f7; --ink-2: #c7c9d1; --muted: #86868b; --line: rgba(255, 255, 255, .08); --line-2: rgba(255, 255, 255, .14);
  --prem: #ff9f66; --prem-bg: rgba(255, 159, 102, .12); --disc: #3ddc97; --disc-bg: rgba(61, 220, 151, .12);
  --accent: #f2a36f; --accent-ink: #1d1209;
  --coin: #e9a46c; --coin-edge: #b8703f; --coin-ink: #2a1a10;
  --glass: rgba(22, 25, 31, .62);
  --glass-solid: rgba(20, 23, 28, .96);
  --blur: blur(20px) saturate(160%);
  /* SF Pro on Apple devices, Inter elsewhere. */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, "Cascadia Mono", Consolas, monospace;
  --cz: min(36vw, 440px);
  --gut: clamp(18px, 4.5vw, 80px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--sans); letter-spacing: -.011em; -webkit-font-smoothing: antialiased; overflow-x: hidden; font-feature-settings: "cv11", "ss01"; }
a { color: inherit; }
button { font: inherit; color: inherit; letter-spacing: inherit; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Full width: content spans the screen with side gutters. */
main { position: relative; padding-inline: var(--gut); }

/* Each section is one screen. */
.screen { position: relative; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 104px 0 56px; }

/* ---------- background ---------- */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-lines { position: absolute; left: 50%; top: 50%; width: 130vmin; height: 130vmin; margin: -65vmin 0 0 -65vmin; overflow: visible; animation: spin 140s linear infinite; will-change: transform; }
/* Stroke in SVG units (no non-scaling-stroke): the spin can then rotate a cached layer instead of repainting every frame. */
.bg-lines path { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: .22; }
.bg-lines .dash { stroke: rgba(242, 163, 111, .22); stroke-dasharray: .3 1.1; transform-box: fill-box; transform-origin: center; transform: scale(1.2); }
.bg .grain { position: absolute; inset: 0; opacity: .05; 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='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- coin (behind the content) ---------- */
.coin-wrap { position: fixed; z-index: 1; left: 50%; top: 50%; width: var(--cz); height: var(--cz); margin: calc(var(--cz) / -2) 0 0 calc(var(--cz) / -2); pointer-events: none; perspective: 1400px; will-change: transform, opacity; opacity: 0; }
.coin-tilt, .coin-float, .coin { position: absolute; inset: 0; transform-style: preserve-3d; }
.coin-float { animation: drift 9s ease-in-out infinite; }
@keyframes drift { 50% { transform: translate3d(0, -14px, 0) rotateZ(3deg); } }
.coin { will-change: transform; }
.coin .face { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.coin .front { transform: translateZ(6px); }
.coin .back { transform: rotateY(180deg) translateZ(6px); }
.coin .edge { position: absolute; inset: 1%; border-radius: 50%; background: #9a5b31; }
.coin-glow { position: absolute; inset: -30%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(242, 163, 111, .16), transparent 70%); }
.c-rim { fill: #c98a5a; }
.c-reed { fill: none; stroke: #a5683d; stroke-width: 4; stroke-dasharray: 1.1 1.1; }
.c-face { fill: #e2a070; }
.c-line-hi { fill: none; stroke: #f4c79e; stroke-width: .8; }
.c-line-lo { fill: none; stroke: #b9784a; stroke-width: .7; }
.c-ring { font: 600 8.4px var(--sans); letter-spacing: 2.6px; fill: #8c532d; }
.c-ink { fill: #2e1c10; }
.c-light { fill: #fff3e6; }
.c-deep { fill: #b06f42; }
.c-shine { fill: none; stroke: #fff; stroke-opacity: .35; stroke-width: 4; stroke-linecap: round; }
.c-word { font: 700 25px var(--display); letter-spacing: -.5px; fill: #2e1c10; text-anchor: middle; }
.c-small { font: 600 7.5px var(--sans); letter-spacing: 2.5px; fill: #8c532d; text-anchor: middle; }
/* ScrollSmoother wraps the page; keep it above the coin. */
#smooth-wrapper { z-index: 2; }

.progress { position: fixed; z-index: 30; left: 0; right: 0; top: 0; height: 2px; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- glass ---------- */
.glass { background: var(--glass); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 48px -28px rgba(0, 0, 0, .8); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
html.lite .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--glass-solid); }
html.lite .bg-lines, html.lite .coin-float, html.lite .tape-track { animation: none; }
html.lite .coin-glow { display: none; }

/* ---------- top bar ---------- */
.bar { position: fixed; z-index: 20; top: 12px; left: max(12px, calc(var(--gut) - 10px)); right: max(12px, calc(var(--gut) - 10px)); display: flex; align-items: center; gap: 18px; padding: 10px 12px 10px 18px; border-radius: 16px; background: rgba(12, 14, 18, .62); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font: 600 19px/1 var(--display); letter-spacing: -.02em; }
.brand .accent { fill: var(--accent); }
.session { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 11px; }
.session i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.session.live i { background: var(--disc); box-shadow: 0 0 0 0 var(--disc); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } }
.bar nav { margin-left: auto; display: flex; gap: 24px; font-size: 13.5px; }
.bar nav a { text-decoration: none; color: var(--ink-2); transition: color .2s; }
.bar nav a:hover { color: var(--ink); }
.btn-ask { border: 0; cursor: pointer; padding: 8px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--accent-ink); background: var(--accent); }

/* ---------- hero ---------- */
.hero-copy { max-width: min(900px, 58vw); }
.kick { font-size: 14px; font-weight: 600; color: var(--accent); margin: 0 0 18px; }
h1 { font: 700 clamp(2.7rem, 6.2vw, 5.4rem)/1.02 var(--display); letter-spacing: -.045em; margin: 0; }
h1 em { font-style: normal; color: var(--muted); }
h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
h1 .w > span { display: inline-block; }
.lede { max-width: 48ch; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.45; color: var(--ink-2); margin: 24px 0 0; letter-spacing: -.015em; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; text-decoration: none; font-size: 15px; font-weight: 500; cursor: pointer; transition: transform .2s, background .2s; }
.btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, .06); }
.btn.primary { border-color: transparent; color: var(--accent-ink); background: var(--accent); font-weight: 600; }
.btn.primary:hover { background: #f6b386; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 52px; }
.tile { border-radius: 18px; padding: 18px 20px 16px; }
.stats small { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.stats b { display: block; font: 700 clamp(1.8rem, 3vw, 2.5rem)/1.1 var(--display); letter-spacing: -.035em; margin-top: 8px; font-variant-numeric: tabular-nums; }

/* ticker tape */
.tape { overflow: hidden; margin: 40px calc(-1 * var(--gut)) 0; padding: 14px 0; border-block: 1px solid var(--line); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.tape-track { display: flex; width: max-content; gap: 34px; font-size: 13.5px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; animation: marquee 60s linear infinite; }
.tape.off .tape-track { animation-play-state: paused; }
.tape-track span b { color: var(--ink); font-weight: 600; margin-right: 8px; }
@keyframes marquee { to { transform: translate3d(-50%, 0, 0); } }

/* ---------- sections ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--accent); margin: 0 0 10px; }
h2 { font: 700 clamp(2rem, 3.8vw, 3.2rem)/1.06 var(--display); margin: 0; letter-spacing: -.04em; }
#updated { font-size: 13px; }

/* agent notes */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card { border-radius: 20px; padding: 20px 20px 22px; min-height: 220px; display: flex; flex-direction: column; gap: 10px; transition: transform .25s, border-color .25s; }
.card:hover { transform: translateY(-4px); border-color: var(--line-2); }
.card.skeleton { animation: shimmer 1.4s infinite alternate; }
@keyframes shimmer { to { opacity: .45; } }
.card header { display: flex; justify-content: space-between; align-items: baseline; }
.card .t { font-size: 15px; font-weight: 600; }
.card .g { font: 700 32px/1 var(--display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.card p { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.card .sp { align-self: flex-start; font-size: 12px; font-weight: 600; color: var(--prem); background: var(--prem-bg); padding: 4px 9px; border-radius: 999px; }

/* board: fits one screen, the table scrolls inside */
.panel { border-radius: 22px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9); overflow: hidden; }
.search input { font: 15px var(--sans); background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 10px 18px; width: min(280px, 80vw); color: var(--ink); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
/* No inner vertical scroll: a scroll area inside the page catches the wheel and makes the page feel stuck. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #2b2f37 transparent; }
.more { display: block; width: 100%; padding: 14px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.more:hover { color: var(--ink); background: var(--surface-2); }
.more[hidden] { display: none; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { position: sticky; top: 0; z-index: 1; background: var(--surface); font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; padding: 16px 16px 12px; cursor: pointer; user-select: none; white-space: nowrap; box-shadow: inset 0 -1px 0 var(--line); }
th:hover { color: var(--ink-2); }
th[aria-sort]::after { content: " ↓"; color: var(--accent); }
th[aria-sort="ascending"]::after { content: " ↑"; }
td { padding: 14px 16px; border-top: 1px solid var(--line); white-space: nowrap; }
tbody tr:first-child td { border-top: 0; }
.num { text-align: right; font-size: 14.5px; }
tbody tr.row { cursor: pointer; transition: background .15s; }
tbody tr.row:hover td { background: var(--surface-2); }
tbody tr.row[aria-expanded="true"] td { background: var(--surface-2); }
.tk { font-size: 15px; font-weight: 600; }
.nm { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; max-width: 26ch; overflow: hidden; text-overflow: ellipsis; }
.gapcol { min-width: 170px; }
.gapcell { display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-weight: 600; }
.meter { position: relative; width: 80px; height: 6px; background: linear-gradient(var(--line-2), var(--line-2)) center / 1px 100% no-repeat; }
.meter span { position: absolute; top: 0; height: 6px; border-radius: 3px; }
.prem { color: var(--prem); } .disc { color: var(--disc); }
.meter .prem { background: var(--prem); left: 50%; } .meter .disc { background: var(--disc); right: 50%; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.tag.prem { background: var(--prem-bg); } .tag.disc { background: var(--disc-bg); }
.pad { padding: 30px 16px; }
.legend { font-size: 13.5px; color: var(--muted); margin: 16px 0 0; }
tr.detail td { background: #0c0e11; padding: 0; white-space: normal; }
.detail-in { padding: 18px 16px 22px; }
.detail-in p { margin: 0 0 14px; max-width: 80ch; color: var(--ink-2); }
.pools { width: 100%; font-size: 13.5px; }
.pools th { position: static; background: none; cursor: default; padding: 6px 10px; box-shadow: none; }
.pools td { padding: 8px 10px; border-top: 1px solid var(--line); }
.pools .num { font-size: 13.5px; }
.pools a { text-decoration: none; border-bottom: 1px solid var(--line-2); }
.addr { font: 12px var(--mono); color: var(--muted); margin-top: 14px !important; word-break: break-all; }
.flag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--ink-2); margin-left: 6px; }

/* method */
.rail { height: 2px; background: var(--line); border-radius: 2px; margin-bottom: 18px; overflow: hidden; }
.rail i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.method ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.step { border-radius: 20px; padding: 24px; color: var(--ink-2); font-size: 15px; }
.step .n { display: block; font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 12px; }
.step b { color: var(--ink); font-weight: 600; }
.fine { margin-top: 22px; max-width: 75ch; font-size: 13.5px; }

.outro { align-items: center; text-align: center; gap: 14px; padding-bottom: 120px; }
.outro h2 { font-size: clamp(2.6rem, 6vw, 4.8rem); }
.outro p { margin: 0 0 8px; font-size: 18px; }
.foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 22px 0 28px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); text-align: left; }
.fx { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }

/* reveal (only when motion.js runs, so content shows without JS) */
.js-motion .reveal, .js-motion .group:not(.shown) > * { opacity: 0; transform: translate3d(0, 28px, 0); }

/* ---------- assistant ---------- */
.chat-fab { position: fixed; z-index: 40; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; border: 1px solid var(--line-2); cursor: pointer; background: var(--surface-2); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .8); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); display: grid; place-items: center; }
.chat-fab:hover { transform: scale(1.08) rotate(-8deg); }
.chat-fab[aria-expanded="true"] { transform: scale(.85); opacity: 0; pointer-events: none; }
.chat { position: fixed; z-index: 41; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100svh - 110px)); border-radius: 24px; display: flex; flex-direction: column; overflow: hidden; background: rgba(20, 23, 29, .82); transform-origin: 100% 100%; }
.chat[hidden] { display: none; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.chat-head div { flex: 1; min-width: 0; }
.chat-head b { display: block; font-size: 15px; font-weight: 600; }
.chat-head small { display: block; font-size: 12px; color: var(--muted); }
.chat-face { flex: none; }
.chat.busy .chat-face { animation: wobble .6s ease-in-out infinite; }
@keyframes wobble { 50% { transform: rotate(-10deg) translateY(-2px); } }
.chat-btn { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.chat-btn:hover { color: var(--ink); border-color: var(--line-2); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { align-self: flex-start; background: rgba(255, 255, 255, .07); border-bottom-left-radius: 6px; }
.msg.me { align-self: flex-end; color: var(--accent-ink); background: var(--accent); border-bottom-right-radius: 6px; }
.msg.typing::after { content: "▍"; animation: blink2 1s steps(2) infinite; color: var(--accent); }
@keyframes blink2 { 50% { opacity: 0; } }
.chips[hidden] { display: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 10px; scrollbar-width: none; }
.chips button { flex: none; border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 7px 13px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.chips button:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; font: 15px var(--sans); color: var(--ink); background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 999px; padding: 11px 16px; }
.chat-form input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.chat-form button { width: 44px; border: 0; border-radius: 50%; cursor: pointer; color: var(--accent-ink); background: var(--accent); display: grid; place-items: center; }
.chat-form button:disabled { opacity: .5; cursor: wait; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .method ol { grid-template-columns: 1fr; }
  :root { --cz: min(50vw, 340px); }
  .hero-copy { max-width: none; }
}
@media (max-width: 640px) {
  .bar nav, .session span { display: none; }
  .session { margin-left: auto; padding: 8px; }
  .screen { min-height: auto; padding: 96px 0 48px; }
  .hero { min-height: 100svh; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .hide-s, .meter { display: none; }
  .gapcol { min-width: 0; }
  td, th { padding-inline: 10px; }
  .nm { max-width: 15ch; }
  .outro { min-height: 80svh; }
  .chat { right: 8px; left: 8px; bottom: 8px; width: auto; height: calc(100svh - 80px); }
  :root { --cz: 72vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* official $BASIS contract (set in the admin panel) */
.ca { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding: 8px 8px 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); max-width: 100%; }
.ca[hidden], .ca-buy[hidden], #caFoot[hidden] { display: none; }
.ca-label { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.ca code { font: 13px var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.ca-copy, .ca-buy { border: 0; border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; }
.ca-copy { background: rgba(255, 255, 255, .08); color: var(--ink); }
.ca-copy.ok { background: var(--disc); color: #06120c; }
.ca-buy { background: var(--accent); color: var(--accent-ink); }
#caFoot code { font: 12px var(--mono); }
