:root {
  --bg: #f6f4ef;
  --text: #0a0a0a;
  --muted: #6b6a66;
  --card: #ffffff;
  --card-2: #fbfaf7;
  --border: #e4e1d9;
  --accent: #d4fc50;
  --accent-hover: #c4ef3c;
  --accent-soft: #f3ffd4;
  --on-accent: #111111;
  --success: #30d158;
  --danger: #ff3b30;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 10px;
  --radius-sm: 6px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --text: #f5f5f3;
    --muted: #8e8d89;
    --card: #161616;
    --card-2: #1c1c1c;
    --border: #262626;
    --accent-soft: #1d2410;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { display: block; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* Nav */
.nav { border-bottom: 1px solid var(--border); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand img { width: 28px; height: 28px; }
.hero-logo { width: 96px; height: 96px; margin-bottom: 20px; }
@media (min-width: 720px) { .hero-logo { width: 112px; height: 112px; } }
.brand .tick { font-family: var(--mono); font-size: 13px; color: var(--muted); font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a.link { display: none; text-decoration: none; font-size: 14px; color: var(--muted); padding: 6px 10px; border-radius: var(--radius-sm); }
.nav-links a.link:hover { color: var(--text); }
@media (min-width: 720px) { .nav-links a.link { display: inline-block; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font: 600 15px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--text); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn svg { width: 16px; height: 16px; }

/* Hero */
.hero { padding-top: 56px; padding-bottom: 48px; }
@media (min-width: 720px) { .hero { padding-top: 96px; padding-bottom: 72px; } }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; background: var(--card);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(52px, 13vw, 112px);
  line-height: .95; letter-spacing: -0.02em;
  margin: 22px 0 10px;
}
h1 .t { font-family: var(--mono); font-size: .28em; letter-spacing: 0; vertical-align: middle; color: var(--muted); margin-left: .2em; white-space: nowrap; }
.lede { font-size: clamp(18px, 4.4vw, 22px); line-height: 1.45; max-width: 620px; margin: 0 0 28px; }
.lede em { font-style: normal; background: var(--accent); color: var(--on-accent); padding: 0 .25em; border-radius: 4px; }

.ca {
  display: flex; align-items: stretch; max-width: 560px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card); overflow: hidden; margin-bottom: 14px;
}
.ca .label { font-size: 12px; color: var(--muted); padding: 0 12px; display: flex; align-items: center; border-right: 1px solid var(--border); text-transform: uppercase; letter-spacing: .06em; }
.ca code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; padding: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca button { border: 0; border-left: 1px solid var(--border); background: var(--card-2); color: var(--text); font: 600 13px var(--sans); padding: 0 14px; cursor: pointer; min-width: 74px; }
.ca button:hover { background: var(--accent-soft); }
.ca button.ok { background: var(--accent); color: var(--on-accent); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { flex: 1 1 140px; }
@media (min-width: 520px) { .actions .btn { flex: 0 0 auto; } }
.safety { margin-top: 18px; font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.safety svg { flex: none; width: 16px; height: 16px; margin-top: 3px; }

/* Sections */
section { padding: 56px 0; border-top: 1px solid var(--border); }
@media (min-width: 720px) { section { padding: 80px 0; } }
.eyebrow { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 10px; }
h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 8vw, 56px); line-height: 1; letter-spacing: -0.015em; margin: 0 0 28px; }
h3 { font-size: 16px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.005em; }

.steps { display: grid; gap: 12px; grid-template-columns: 1fr; counter-reset: s; list-style: none; padding: 0; margin: 0; }
@media (min-width: 640px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.steps .card p { margin: 0; color: var(--muted); font-size: 15px; }
.num { font-family: var(--mono); font-size: 12px; display: inline-block; background: var(--accent); color: var(--on-accent); border-radius: 4px; padding: 2px 7px; margin-bottom: 14px; font-weight: 600; }

/* Live */
.live-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.live-head h2 { margin: 0; }
.status { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.status .dot.off { background: var(--danger); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat .k { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.stat .v { font-family: var(--mono); font-size: clamp(18px, 4.6vw, 24px); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v a { text-decoration: none; }
.stat .v a:hover { text-decoration: underline; }

.feeds { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .feeds { grid-template-columns: repeat(3, 1fr); } }
.feed { padding: 0; overflow: hidden; }
.feed h3 { padding: 14px 16px; margin: 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.feed h3 .count { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 500; }
.feed ul { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow-y: auto; }
.feed li { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed li .row { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.feed li a { font-family: var(--mono); font-size: 12px; text-decoration: none; border-bottom: 1px solid var(--border); }
.feed li a:hover { border-color: var(--text); }
.feed .text { word-break: break-word; }
.feed .text a { font-size: 13px; }
.feed .empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; }

.coming {
  display: none; text-align: center; padding: 40px 20px; margin-bottom: 12px;
  background: var(--accent-soft); border-color: var(--border);
}
.coming p { margin: 0; }
.coming .big { font-family: var(--serif); font-size: clamp(28px, 7vw, 40px); line-height: 1.1; margin-bottom: 6px; color: var(--text); }
.is-empty .coming { display: block; }
.is-empty .feeds { display: none; }

.cta-row { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.cta-row p { margin: 0; color: var(--muted); font-size: 14px; }

/* FAQ */
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 0; font-weight: 600; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); font-weight: 400; font-size: 20px; color: var(--muted); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 18px; color: var(--muted); max-width: 720px; }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 32px 0 48px; font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 720px) { footer .wrap { flex-direction: row; justify-content: space-between; align-items: center; } }
footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }

/* Legal pages */
.legal { padding-top: 48px; padding-bottom: 72px; max-width: 760px; }
.legal h1 { font-size: clamp(44px, 10vw, 72px); margin-top: 0; }
.legal h2 { font-family: var(--sans); font-size: 18px; font-weight: 600; margin: 32px 0 8px; letter-spacing: 0; line-height: 1.3; }
.legal p, .legal li { color: var(--muted); }
.legal strong { color: var(--text); }

:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* Nav extras */
.nav-links a.link.always { display: inline-block; }
.nav-links a.link.active { color: var(--text); }
@media (max-width: 400px) { .brand .tick { display: none; } }

/* Top 100 page */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: 13px; }
.t100 { padding-top: 40px; padding-bottom: 64px; }
@media (min-width: 720px) { .t100 { padding-top: 64px; } }
.t-title { font-size: clamp(48px, 11vw, 88px); margin: 0 0 12px; }
.t-sub { font-size: clamp(17px, 4vw, 20px); margin: 0 0 14px; max-width: 640px; }
.t-head .status { margin: 0; }
.t-block { border-top: 0; padding: 0; margin-top: 36px; }
.t-block h2 { font-size: clamp(28px, 6vw, 36px); margin: 0; }
.t-block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }

.t-error { margin-top: 32px; text-align: center; padding: 40px 20px; }
.t-error p { margin: 0; }
.t-error .big { font-family: var(--serif); font-size: clamp(26px, 6vw, 36px); line-height: 1.15; margin-bottom: 6px; }
.is-error .t-block { display: none; }

.tag { display: inline-block; font-family: var(--sans); font-size: 11px; font-weight: 600; line-height: 1; padding: 3px 6px; border-radius: 4px; background: var(--accent); color: var(--on-accent); vertical-align: 1px; letter-spacing: .02em; }

/* Up next */
.next-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.next-strip::-webkit-scrollbar { display: none; }
@media (min-width: 720px) { .next-strip { margin: 0; padding-left: 0; padding-right: 0; overflow: visible; } }
.next-card { scroll-snap-align: start; display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 12px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid var(--accent); text-decoration: none; color: var(--text); transition: border-color .15s; }
.next-card:hover { border-color: var(--text); }
.next-card.sk { background: var(--card); border-color: var(--border); }
.nc-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nc-sym { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-cap { font-size: 12px; color: var(--muted); }
.nc-rank { font-size: 11px; color: var(--muted); align-self: flex-start; }

/* Logos */
.coin-logo, .ph { flex: none; border-radius: 50%; background: var(--card-2); border: 1px solid var(--border); object-fit: cover; display: inline-block; }

/* Last cycle */
.last-card { padding: 18px 20px; }
.last-card .t-block-head { margin-bottom: 8px; }
.last-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.last-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14px; }
.ll-sym { font-weight: 600; }
.ll-sym a { text-decoration: none; border-bottom: 1px solid var(--border); }
.ll-sym a:hover { border-color: var(--text); }
.res { font-size: 12px; min-width: 64px; text-align: right; }
.res.ok { color: var(--text); font-weight: 600; }
.res.ok::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); margin-right: 6px; vertical-align: 1px; }

/* Search */
.t-tools { align-items: center; }
.search { position: relative; display: flex; align-items: center; flex: 1 1 240px; max-width: 320px; }
.search svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 40px; padding: 0 12px 0 36px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font: 15px var(--sans); }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--text); }
@media (max-width: 559px) { .search { max-width: none; flex-basis: 100%; } }

