:root {
  --bg: #0a0b0a;
  --surface: #101210;
  --surface-2: #161916;
  --line: #222622;
  --line-strong: #30352f;
  --text: #eef0ea;
  --muted: #9aa299;
  --faint: #6c746b;
  --accent: #f2b84b;
  --accent-2: #ff8a4c;
  --accent-ink: #1b1305;
  --up: #3fd17f;
  --down: #ff6b5e;
  --radius: 12px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: 'Geist', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: radial-gradient(1100px 560px at 50% -220px, rgb(242 184 75 / 0.09), transparent 70%), var(--bg); color: var(--text); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
main { overflow-x: clip; }
a { color: inherit; }
img, svg { display: block; }
button, input { font: inherit; color: inherit; }
h1, h2 { text-wrap: balance; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 10; }
.skip:focus { left: 8px; }

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

/* Header: floating glass pill */
.site-header { position: sticky; top: 0; z-index: 5; padding: 10px 0; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 56px; padding: 0 10px 0 16px; border: 1px solid var(--line); border-radius: 14px; background: rgb(14 16 14 / 0.72); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); box-shadow: 0 12px 32px -16px rgb(0 0 0 / 0.7); }
.brand { display: flex; align-items: center; gap: 10px; font: 600 19px var(--mono); letter-spacing: -0.03em; text-decoration: none; }
.brand svg { width: 28px; height: 28px; transition: transform 0.3s var(--ease); }
.brand:hover svg { transform: translateY(-2px) rotate(-6deg); }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 6px 10px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap; transition: color 0.2s, background 0.2s; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current='page'] { color: var(--text); background: var(--surface-2); }
.site-header .wrap > :last-child:not(.nav) { margin-left: auto; }
@media (max-width: 640px) {
  .site-header .wrap { gap: 10px; padding-right: 8px; }
  .site-header .btn, .site-header .btn-shimmer { display: none; }
  .brand span { display: none; }
  .nav a { padding: 6px 8px; }
  .nav a[href="/app#positions"] { display: none; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface-2); text-decoration: none; font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: border-color 0.2s, background 0.2s; }
