/* ==========================================================
   QuantHub Landing — global styles
   Type: Sora (display + body), Source Code Pro (mono UI),
   Space Grotesk (taglines), Plus Jakarta Sans (chart UI)
   ========================================================== */

:root {
  --ink: rgb(14, 12, 21);
  --ink-2: rgb(39, 36, 45);
  --ink-3: rgb(9, 9, 9);
  --muted: rgb(117, 113, 133);
  --muted-2: rgb(173, 168, 195);
  --line: rgba(20, 16, 38, 0.08);
  --line-2: rgba(20, 16, 38, 0.14);
  --bg: rgb(255, 255, 255);
  --surface: rgb(250, 249, 252);

  --pink: rgb(216, 124, 238);
  --lavender: rgb(144, 153, 252);
  --mint: rgb(137, 249, 232);
  --apricot: rgb(250, 203, 123);

  --green-up: rgb(34, 160, 99);
  --red-dn: rgb(221, 79, 79);

  --shadow-card: 0 1px 2px rgba(20, 16, 38, 0.04), 0 24px 60px -24px rgba(96, 91, 255, 0.18);

  --font-display: "Sora", system-ui, sans-serif;
  --font-mono: "Source Code Pro", ui-monospace, monospace;
  --font-track: "Space Grotesk", sans-serif;
  --font-ui: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-tabular: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; padding: 0; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(14, 12, 21);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  height: 84px;
  display: flex;
  align-items: center;
  padding: 0 40px;
  color: #fff;
}
.nav-inner {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-mark svg { display: block; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.menu { display: flex; gap: 4px; }
.menu a {
  padding: 0 24px;
  height: 84px;
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
  position: relative;
  transition: color .2s;
}
.menu a {
  position: relative;
}
.menu a::after {
  content: "";
  position: absolute;
  bottom: 0; left: 24px; right: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--pink), var(--lavender));
  transform: scaleX(0);
  transform-origin: 50% 50%;
  transition: transform .25s cubic-bezier(.2,.9,.2,1);
}
.menu a:hover { color: #fff; }
.menu a:hover::after { transform: scaleX(1); }
.nav-cta { display: flex; align-items: center; gap: 28px; justify-content: flex-end; }
.nav-cta .mono-link {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  transition: color .2s;
}
.nav-cta .mono-link:hover { color: #fff; }

/* ---------- Pill buttons (ghost / primary) ---------- */
.btn-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border-radius: 999px;
  transition: transform .15s, box-shadow .2s, background .2s, color .2s;
}
.btn-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(90deg, var(--apricot), var(--pink) 35%, var(--lavender) 65%, var(--mint));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.btn-pill:hover { transform: translateY(-1px); }
.btn-pill.btn-filled {
  background: #fff;
}
.btn-pill.btn-filled:hover {
  background: rgba(255,255,255,0.92);
}
.btn-pill.btn-dark {
  background: var(--ink);
  color: #fff;
}
.btn-pill.btn-dark::before { display: none; }
.btn-pill.btn-dark:hover { background: rgb(36, 32, 50); }
.btn-pill.btn-light-on-dark { color: #fff; }
.btn-pill.btn-light-on-dark:hover { background: rgba(255,255,255,0.08); }

/* ---------- Hero ---------- */
/* ---------- Connected frame stack ---------- */
.stack {
  --frame-line: rgba(20, 16, 38, 0.32);
  position: relative;
  width: calc(100% - 32px);
  max-width: 1200px;
  margin: 0 auto 64px;
  border-left: 1px solid var(--frame-line);
  border-right: 1px solid var(--frame-line);
}
.stack-section {
  position: relative;
  border-bottom: 1px solid var(--frame-line);
}
.stack-section:nth-of-type(1) { z-index: 3; }
.stack-section:nth-of-type(2) { z-index: 2; }
.stack-section:nth-of-type(3) { z-index: 1; }
.stack-section:last-of-type { /* bottom edge of frame */ }

/* Corner brackets: at every horizontal-line/edge junction */
.corner {
  position: absolute;
  width: 17px; height: 17px;
  z-index: 3;
  pointer-events: none;
}
.corner::before, .corner::after {
  content: "";
  position: absolute;
  background: var(--ink);
}
.corner::before { left: 0; top: 8px; width: 17px; height: 1px; }
.corner::after  { top: 0; left: 8px; width: 1px; height: 17px; }

.stack > .corner.tl { left: -9px; top: -8px; }
.stack > .corner.tr { right: -9px; top: -8px; }
.stack-section > .corner.bl { left: -9px; bottom: -9px; }
.stack-section > .corner.br { right: -9px; bottom: -9px; }

/* ---------- Hero block (now inside stack) ---------- */
.hero {
  position: relative;
  padding: 88px 40px 64px;
}
.hero-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.rings {
  position: absolute;
  left: 50%;
  top: 40px;
  transform: translateX(-50%);
  width: 1248px;
  height: 1248px;
  pointer-events: none;
  z-index: 0;
}
.rings svg { width: 100%; height: 100%; display: block; }

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
  padding-top: 80px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 96px;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
  color: var(--ink-3);
}
.hero-sub {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-3);
  max-width: 720px;
  margin: 0;
}
.hero-sub strong { font-weight: 600; }
.hero-actions { display: flex; gap: 16px; margin-top: 16px; }

