@font-face {
  font-family: "Inter Tight";
  src: url("/assets/fonts/InterTight.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  /* bg, text, up and down are the card's themeable colors (see js/theme.js);
     the rest are derived so a custom theme stays coherent. */
  --bg: #000;
  --text: #e8ecf1;
  --up: #05c1b7;
  --down: #f2566b;
  --surface: color-mix(in srgb, var(--text) 7%, var(--bg));
  --line: color-mix(in srgb, var(--text) 14%, var(--bg));
  --muted: color-mix(in srgb, var(--text) 55%, var(--bg));
  --live: #f2566b;
  --img: none;
  --dim: 60%;
  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* The logo's angled cut, reused on badges and primary buttons. */
  --cut: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.35 var(--sans);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }

.up { color: var(--up); }
.down { color: var(--down); }

/* Small uppercase mono caption used for every label in the product. */
.label, .watch, .meta, .positions h2, .venue, .cta, .brand, .form label, .form h2, .preview-label {
  font: 500 10px/1.4 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); letter-spacing: .2em; text-decoration: none; white-space: nowrap; }
.mark {
  flex: none;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("/assets/favicon.png") center / contain no-repeat;
  mask: url("/assets/favicon.png") center / contain no-repeat;
}

/* ---------- card (the 480x480 embed) ---------- */

body.embed {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100vw, 560px);
  height: min(100dvh, 560px);
  padding: 16px 18px 12px;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.card[hidden] { display: none; }
.card.has-img {
  --veil: color-mix(in srgb, var(--bg) var(--dim), transparent);
  background: linear-gradient(var(--veil), var(--veil)), var(--img) center / cover no-repeat;
}

.head { display: flex; align-items: flex-start; gap: 10px; }
.who { min-width: 0; flex: 1; }
.handle { font-weight: 600; font-size: 16px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--muted); font: 11px var(--mono); }
.wallet > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { position: relative; flex: none; display: inline-flex; color: var(--text); cursor: help; outline: none; }
.badge svg { display: block; width: 12px; height: 12px; }
.badge-tip, .tip {
  position: absolute;
  z-index: 2;
  padding: 5px 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: 11px var(--mono);
  white-space: nowrap;
  pointer-events: none;
}
.badge-tip {
  top: calc(100% + 6px);
  left: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .12s;
}
.badge:hover .badge-tip, .badge:focus .badge-tip { opacity: 1; visibility: visible; }
.live { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.live-tag { display: flex; align-items: center; gap: 7px; font: 600 10px/1.4 var(--mono); letter-spacing: .2em; }
.watch { white-space: nowrap; }
.pulse { width: 6px; height: 6px; background: var(--live); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink {
  50% { opacity: .25; }
}

.stats { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.empty-state { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding-bottom: 24px; }
.empty-state h2 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.empty-state p { margin: 0; max-width: 34ch; color: var(--muted); font-size: 14px; line-height: 1.45; }

.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 14px; }
.pnl { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.pnl .big { font-size: 36px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.pnl .sub { font: 500 12px var(--mono); }
.pnl[data-dir="up"] { color: var(--up); }
.pnl[data-dir="down"] { color: var(--down); }

.tabs { display: flex; gap: 14px; padding-bottom: 6px; }
.tabs button {
  padding: 0 0 3px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  color: var(--muted);
  font: 500 10px/1.4 var(--mono);
  letter-spacing: .12em;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--text); }

.meta { margin-top: 4px; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chart {
  position: relative;
  flex: none;
  height: 92px;
  margin: 10px 0 8px;
  touch-action: none;
  cursor: crosshair;
}
.chart[data-dir="up"] { color: var(--up); }
.chart[data-dir="down"] { color: var(--down); }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.zero { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); pointer-events: none; }
.cross { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); opacity: .5; pointer-events: none; }
.dot {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  background: currentColor;
  box-shadow: 0 0 0 2px var(--bg);
  transform: rotate(45deg);
  pointer-events: none;
}
.dot.live { animation: glow 1.6s ease-out infinite; }
@keyframes glow {
  0% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 2px currentColor; }
  100% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 8px transparent; }
}
.tip { top: 0; display: flex; flex-direction: column; gap: 1px; }
.tip span { color: var(--muted); font-size: 10px; }
.tip[data-side="right"] { transform: translateX(8px); }
.tip[data-side="left"] { transform: translateX(calc(-100% - 8px)); }

