:root {
  --bg: #07080d;
  --raise: #12141c;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f7fb;
  --muted: #9aa3b5;
  --accent: #58c7fa;
  --ink: #041821;
  --up: #3dce78;
  --down: #ff5d5e;
  --sans: "Instrument Sans", "Avenir Next", "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --pad: max(20px, env(safe-area-inset-left));
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(720px 360px at 100% -10%, rgba(88, 199, 250, 0.16), transparent 55%),
    radial-gradient(640px 420px at -10% 8%, rgba(16, 36, 68, 0.9), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom);
}
img { max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.045em; font-weight: 560; }
p { margin: 0; }

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--accent);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 6;
}
.skip:focus { top: 12px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 10px var(--pad);
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(7, 8, 13, 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  font-weight: 680;
  letter-spacing: -0.03em;
}
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav-toggle {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  min-height: 40px;
  padding: 0 14px;
}
.nav-links {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  flex-direction: column;
  gap: 4px;
  padding: 8px var(--pad) 16px;
  background: rgba(7, 8, 13, 0.98);
  border-bottom: 1px solid var(--line);
}
.nav-links.open { display: flex; }
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  padding: 12px 0;
  font-size: 1.05rem;
}
.nav-store {
  color: var(--ink) !important;
  background: var(--accent);
  border-radius: 999px;
  text-align: center;
  padding: 12px 16px !important;
  font-weight: 700;
}

