/* Home: the thesis, the leader peeking over the leaderboard, and the race drawn as a swimming pool, because polars
   swim in liquidity pools. Tokens come from arena.css; the water has its own pair per theme. */
:root, [data-theme="dark"] { --water: #0d2743; --water-2: #10304f; --rope: #e2574c; --rope-2: #f4f7fb; --code: #070d18; }
[data-theme="light"] { --water: #d4eafc; --water-2: #c6e2f9; --rope: #e2574c; --rope-2: #ffffff; --code: #0f1a2b; }

.home-main > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 44px; align-items: end; padding-top: 8px; }
.pitch { padding-bottom: 12px; }
.live { display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font: 700 14px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero h1 { font-size: clamp(48px, 4.9vw, 76px); line-height: 0.95; margin: 18px 0 18px; max-width: 17ch; }
.hero .sub { font-size: 20px; line-height: 1.55; color: var(--ink-2); max-width: 54ch; }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 18px; }
.hero .ctas .btn { min-width: 200px; height: 60px; font-size: 18px; }
.facts { color: var(--muted); font-size: 16px; font-weight: 600; max-width: 58ch; }
.proof-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; margin-left: -34px; }
.proof-arrow { width: 24px; height: 18px; flex: none; color: var(--accent); animation: nudge 1.6s var(--ease) infinite; }
@keyframes nudge { 50% { translate: 4px 0; } }
.proof { display: inline-flex; align-items: center; gap: 14px; flex-wrap: nowrap; padding: 10px 12px 10px 14px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); box-shadow: 0 3px 0 var(--shadow); font-size: 16px; font-weight: 600; color: var(--ink-2); }
.proof b { color: var(--accent-ink); font-weight: 800; white-space: nowrap; }
.proof b::after { content: " \2192"; }
.proof:hover { border-color: var(--accent); }
.facts b { color: var(--ink); font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums; }

/* the leader leans over the board: the canvas is cut two sprite rows below the board's top edge, so its raised paws
   sit in front of the bezel (one sprite pixel is 8 CSS px) */
.board-col { position: relative; --px: 8px; }
.peek { position: absolute; left: 50%; translate: -50% 0; top: 0; width: calc(42 * var(--px)); height: calc(35 * var(--px)); overflow: hidden; z-index: 2; cursor: pointer; }
.peek canvas { display: block; width: calc(42 * var(--px)); height: calc(42 * var(--px)); image-rendering: pixelated; }
.board { position: relative; z-index: 1; margin-top: calc(33 * var(--px)); padding: 30px 16px 14px; border: 2px solid var(--line-2); border-radius: 24px; background: var(--panel); box-shadow: 0 7px 0 var(--shadow); }
.board-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 0 8px 10px; font: 400 22px/1 var(--font-pixel); text-transform: uppercase; letter-spacing: 0.04em; }
.board-head .dim { color: var(--muted); font-size: 16px; }
.board-head .clock { color: var(--accent-ink); }
.board-rows { list-style: none; margin: 0; padding: 6px; display: grid; gap: 2px; border-radius: 16px; background: var(--panel-2); }
.board-rows a { display: grid; grid-template-columns: 30px 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px 10px; border-radius: 12px; }
.board-rows a:hover { background: var(--panel-3); }
.board-rows .n { font: 400 30px/1 var(--font-pixel); color: var(--muted); text-align: center; }
.board-rows li:first-child .n { color: var(--sun-ink); }
.board-rows img { width: 40px; height: 40px; }
.board-rows .who { min-width: 0; }
.board-rows b { display: block; font-weight: 800; font-size: 17.5px; }
.board-rows small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-rows .edge { font: 400 30px/1 var(--font-pixel); font-variant-numeric: tabular-nums; }
.board-rows .skel-row { height: 52px; border-radius: 12px; background: var(--panel-3); }
.board-foot { display: block; text-align: center; padding: 12px 0 2px; font-weight: 700; font-size: 14px; color: var(--muted); }
.board-foot:hover { color: var(--ink); }

/* sections */
.sec { padding-top: 56px; }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 16px; }
.sec-head p { color: var(--muted); margin-top: 8px; max-width: 62ch; }
.more { font-weight: 800; font-size: 14px; color: var(--accent-ink); white-space: nowrap; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }
.banner { margin: 20px auto 0; }