/* ---------- Chart stats above the chart ---------- */
.chart-stats {
  position: relative;
  z-index: 2;
  text-align: center;
  margin: 64px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.chart-stats-eyebrow {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--green-up, #38c172);
  box-shadow: 0 0 0 0 rgba(56, 193, 114, 0.55);
  opacity: 0.35;
  transition: opacity 200ms ease;
}
.live-dot.is-live {
  opacity: 1;
  animation: liveDotPulse 1100ms ease-out infinite;
}
@keyframes liveDotPulse {
  0%   { box-shadow: 0 0 0 0 rgba(56, 193, 114, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(56, 193, 114, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 193, 114, 0); }
}

.chart-stats-main {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 64px;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink-3);
  position: relative;
  font-variant-numeric: tabular-nums;
  transition: text-shadow 280ms ease-out, color 280ms ease-out;
}
.chart-stats-main .chart-stats-num {
  display: inline-flex;
  align-items: baseline;
}
.odo-static {
  display: inline-block;
}
.odo-digit {
  display: inline-block;
  height: 1em;
  line-height: 1;
  overflow: hidden;
  vertical-align: baseline;
  font-variant-numeric: tabular-nums;
  /* a tabular digit in this display face is ~0.55ch wide;
     keep the slot width steady regardless of value */
  min-width: 0.58em;
  text-align: center;
}
.odo-col {
  display: flex;
  flex-direction: column;
  will-change: transform;
}
.odo-slot {
  height: 1em;
  line-height: 1;
  display: block;
}
.chart-stats-main.is-ticking {
  text-shadow:
    0 0 22px rgba(216, 124, 238, 0.55),
    0 0 6px rgba(216, 124, 238, 0.35);
}
.chart-stats-main.is-settled .chart-stats-num {
  animation: numSettle 520ms cubic-bezier(.2,.9,.2,1);
}
@keyframes numSettle {
  0%   { transform: translateY(0) scale(1); }
  35%  { transform: translateY(-2px) scale(1.035); }
  100% { transform: translateY(0) scale(1); }
}

.chart-stats-main .tick-chip {
  position: absolute;
  top: 6px;
  left: calc(100% + 10px);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--green-up, #38c172);
  background: color-mix(in oklab, var(--green-up, #38c172) 14%, transparent);
  border: 1px solid color-mix(in oklab, var(--green-up, #38c172) 34%, transparent);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.85);
  animation: tickChip 1600ms ease-out forwards;
}
@keyframes tickChip {
  0%   { opacity: 0; transform: translateY(8px) scale(0.85); }
  18%  { opacity: 1; transform: translateY(0) scale(1); }
  60%  { opacity: 1; transform: translateY(-6px) scale(1); }
  100% { opacity: 0; transform: translateY(-18px) scale(0.96); }
}

.chart-stats-delta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-tabular);
  font-weight: 600;
  font-size: 14px;
  margin-top: 2px;
}
.chart-stats-delta.up { color: var(--green-up); }
.chart-stats-delta.dn { color: var(--red-dn); }
.chart-stats-delta svg { transform: translateY(-1px); }
.chart-stats-delta.is-bounce svg {
  animation: arrowBounce 720ms cubic-bezier(.2,.9,.2,1);
}
@keyframes arrowBounce {
  0%   { transform: translateY(-1px) scale(1); }
  45%  { transform: translateY(-5px) scale(1.18); }
  100% { transform: translateY(-1px) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .chart-stats-main.is-ticking { text-shadow: none; }
  .chart-stats-main.is-settled .chart-stats-num,
  .chart-stats-delta.is-bounce svg,
  .live-dot.is-live { animation: none; }
  .chart-stats-main .tick-chip { animation: none; opacity: 0; }
}

/* ---------- Chart inside hero ---------- */
.chart-wrap {
  position: relative;
  z-index: 1;
  margin: -8px -40px 0;  /* full-bleed: cancels the .hero 40px side padding; pulls chart closer to stats */
  width: auto;
  max-width: none;
  height: 190px;
}
.chart-wrap svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-canvas {
  position: relative;
  width: 100%;
  height: 260px;
}
.chart-pin-dot {
  position: absolute;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgb(216, 124, 238);
  transform: translate(50%, -50%);
  box-shadow:
    0 0 0 0 rgba(216, 124, 238, 0.6),
    0 0 14px rgba(216, 124, 238, 0.55);
  animation: chartPinPulse 1700ms ease-out infinite;
  pointer-events: none;
  z-index: 2;
}
.chart-pin-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: #fff;
  opacity: 0.95;
}
@keyframes chartPinPulse {
  0%   { box-shadow: 0 0 0 0 rgba(216, 124, 238, 0.65), 0 0 14px rgba(216, 124, 238, 0.55); }
  70%  { box-shadow: 0 0 0 16px rgba(216, 124, 238, 0), 0 0 14px rgba(216, 124, 238, 0.55); }
  100% { box-shadow: 0 0 0 0 rgba(216, 124, 238, 0), 0 0 14px rgba(216, 124, 238, 0.55); }
}
.chart-pin-label {
  position: absolute;
  right: 22px;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px 3px 9px;
  border-radius: 999px;
  background: rgba(10, 10, 16, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  transition: background-color 650ms ease, border-color 650ms ease;
  animation: chartPinLabelIn 520ms cubic-bezier(.2,.9,.2,1);
  z-index: 2;
}
.chart-pin-label.up {
  background: rgb(34, 160, 99);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.chart-pin-label.dn {
  background: rgb(196, 64, 64);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}
@keyframes chartPinLabelIn {
  0%   { opacity: 0; transform: translate(4px, -50%); }
  100% { opacity: 1; transform: translate(0, -50%); }
}
@media (prefers-reduced-motion: reduce) {
  .chart-pin-dot { animation: none; }
  .chart-pin-label { animation: none; }
}
.tooltip-pin {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--lavender);
  box-shadow: 0 4px 16px rgba(96, 91, 255, 0.4);
}
.tooltip-card {
  position: absolute;
  background: #fff;
  border: 1px solid rgb(237,237,237);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(20,16,38,0.08);
  font-family: var(--font-ui);
}
.tooltip-card .date {
  font-size: 12px;
  color: rgb(161,161,161);
  letter-spacing: -0.02em;
}
.tooltip-card .row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.tooltip-card .val {
  font-weight: 700;
  font-size: 14px;
  color: rgb(54,54,54);
}
.tooltip-card .pct {
  font-weight: 500;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgb(220,252,231);
  color: var(--green-up);
}

.mobile-divider { display: none; }

/* ---------- Section meta ---------- */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-track);
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: lowercase;
  color: var(--ink);
}
.section-eyebrow::before,
.section-eyebrow::after {
  content: "";
  width: 4px; height: 12px;
  border: 1px solid var(--ink);
}
.section-eyebrow.eyebrow-plain::before,
.section-eyebrow.eyebrow-plain::after { display: none; }

/* ---------- Leaderboard ---------- */
.leaderboard {
  position: relative;
  padding: 64px 80px 80px;
}
.leaderboard-inner { width: 100%; max-width: 1280px; margin: 0 auto; }

/* How it works (above table) */
.how-it-works {
  margin-bottom: 64px;
}
.how-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
  max-width: 720px;
}
.how-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink-3);
  margin: 0;
  text-wrap: balance;
}
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.how-step {
  position: relative;
  padding: 24px 24px 28px;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  overflow: hidden;
}
.how-step::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--pink), var(--lavender));
  opacity: 0.85;
}
.how-step:nth-child(2)::before { background: linear-gradient(90deg, var(--lavender), var(--mint)); }
.how-step:nth-child(3)::before { background: linear-gradient(90deg, var(--mint), var(--apricot)); }
.how-step:hover {
  transform: translateY(-2px);
  border-color: rgba(20,16,38,0.24);
  box-shadow: 0 12px 32px -16px rgba(20,16,38,0.15);
}
.how-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.how-step-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink-3);
}
.how-step-desc {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
}
.lb-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.lb-bar .left { display: flex; align-items: center; gap: 12px; }
.lb-bar .label {
  font-family: var(--font-tabular);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.lb-dropdown {
  width: 220px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-family: var(--font-tabular);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink);
  position: relative;
}
.lb-dropdown:hover { border-color: var(--ink); }
.lb-dropdown .caret { transition: transform .2s; }
.lb-dropdown.open .caret { transform: rotate(180deg); }
.lb-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow-card);
  z-index: 5;
}
.lb-dropdown-menu button {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-family: var(--font-tabular);
  font-size: 13px;
  color: var(--ink);
}
.lb-dropdown-menu button:hover { background: var(--surface); }
.lb-dropdown-menu button[aria-current="true"] {
  background: var(--ink); color: #fff;
}