.hero, .markets, .features, .pricing, .footer {
  width: min(var(--max), calc(100% - (var(--pad) * 2)));
  margin-left: auto;
  margin-right: auto;
}
.hero { padding: 28px 0 8px; }
.kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 11vw, 5.1rem);
  line-height: 0.94;
  max-width: 11ch;
}
h1 em { font-style: italic; color: #dff6ff; }
.lede {
  margin-top: 16px;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin: 22px 0;
}
.store {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  text-decoration: none;
  background: #f4f6f8;
  color: #111;
  border-radius: 14px;
  padding: 8px 16px;
}
.store svg { width: 18px; height: 22px; flex: none; }
.store small { display: block; font-size: 0.68rem; }
.store span { font-weight: 720; line-height: 1.1; }
.text-link {
  color: var(--accent);
  text-align: center;
  padding: 8px;
}
.up { color: var(--up); }
.down { color: var(--down); }

.stage { display: grid; gap: 14px; margin-top: 22px; }
.chart-card, .device {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20, 23, 32, 0.96), rgba(10, 12, 18, 0.96));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.chart-card { border-radius: 20px; padding: 14px 14px 6px; }
.chart-card figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}
.chart-card canvas { width: 100%; height: 150px; display: block; }
.device { border-radius: 28px; padding: 10px; }
.device-screen { border-radius: 20px; background: #101218; overflow: hidden; }
.device-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 14px 6px;
  font-weight: 680;
}
.device-top img { width: 18px; height: 18px; border-radius: 5px; }
.device ol { list-style: none; margin: 0; padding: 0 8px 10px; }
.device li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
}
.device li + li { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.device .px { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.device .px small { display: block; font-size: 0.75rem; font-weight: 600; }

.coin-mark {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  overflow: hidden;
  background: #232838;
}
.coin-mark > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 750;
  color: #d5deea;
}
.coin-mark img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  opacity: 0;
}
.coin-mark.is-ready img { opacity: 1; }
.coin-mark.is-ready > span { visibility: hidden; }
.coin-name, .coin-symbol { display: block; min-width: 0; }
.coin-name {
  font-weight: 680;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.coin-symbol { color: var(--muted); font-size: 0.78rem; }

.markets, .features, .pricing { padding: 56px 0 8px; scroll-margin-top: 84px; }
.section-head { margin-bottom: 16px; }
h2 { font-size: clamp(1.8rem, 7vw, 3rem); max-width: 16ch; }
.updated { margin-top: 8px; color: var(--muted); font-size: 0.88rem; }
.market-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
  margin-bottom: 12px;
}
.search input, .currency select, .more, .sortbar button {
  width: 100%;
  min-height: 46px;
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.search input:focus, .currency select:focus, .more:focus, .sortbar button:focus, .nav-toggle:focus, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sortbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.sortbar button {
  width: auto;
  flex: none;
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
  cursor: pointer;
}
.sortbar button[aria-sort] {
  color: var(--ink);
  background: var(--accent);
  border-color: var(--accent);
}
.market-list {
  display: grid;
  gap: 8px;
}
.mkt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "coin price"
    "coin day"
    "extra extra";
  gap: 2px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(16, 18, 26, 0.88);
}
.mkt-coin {
  grid-area: coin;
  display: grid;
  grid-template-columns: auto 36px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.rank { color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; width: 1.6rem; }
.mkt-price {
  grid-area: price;
  justify-self: end;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}
.mkt-day {
  grid-area: day;
  justify-self: end;
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.mkt-extra {
  grid-area: extra;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.78rem;
}
.mkt-extra b { font-weight: 700; }
.table-status, .fine { color: var(--muted); }
.table-status { padding: 24px 8px; text-align: center; }
.more {
  display: block;
  width: 100%;
  margin-top: 12px;
  cursor: pointer;
  background: transparent;
}
.more[hidden], .table-status[hidden] { display: none; }
.fine { margin-top: 14px; font-size: 0.8rem; }

.feature-grid, .plans { display: grid; gap: 12px; }
.features article, .plan {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: rgba(18, 20, 28, 0.72);
}
.features h3, .plan h3 { font-size: 1.15rem; margin-bottom: 6px; }
.features p, .plan li { color: var(--muted); }
.price {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 2.7rem;
  letter-spacing: -0.04em;
}
.period { margin: 0 0 10px; color: var(--muted); }
.plan ul { margin: 0; padding-left: 18px; }
.plan li + li { margin-top: 6px; }
.plan-featured {
  background: linear-gradient(180deg, rgba(88, 199, 250, 0.18), rgba(18, 20, 28, 0.9));
  border-color: rgba(88, 199, 250, 0.7);
}
.badge {
  margin: 0 0 8px;
  display: inline-block;
  color: var(--ink);
  background: var(--accent);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pricing { padding-bottom: 64px; }
.store-center { margin-top: 20px; }

.footer {
  display: grid;
  gap: 16px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer a { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.footer div:last-of-type { display: flex; flex-direction: column; gap: 10px; }
.copy { margin: 0; }

@media (min-width: 760px) {
  .nav-toggle { display: none; }
  .nav-links {
    position: static;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 22px;
    padding: 0;
    background: none;
    border: 0;
  }
  .nav-links a { padding: 0; font-size: 0.95rem; }
  .nav-store { padding: 8px 14px !important; }
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 36px;
    align-items: center;
    padding-top: 54px;
  }
  .hero-actions { flex-direction: row; align-items: center; }
  .text-link { text-align: left; }
  .store { width: auto; }
  .stage { margin-top: 0; }
  .chart-card canvas { height: 180px; }
  .section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
  }
  .updated { margin: 0; }
  .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mkt-row {
    grid-template-columns: minmax(220px, 1.5fr) 0.9fr 0.7fr minmax(220px, 1.5fr);
    grid-template-areas: "coin price day extra";
    gap: 12px;
    padding: 10px 14px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    background: transparent;
  }
  .market-list {
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(12, 14, 20, 0.8);
  }
  .mkt-row:hover { background: rgba(88, 199, 250, 0.05); }
  .mkt-extra {
    margin: 0;
    padding: 0;
    border: 0;
    justify-content: flex-end;
    flex-wrap: nowrap;
  }
  .mkt-price, .mkt-day { justify-self: end; }
  .footer {
    grid-template-columns: 1.4fr auto;
    align-items: start;
  }
  .footer div:last-of-type { align-items: flex-end; text-align: right; }
}

@media (min-width: 1100px) {
  .plans { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 759px) {
  .device { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