/* Coin table: grid rows on desktop, cards on mobile */
.coin-table { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.coin-row { position: relative; display: grid; align-items: center; gap: 4px 12px; padding: 12px 14px; border-top: 1px solid var(--border);
  grid-template-columns: 28px 1fr auto 32px;
  grid-template-areas: "rank coin cap ex" "rank coin status ex"; }
.coin-row[hidden] { display: none; }
#rows .coin-row:first-child { border-top: 0; }
.coin-headrow { display: none; }
.c-rank { grid-area: rank; font-size: 13px; color: var(--muted); }
.c-coin { grid-area: coin; display: flex; align-items: center; gap: 10px; min-width: 0; }
.c-names { display: flex; flex-direction: column; min-width: 0; }
.c-name { font-weight: 600; font-size: 15px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-name.stretch::after { content: ""; position: absolute; inset: 0; }
.c-sym { font-size: 12px; color: var(--muted); }
.c-cap { grid-area: cap; font-size: 14px; }
.c-status { grid-area: status; justify-self: end; }
.c-pair { display: none; font-size: 13px; color: var(--muted); }
.c-ex { grid-area: ex; justify-self: end; }
.m-label { display: none; }
@media (min-width: 760px) { .m-pair { display: none; } }
.r { text-align: right; }
.ex { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-sm); color: var(--muted); border: 1px solid transparent; }
.ex:hover { color: var(--text); border-color: var(--border); background: var(--card-2); }
.ex svg { width: 15px; height: 15px; }
.coin-row:not(.coin-headrow):not(.sk-row):hover { background: var(--card-2); }
.coin-row.is-next { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.coin-row.is-next:hover { background: var(--accent-soft); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.badge .bd { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.badge.grad .bd { background: var(--success); }

@media (min-width: 760px) {
  .coin-row { grid-template-columns: 44px minmax(0, 1fr) 130px 120px 80px 36px; grid-template-areas: "rank coin cap status pair ex"; padding: 10px 16px; }
  .coin-headrow { display: grid; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding-top: 12px; padding-bottom: 12px; border-top: 0; border-bottom: 1px solid var(--border); background: var(--card-2); }
  .coin-headrow > :nth-child(1) { grid-area: rank; } .coin-headrow > :nth-child(2) { grid-area: coin; }
  .coin-headrow > :nth-child(3) { grid-area: cap; } .coin-headrow > :nth-child(4) { grid-area: status; }
  .coin-headrow > :nth-child(5) { grid-area: pair; } .coin-headrow > :nth-child(6) { grid-area: ex; }
  .c-status { justify-self: start; }
  .c-pair { display: block; grid-area: pair; }
}

/* Skeleton */
.sk { background: var(--card-2); border-radius: 6px; position: relative; overflow: hidden; }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(127,127,127,.12), transparent); transform: translateX(-100%); animation: sk 1.4s infinite; }
@keyframes sk { to { transform: translateX(100%); } }
.sk-row .sk { height: 14px; display: block; }
.sk-row .sk-s { width: 22px; } .sk-row .sk-m { width: 70px; } .sk-row .sk-l { width: 60%; height: 28px; }
.sk-row > :nth-child(1) { grid-area: rank; } .sk-row > :nth-child(2) { grid-area: coin; } .sk-row > :nth-child(3) { grid-area: cap; justify-self: end; }
.sk-row > :nth-child(4) { grid-area: status; justify-self: end; } .sk-row > :nth-child(5) { display: none; } .sk-row > :nth-child(6) { grid-area: ex; }
@media (min-width: 760px) { .sk-row > :nth-child(5) { display: block; grid-area: pair; } .sk-row > :nth-child(4) { justify-self: start; } }
.t-empty { text-align: center; padding: 20px 0; margin: 0; }
.t100 .safety { margin-top: 32px; }
@media (prefers-reduced-motion: reduce) { .sk::after { animation: none; } }

/* Hero shader background */
.hero-shell { position: relative; overflow: hidden; isolation: isolate; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; opacity: 0; transition: opacity 1.2s ease; }
.hero-canvas.ready { opacity: .6; }
.hero-shell::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 65% 70% at 25% 50%, color-mix(in srgb, var(--bg) 80%, transparent), transparent 80%),
    linear-gradient(to bottom, transparent 55%, var(--bg));
}
.hero-shell .hero { position: relative; }
/* Dark mode only: the light hero stays plain */
@media (prefers-color-scheme: light) {
  .hero-canvas { display: none; }
}