.lb-table {
  scroll-margin-top: 100px; width: 100%; border-collapse: collapse; }
.lb-table thead th {
  font-family: var(--font-tabular);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  padding: 16px 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
  user-select: none;
}
.lb-table thead th.sortable { cursor: pointer; }
.lb-table thead th.sortable:hover { color: var(--ink); }
.lb-table thead th .sort-arrow { display: inline-block; margin-left: 4px; opacity: 0.4; }
.lb-table thead th.active { color: var(--ink); }
.lb-table thead th.active .sort-arrow { opacity: 1; color: var(--pink); }

.lb-table tbody tr {
  border-bottom: 1px solid var(--line);
  transition: background .2s;
}
.lb-table tbody tr:not(.expand-row):hover { background: rgba(216, 124, 238, 0.05); }
.lb-table tbody tr.expanded { background: rgba(144,153,252,0.04); }

.lb-table td {
  padding: 18px 12px;
  vertical-align: middle;
  font-family: var(--font-display);
}
.lb-rank {
  font-family: var(--font-tabular);
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
  width: 40px;
}
.lb-rank-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  font-weight: 700;
  color: var(--ink);
}
.lb-rank-top.r1 { background: var(--apricot); }
.lb-rank-top.r2 { background: var(--mint); }
.lb-rank-top.r3 { background: var(--pink); color: #fff; }
.lb-rank-top.r-out {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(20,16,38,0.18);
  font-weight: 500;
}

.lb-name {
  display: flex; align-items: center; gap: 14px;
  min-width: 220px;
}
.lb-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.05em;
}
.lb-avatar.melon { background: linear-gradient(135deg, var(--pink), var(--apricot)); }
.lb-avatar.mistreat { background: linear-gradient(135deg, var(--lavender), var(--mint)); color: var(--ink); }
.lb-avatar.fear { background: linear-gradient(135deg, var(--mint), var(--lavender)); color: var(--ink); }
.lb-avatar.bguber { background: var(--ink); }
.lb-avatar.videigren { background: linear-gradient(135deg, var(--apricot), var(--pink)); }
.lb-avatar.alfa { background: linear-gradient(135deg, var(--lavender), var(--pink)); }
.lb-avatar.kronos { background: linear-gradient(135deg, var(--mint), var(--apricot)); color: var(--ink); }
.lb-avatar.tensor { background: linear-gradient(135deg, var(--apricot), var(--lavender)); color: var(--ink); }
.lb-avatar.sigma { background: linear-gradient(135deg, var(--pink), var(--mint)); color: var(--ink); }
.lb-name .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--ink);
}
.lb-name .by {
  font-family: var(--font-tabular);
  font-size: 11px;
  color: var(--muted);
}