.btn:hover { border-color: var(--faint); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #f6c868; border-color: #f6c868; }
.btn-ghost { border-radius: 999px; padding: 12px 22px; background: rgb(255 255 255 / 0.02); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn svg, .btn-shimmer svg { width: 16px; height: 16px; }

/* Hero */
.hero { position: relative; isolation: isolate; padding: 72px 0 0; text-align: center; }
.hero-bg { position: absolute; inset: -88px 0 35% 0; z-index: -1; pointer-events: none; -webkit-mask-image: radial-gradient(ellipse 60% 75% at 50% 35%, #000 15%, transparent 72%); mask-image: radial-gradient(ellipse 60% 75% at 50% 35%, #000 15%, transparent 72%); }
.hero-bg canvas { width: 100%; height: 100%; }
.hero-copy { display: flex; flex-direction: column; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 28px; padding: 6px 10px 6px 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgb(255 255 255 / 0.03); font-size: 13px; text-decoration: none; transition: border-color 0.2s, background 0.2s; }
.badge:hover { border-color: rgb(242 184 75 / 0.45); background: rgb(242 184 75 / 0.06); }
.badge svg { width: 14px; height: 14px; color: var(--muted); transition: transform 0.2s; }
.badge:hover svg { transform: translateX(2px); }
.eyebrow { font: 500 13px/1 var(--mono); color: var(--accent); letter-spacing: 0.04em; text-transform: uppercase; margin: 0 0 20px; }
h1 { font-size: clamp(40px, 6vw, 68px); line-height: 1.02; letter-spacing: -0.035em; margin: 0 0 20px; font-weight: 600; }
h1 em { font-style: normal; color: var(--accent); }
.hero h1 { font-size: clamp(44px, 7.6vw, 88px); line-height: 0.98; letter-spacing: -0.045em; margin-bottom: 24px; }
.hero h1 em { text-shadow: 0 0 48px rgb(242 184 75 / 0.35); }
h2 { font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 14px; font-weight: 600; }
h3 { font-size: 17px; margin: 0 0 6px; font-weight: 600; letter-spacing: -0.01em; }
.lede { font-size: 18px; color: var(--muted); max-width: 52ch; margin: 0 0 28px; }
.hero .lede { max-width: 60ch; font-size: 19px; margin-bottom: 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.hero .actions { justify-content: center; }
.footnote { font-size: 13px; color: var(--faint); margin: 12px 0 0; }
.hero .ca { width: min(620px, 100%); text-align: left; }
.hero-shot { position: relative; max-width: 980px; margin-top: 64px; }
.hero-shot::before { content: ''; position: absolute; inset: 8% 6% -6%; z-index: -1; background: radial-gradient(closest-side, rgb(242 184 75 / 0.28), transparent); filter: blur(48px); }

/* Terminal window */
.screen { position: relative; border: 1px solid var(--line-strong); border-radius: 16px; background: linear-gradient(180deg, #131512, #0c0d0c); overflow: hidden; text-align: left; box-shadow: 0 40px 90px -40px rgb(0 0 0 / 0.9), inset 0 1px 0 rgb(255 255 255 / 0.05); }
.screen-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--faint); }
.live-dot { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; background: rgb(63 209 127 / 0.1); color: var(--up); font: 600 11px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.live-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--up); animation: pulse 1.8s infinite; }
.lt-tabs { display: flex; gap: 4px; }
.lt-tabs button { padding: 4px 10px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font: 500 12px var(--mono); cursor: pointer; }
.lt-tabs button:hover { color: var(--text); }
.lt-tabs button[aria-pressed='true'] { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
.lt-open { margin-left: auto; color: var(--accent); text-decoration: none; font: 500 12px var(--mono); white-space: nowrap; }
.lt-open:hover { text-decoration: underline; }
.lt { display: grid; grid-template-columns: minmax(0, 1fr) 260px; }
.lt-main { min-width: 0; padding: 16px 18px 12px; }
.lt-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 12px; margin-bottom: 10px; font-size: 14px; }
.lt-head strong { font-size: 18px; }
#lt-px { padding: 0 4px; border-radius: 4px; font: 600 22px var(--mono); letter-spacing: -0.02em; }
#lt-chg { font-size: 13px; }
.lt-chart { display: block; width: 100%; height: 290px; }
.lt-chart line { stroke-width: 1; vector-effect: non-scaling-stroke; }
.lt-chart .cu { fill: var(--up); stroke: var(--up); }
.lt-chart .cd { fill: var(--down); stroke: var(--down); }
.lt-chart .last { stroke: var(--accent); stroke-dasharray: 3 4; opacity: 0.8; }
.lt-book { padding: 14px 16px; border-left: 1px solid var(--line); font: 12.5px/1 var(--mono); }
.lt-book-head { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--faint); }
.lt-row { display: flex; justify-content: space-between; margin: 0 -6px; padding: 5px 6px; background: linear-gradient(var(--tint), var(--tint)) no-repeat right / var(--w) 100%; }
.lt-row.ask { --tint: rgb(255 107 94 / 0.12); }
.lt-row.bid { --tint: rgb(63 209 127 / 0.12); }
.lt-row.ask span:first-child { color: var(--down); }
.lt-row.bid span:first-child { color: var(--up); }
.lt-mid { padding: 10px 0; text-align: center; font-size: 15px; font-weight: 600; color: var(--text); }
.flash-up { animation: flash-up 0.8s ease-out; }
.flash-down { animation: flash-down 0.8s ease-out; }
@media (max-width: 860px) {
  .hero { padding-top: 48px; }
  .hero-shot { margin-top: 48px; }
  .lt { grid-template-columns: 1fr; }
  .lt-book { border-left: 0; border-top: 1px solid var(--line); }
  .lt-row.ask:nth-child(-n+2), .lt-row.bid:nth-last-child(-n+2) { display: none; }
  .lt-chart { height: 220px; }
}
@media (max-width: 640px) {
  .lt-open { display: none; }
}

/* CA box */
.ca { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: rgb(16 18 16 / 0.8); backdrop-filter: blur(6px); }
.ca-ticker { font: 600 14px var(--mono); color: var(--accent); }
.ca-addr { font: 13px var(--mono); color: var(--text); overflow-wrap: anywhere; flex: 1 1 240px; }
.ca-addr.empty { color: var(--faint); }
.ca-link { font-size: 13px; color: var(--muted); }

/* Sections */
section { padding: 80px 0; }
.section-head { max-width: 680px; margin: 0 auto 44px; text-align: center; }
.section-head p { color: var(--muted); margin: 0; }
.kicker { display: inline-block; margin: 0 0 16px !important; padding: 6px 10px; border: 1px solid rgb(242 184 75 / 0.25); border-radius: 999px; background: rgb(242 184 75 / 0.06); font: 500 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent) !important; }
.card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
a.card { text-decoration: none; display: block; }
.card .more { display: inline-block; margin-top: 14px; font-size: 14px; color: var(--accent); transition: transform 0.2s; }
a.card:hover .more { transform: translateX(3px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } section { padding: 64px 0; } }

/* Live tape + stats */
.tape { margin-top: 80px; min-height: 48px; border-block: 1px solid var(--line); background: rgb(255 255 255 / 0.015); }
.tick { display: inline-flex; align-items: baseline; gap: 10px; font: 13px var(--mono); white-space: nowrap; }
.tick b { font: 600 14px var(--font); color: var(--text); }
.tick .px { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 64px 0 0; }
.stats div { display: flex; flex-direction: column-reverse; align-items: center; padding: 8px 24px; text-align: center; }
.stats div + div { border-left: 1px solid var(--line); }
.stats dt { color: var(--muted); font-size: 14px; }
.stats dd { margin: 0 0 6px; font: 600 clamp(32px, 4.4vw, 48px)/1.1 var(--mono); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, var(--text) 30%, #8f9688); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr; gap: 24px; } .stats div + div { border-left: 0; } }

/* Bento */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bento-card { display: flex; flex-direction: column; min-height: 360px; border-radius: 18px; overflow: hidden; }
.bento-card .viz { position: relative; flex: 1 1 auto; min-height: 220px; }
.bento-card .copy { padding: 4px 24px 24px; }
.bento-card .copy p { margin: 0; color: var(--muted); font-size: 15px; }
.span-2 { grid-column: span 2; }
@media (max-width: 860px) { .bento { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }

.beam-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 28px clamp(20px, 6vw, 72px); }
.beams { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.beam-base, .beam-glow { fill: none; stroke-width: 2; stroke-linecap: round; }
.beam-base { stroke: var(--line-strong); }
.node { position: relative; z-index: 1; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-2); font: 600 15px var(--mono); }
.node-order { padding: 12px 16px; line-height: 1.3; text-align: center; }
.node-order small { display: block; font: 400 11px var(--mono); color: var(--muted); }
.node-hub { width: 76px; height: 76px; border-radius: 50%; border-color: rgb(242 184 75 / 0.45); box-shadow: 0 0 48px -8px rgb(242 184 75 / 0.5); }
.node-hub svg { width: 42px; height: 42px; }
.node-col { position: relative; z-index: 1; display: grid; gap: 8px; }
.node-acct { padding: 6px 12px; font-size: 12px; font-weight: 500; color: var(--muted); }

.fills { display: flex; flex-direction: column; gap: 10px; height: 100%; max-height: 268px; margin: 0; padding: 22px 20px 0; list-style: none; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.fills li { flex: none; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; height: 58px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.fills li.enter { animation: list-in 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }
.fills .ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font: 600 13px var(--mono); }
.fills .ic.long { background: rgb(63 209 127 / 0.14); color: var(--up); }
.fills .ic.short { background: rgb(255 107 94 / 0.14); color: var(--down); }
.fills b { display: block; font-size: 14px; font-weight: 600; }
.fills small { font: 12px var(--mono); color: var(--muted); }
.fills .mv { text-align: right; }
.fills .mv b { font: 600 14px var(--mono); }

.lanes { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 100%; gap: 10px; height: 236px; padding: 0 20px; overflow: hidden; }
.chip { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font: 13px var(--mono); }
.chip b { font: 600 14px var(--font); }

.exits { position: relative; margin: 28px 24px 12px; aspect-ratio: 8 / 3; }
.exits svg { width: 100%; height: 100%; overflow: visible; }
.exits .lvl { stroke-width: 1; stroke-dasharray: 4 5; }
.exits .lvl.tp { stroke: var(--up); }
.exits .lvl.sl { stroke: var(--down); }
.exits .lvl.entry { stroke: var(--faint); }
.exits .price { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; }
.lvl-tag { position: absolute; right: 0; transform: translateY(-120%); padding: 2px 8px; border-radius: 6px; font: 500 11px var(--mono); background: var(--surface-2); color: var(--muted); }
.lvl-tag.tp { color: var(--up); background: rgb(63 209 127 / 0.12); }
.exits-label { position: absolute; left: 0; top: -22px; font: 11px var(--mono); color: var(--faint); }
.exits:not(.ready) svg, .exits:not(.ready) .lvl-tag { visibility: hidden; }
.lvl-tag.sl { color: var(--down); background: rgb(255 107 94 / 0.12); }

/* Splitter */
.splitter { display: grid; grid-template-columns: 340px 1fr; gap: 16px; }
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field label, .label { font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; }
.field output { color: var(--text); font-family: var(--mono); }
input[type='range'] { width: 100%; accent-color: var(--accent); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { flex: 1; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: transparent; cursor: pointer; font: 13px var(--mono); transition: border-color 0.2s, color 0.2s, background 0.2s; }
.seg button[aria-pressed='true'] { border-color: var(--accent); color: var(--accent); background: rgb(242 184 75 / 0.08); }
.card.glow { background: radial-gradient(80% 120% at 100% 0%, rgb(242 184 75 / 0.07), transparent 60%), var(--surface); }
.alloc { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alloc li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.alloc .bar { grid-column: 2 / 4; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.alloc .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.4s var(--ease); }
.alloc .idx { font: 12px var(--mono); color: var(--faint); }
.split-foot { display: flex; justify-content: space-between; margin-top: 16px; font-size: 14px; color: var(--muted); }
.split-foot strong { color: var(--text); font-family: var(--mono); }
@media (max-width: 860px) { .splitter { grid-template-columns: 1fr; } }

/* Market cards */
.tabs { display: flex; justify-content: center; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.tabs button { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; transition: color 0.2s, background 0.2s, border-color 0.2s; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-pressed='true'] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.market-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.market-card { display: grid; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; transition: transform 0.25s var(--ease); }
.market-card:hover { transform: translateY(-3px); }
.market-card .top { display: flex; flex-wrap: wrap; gap: 2px 8px; justify-content: space-between; font-size: 13px; color: var(--muted); }
.market-card .sym { font-weight: 600; font-size: 17px; color: var(--text); }
.market-card .px { font: 600 22px var(--mono); letter-spacing: -0.02em; }
#markets .footnote { text-align: center; }
@media (max-width: 860px) { .market-cards { grid-template-columns: repeat(2, 1fr); } }
.skeleton { min-height: 112px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--radius); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li::before { counter-increment: step; content: '0' counter(step); display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 18px; border: 1px solid rgb(242 184 75 / 0.3); border-radius: 10px; background: rgb(242 184 75 / 0.08); color: var(--accent); font: 600 14px var(--mono); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* CTA */
.cta { position: relative; isolation: isolate; overflow: hidden; margin: 24px 0 96px; padding: 88px 24px; border: 1px solid var(--line); border-radius: 24px; text-align: center; background: radial-gradient(60% 90% at 50% 110%, rgb(242 184 75 / 0.16), transparent 70%), var(--surface); }
.cta canvas { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000, transparent 75%); mask-image: radial-gradient(ellipse at 50% 50%, #000, transparent 75%); }
.cta p { color: var(--muted); margin: 0 0 28px; }
.cta-mark { width: 64px; height: 64px; margin: 0 auto 22px; filter: drop-shadow(0 10px 28px rgb(242 184 75 / 0.45)); }

.site-footer { border-top: 1px solid var(--line); padding: 32px 0 0; color: var(--faint); font-size: 13px; overflow: hidden; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-bottom: 48px; }
.site-footer nav { display: flex; gap: 16px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin: 0; max-width: 60ch; }
.footer-mark { margin-top: -8px; padding-bottom: 0.08em; font: 600 clamp(40px, 12vw, 170px)/1 var(--mono); letter-spacing: -0.06em; text-align: center; white-space: nowrap; background: linear-gradient(180deg, rgb(242 184 75 / 0.2), transparent 80%); -webkit-background-clip: text; background-clip: text; color: transparent; user-select: none; }

/* ------------------------------------------------------------------
   Animated components, ported from Magic UI (MIT, see assets/fx.js)
   ------------------------------------------------------------------ */

/* MagicCard: border and spotlight follow the pointer (fx.js sets --mx/--my) */
.magic { --mx: -1000px; --my: -1000px; border: 1px solid transparent; background: radial-gradient(320px circle at var(--mx) var(--my), rgb(242 184 75 / 0.07), transparent 70%) padding-box, linear-gradient(var(--surface), var(--surface)) padding-box, radial-gradient(260px circle at var(--mx) var(--my), var(--accent), var(--accent-2) 25%, var(--line) 70%) border-box; }
.magic:not(:hover) { --mx: -1000px !important; --my: -1000px !important; }

/* BorderBeam: a light that travels around the edge */
.border-beam { position: absolute; inset: 0; z-index: 1; border: 1px solid transparent; border-radius: inherit; pointer-events: none; -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0); mask-composite: exclude; }
.border-beam::after { content: ''; position: absolute; width: 110px; aspect-ratio: 1; background: linear-gradient(to left, var(--accent), var(--accent-2), transparent); offset-path: rect(0 auto auto 0 round 110px); animation: border-beam 9s linear infinite; }
@supports not (offset-path: rect(0 auto auto 0)) { .border-beam { display: none; } }

/* ShimmerButton: a spark circles the border */
.btn-shimmer { --spread: 90deg; position: relative; z-index: 0; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border: 1px solid rgb(255 255 255 / 0.1); border-radius: 999px; background: #120f09; color: #fff3d9; font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; box-shadow: 0 10px 34px -12px rgb(242 184 75 / 0.55); transition: transform 0.3s var(--ease), box-shadow 0.3s; }
.btn-shimmer::before { content: ''; position: absolute; inset: -100%; z-index: -2; filter: blur(2px); background: conic-gradient(from calc(270deg - var(--spread) * 0.5), transparent 0, var(--accent) var(--spread), transparent var(--spread)); animation: spin-around 3s linear infinite; }
.btn-shimmer::after { content: ''; position: absolute; inset: 1.5px; z-index: -1; border-radius: inherit; background: linear-gradient(180deg, #241b0d, #120f09); box-shadow: inset 0 -8px 10px rgb(255 255 255 / 0.1); transition: box-shadow 0.3s; }
.btn-shimmer:hover { box-shadow: 0 14px 40px -12px rgb(242 184 75 / 0.7); }
.btn-shimmer:hover::after { box-shadow: inset 0 -6px 10px rgb(255 255 255 / 0.2); }
.btn-shimmer:active { transform: translateY(1px); }
.btn-shimmer.btn-sm { padding: 8px 14px; font-size: 13px; }

/* AnimatedShinyText */
.shiny { --w: 120px; color: rgb(238 240 234 / 0.62); background: linear-gradient(90deg, transparent, var(--text) 50%, transparent) 0 0 / var(--w) 100% no-repeat; -webkit-background-clip: text; background-clip: text; animation: shiny-text 8s infinite; }

/* Marquee */
.marquee { --gap: 36px; --duration: 80s; display: flex; gap: var(--gap); overflow: hidden; padding: 13px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-group { display: flex; flex-shrink: 0; justify-content: space-around; gap: var(--gap); animation: marquee var(--duration) linear infinite; }
.marquee:hover .marquee-group { animation-play-state: paused; }
.marquee.reverse .marquee-group { animation-direction: reverse; }
.marquee.vertical { --gap: 10px; --duration: 36s; flex-direction: column; height: 100%; padding: 0; -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent); }
.marquee.vertical .marquee-group { flex-direction: column; animation-name: marquee-y; }

/* Motion: hero text blur-in on load, BlurFade on scroll, loops */
@media (prefers-reduced-motion: no-preference) {
  .hero .w { display: inline-block; animation: blur-in 0.8s var(--ease) both; animation-delay: calc(var(--i) * 60ms + 100ms); }
  .rise { animation: blur-in 0.9s var(--ease) both; animation-delay: calc(var(--i) * 60ms + 150ms); }
  .node-hub, .cta-mark { animation: bob 4s ease-in-out infinite; }
  .exits .price { stroke-dashoffset: 1; animation: draw 7s ease-in-out infinite; }
  .exits .area { animation: area 7s ease-in-out infinite; }
  .lvl-tag.tp { animation: hit 7s ease-in-out infinite; }
  @supports (animation-timeline: view()) {
    [data-reveal] { animation: blur-in linear both; animation-timeline: view(); animation-range: entry calc(var(--i, 0) * 8%) entry calc(75% + var(--i, 0) * 8%); }
  }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .live-dot::before, .flash-up, .flash-down, .skeleton, .btn-shimmer::before, .shiny, .fills li.enter { animation: none; }
  .border-beam { display: none; }
  .marquee:not(.vertical) { overflow-x: auto; scrollbar-width: none; }
  .marquee-group { animation: none; }
}

@keyframes blur-in { from { opacity: 0; filter: blur(8px); transform: translateY(14px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(63 209 127 / 0.6); } 70%, 100% { box-shadow: 0 0 0 7px rgb(63 209 127 / 0); } }
@keyframes flash-up { from { background: rgb(63 209 127 / 0.3); } }
@keyframes flash-down { from { background: rgb(255 107 94 / 0.3); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes border-beam { to { offset-distance: 100%; } }
@keyframes spin-around { 0% { transform: rotate(0); } 15%, 35% { transform: rotate(90deg); } 65%, 85% { transform: rotate(270deg); } 100% { transform: rotate(360deg); } }
@keyframes shiny-text { 0%, 90%, 100% { background-position: calc(-100% - var(--w)) 0; } 30%, 60% { background-position: calc(100% + var(--w)) 0; } }
@keyframes marquee { to { transform: translateX(calc(-100% - var(--gap))); } }
@keyframes marquee-y { to { transform: translateY(calc(-100% - var(--gap))); } }
@keyframes list-in { from { opacity: 0; transform: scale(0.9); margin-top: -68px; } }
@keyframes draw { 0% { stroke-dashoffset: 1; opacity: 1; } 45%, 90% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes area { 0%, 30% { opacity: 0; } 50%, 90% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hit { 0%, 42%, 100% { box-shadow: none; } 48%, 90% { box-shadow: 0 0 0 1px rgb(63 209 127 / 0.5), 0 0 18px rgb(63 209 127 / 0.35); } }

/* Notice */
.notice { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid rgb(242 184 75 / 0.3); border-radius: var(--radius-sm); background: rgb(242 184 75 / 0.06); font-size: 13px; color: var(--muted); }
.notice strong { color: var(--accent); }

/* Docs */
.docs { display: grid; grid-template-columns: 200px 1fr; gap: 48px; padding: 48px 0 80px; }
.docs nav { position: sticky; top: 96px; align-self: start; display: grid; gap: 2px; }
.docs nav a { padding: 6px 10px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-size: 14px; }
.docs nav a:hover { background: var(--surface-2); color: var(--text); }
.docs article { max-width: 720px; }
.docs article section { padding: 0 0 40px; scroll-margin-top: 96px; }
.docs article h2 { font-size: 26px; }
.docs article p, .docs article li { color: var(--muted); }
.docs article strong { color: var(--text); }
@media (max-width: 760px) { .docs { grid-template-columns: 1fr; gap: 24px; } .docs nav { position: static; display: flex; flex-wrap: wrap; } }

/* Small pages (token, admin) */
.narrow { width: min(640px, 100% - 32px); margin: 64px auto 96px; }
.narrow section { padding: 48px 0 0; }
.narrow h1 { font-size: clamp(34px, 5vw, 48px); }
.form { display: grid; gap: 16px; }
.input { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface-2); font-family: var(--mono); font-size: 14px; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgb(242 184 75 / 0.18); }
.status { min-height: 1.5em; font-size: 14px; margin: 0; }
.status.ok { color: var(--up); }
.status.err { color: var(--down); }

/* Terminal */
[hidden] { display: none !important; }
.term { display: grid; grid-template-columns: 260px minmax(0, 1fr) 320px; gap: 12px; padding: 12px 0 32px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.rail { display: flex; flex-direction: column; height: calc(100vh - 152px); min-height: 560px; position: sticky; top: 84px; overflow: hidden; }
.rail .search { padding: 12px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips button { padding: 4px 8px; font-size: 12px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.chips button[aria-pressed='true'] { border-color: var(--line-strong); color: var(--text); background: var(--surface-2); }
.mlist { overflow-y: auto; flex: 1; list-style: none; margin: 0; padding: 0; }
.mlist button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.mlist button:hover { background: var(--surface-2); }
.mlist button[aria-current='true'] { background: var(--surface-2); box-shadow: inset 2px 0 var(--accent); }
.mlist .s { font-weight: 600; font-size: 14px; }
.mlist .p { font: 13px var(--mono); text-align: right; }
.mlist .m { font-size: 12px; color: var(--faint); }
.mlist .c { font: 12px var(--mono); text-align: right; }

.center { display: grid; gap: 12px; min-width: 0; }
.mhead { display: flex; justify-content: space-between; align-items: center; padding: 16px; gap: 12px; flex-wrap: wrap; }
.mhead.flush { padding: 16px 0; }
.mhead h1 { font-size: 26px; margin: 0; letter-spacing: -0.02em; }
.mhead .right { text-align: right; }
.sub { font-size: 13px; color: var(--muted); }
.price { font: 600 26px var(--mono); letter-spacing: -0.02em; }
.chart-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 16px 8px; flex-wrap: wrap; }
.seg-sm button { flex: 0 0 auto; padding: 4px 10px; font-size: 12px; }
.chart { height: 380px; padding: 0 4px 8px; }
.h3 { font-size: 15px; margin: 0 0 8px; font-weight: 600; }
.h3.gap { margin: 32px 0 12px; }
.book { padding: 14px 16px 16px; }
.book table { width: 100%; border-collapse: collapse; font: 12px var(--mono); }
.book th { text-align: right; color: var(--faint); font-weight: 400; padding: 4px 0; }
.book th:first-child, .book td:first-child { text-align: left; }
.book td { text-align: right; padding: 3px 0; }
.book tr { background-repeat: no-repeat; background-position: right; }
.book tr.ask { background-image: linear-gradient(rgb(255 107 94 / 0.12), rgb(255 107 94 / 0.12)); }
.book tr.bid { background-image: linear-gradient(rgb(63 209 127 / 0.12), rgb(63 209 127 / 0.12)); }
.book tr.ask td:first-child { color: var(--down); }
.book tr.bid td:first-child { color: var(--up); }
.book tr.spread td { color: var(--muted); text-align: center; padding: 6px 0; }

.order { padding: 16px; display: grid; gap: 14px; position: sticky; top: 84px; }
.order h2 { font-size: 18px; margin: 0; display: flex; justify-content: space-between; align-items: center; }
.order .field { margin: 0; }
.tag { font: 500 11px var(--mono); padding: 3px 6px; border-radius: 4px; background: rgb(242 184 75 / 0.12); color: var(--accent); }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--radius-sm); }
.sides button { padding: 8px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 500; }
.sides button[aria-pressed='true'][data-side='long'] { background: rgb(63 209 127 / 0.15); color: var(--up); }
.sides button[aria-pressed='true'][data-side='short'] { background: rgb(255 107 94 / 0.15); color: var(--down); }
details.tpsl summary { cursor: pointer; font-size: 14px; }
details.tpsl summary .muted { font-size: 12px; margin-left: 6px; }
.tpsl .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.summary { display: grid; gap: 6px; font-size: 13px; padding-top: 12px; border-top: 1px solid var(--line); margin: 0; }
.summary div { display: flex; justify-content: space-between; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-family: var(--mono); }
.btn-block { width: 100%; justify-content: center; padding: 12px; }
.btn-long { background: var(--up); border-color: var(--up); color: #04150b; }
.btn-short { background: var(--down); border-color: var(--down); color: #1d0503; }
.order .status { min-height: 0; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--line-strong); padding: 10px 16px; border-radius: var(--radius-sm); font-size: 14px; z-index: 20; max-width: calc(100% - 32px); }
.toast a { color: var(--accent); }

.positions { padding: 8px 0 48px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.pos { width: 100%; border-collapse: collapse; font-size: 14px; }
table.pos th, table.pos td { padding: 12px 14px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.pos tr:last-child td { border-bottom: 0; }
table.pos th { font-weight: 400; color: var(--muted); font-size: 12px; }
table.pos th:first-child, table.pos td:first-child { text-align: left; }
table.pos td { font-family: var(--mono); }
.empty-state { padding: 40px 16px; text-align: center !important; color: var(--muted); font-family: var(--font) !important; white-space: normal !important; }
.empty-state a { color: var(--accent); }

@media (max-width: 1100px) {
  .term { grid-template-columns: 240px minmax(0, 1fr); }
  .order { grid-column: 1 / -1; position: static; }
  .rail { position: static; height: 660px; min-height: 0; }
}
@media (max-width: 760px) {
  .term { grid-template-columns: 1fr; }
  .rail { position: static; height: 320px; min-height: 0; }
  .chart { height: 300px; }
  .mhead .right { text-align: left; }
}
