/* The polar.sh grammar: near-black ground, square #111 panels, one grotesk at
   regular weight, white statements with a grey continuation line, section
   labels on the left and the statement on the right, white pills. */

:root {
  --bg: #090909;
  --panel: #111111;
  --panel-2: #181818;
  --panel-3: #202020;
  --line: #1c1c1c;
  --line-2: #2a2a2a;
  --text: #ffffff;
  --mute: #858585;
  --dim: #5a5a5a;
  --pill: #e6e6e6;
  --green: #4cc38a;
  --green-bg: #0f261b;
  --red: #ec5d5e;
  --red-bg: #2a1213;
  --gutter: 48px;
  --max: 1440px;
  --font: "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
img, svg { display: block; }
.mono { font-family: var(--mono); letter-spacing: 0; }
.mute { color: var(--mute); }
.dim { color: var(--dim); }
.up { color: var(--green); }
.down { color: var(--red); }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ── announcement + nav ───────────────────────────────────── */

.announce {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  height: 44px; background: var(--panel); font-size: 14px; color: var(--text);
}
.announce svg { width: 14px; height: 14px; transition: transform .25s ease; }
.announce:hover svg { transform: translateX(3px); }

.nav { height: 88px; display: flex; align-items: center; gap: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 26px; letter-spacing: -0.02em; }
.brand img { width: 30px; height: 30px; object-fit: contain; }
.links { display: flex; gap: 24px; font-size: 20px; color: var(--mute); }
.links a { transition: color .2s ease; }
.links a:hover, .links a[aria-current="page"] { color: var(--text); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 36px; }
.nav-right .text-btn { font-size: 14px; font-weight: 550; letter-spacing: 0.01em; background: none; border: 0; cursor: pointer; padding: 0; }

.pill {
  display: inline-flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--text); color: #000; font-size: 14px; font-weight: 550; letter-spacing: 0.01em;
  transition: background .2s ease, transform .2s ease, opacity .2s ease;
  white-space: nowrap;
}
.pill svg { width: 12px; height: 12px; transition: transform .25s ease; }
.pill:hover svg { transform: translateX(3px); }
.pill:hover { background: #d9d9d9; }
.pill.grey { background: var(--pill); height: 48px; }
.pill.dark { background: var(--panel-3); color: var(--text); }
.pill.dark:hover { background: #2c2c2c; }
.pill.block { width: 100%; justify-content: center; height: 48px; font-size: 15px; }
.pill:disabled { opacity: .35; cursor: not-allowed; }

/* ── hero ─────────────────────────────────────────────────── */

.hero { padding-top: 108px; padding-bottom: 96px; }
.display {
  font-size: 72px; line-height: 1; font-weight: 400; letter-spacing: -0.03em; margin: 0;
}
.display .grey { color: var(--mute); display: block; margin-top: 16px; }
.hero-ctas { margin-top: 52px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ca {
  display: inline-flex; align-items: center; gap: 12px; max-width: 100%;
  height: 48px; padding: 0 8px 0 20px; border-radius: 999px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line-2); color: var(--text);
  font: 400 14px/1 var(--mono); transition: border-color .2s ease, background .2s ease;
}
.ca:hover { border-color: #3a3a3a; background: var(--panel-2); }
.ca-k { color: var(--mute); }
.ca-v { user-select: all; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ca-s { flex: none; height: 34px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 999px; background: var(--panel-3); color: var(--mute); font: 550 13px/1 var(--font); }

/* ── cards ────────────────────────────────────────────────── */

.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card { background: var(--panel); position: relative; overflow: hidden; }
.glyph-card { aspect-ratio: 324 / 420; display: flex; flex-direction: column; padding: 48px; }
.glyph-card .glyph { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; }
.glyph-card .glyph svg { width: 160px; height: 160px; overflow: visible; }
.glyph-card h3 { font-size: 24px; line-height: 1.375; font-weight: 400; margin: 0 0 8px; letter-spacing: -0.005em; }
.glyph-card p { font-size: 18px; line-height: 1.5; color: var(--mute); margin: 0; }

.burst-card { aspect-ratio: 324 / 544; display: flex; flex-direction: column; padding: 48px; }
.burst-card .glyph { height: 220px; display: flex; align-items: center; justify-content: center; }
.burst-card .glyph svg { width: 170px; height: 170px; overflow: visible; }
.burst-card .copy { margin-top: auto; }
.burst-card h3 { font-size: 22px; line-height: 1.5; font-weight: 400; margin: 0 0 14px; }
.burst-card p { font-size: 18px; line-height: 1.55; color: var(--mute); margin: 0; }

.mock-col h3 { font-size: 22px; font-weight: 400; margin: 28px 0 6px; }
.mock-col p { font-size: 18px; line-height: 1.55; color: var(--mute); margin: 0; }
.mock { aspect-ratio: 324 / 320; display: flex; flex-direction: column; justify-content: center; padding: 32px; gap: 8px; }
.mock .row {
  background: var(--panel-2); padding: 18px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-size: 15px;
}
.mock .row small { display: block; color: var(--mute); font-size: 14px; }
.mock .head { display: flex; justify-content: space-between; font-size: 12px; color: var(--mute); padding: 0 24px 4px; }
.meter { height: 3px; background: var(--panel-3); margin-top: 14px; position: relative; }
.meter i { position: absolute; inset: 0 auto 0 0; background: var(--text); transition: width 1.2s cubic-bezier(.2,.7,.2,1); }
.tag { white-space: nowrap;
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px;
  background: var(--panel-3); color: var(--mute); letter-spacing: 0.04em;
}
.tag.long { background: var(--green-bg); color: var(--green); }
.tag.short { background: var(--red-bg); color: var(--red); }

/* ── sections ─────────────────────────────────────────────── */

.section { padding-top: 150px; }
.section > .wrap > .rule { border-top: 1px solid var(--line); margin-bottom: 150px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.label, .statement { font-size: 48px; line-height: 1.25; font-weight: 400; letter-spacing: -0.02em; margin: 0; }
.statement .grey { color: var(--mute); display: block; }
.lead { font-size: 30px; line-height: 1.375; color: var(--mute); margin: 80px 0 0; letter-spacing: -0.005em; }
.lead + .lead { margin-top: 24px; }
.section .body { margin-top: 100px; }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.outline { border: 1px solid var(--line); }
.flow { padding: 64px 24px; display: flex; flex-direction: column; align-items: center; }
.flow .stack { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 8px; }
.flow .box { background: var(--panel); padding: 16px 20px; font-size: 15px; }
.flow .box.center { text-align: center; }
.flow .arrow { display: flex; justify-content: center; padding: 20px 0; color: var(--mute); }
.flow .arrow svg { width: 14px; height: 26px; }
.check { display: flex; align-items: flex-start; gap: 14px; padding: 9px 0; }
.check b {
  flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--green-bg); color: var(--green);
  display: grid; place-items: center; font-size: 11px; font-weight: 600; margin-top: 1px;
}
.check.burn b { background: var(--red-bg); color: var(--red); }
.quote-panel { background: var(--panel); display: flex; align-items: center; justify-content: center; padding: 48px; }
.quote-panel p { font-size: 22px; line-height: 1.5; margin: 0; max-width: 340px; }

/* live numbers strip */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.figure { background: var(--panel); padding: 32px; min-height: 180px; display: flex; flex-direction: column; justify-content: space-between; }
.figure span { font-size: 14px; color: var(--mute); }
.figure strong { font-size: 40px; line-height: 1.1; font-weight: 400; letter-spacing: -0.02em; display: block; }
.figure small { color: var(--mute); font-size: 14px; }

/* coins table */
.coins { display: flex; flex-direction: column; gap: 8px; }
.coin-row {
  background: var(--panel); display: grid; grid-template-columns: 2.2fr 2.4fr 1fr 1fr 1fr; gap: 16px; align-items: center;
  padding: 20px 24px; transition: background .2s ease;
}
a.coin-row:hover { background: var(--panel-2); }
.coin-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.coin-id .ava { width: 40px; height: 40px; flex: 0 0 40px; background: var(--panel-3); object-fit: cover; display: grid; place-items: center; font-size: 14px; color: var(--mute); }
.coin-id b { font-weight: 400; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-id small { color: var(--mute); font-size: 14px; }
.legs-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.cell small { display: block; color: var(--mute); font-size: 12px; }
.empty { background: var(--panel); padding: 64px 24px; text-align: center; color: var(--mute); font-size: 18px; }
.empty .pill { margin-top: 24px; }

/* faq */
.faq { display: flex; flex-direction: column; }
.faq details { border-top: 1px solid var(--line); padding: 28px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; font-size: 22px; display: flex; justify-content: space-between; gap: 24px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--mute); transition: transform .25s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--mute); font-size: 18px; line-height: 1.6; margin: 16px 0 0; max-width: 760px; }

/* closing + footer */
.closing { padding-top: 200px; padding-bottom: 160px; text-align: center; }
.closing .display { font-size: 64px; }
.closing .pill { margin-top: 44px; }
footer { border-top: 1px solid var(--line); padding: 72px 0 48px; }
.foot { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.foot h4 { font-size: 16px; font-weight: 400; color: var(--mute); margin: 0 0 18px; }
.foot a, .foot span { display: block; font-size: 16px; padding: 5px 0; }
.foot a:hover { color: var(--mute); }
.foot .addr { font-family: var(--mono); font-size: 13px; color: var(--mute); word-break: break-all; }
.fine { margin-top: 72px; color: var(--dim); font-size: 14px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* ── app ──────────────────────────────────────────────────── */

.app-head { padding: 72px 0 48px; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.app-head .display { font-size: 56px; }
.app-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; padding-bottom: 120px; }
.panel { background: var(--panel); padding: 32px; }
.panel + .panel { margin-top: 16px; }
.panel h2 { overflow-wrap: anywhere; font-size: 24px; font-weight: 400; margin: 0 0 4px; letter-spacing: -0.01em; }
.panel .sub { color: var(--mute); margin: 0 0 24px; font-size: 15px; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kv > div { background: var(--panel-2); padding: 16px 18px; }
.kv span { display: block; color: var(--mute); font-size: 13px; }
.kv strong { font-size: 20px; font-weight: 400; display: block; margin-top: 4px; }
.leg-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.leg-table th { text-align: left; font-weight: 400; color: var(--mute); font-size: 12px; padding: 0 12px 10px; }
.leg-table td { background: var(--panel-2); padding: 14px 12px; border-top: 8px solid var(--panel); }
.leg-table td:first-child { padding-left: 18px; }
.leg-table .r, .leg-table th.r { text-align: right; }

.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel-2); padding: 4px; gap: 4px; margin-bottom: 20px; }
.seg button { border: 0; background: none; height: 40px; cursor: pointer; color: var(--mute); }
.seg button[aria-pressed="true"] { background: var(--panel-3); color: var(--text); }
.field { display: block; margin-bottom: 16px; }
.field > span { display: flex; justify-content: space-between; font-size: 13px; color: var(--mute); margin-bottom: 8px; }
.input, .select, textarea.input {
  width: 100%; background: var(--panel-2); border: 1px solid transparent; outline: 0; height: 52px; padding: 0 16px; font-size: 17px;
  transition: border-color .2s ease; border-radius: 0; -webkit-appearance: none; appearance: none;
}
textarea.input { height: 92px; padding: 14px 16px; resize: vertical; font-size: 15px; line-height: 1.5; }
.input:focus, .select:focus { border-color: var(--line-2); }
.select { background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%);
  background-position: calc(100% - 20px) 23px, calc(100% - 15px) 23px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.quote { color: var(--mute); font-size: 14px; min-height: 21px; margin: -4px 0 16px; }
.note { color: var(--mute); font-size: 14px; line-height: 1.55; margin: 16px 0 0; }
.status { font-size: 14px; margin-top: 14px; min-height: 21px; color: var(--mute); word-break: break-word; }
.status.err { color: var(--red); }
.status.ok { color: var(--green); }
.status a { text-decoration: underline; text-underline-offset: 3px; }

.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--panel-2); padding: 16px 18px; cursor: pointer; border: 1px solid transparent; transition: border-color .2s ease; width: 100%; text-align: left; }
.list-row + .list-row { margin-top: 8px; }
.list-row[aria-current="true"] { border-color: var(--line-2); }
.list-row small { color: var(--mute); font-size: 13px; display: block; }

/* launch builder */
.builder-legs { display: flex; flex-direction: column; gap: 8px; }
.leg-edit { display: grid; grid-template-columns: minmax(0, 1.4fr) 116px minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
.leg-edit .input, .leg-edit .select { height: 48px; font-size: 15px; }
.side { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel-2); height: 48px; padding: 4px; gap: 4px; }
.side button { border: 0; background: none; cursor: pointer; color: var(--mute); font-size: 13px; }
.side button.on.long { background: var(--green-bg); color: var(--green); }
.side button.on.short { background: var(--red-bg); color: var(--red); }
.x { height: 48px; border: 0; background: var(--panel-2); color: var(--mute); cursor: pointer; font-size: 18px; }
.x:hover { color: var(--text); }
.add { margin-top: 8px; border: 1px dashed var(--line-2); background: none; height: 48px; width: 100%; cursor: pointer; color: var(--mute); }
.add:hover { color: var(--text); border-color: var(--mute); }
.range { width: 100%; accent-color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: none; cursor: pointer; color: var(--mute); }
.chips button.on { background: var(--text); color: #000; border-color: var(--text); }
.sum { display: flex; justify-content: space-between; font-size: 14px; color: var(--mute); margin-top: 12px; }
.sum.bad b { color: var(--red); font-weight: 400; }
.expo { display: flex; height: 8px; gap: 2px; margin-top: 12px; }
.expo i { display: block; height: 100%; }

/* wallet sheet */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); z-index: 50; display: none; align-items: center; justify-content: center; padding: 16px; }
.sheet-bg.open { display: flex; }
.sheet { background: var(--panel); width: 100%; max-width: 420px; padding: 32px; }
.sheet h3 { font-size: 24px; font-weight: 400; margin: 0 0 6px; }
.sheet p { color: var(--mute); margin: 0 0 24px; font-size: 15px; }
.sheet .wallet { display: flex; align-items: center; gap: 14px; width: 100%; background: var(--panel-2); border: 0; padding: 16px 18px; cursor: pointer; text-align: left; margin-bottom: 8px; transition: background .2s ease; }
.sheet .wallet:hover { background: var(--panel-3); }
.sheet .wallet img, .sheet .wallet i { width: 28px; height: 28px; background: var(--panel-3); }
.sheet .close { margin-top: 12px; width: 100%; background: none; border: 0; color: var(--mute); cursor: pointer; height: 40px; }

/* docs */
.doc { max-width: 820px; padding-bottom: 140px; }
.doc h2 { font-size: 32px; font-weight: 400; margin: 88px 0 20px; letter-spacing: -0.015em; }
.doc p, .doc li { color: var(--mute); font-size: 18px; line-height: 1.7; }
.doc strong { color: var(--text); font-weight: 400; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.doc td { padding: 14px 0; border-top: 1px solid var(--line); font-size: 16px; }
.doc td:last-child { text-align: right; color: var(--mute); }
.doc code { font-family: var(--mono); font-size: 14px; background: var(--panel-2); padding: 2px 6px; color: var(--text); }

/* ── motion ───────────────────────────────────────────────── */

.rv { opacity: 0; transform: translateY(18px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.rv.is-in { opacity: 1; transform: none; }
.rv[data-d="1"] { transition-delay: .08s; }
.rv[data-d="2"] { transition-delay: .16s; }
.rv[data-d="3"] { transition-delay: .24s; }
.line-in > span { display: block; overflow: hidden; }
.line-in > span > span { display: block; transform: translateY(105%); transition: transform 1s cubic-bezier(.2,.7,.2,1); }
.line-in.is-in > span > span { transform: none; }
.line-in.is-in > span:nth-child(2) > span { transition-delay: .09s; }
.line-in.is-in > span:nth-child(3) > span { transition-delay: .18s; }

.draw path, .draw circle, .draw line, .draw polyline { stroke-dasharray: var(--len, 600); stroke-dashoffset: var(--len, 600); transition: stroke-dashoffset 1.8s cubic-bezier(.3,.6,.2,1); }
.is-in .draw path, .is-in .draw circle, .is-in .draw line, .is-in .draw polyline { stroke-dashoffset: 0; }
.spin { transform-origin: 50% 50%; transform-box: fill-box; animation: spin 40s linear infinite; }
.spin.rev { animation-direction: reverse; animation-duration: 28s; }
@keyframes spin { to { transform: rotate(360deg); } }
.pulse line { animation: pulse 3.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .rv, .line-in > span > span { opacity: 1 !important; transform: none !important; transition: none !important; }
  .draw * { stroke-dashoffset: 0 !important; transition: none !important; }
  .spin, .pulse line { animation: none !important; }
}

/* ── responsive ───────────────────────────────────────────── */

@media (max-width: 1100px) {
  .grid4, .figures { grid-template-columns: repeat(2, 1fr); }
  .app-grid { grid-template-columns: minmax(0, 1fr); }
  .coin-row { grid-template-columns: 1.6fr 2fr 1fr; }
  .coin-row .hide-md { display: none; }
}
@media (max-width: 820px) {
  :root { --gutter: 16px; }
  .nav { gap: 24px; height: 72px; }
  .links { display: none; }
  .nav-right { gap: 16px; }
  .display { font-size: 44px; }
  .hero { padding-top: 64px; padding-bottom: 56px; }
  .hero .pill { margin-top: 36px; }
  .split, .duo { grid-template-columns: 1fr; }
  .label, .statement { font-size: 34px; }
  .label { margin-bottom: 24px; }
  .lead { font-size: 22px; margin-top: 40px; }
  .section { padding-top: 88px; }
  .section > .wrap > .rule { margin-bottom: 88px; }
  .section .body { margin-top: 56px; }
  .glyph-card, .burst-card { aspect-ratio: auto; min-height: 380px; padding: 32px; }
  .figure strong { font-size: 30px; }
  .coin-row { grid-template-columns: 1fr auto; }
  .coin-row .hide-sm { display: none; }
  .closing { padding-top: 120px; padding-bottom: 100px; }
  .closing .display { font-size: 40px; }
  .foot { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr 1fr; }
  .leg-edit { grid-template-columns: minmax(0, 1fr) 96px; }
  .leg-edit .wgt { grid-column: 1; }
  .app-head .display { font-size: 40px; }
  .panel { padding: 20px; }
  .flow { padding: 40px 16px; }
}
@media (max-width: 520px) {
  .grid4, .figures { grid-template-columns: 1fr; }
  .nav-right .text-btn.hide-xs { display: none; }
  .brand { font-size: 22px; }
}