.num-mmc {
  font-family: var(--font-tabular);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
}

.num-return {
  font-family: var(--font-tabular);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
}
.num-return.up { color: var(--green-up); }
.num-return.dn { color: var(--red-dn); }

.spark { width: 120px; height: 36px; }
.lb-spark-cell { text-align: right; padding-right: 24px !important; }
.lb-spark-cell .spark { display: inline-block; }

.trade-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  background: #fff;
  position: relative;
  transition: transform .15s;
}
.trade-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(90deg, var(--pink), var(--lavender));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.trade-btn:hover { transform: translateY(-1px); }

.trade-btn.expand-cta {
  margin-top: 16px;
  text-transform: none;
  letter-spacing: 0.02em;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  height: 40px;
  padding: 0 18px;
  white-space: nowrap;
}

.lb-foot {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.expand-row td {
  padding: 0;
  border: 0 !important;
}
.expand-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 360ms cubic-bezier(.2,.9,.2,1);
}
.expand-row.is-open .expand-wrap {
  grid-template-rows: 1fr;
}
.expand-inner {
  overflow: hidden;
}
.expand-pane {
  padding: 24px 56px 28px;
  background: linear-gradient(180deg, rgba(216,124,238,0.04), rgba(144,153,252,0.04));
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.expand-pane h4 {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.expand-pane p {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}
.expand-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.expand-stat .big {
  font-family: var(--font-tabular);
  font-weight: 600;
  font-size: 22px;
  color: var(--ink);
}

/* ---------- CTA ---------- */
.cta {
  position: relative;
  padding: 120px 40px 140px;
  background:
    radial-gradient(60% 60% at 20% 30%, rgba(144,153,252,0.10), transparent 60%),
    radial-gradient(50% 50% at 85% 70%, rgba(216,124,238,0.12), transparent 60%),
    #fff;
}
.cta-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.cta-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  text-align: center;
}
.cta-waves {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  width: 100%;
  height: 70%;
  pointer-events: none;
}
.cta-waves svg { width: 100%; height: 100%; display: block; }
.cta-content { position: relative; z-index: 1; }
.cta h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 76px;
  letter-spacing: -0.025em;
  line-height: 1.04;
  margin: 16px 0 24px;
  color: var(--ink-3);
}
.cta h2 .accent {
  background: linear-gradient(90deg, var(--pink), var(--lavender));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cta p {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 640px;
  margin: 0 auto 36px;
}
.cta-actions { display: flex; gap: 16px; justify-content: center; align-items: center; }
.cta-actions .btn-pill {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.cta-actions .btn-pill.btn-dark,
.cta-actions .btn-pill.btn-filled { backdrop-filter: none; -webkit-backdrop-filter: none; }
.cta-mini {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 80px;
  flex-wrap: wrap;
}
.cta-mini .item {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cta-mini .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(137,249,232,0.25);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 80px 40px 40px;
}
.footer-inner {
  max-width: 1840px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 48px;
}
.footer-brand .brand-name { font-size: 28px; color: #fff; }
.footer-brand p {
  margin: 20px 0 0;
  max-width: 320px;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 300;
}
.footer-col h5 {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.footer-col a {
  display: block;
  padding: 6px 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  transition: color .2s;
}
.footer-col a:hover { color: var(--pink); }
.footer-bottom {
  max-width: 1840px;
  margin: 56px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.socials { display: flex; gap: 12px; }
.socials a {
  width: 36px; height: 36px;
  border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.7);
  transition: all .2s;
}
.socials a:hover { background: #fff; color: var(--ink); }

/* ---------- Animations ---------- */
@keyframes pulse-ring {
  0% { transform: scale(0.85); opacity: 0.55; }
  100% { transform: scale(1.05); opacity: 0; }
}
@keyframes float-pin {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.tooltip-pin { animation: float-pin 3s ease-in-out infinite; }

/* ==========================================================
   Burger button — shared (hidden on desktop, shown on mobile)
   ========================================================== */
.nav-burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 4px;
  background: none;
  border: none;
  cursor: pointer;
  justify-self: end;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 220ms ease, opacity 160ms ease;
  transform-origin: center;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile slide-down nav panel */
.nav-mobile-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  min-height: calc(100vh - 64px);
  background: rgb(14, 12, 21);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 20px 28px;
  display: none;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
  overflow-y: auto;
}
.nav-mobile-panel.open { display: flex; }
.nav-mobile-panel a:not(.btn-pill) {
  padding: 18px 0;
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-mobile-panel a:not(.btn-pill):last-of-type { border-bottom: none; }
.nav-mobile-panel .btn-pill {
  margin-top: auto;
  align-self: stretch;
  width: 100%;
  justify-content: center;
}

/* ==========================================================
   Mobile (\u2264 720px)
   Overrides only \u2014 desktop styles above are untouched.
   ========================================================== */
@media (max-width: 720px) {
  /* --- Header --- */
  .nav { padding: 0 16px; height: 64px; }
  .nav-inner { grid-template-columns: 1fr auto; }
  .nav .menu,
  .nav .nav-cta { display: none; }
  .nav-burger { display: flex; }
  .brand-name { font-size: 22px !important; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-mark svg { width: 32px; height: 32px; }

  /* --- Stack frame --- */
  /* No gap between header nav and stack frame top, but keep 16px side gutters. */
  .stack { margin: 0 16px 32px; width: auto; max-width: none; }

  /* --- Hero --- */
  .hero { padding: 32px 20px 28px; }
  .hero-content { padding-top: 16px; gap: 18px; }
  .hero h1,
  .hero-intro h1 { font-size: 26px !important; line-height: 1.15 !important; letter-spacing: -0.01em; }
  .hero-sub { font-size: 15px; }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }
  .hero-actions .btn-pill { width: 100%; }
  /* Chart stays the same; just realign its full-bleed margin to the new hero padding. */
  .chart-wrap { margin: -8px -20px 0; }
  /* Mobile chart proportions: match the 1120:240 viewBox aspect so it doesn't
     look vertically stretched at narrow widths. Inline height on the svg is
     overridden with !important. */
  .chart-canvas { height: auto; aspect-ratio: 1120 / 240; }
  .chart-canvas svg { height: 100% !important; }
  .chart-stats { margin-top: 28px; }
  .chart-stats-main { font-size: 48px; }

  /* Divider between CTA buttons and AVG 1M — matches the .corner +
     marks used at section/frame intersections; spans full section width. */
  .mobile-divider {
    display: block;
    position: relative;
    height: 18px;
    /* Hero has 20px side padding; -20px reaches the stack frame border. */
    margin: 32px -20px 0;
  }
  .mobile-divider .line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(20, 16, 38, 0.32);
    transform: translateY(-50%);
  }
  .mobile-divider .plus {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    pointer-events: none;
  }
  .mobile-divider .plus.left { left: 0; transform: translate(-50%, -50%); }
  .mobile-divider .plus.right { right: 0; transform: translate(50%, -50%); }
  .mobile-divider .plus::before,
  .mobile-divider .plus::after {
    content: "";
    position: absolute;
    background: var(--ink);
  }
  .mobile-divider .plus::before {
    left: 0; top: 50%;
    width: 18px; height: 1.5px;
    transform: translateY(-50%);
  }
  .mobile-divider .plus::after {
    top: 0; left: 50%;
    width: 1.5px; height: 18px;
    transform: translateX(-50%);
  }

  /* --- How it works --- */
  .leaderboard { padding: 36px 16px 48px; }
  .how-it-works { margin-bottom: 36px; }
  .how-head { margin-bottom: 24px; }
  .how-title { font-size: 26px; }
  .how-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .how-step { padding: 18px 18px 20px; }
  .how-step-title { font-size: 17px; }
  .how-step-desc { font-size: 13px; }

  /* --- Leaderboard table: card-style rows --- */
  .lb-table,
  .lb-table tbody,
  .lb-table thead,
  .lb-table tr,
  .lb-table td,
  .lb-table th { display: block; }
  .lb-table thead { display: none; }
  .lb-table tbody tr:not(.expand-row) {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "rank name return"
      "spark spark spark";
    align-items: center;
    column-gap: 12px;
    row-gap: 10px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
  }
  .lb-table tbody tr.expanded { background: rgba(144, 153, 252, 0.04); }
  .lb-table td { padding: 0; border: 0; }
  .lb-table td.lb-rank { grid-area: rank; width: auto; }
  .lb-table tr td:nth-child(2) { grid-area: name; }
  .lb-name { min-width: 0; gap: 10px; }
  .lb-name .name { font-size: 14px; }
  .lb-avatar { width: 32px; height: 32px; font-size: 11px; border-radius: 8px; }
  .lb-table td.num-return-cell { grid-area: return; justify-self: end; }
  .num-return { font-size: 13px; }
  .lb-table td.lb-spark-cell {
    grid-area: spark;
    text-align: right;
    padding: 0 !important;
  }
  .lb-table td.lb-spark-cell .spark {
    width: 60%;
    height: 44px;
    display: inline-block;
    margin-right: -2px; /* counter the 2px inner pad so the line reaches the edge */
  }

  /* --- Expanded accordion row --- */
  .lb-table tr.expand-row.is-open {
    border-bottom: 1px solid var(--line);
  }
  .lb-table tr.expand-row > td { padding: 0; }
  .expand-pane {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px 6px 22px;
  }
  .expand-pane h4 { margin-bottom: 4px; }
  .expand-pane p { font-size: 13px; }
  .expand-stat { gap: 4px; }
  .expand-stat .big { font-size: 20px; }
  .trade-btn.expand-cta {
    margin-top: 12px;
    width: 100%;
    justify-content: center;
  }

  /* --- CTA / footer hero --- */
  .cta { padding: 60px 20px 70px; }
  .cta-inner { text-align: left; }
  .cta h2 { font-size: 26px; margin-bottom: 18px; text-align: left; }
  .cta p { font-size: 15px; margin: 0 0 24px; text-align: left; max-width: none; }
  .cta-actions {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    gap: 10px;
  }
  .cta-actions .btn-pill { width: 100%; }
  .cta-mini { gap: 16px; margin-top: 40px; }

  /* --- Footer --- */
  .footer { padding: 48px 20px 28px; }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 28px 24px;
  }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
    margin-top: 36px;
  }
}

/* ==========================================================
   v5 — light header & footer
   ========================================================== */
.nav-light {
  background: #ffffff !important;
  color: var(--ink);
  border-bottom: 1px solid rgba(20, 16, 38, 0.08);
}
.nav-light .menu a { color: rgba(20, 16, 38, 0.65); }
.nav-light .menu a:hover { color: var(--ink); }
.nav-light .nav-cta .mono-link { color: rgba(20, 16, 38, 0.55); }
.nav-light .nav-cta .mono-link:hover { color: var(--ink); }
.nav-light .nav-burger span { background: var(--ink); }
.nav-light .nav-mobile-panel {
  background: #ffffff;
  border-bottom: 1px solid rgba(20, 16, 38, 0.08);
  box-shadow: 0 12px 32px rgba(20, 16, 38, 0.08);
}
.nav-light .nav-mobile-panel a:not(.btn-pill) {
  color: var(--ink);
  border-bottom: 1px solid rgba(20, 16, 38, 0.08);
}

.footer-light {
  background: #ffffff;
  color: var(--ink-2);
  border-top: 1px solid rgba(20, 16, 38, 0.08);
}
.footer-light .brand-name,
.footer-light .footer-brand .brand-name { color: var(--ink); }
.footer-light .footer-brand p { color: var(--ink-2); }
.footer-light .footer-col h5 { color: rgba(20, 16, 38, 0.55); }
.footer-light .footer-col a { color: var(--ink-2); }
.footer-light .footer-col a:hover { color: var(--ink); }
.footer-light .footer-bottom {
  border-top: 1px solid rgba(20, 16, 38, 0.08);
  color: rgba(20, 16, 38, 0.55);
}
.footer-light .socials a {
  background: rgba(20, 16, 38, 0.04);
  color: var(--ink);
}
.footer-light .socials a:hover { background: var(--ink); color: #ffffff; }

/* ==========================================================
   v5 — Hero intro lives INSIDE the framed stack (top section)
   ========================================================== */
.hero-intro {
  position: relative;
  padding: 56px 40px 48px;
}
.hero-intro .hero-content {
  padding-top: 0;
  gap: 24px;
}
/* Reduce framed-hero padding now that only chart + stats live inside it */
.hero { padding: 56px 40px 64px; }
.chart-stats { margin-top: 0; }

@media (max-width: 720px) {
  .hero-intro { padding: 28px 20px 28px; }
  .hero-intro .hero-content { gap: 18px; }
  .hero { padding: 28px 20px 28px; }
}

/* ==========================================================
   FAQ
   ========================================================== */
.faq {
  position: relative;
  padding: 96px 40px 104px;
  background: #ffffff;
}
.faq-inner {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 64px;
  align-items: start;
}
.faq-head {
  position: sticky;
  top: 104px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.faq-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  letter-spacing: -0.025em;
  line-height: 1.04;
  color: var(--ink-3);
  margin: 0;
  text-wrap: balance;
}
.faq-lede {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 320px;
}
.faq-link {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1px solid var(--line-2);
  transition: border-color .2s, color .2s;
}
.faq-link:hover {
  color: var(--pink);
  border-bottom-color: var(--pink);
}

.faq-list {
  border-top: 1px solid var(--line-2);
}
.faq-item {
  border-bottom: 1px solid var(--line-2);
}
.faq-q {
  display: grid;
  grid-template-columns: 56px 1fr 32px;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 22px 0;
  text-align: left;
  cursor: pointer;
  transition: color .2s;
}
.faq-q:hover { color: var(--ink-3); }
.faq-q:hover .faq-toggle { border-color: var(--ink); color: var(--ink); }
.faq-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.faq-q-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.005em;
  line-height: 1.35;
  color: var(--ink-3);
  text-wrap: balance;
}
.faq-toggle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: background .2s, border-color .2s, color .2s, transform .2s;
  justify-self: end;
}
.faq-toggle-v {
  transform-origin: 7px 7px;
  transition: transform 240ms cubic-bezier(.2,.9,.2,1), opacity 200ms ease;
}
.faq-item.is-open .faq-toggle {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.faq-item.is-open .faq-toggle-v {
  transform: rotate(90deg);
  opacity: 0;
}

.faq-a-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 320ms cubic-bezier(.2,.9,.2,1);
}
.faq-item.is-open .faq-a-wrap {
  grid-template-rows: 1fr;
}
.faq-a {
  overflow: hidden;
}
.faq-a p {
  margin: 0;
  padding: 0 32px 28px 72px;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 640px;
}

@media (max-width: 880px) {
  .faq-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .faq-head { position: static; }
  .faq-lede { max-width: none; }
}

@media (max-width: 720px) {
  .faq { padding: 48px 20px 56px; }
  .faq-title { font-size: 26px; }
  .faq-q {
    grid-template-columns: 36px 1fr 28px;
    gap: 12px;
    padding: 18px 0;
  }
  .faq-q-text { font-size: 16px; }
  .faq-toggle { width: 28px; height: 28px; }
  .faq-a p {
    padding: 0 0 22px 48px;
    font-size: 14px;
  }
}


/* ==========================================================
   v6 — Theme toggle button
   ========================================================== */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}
.theme-toggle-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 56px;
  height: 30px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(20, 16, 38, 0.06);
  border: 1px solid var(--line-2);
  transition: background .2s, border-color .2s;
}
.theme-toggle:hover .theme-toggle-track {
  border-color: var(--ink);
}
.theme-toggle-icon {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--ink);
  transition: opacity .2s, color .2s;
}
.theme-toggle-icon-sun { opacity: 1; }
.theme-toggle-icon-moon { opacity: 0.55; }
.theme-toggle-thumb {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(20, 16, 38, 0.12), 0 2px 6px rgba(20, 16, 38, 0.08);
  transform: translateY(-50%);
  transition: transform 280ms cubic-bezier(.2,.9,.2,1), background .2s;
  z-index: 1;
}