/* the race, drawn 15% smaller than the page scale */
.pool-card { zoom: 0.85; }
.pool-card { overflow: hidden; background: var(--water); border-color: var(--line-2); }
.lanes-scroll { overflow-x: auto; }
.lanes { position: relative; min-width: 780px; padding: 36px 0 10px; }
.lane { position: relative; height: 64px; background-image: repeating-linear-gradient(to right, var(--rope) 0 14px, var(--rope-2) 14px 28px); background-size: 100% 3px; background-repeat: no-repeat; background-position: 0 100%; }
.lane:nth-of-type(odd) { background-color: var(--water-2); }
.lane:last-child { background-image: none; }
.lane-n { position: absolute; left: 12px; top: 50%; translate: 0 -50%; font: 400 22px/1 var(--font-pixel); color: var(--faint); }
.swimmer { position: absolute; top: 2px; height: 60px; display: flex; align-items: center; gap: 6px; translate: -28px 0; white-space: nowrap; color: var(--ink); transition: left 1.1s var(--ease); z-index: 1; }
.swimmer img { width: 56px; height: 56px; flex: none; -webkit-mask-image: linear-gradient(to bottom, #000 64%, rgb(0 0 0 / 0.4) 64%); mask-image: linear-gradient(to bottom, #000 64%, rgb(0 0 0 / 0.4) 64%); }
.swimmer.flip { flex-direction: row-reverse; translate: calc(-100% + 28px) 0; }
.swimmer.flip .lbl { align-items: flex-end; }
.swimmer .lbl { display: flex; flex-direction: column; line-height: 1.15; }
.swimmer .lbl b { font-size: 14px; font-weight: 800; }
.swimmer .lbl span { font: 600 12.5px/1.2 var(--font-mono); }
.swimmer:hover .lbl b { text-decoration: underline; }
.buoys { position: absolute; top: 0; bottom: 0; width: 0; border-left: 4px dotted var(--sun); z-index: 2; pointer-events: none; }
.buoys span { position: absolute; top: 8px; left: 8px; font: 700 11px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--on-accent); background: var(--sun); padding: 4px 6px; border-radius: 6px; }
.ends { position: absolute; left: 0; right: 0; top: 10px; display: flex; justify-content: space-between; padding: 0 16px; font: 700 11px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

/* feed and pools */
.two { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.pool-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 104px; gap: 12px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.pool-row:first-child { border-top: 0; }
.pool-row:hover { background: var(--panel-2); }
.pool-row .pair { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pool-row .pair .ic { color: var(--ice); width: 18px; height: 18px; }
.pool-row .pair b { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pool-row .pair small { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.pool-row .stack { display: flex; align-items: center; }
.pool-row .stack img { width: 30px; height: 30px; margin-left: -8px; border-radius: 50%; background: var(--panel-3); box-shadow: 0 0 0 2px var(--panel); }
.pool-row .stack img:first-child { margin-left: 0; }
.pool-row .stack i { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 6px; }
.pool-row .vol { text-align: right; }
.pool-row .vol b { display: block; font: 600 14px var(--font-mono); }
.pool-row .vol small { color: var(--muted); font-size: 11.5px; font-weight: 600; }

/* lore */
.lore-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lore-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 18px; align-items: start; }
.lore-card img { width: 96px; height: 96px; }
.lore-card h3 { font-size: 26px; margin: 4px 0 8px; }
.lore-card p { color: var(--ink-2); font-size: 14.5px; }

/* bring your own */
.byo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 32px; align-items: center; }
.byo h2 { margin: 10px 0 12px; }
.byo-copy p:not(.eyebrow) { color: var(--ink-2); max-width: 52ch; }
.byo .ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.code { margin: 0; overflow: hidden; background: var(--code); border-color: var(--line-2); }
.code figcaption { padding: 12px 16px; font: 600 12px/1 var(--font-mono); color: #8a9dba; border-bottom: 1px solid #1d2a40; }
.code pre { margin: 0; padding: 16px; overflow-x: auto; font: 500 12.5px/1.65 var(--font-mono); color: #dfe8f5; }
.code .c { color: #7f93b0; }

.home-foot { margin-top: 56px; padding-top: 18px; border-top: 1px solid var(--line); }
.home-foot p { color: var(--muted); font-size: 12.5px; }
.home-foot .fund { color: var(--ink-2); font-size: 14px; margin-bottom: 8px; }
.home-foot a { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .board-col { max-width: 560px; }
  .lore-grid { grid-template-columns: minmax(0, 1fr); }
  .two, .byo { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .proof-row { margin-left: 0; }
  .proof-arrow { display: none; }
  .board-col { --px: 6px; }
  .hero h1 { font-size: clamp(40px, 12vw, 54px); }
  .hero .sub { font-size: 17px; }
  .hero .ctas .btn { flex: 1 1 150px; min-width: 0; }
  .board-rows a { grid-template-columns: 24px 34px minmax(0, 1fr) auto; gap: 8px; padding: 6px; }
  .board-rows img { width: 34px; height: 34px; }
  .board-rows .edge, .board-rows .n { font-size: 24px; }
  .board-head .dim { display: none; }
  .sec-head { flex-direction: column; align-items: flex-start; }
  .pool-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .pool-row .stack { display: none; }
  .lore-card { grid-template-columns: 72px minmax(0, 1fr); }
  .lore-card img { width: 72px; height: 72px; }
}
