/* ── tokens ────────────────────────────────────────────────── */
:root {
  --bg:          #0a0c14;
  --bg-2:        #0d1018;
  --card:        #11141d;
  --card-2:      #141824;
  --border:      #232838;
  --border-soft: #1a1e2c;
  --text:        #e6ebf5;
  --text-mute:   #8b93a7;
  --text-dim:    #5a6378;

  --blue:    #60a5fa;
  --purple:  #a78bfa;
  --purple2: #6366f1;
  --orange:  #f59e0b;
  --green:   #34d399;
  --cyan:    #22d3ee;
  --amber:   #fbbf24;

  --radius:    14px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  --shadow-card: 0 1px 0 rgba(255,255,255,.02) inset, 0 8px 32px rgba(0,0,0,.35);
  --glow-purple: 0 0 0 1px rgba(167,139,250,.35), 0 8px 32px rgba(99,102,241,.35);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, Helvetica, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(99,102,241,.10), transparent 60%),
    radial-gradient(900px 500px at 90% -20%, rgba(34,211,238,.06), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── top nav ───────────────────────────────────────────────── */
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 18px 32px;
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, rgba(10,12,20,.85), rgba(10,12,20,.6) 70%, transparent);
  backdrop-filter: blur(8px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; }
.wordmark { font-family: var(--mono); font-weight: 600; font-size: 18px;
  letter-spacing: .01em; }