[data-theme="dark"] .theme-toggle-track {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}
[data-theme="dark"] .theme-toggle:hover .theme-toggle-track {
  border-color: rgba(255, 255, 255, 0.4);
}
[data-theme="dark"] .theme-toggle-icon { color: #fff; }
[data-theme="dark"] .theme-toggle-icon-sun { opacity: 0.55; }
[data-theme="dark"] .theme-toggle-icon-moon { opacity: 1; }
[data-theme="dark"] .theme-toggle-thumb {
  transform: translate(26px, -50%);
  background: rgb(36, 32, 50);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 2px 6px rgba(0,0,0,0.4);
}

.nav-mobile-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
  padding-top: 20px;
}
.nav-mobile-foot .theme-toggle {
  align-self: flex-start;
}

.nav-mobile-right {
  display: none;
  align-items: center;
  gap: 10px;
  justify-self: end;
}
@media (max-width: 720px) {
  .nav-mobile-right { display: inline-flex; }
  .nav-mobile-right .nav-burger { justify-self: auto; }
}

/* ==========================================================
   v6 — Dark theme overrides
   ========================================================== */
[data-theme="dark"] {
  --ink: rgb(232, 228, 245);
  --ink-2: rgb(190, 186, 210);
  --ink-3: rgb(255, 255, 255);
  --muted: rgb(140, 134, 162);
  --muted-2: rgb(173, 168, 195);
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.14);
  --bg: rgb(14, 12, 21);
  --surface: rgb(22, 19, 32);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.4), 0 24px 60px -24px rgba(0,0,0,0.6);
}

