:root {
  /* colours read from Hyperliquid's own app (2026-10-29): background, panels, mint, teal long, pink short */
  --bg: #0b1418;
  --card: #0f1a1f;
  --glass: #0f1a1f;
  --tile: #1b2429;
  --tile2: #273035;
  --ink: #f6fefd;
  --ink2: #d2dad7;
  --muted: #949e9c;
  --line: #222d32;
  --mint: #97fce4;
  --on-mint: #04060c;
  --up: #50d2c1;
  --up-bg: rgba(80, 210, 193, .11);
  --down: #ed7088;
  --down-bg: rgba(237, 112, 136, .11);
  --r: 22px;
  --shadow: 0 0 0 1px var(--line), 0 14px 40px rgba(0, 0, 0, .28);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scrollbar-color: var(--tile2) var(--bg); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--tile2); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a464c; }
html { background: var(--bg); }
body {
  margin: 0; background: transparent; color: var(--ink);
  font: 500 15px/1.45 'Geist', system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
b, .num { font-variant-numeric: tabular-nums; }
.mono { font-family: 'Geist Mono', ui-monospace, monospace; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 28px; }
/* all content sits on one solid sheet, so the water only shows around the page, never between the boxes */
main.wrap.launch { padding-top: 26px; }
main.wrap {
  background: var(--bg); border-radius: 30px; margin: 8px auto 48px; padding-top: 4px; padding-bottom: 28px;
  box-shadow: 0 0 0 1px rgba(246, 254, 253, .05), 0 40px 120px rgba(0, 0, 0, .5);
}

/* ---------------------------------------------------------------- water behind every page (water.js) */
#water { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: -2; opacity: 0; transition: opacity 1.4s cubic-bezier(.23, 1, .32, 1); pointer-events: none; }
#water.on { opacity: 1; }
.grain {
  position: fixed; inset: -60%; z-index: -1; pointer-events: none; opacity: .05; mix-blend-mode: overlay; animation: grain 1s steps(3) infinite;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@keyframes grain { 0% { transform: translate(0, 0); } 33% { transform: translate(-3%, 2%); } 66% { transform: translate(2%, -3%); } 100% { transform: translate(0, 0); } }

/* ---------------------------------------------------------------- header */
header.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 20, 24, .9);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
header.top.scrolled { border-color: var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 21px; letter-spacing: -.04em; }
.logo svg { width: 30px; height: 30px; }
nav.links { display: flex; gap: 4px; }
nav.links a { padding: 8px 14px; border-radius: 999px; font-weight: 600; color: var(--ink2); transition: background .15s, color .15s; }
nav.links a:hover { background: var(--tile); color: var(--ink); }
nav.links a.on { background: var(--tile2); color: var(--ink); }
.spacer { flex: 1; }
.ca-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; margin-right: -16px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--tile); box-shadow: inset 0 0 0 1px var(--tile2); color: var(--ink2); font: 600 13px 'Geist Mono', ui-monospace, monospace;
  transition: background 150ms ease, color 150ms ease, transform 160ms cubic-bezier(.23, 1, .32, 1);
}
.ca-chip:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .ca-chip:hover { background: var(--tile2); color: var(--ink); } }
.ca-chip .ca-k { color: var(--muted); }
.ca-chip.done { color: var(--up); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
  border-radius: 999px; border: 0; background: var(--mint); color: var(--on-mint); font: 700 15px 'Geist', sans-serif; cursor: pointer;
  transition: transform .15s cubic-bezier(.2, .8, .2, 1), background .15s;
}
.btn:hover { background: #b4fdec; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: var(--tile); color: var(--ink); box-shadow: inset 0 0 0 1px var(--tile2); }
.btn.ghost:hover { background: var(--tile2); }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------------------------------------------------------------- totals */
.totals { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 14px; margin: 26px 0 30px; }
.total { background: var(--glass); border-radius: var(--r); padding: 20px 24px; box-shadow: var(--shadow); }
.total small { display: block; color: var(--muted); font-weight: 600; font-size: 13px; }
.total b { display: block; font-size: 34px; font-weight: 800; letter-spacing: -.04em; line-height: 1.15; margin-top: 6px; }
.total span { color: var(--muted); font-size: 13px; font-weight: 500; }
.total.main b { font-size: 46px; }
.total.main.up b { color: var(--up); }
.total.main.down b { color: var(--down); }

/* ---------------------------------------------------------------- filters */
.bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); border-radius: 999px; padding: 3px; }
.seg button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font: 600 14px 'Geist', sans-serif;
  color: var(--ink2); cursor: pointer; transition: background .15s, color .15s;
}
.seg button.on { background: var(--tile2); color: var(--ink); }
.bar .count { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 14px; }