.nav-actions { display: flex; align-items: center; gap: 10px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  font: 500 13px/1 var(--font);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: transform .08s ease, border-color .15s, background .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { border-color: #2f3549; background: #181c27; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .ico { width: 16px; height: 16px; }

.btn-ghost { background: var(--card); }

.btn-primary {
  background: linear-gradient(180deg, #8b7dfa 0%, #6366f1 100%);
  border-color: rgba(167,139,250,.35);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 4px 16px rgba(99,102,241,.35);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #9b8dff 0%, #7377f5 100%);
  border-color: rgba(167,139,250,.55);
  box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 6px 20px rgba(99,102,241,.5);
}

.btn-sm { padding: 7px 11px; font-size: 12.5px; }

/* download menu (native <details>) */
.download-menu { position: relative; }
.download-menu summary {
  list-style: none;
  user-select: none;
}
.download-menu summary::-webkit-details-marker { display: none; }
.download-menu .chevron { transition: transform .15s; }
.download-menu[open] .chevron { transform: rotate(180deg); }
.download-menu .menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 200px; padding: 6px;
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  display: flex; flex-direction: column;
  z-index: 30;
}
.download-menu .menu a {
  padding: 8px 10px; border-radius: var(--radius-xs);
  color: var(--text); font-size: 13px;
  display: flex; justify-content: space-between; align-items: center;
}
.download-menu .menu a:hover { background: #1b2030; text-decoration: none; }
.download-menu .menu .muted { color: var(--text-dim); font-size: 11.5px; }

/* live badge */
.live-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  font: 500 12.5px/1 var(--font); color: var(--green);
  background: rgba(52,211,153,.08);
  border: 1px solid rgba(52,211,153,.28);
  border-radius: 999px;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(52,211,153,.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(52,211,153,.18); }
  50%      { box-shadow: 0 0 0 8px rgba(52,211,153,.04); }
}
.live-badge.offline { color: var(--text-dim); border-color: var(--border); background: transparent; }
.live-badge.offline .live-dot { background: var(--text-dim); animation: none;
  box-shadow: 0 0 0 4px rgba(91,99,120,.12); }

/* ── main layout ───────────────────────────────────────────── */
main {
  max-width: 1440px; margin: 0 auto; padding: 8px 32px 48px;
  display: flex; flex-direction: column; gap: 28px;
}

/* ── hero ──────────────────────────────────────────────────── */
.hero-grid {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 32px;
  padding: 16px 0 0;
}
.hero-title {
  font-family: var(--font);
  font-weight: 800;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.gradient-text {
  background: linear-gradient(135deg, #a78bfa 0%, #60a5fa 60%, #6366f1 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: 20px; color: var(--text); margin: 0 0 8px;
  font-weight: 500; max-width: 58ch;
}
.hero-caption {
  color: var(--text-mute); font-size: 15px; margin: 0 0 28px; max-width: 62ch;
}

/* trust badges */
.badges-row { display: flex; gap: 24px; flex-wrap: wrap; }
.badge { display: flex; align-items: center; gap: 14px; }
.badge-ico { width: 34px; height: 34px; padding: 6px;
  border-radius: 10px; background: rgba(255,255,255,.02);
  border: 1px solid var(--border-soft); }
.badge-ico.ico-blue   { color: var(--blue); }
.badge-ico.ico-purple { color: var(--purple); }
.badge-ico.ico-green  { color: var(--green); }
.badge-title { font-weight: 600; font-size: 14px; color: var(--text); }
.badge-sub   { font-size: 12.5px; color: var(--text-mute); }

/* explainer */
.explainer {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}
.explainer-title {
  margin: 0 0 16px;
  font-size: 16px;
  color: var(--purple);
  font-weight: 600;
}
.explainer-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
}
.explainer-item:first-of-type { border-top: none; padding-top: 0; }
.swatch { flex: 0 0 auto; width: 20px; height: 3px; margin-top: 9px; border-radius: 2px; }
.swatch-blue   { background: var(--blue); }
.swatch-orange { background: var(--orange); }
.swatch-purple { background: var(--purple); }
.explainer-label { font-weight: 600; font-size: 13.5px; color: var(--text); margin-bottom: 2px; }
.explainer-label:has(+ .explainer-text) { /* no-op, for future */ }
.explainer-item:nth-child(2) .explainer-label { color: var(--blue); }
.explainer-item:nth-child(3) .explainer-label { color: var(--orange); }
.explainer-item:nth-child(4) .explainer-label { color: var(--purple); }
.explainer-text { color: var(--text-mute); font-size: 13px; }

/* ── metric cards ──────────────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.metric-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; gap: 14px; align-items: flex-start;
  box-shadow: var(--shadow-card);
}
.metric-ico {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border-soft);
}
.metric-ico svg { width: 22px; height: 22px; }
.metric-ico.ico-blue   { color: var(--blue);   background: rgba(96,165,250,.08);  border-color: rgba(96,165,250,.24); }
.metric-ico.ico-purple { color: var(--purple); background: rgba(167,139,250,.08); border-color: rgba(167,139,250,.24); }
.metric-ico.ico-orange { color: var(--orange); background: rgba(245,158,11,.08);  border-color: rgba(245,158,11,.24); }
.metric-ico.ico-green  { color: var(--green);  background: rgba(52,211,153,.08);  border-color: rgba(52,211,153,.24); }
.metric-ico.ico-cyan   { color: var(--cyan);   background: rgba(34,211,238,.08);  border-color: rgba(34,211,238,.24); }
.metric-ico.ico-amber  { color: var(--amber);  background: rgba(251,191,36,.08);  border-color: rgba(251,191,36,.24); }

.metric-body { min-width: 0; }
.metric-value {
  font-size: 28px; font-weight: 700; letter-spacing: -0.015em;
  color: var(--text); line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.metric-label { color: var(--text); font-size: 13px; font-weight: 500; margin-top: 6px; }
.metric-sub   { color: var(--text-dim); font-size: 11.5px; margin-top: 2px; }

/* ── chart card ────────────────────────────────────────────── */
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px 18px;
  box-shadow: var(--shadow-card);
}
.chart-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.chart-title-group { display: inline-flex; align-items: center; gap: 8px; }
.chart-title { font-size: 16px; font-weight: 600; margin: 0; color: var(--text); }
.chart-info { color: var(--text-dim); cursor: help; line-height: 0; }
.chart-info .ico { width: 16px; height: 16px; }
.chart-hint {
  color: var(--text-dim); font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.chart-hint b { color: var(--text-mute); font-weight: 500; }
.chart-hint .sep { color: var(--border); }

.chart-wrap { position: relative; width: 100%; }
#chart { display: block; width: 100%; height: 420px; }

/* ── info cards ────────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.info-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 10px;
}
.info-title {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14.5px; font-weight: 600; color: var(--text);
  margin: 0 0 4px;
}
.info-ico { width: 26px; height: 26px; padding: 4px;
  border-radius: 7px;
  border: 1px solid var(--border-soft);
  display: grid; place-items: center; }
.info-ico svg { width: 16px; height: 16px; }
.info-ico.ico-amber  { color: var(--amber);  background: rgba(251,191,36,.08);  border-color: rgba(251,191,36,.22); }
.info-ico.ico-cyan   { color: var(--cyan);   background: rgba(34,211,238,.08);  border-color: rgba(34,211,238,.22); }
.info-ico.ico-orange { color: var(--orange); background: rgba(245,158,11,.08);  border-color: rgba(245,158,11,.22); }
.info-strong { color: var(--text); font-weight: 600; margin: 0; }
.info-text   { color: var(--text-mute); font-size: 13px; margin: 0; }
.info-tag    { color: var(--text); font-weight: 500; }
.info-link   { color: var(--blue); font-size: 13px; display: inline-flex;
  align-items: center; gap: 4px; margin-top: auto; }
.info-link:hover { text-decoration: underline; }
.ico-ext { width: 12px; height: 12px; }
.ico-arrow { width: 14px; height: 14px; }

/* live status */
.status-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-dim);
  box-shadow: 0 0 0 3px rgba(91,99,120,.12);
  display: inline-block;
}
.status-dot.on {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(52,211,153,.18);
}
.status-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
}
.status-row:first-of-type { border-top: none; }
.status-key { color: var(--text-mute); }
.status-value { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.status-value.on { color: var(--green); font-weight: 500; }
.status-chip {
  font-family: var(--mono); font-size: 12px; color: var(--text);
  padding: 3px 8px; border-radius: 5px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border-soft);
}

/* ── footer ────────────────────────────────────────────────── */
.site-footer {
  max-width: 1440px; margin: 8px auto 0;
  padding: 18px 32px 24px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--border-soft);
  color: var(--text-dim); font-size: 12.5px;
}
.footer-brand   { color: var(--text-mute); }
.footer-center  { color: var(--text-mute); }
.footer-right a { color: var(--text-mute); text-decoration: underline;
  text-decoration-color: rgba(139,147,167,.35); text-underline-offset: 3px; }
.footer-right a:hover { color: var(--text); }
.heart { color: #f472b6; }

/* ── responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .topnav { padding: 14px 18px; flex-wrap: wrap; gap: 8px; }
  main { padding: 8px 18px 48px; }
  .site-footer { padding: 18px 18px 24px; text-align: center; }
  .nav-actions { flex-wrap: wrap; }
  .btn { padding: 8px 12px; font-size: 12.5px; }
  .hero-title { font-size: 40px; }
  .hero-sub { font-size: 17px; }
  #chart { height: 320px; }
}