[data-theme="dark"] body { background: var(--bg); color: var(--ink); }

/* Header (light variant overridden) */
[data-theme="dark"] .nav-light {
  background: var(--bg) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .nav-light .menu a { color: rgba(255, 255, 255, 0.65); }
[data-theme="dark"] .nav-light .menu a:hover { color: #fff; }
[data-theme="dark"] .nav-light .brand-name { color: #fff; }
[data-theme="dark"] .nav-light .nav-burger span { background: #fff; }
[data-theme="dark"] .nav-light .nav-mobile-panel {
  background: var(--bg);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
[data-theme="dark"] .nav-light .nav-mobile-panel a:not(.btn-pill) {
  color: rgba(255, 255, 255, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* Stack frame */
[data-theme="dark"] .stack { --frame-line: rgba(255, 255, 255, 0.18); }
[data-theme="dark"] .corner::before,
[data-theme="dark"] .corner::after { background: rgba(255, 255, 255, 0.7); }
[data-theme="dark"] .mobile-divider .line { background: rgba(255, 255, 255, 0.18); }
[data-theme="dark"] .mobile-divider .plus::before,
[data-theme="dark"] .mobile-divider .plus::after { background: rgba(255, 255, 255, 0.7); }

/* Hero / chart */
[data-theme="dark"] .chart-pin-label {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.1);
  color: rgb(14, 12, 21);
}
[data-theme="dark"] .chart-pin-label.up {
  background: rgb(34, 160, 99);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}
[data-theme="dark"] .chart-pin-label.dn {
  background: rgb(196, 64, 64);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Buttons */
[data-theme="dark"] .btn-pill { color: var(--ink); }
[data-theme="dark"] .btn-pill.btn-filled {
  background: #fff;
  color: rgb(14, 12, 21);
}
[data-theme="dark"] .btn-pill.btn-filled:hover { background: rgba(255, 255, 255, 0.9); }
[data-theme="dark"] .btn-pill.btn-dark {
  background: #ac6aff;
  color: #fff;
}
[data-theme="dark"] .btn-pill.btn-dark:hover { background: rgb(157, 89, 245); }

/* How-it-works cards */
[data-theme="dark"] .how-step {
  background: var(--surface);
  border-color: var(--line-2);
}
[data-theme="dark"] .how-step:hover {
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.6);
}

/* Leaderboard dropdown & table */
[data-theme="dark"] .lb-dropdown {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--ink);
}
[data-theme="dark"] .lb-dropdown:hover { border-color: rgba(255, 255, 255, 0.5); }
[data-theme="dark"] .lb-dropdown-menu {
  background: var(--surface);
  border-color: var(--line-2);
}
[data-theme="dark"] .lb-dropdown-menu button { color: var(--ink); }
[data-theme="dark"] .lb-dropdown-menu button:hover { background: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .lb-dropdown-menu button[aria-current="true"] {
  background: #fff;
  color: rgb(14, 12, 21);
}
[data-theme="dark"] .lb-table thead th {
  border-bottom-color: var(--line-2);
  color: var(--muted);
}
[data-theme="dark"] .lb-table thead th.active { color: var(--ink); }
[data-theme="dark"] .lb-table tbody tr {
  border-bottom-color: var(--line);
}
[data-theme="dark"] .lb-table tbody tr:not(.expand-row):hover {
  background: rgba(216, 124, 238, 0.08);
}
[data-theme="dark"] .lb-table tbody tr.expanded {
  background: rgba(144, 153, 252, 0.08);
}
[data-theme="dark"] .lb-rank-top.r-out {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--muted);
}
[data-theme="dark"] .lb-rank-top.r1,
[data-theme="dark"] .lb-rank-top.r2 { color: rgb(14, 12, 21); }
[data-theme="dark"] .lb-name .name { color: var(--ink); }
[data-theme="dark"] .num-mmc { color: var(--ink); }
[data-theme="dark"] .trade-btn {
  background: var(--surface);
  color: var(--ink);
}
[data-theme="dark"] .expand-pane {
  background: linear-gradient(180deg, rgba(216, 124, 238, 0.06), rgba(144, 153, 252, 0.06));
}
[data-theme="dark"] .expand-stat .big { color: var(--ink); }

/* Tooltip card */
[data-theme="dark"] .tooltip-card {
  background: var(--surface);
  border-color: var(--line-2);
}
[data-theme="dark"] .tooltip-card .date { color: var(--muted); }
[data-theme="dark"] .tooltip-card .val { color: var(--ink); }

/* CTA */
[data-theme="dark"] .cta {
  background:
    radial-gradient(60% 60% at 20% 30%, rgba(144, 153, 252, 0.18), transparent 60%),
    radial-gradient(50% 50% at 85% 70%, rgba(216, 124, 238, 0.20), transparent 60%),
    var(--bg);
}
/* FAQ */
[data-theme="dark"] .faq { background: var(--bg); }
[data-theme="dark"] .faq-title { color: var(--ink-3); }
[data-theme="dark"] .faq-lede { color: var(--ink-2); }
[data-theme="dark"] .faq-list { border-top-color: var(--line-2); }
[data-theme="dark"] .faq-item { border-bottom-color: var(--line-2); }
[data-theme="dark"] .faq-q-text { color: var(--ink-3); }
[data-theme="dark"] .faq-toggle {
  border-color: var(--line-2);
  color: var(--ink);
}
[data-theme="dark"] .faq-item.is-open .faq-toggle {
  background: #fff;
  border-color: #fff;
  color: rgb(14, 12, 21);
}
[data-theme="dark"] .faq-a p { color: var(--ink-2); }
[data-theme="dark"] .faq-link { border-bottom-color: var(--line-2); }

/* Footer (light footer variant -> dark) */
[data-theme="dark"] .footer-light {
  background: var(--bg);
  color: var(--ink-2);
  border-top-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .footer-light .brand-name,
[data-theme="dark"] .footer-light .footer-brand .brand-name { color: #fff; }
[data-theme="dark"] .footer-light .footer-brand p { color: rgba(255, 255, 255, 0.75); }
[data-theme="dark"] .footer-light .footer-col h5 { color: rgba(255, 255, 255, 0.5); }
[data-theme="dark"] .footer-light .footer-col a { color: rgba(255, 255, 255, 0.85); }
[data-theme="dark"] .footer-light .footer-col a:hover { color: var(--pink); }
[data-theme="dark"] .footer-light .footer-bottom {
  border-top-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.5);
}
[data-theme="dark"] .footer-light .socials a {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
}
[data-theme="dark"] .footer-light .socials a:hover {
  background: #fff;
  color: rgb(14, 12, 21);
}

/* Section eyebrow brackets in dark */
[data-theme="dark"] .section-eyebrow::before,
[data-theme="dark"] .section-eyebrow::after { border-color: var(--ink); }

/* Theme transition smoothing */
html, body, .nav-light, .footer-light, .how-step, .lb-dropdown,
.faq, .cta, .lb-table tbody tr, .faq-toggle, .trade-btn, .theme-toggle-track,
.theme-toggle-thumb, .theme-toggle-icon {
  transition: background-color 240ms ease, color 240ms ease, border-color 240ms ease;
}