/* ---------------------------------------------------------------- coin card */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; padding-bottom: 60px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 16px; padding: 22px 22px 20px;
  background: var(--glass); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden;
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s;
}
.card.enter { animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
a.card:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--tile2), 0 20px 50px rgba(0, 0, 0, .4); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .6s;
}
.card.up::before { background: linear-gradient(180deg, var(--up-bg), rgba(15, 26, 31, 0) 60%); opacity: 1; }
.card.down::before { background: linear-gradient(180deg, var(--down-bg), rgba(15, 26, 31, 0) 60%); opacity: 1; }
.card > * { position: relative; }
.c-top { display: flex; align-items: center; gap: 12px; }
.av { flex: none; border-radius: 50%; overflow: hidden; display: block; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-name { min-width: 0; flex: 1; }
.c-name b { display: block; font-size: 17px; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-name small { color: var(--muted); font-weight: 600; font-size: 13px; letter-spacing: .02em; }
.state {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted);
  background: var(--tile); padding: 5px 10px; border-radius: 999px;
}
.state.on { color: var(--ink); }
.state.on::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 rgba(80, 210, 193, .5); animation: ping 1.8s infinite; }
.state.paper { color: #f2d48a; background: rgba(242, 212, 138, .1); }
@keyframes ping { 70% { box-shadow: 0 0 0 7px rgba(80, 210, 193, 0); } 100% { box-shadow: 0 0 0 0 rgba(80, 210, 193, 0); } }

.pnl { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pnl .usd { font-size: 44px; font-weight: 800; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; }
.pnl .pct { font-size: 20px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--muted); }
.card.up .usd, .card.up .pct { color: var(--up); }
.card.down .usd, .card.down .pct { color: var(--down); }
.card.tick-up .usd { animation: flashUp .7s; }
.card.tick-down .usd { animation: flashDown .7s; }
@keyframes flashUp { 0% { text-shadow: 0 0 22px rgba(80, 210, 193, .7); } 100% { text-shadow: none; } }
@keyframes flashDown { 0% { text-shadow: 0 0 22px rgba(237, 112, 136, .7); } 100% { text-shadow: none; } }

.pos { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 15px; font-weight: 750; padding: 6px 12px; border-radius: 10px; background: var(--tile); letter-spacing: -.01em; }
.chip.sd.long { background: var(--up); color: var(--on-mint); }
.chip.sd.short { background: var(--down); color: var(--on-mint); }
.chip.lv { background: var(--mint); color: var(--on-mint); }
.chip.tp { background: rgba(242, 212, 138, .14); color: #f2d48a; }
.foot { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-weight: 500; min-height: 19px; }
.foot b { color: var(--ink2); font-weight: 650; }
.pot { height: 5px; background: var(--tile); border-radius: 9px; overflow: hidden; margin-top: -4px; }
.pot i { display: block; height: 100%; background: linear-gradient(90deg, var(--up), var(--mint)); border-radius: 9px; transition: width .6s; }

.empty { grid-column: 1 / -1; text-align: center; padding: 70px 20px; color: var(--muted); background: var(--glass); border-radius: var(--r); }
.empty b { display: block; color: var(--ink); font-size: 20px; margin-bottom: 6px; }
.empty.tall { min-height: 62vh; padding: 56px 28px 34px; display: flex; flex-direction: column; align-items: center; }
.empty.tall > span { max-width: 560px; line-height: 1.55; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; width: 100%; margin-top: 34px; text-align: left; }
.ex-grid .card { background: var(--bg); box-shadow: 0 0 0 1px var(--line); }

/* ---------------------------------------------------------------- coin page */
.coin-head { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; margin: 26px 0 16px; align-items: start; }
.card.big .pnl .usd { font-size: 76px; }
.card.big .pnl .pct { font-size: 30px; }
.card.big .chip { font-size: 18px; padding: 8px 14px; }
.card.big .c-name b { font-size: 24px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fact { background: var(--glass); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow); }
.fact small { color: var(--muted); font-weight: 600; font-size: 13px; display: block; }
.fact b { font-size: 24px; font-weight: 800; letter-spacing: -.03em; }
.links-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.panel { background: var(--glass); border-radius: var(--r); box-shadow: var(--shadow); padding: 8px 22px; margin-bottom: 60px; }
.panel h2 { font-size: 18px; letter-spacing: -.02em; margin: 14px 0 6px; }
.row { display: flex; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); align-items: baseline; }
.row:first-of-type { border-top: 0; }
.row .t { width: 54px; color: var(--muted); font-size: 13px; flex: none; }
.row .what { flex: 1; }
.row .amt { font-weight: 750; font-variant-numeric: tabular-nums; }
.row a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }

/* ---------------------------------------------------------------- launch */
.launch { display: grid; grid-template-columns: 1fr 400px; gap: 26px; margin: 26px 0 70px; align-items: start; }
.form { background: var(--glass); border-radius: var(--r); box-shadow: var(--shadow); padding: 26px; display: grid; gap: 22px; }
.form h1 { font-size: 30px; letter-spacing: -.04em; margin: 0; font-weight: 800; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.field .hint { color: var(--muted); font-weight: 500; font-size: 13px; margin-top: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input[type=text], input[type=number], textarea {
  width: 100%; border: 1px solid var(--line); background: var(--tile); border-radius: 14px; padding: 13px 14px;
  font: 600 15px 'Geist', sans-serif; color: var(--ink); outline: none; transition: border-color .15s, background .15s;
}
input:focus, textarea:focus { border-color: var(--up); background: var(--card); }
textarea { resize: vertical; min-height: 76px; }
.field label.drop {
  display: flex; align-items: center; gap: 14px; padding: 14px; border: 1.5px dashed var(--tile2); border-radius: 16px; cursor: pointer;
  background: var(--tile); transition: border-color .15s;
}
.drop:hover { border-color: var(--ink); }
.drop .thumb { width: 54px; height: 54px; border-radius: 50%; background: var(--tile2) center/cover; flex: none; }
.markets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mkt {
  border: 0; background: var(--tile); border-radius: 14px; padding: 12px; text-align: left; cursor: pointer;
  font: 600 13px 'Geist', sans-serif; color: var(--muted); box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .15s, background .15s;
}
.mkt b { display: block; color: var(--ink); font-size: 17px; font-weight: 800; }
.mkt.on { background: var(--card); box-shadow: inset 0 0 0 2px var(--up); }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sidebtn {
  border: 0; border-radius: 14px; padding: 16px; font: 800 20px 'Geist', sans-serif; cursor: pointer; background: var(--tile); color: var(--ink2);
  transition: background .15s, color .15s;
}
.sidebtn.long.on { background: var(--up); color: var(--on-mint); }
.sidebtn.short.on { background: var(--down); color: var(--on-mint); }
.levs { display: flex; gap: 8px; flex-wrap: wrap; }
.levs button {
  border: 0; border-radius: 12px; padding: 11px 16px; background: var(--tile); font: 800 17px 'Geist', sans-serif; cursor: pointer; color: var(--ink2);
}
.levs button.on { background: var(--mint); color: var(--on-mint); }
.preview { position: sticky; top: 92px; display: grid; gap: 12px; }
.preview .note { color: var(--muted); font-size: 13px; padding: 0 6px; }
.err { color: var(--down); font-weight: 600; font-size: 14px; min-height: 20px; }

/* ---------------------------------------------------------------- how */
.doc { max-width: 760px; margin: 34px auto 80px; }
.doc h1 { font-size: 44px; letter-spacing: -.045em; line-height: 1.05; margin: 0 0 18px; font-weight: 800; }
.doc h2 { font-size: 22px; letter-spacing: -.025em; margin: 38px 0 8px; font-weight: 800; }
.doc p { font-size: 17px; line-height: 1.6; color: var(--ink2); margin: 0 0 12px; }
.doc table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); margin: 12px 0; }
.doc td, .doc th { padding: 12px 16px; text-align: left; border-top: 1px solid var(--line); font-size: 15px; }
.doc th { border-top: 0; color: var(--muted); font-weight: 600; font-size: 13px; }
.doc td b { font-weight: 800; }

footer { color: var(--muted); font-size: 13px; padding: 24px 0 40px; border-top: 1px solid var(--line); }

@media (max-width: 980px) {
  .totals { grid-template-columns: 1fr 1fr; }
  .coin-head, .launch { grid-template-columns: 1fr; }
  .preview { position: static; }
  .markets { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  main.wrap { border-radius: 22px; margin: 4px 8px 24px; padding: 2px 12px 16px; }
  nav.links { display: none; }
  header.top .wrap { gap: 10px; }
  .logo { font-size: 18px; gap: 8px; }
  .logo img { width: 26px; height: 26px; }
  .ca-chip { height: 36px; padding: 0 10px; margin-right: 0; font-size: 12px; white-space: nowrap; }
  .ca-chip .ca-k { display: none; }
  header.top .btn { height: 36px; padding: 0 14px; font-size: 13px; white-space: nowrap; }
  .bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
  .bar::-webkit-scrollbar { display: none; }
  .bar .count { display: none; }
  .seg { flex: none; }
  .totals { grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 16px; }
  .total { padding: 14px 16px; border-radius: 18px; }
  .total.main { grid-column: 1 / -1; }
  .totals .total:not(.main) { display: none; }
  .total b { font-size: 24px; }
  .total.main b { font-size: 36px; }
  .grid { grid-template-columns: 1fr; }
  .card.big .pnl .usd { font-size: 54px; }
  .two { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