.positions { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.positions h2 { margin: 0 0 6px; }
.positions ul {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  scrollbar-width: none;
}
.positions ul::-webkit-scrollbar { display: none; }
.positions li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.logo { flex: none; width: 24px; height: 24px; border-radius: 50%; }
.logo.plate { background: #fff; }
.positions li.empty { color: var(--muted); }
.pos { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row .val { margin-left: auto; font-weight: 600; white-space: nowrap; }
.row.dim { margin-top: 1px; color: var(--muted); font-size: 12px; }
.row.dim > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.dim .val { font-weight: 500; }
.coin { font-weight: 600; font-size: 14px; letter-spacing: -.01em; }
.side { padding: 2px 7px; font: 600 10px/1.4 var(--mono); letter-spacing: .08em; clip-path: var(--cut); }
.side.long { color: var(--up); background: color-mix(in srgb, var(--up) 14%, transparent); }
.side.short { color: var(--down); background: color-mix(in srgb, var(--down) 14%, transparent); }
.venue { letter-spacing: .08em; white-space: nowrap; }

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.foot .mark { width: 14px; height: 14px; }
.cta { color: var(--text); text-decoration: none; white-space: nowrap; }
.cta:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .pulse, .dot.live { animation: none; }
}

/* ---------- landing ---------- */

body.landing { --bar: 66px; --gap: 48px; height: auto; min-height: 100%; padding: 0 24px 16px; }
/* The page still scrolls, just without a visible scrollbar. */
html:has(body.landing) { scrollbar-width: none; }
html:has(body.landing)::-webkit-scrollbar { display: none; }
/* Stays put while the page scrolls under it; see-through black with a blur, so
   whatever passes beneath stays visible but out of the way. */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 -24px;
  padding: 22px 24px;
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.top-inner { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav { display: flex; align-items: center; gap: 28px; font: 500 11px/1.4 var(--mono); letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; }
.nav a { color: var(--text); text-decoration: none; }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav .soon { color: var(--muted); cursor: default; }
.top .brand { font-size: 11px; }
.top .mark { width: 22px; height: 22px; }
.wrap { max-width: 1040px; margin: var(--gap) auto 0; display: grid; gap: 72px; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.wrap h1 { margin: 0 0 16px; font-size: 48px; font-weight: 600; line-height: 1.02; letter-spacing: -.035em; }
.wrap p { margin: 0 0 36px; color: var(--muted); font-size: 16px; line-height: 1.5; max-width: 40ch; }
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; max-width: 420px; }
.field { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); transition: border-color .12s; }
.field:focus-within { border-color: var(--text); }
.field span { color: var(--muted); font-family: var(--mono); }
.field input { flex: 1; min-width: 0; padding: 12px 6px; border: 0; outline: 0; background: none; color: var(--text); font: 15px var(--sans); }
.form .check { display: flex; align-items: center; gap: 10px; font: 13px var(--sans); letter-spacing: 0; text-transform: none; cursor: pointer; }
.check input { margin: 0; accent-color: var(--text); }
.form h2, .form > label[for="link"] { margin: 18px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.form .swatch { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border: 1px solid var(--line); color: var(--text); cursor: pointer; transition: border-color .12s; }
.swatch input { flex: none; width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
.swatch input::-webkit-color-swatch-wrapper { padding: 0; }
.swatch input::-webkit-color-swatch { border: 1px solid var(--line); border-radius: 0; }
.swatch input::-moz-color-swatch { border: 1px solid var(--line); border-radius: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.form .btn { padding: 10px 14px; border: 1px solid var(--line); border-radius: 0; background: none; color: var(--text); font: 500 10px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; transition: border-color .12s; }
.form .swatch:hover, .form .btn:hover { border-color: var(--muted); }
.form .dim { display: flex; align-items: center; gap: 14px; }
.dim input { flex: 1; min-width: 0; accent-color: var(--text); }
.hint { color: var(--muted); font-size: 13px; }
.hint:empty { display: none; }
.account { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.wallets { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.wallets:empty { display: none; }
.wallets li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 6px 6px 12px; border: 1px solid var(--line); font: 13px var(--mono); }
.form .primary:disabled { opacity: .35; cursor: default; }
.placeholder { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 18px; }
.placeholder h2 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.placeholder p { margin: 0; max-width: 34ch; color: var(--muted); font-size: 14px; line-height: 1.45; }
.link { display: flex; gap: 8px; }
.link code { flex: 1; min-width: 0; padding: 12px; border: 1px solid var(--line); font: 12px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form .primary {
  padding: 14px 18px;
  border: 0;
  background: var(--text);
  color: var(--bg);
  font: 600 11px var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  clip-path: var(--cut);
}
.form .primary:hover { opacity: .85; }
.link .primary { min-width: 84px; padding: 0 18px; }
/* The preview stays where it is while the form beside it scrolls. */
.preview-col { position: sticky; top: calc(var(--bar) + var(--gap)); width: 480px; max-width: 100%; }
.preview-label { margin-bottom: 10px; }
.preview { width: 100%; aspect-ratio: 1; border: 1px solid var(--line); overflow: hidden; }
.sample-note { margin-top: 10px; color: #e6b84f; font-size: 13px; line-height: 1.45; }
.preview iframe { display: block; width: 100%; height: 100%; border: 0; }

@media (max-width: 960px) {
  .wrap { grid-template-columns: minmax(0, 1fr); gap: 48px; margin-top: 40px; }
  .preview-col { position: static; }
  .wrap h1 { font-size: 36px; }
}

[hidden] { display: none !important; }
