/* AERO Dashboard — page-specific styles.
 *
 * Sits ON TOP of shared/css/base.css + nav.css. Uses CSS custom
 * properties from base.css for tone (colors, spacing). The base-l2
 * design-lock rule covers other locked surfaces; this is a NEW page so
 * the lock doesn't apply to it directly, but it should still feel
 * native to the rest of base-l2.
 */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* ── Header ──────────────────────────────────────────────────────────── */

.aero-header {
  margin-bottom: 32px;
}

.aero-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.aero-title-row h1 {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.01em;
  margin: 0;
}

.aero-chain-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--color-surface-2, rgba(255, 255, 255, 0.06));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.12));
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 4px;
}

.aero-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px;
  margin-left: auto;
}

.aero-status-pill::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.aero-status-pill.st-loading  { color: var(--color-text-dim, #888); background: rgba(120, 120, 120, 0.12); }
.aero-status-pill.st-pending  { color: #d4a83a; background: rgba(212, 168, 58, 0.12); }
.aero-status-pill.st-live     { color: #4ade80; background: rgba(74, 222, 128, 0.12); }
.aero-status-pill.st-stale    { color: #f97316; background: rgba(249, 115, 22, 0.12); }
.aero-status-pill.st-error    { color: #ef4444; background: rgba(239, 68, 68, 0.12); }

.aero-subtitle {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 16px;
  color: var(--color-text-dim, #aaa);
  line-height: 1.55;
  margin: 8px 0 14px;
  max-width: 720px;
}

.aero-error-note {
  color: #ef4444;
  font-size: 14px;
  margin: 4px 0 12px;
}

.aero-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--color-text-dim, #888);
  letter-spacing: 0.02em;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.aero-meta code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  background: var(--color-surface-2, rgba(255, 255, 255, 0.04));
  padding: 2px 6px;
  border-radius: 3px;
}

.aero-meta-sep {
  opacity: 0.5;
  padding: 0 2px;
}

/* ── KPI grid ───────────────────────────────────────────────────────── */

.aero-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.aero-kpi {
  background: var(--color-surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.18s ease;
  position: relative;
}

.aero-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  border-radius: 8px 0 0 8px;
  background: var(--kpi-accent, transparent);
}

.aero-kpi[data-kpi="annualized"] { --kpi-accent: linear-gradient(180deg, #4ade80, #22c55e); }
.aero-kpi[data-kpi="daily"]      { --kpi-accent: linear-gradient(180deg, #60a5fa, #3b82f6); }
.aero-kpi[data-kpi="pe"]         { --kpi-accent: linear-gradient(180deg, #c084fc, #a855f7); }
.aero-kpi[data-kpi="rows"]       { --kpi-accent: linear-gradient(180deg, #f59e0b, #d97706); }

.aero-kpi-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-dim, #888);
}

.aero-kpi-value {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--color-text, #f5f5f5);
}

.aero-kpi-sub {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 12px;
  color: var(--color-text-dim, #777);
  margin-top: 2px;
}

.aero-kpi-empty .aero-kpi-value { opacity: 0.4; }
.aero-kpi-empty::before          { opacity: 0.3; }

/* ── Sections (provenance, roadmap, fineprint) ─────────────────────── */

.aero-section {
  margin: 32px 0;
  padding: 24px;
  background: var(--color-surface, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.06));
  border-radius: 8px;
}

.aero-section h2 {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 10px;
}

.aero-section-lead {
  font-size: 14px;
  color: var(--color-text-dim, #999);
  line-height: 1.6;
  margin: 0 0 18px;
  max-width: 680px;
}

/* Provenance dl */

.aero-prov-list {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.aero-prov-list > div {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--color-border, rgba(255, 255, 255, 0.06));
}

.aero-prov-list > div:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.aero-prov-list dt {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-dim, #888);
}

.aero-prov-list dd {
  margin: 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--color-text, #ddd);
  word-break: break-all;
}

.aero-prov-list dd code {
  background: var(--color-surface-2, rgba(255, 255, 255, 0.05));
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
}

@media (max-width: 640px) {
  .aero-prov-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Source tag */

.aero-source-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px;
  background: var(--color-surface-2, rgba(255, 255, 255, 0.06));
  color: var(--color-text-dim, #aaa);
}

.aero-source-tag.src-native  { color: #4ade80; background: rgba(74, 222, 128, 0.12); }
.aero-source-tag.src-ref     { color: #fbbf24; background: rgba(251, 191, 36, 0.12); }
.aero-source-tag.src-scout   { color: #60a5fa; background: rgba(96, 165, 250, 0.12); }
.aero-source-tag.src-manual  { color: #c084fc; background: rgba(192, 132, 252, 0.12); }
.aero-source-tag.src-unknown { color: #ef4444; background: rgba(239, 68, 68, 0.12); }

/* Roadmap list */

.aero-roadmap {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.aero-roadmap li {
  font-size: 14px;
  color: var(--color-text, #ddd);
  line-height: 1.55;
  padding: 12px 16px;
  background: var(--color-surface-2, rgba(255, 255, 255, 0.025));
  border-left: 3px solid var(--color-accent, #60a5fa);
  border-radius: 4px;
}

.aero-roadmap strong {
  color: var(--color-text, #f5f5f5);
  font-weight: 600;
}

/* Fineprint */

.aero-fineprint ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.aero-fineprint li {
  font-size: 13px;
  color: var(--color-text-dim, #999);
  line-height: 1.6;
}

.aero-fineprint code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  background: var(--color-surface-2, rgba(255, 255, 255, 0.05));
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--color-text, #ccc);
}

.aero-fineprint a {
  color: var(--color-accent, #60a5fa);
  text-decoration: none;
}

.aero-fineprint a:hover {
  text-decoration: underline;
}

/* ── OHLCV candle chart container ───────────────────────────────────────── */
.aero-ohlcv-container {
  width: 100%;
  min-height: 480px;
  margin-top: 1rem;
  background: var(--color-surface, #0d1117);
  border-radius: 8px;
  padding: 0.5rem;
}

/* ── Data sections (leaderboard / real-yield / cliff / pulse / MM) ────────── */
/* The data-table, stat-grid, sign tones, links + the responsive column collapse
   all live in the SHARED kit (shared/modules/aero-ui-kit.css). Only page-section
   chrome — container, summary line, sub-heads, MM chips — lives here. */
.aero-data-container { margin-top: 1rem; }

.aero-data-summary {
  font-size: 0.8rem;
  color: var(--color-text-dim, #888);
  margin-bottom: 0.6rem;
  font-family: 'IBM Plex Mono', monospace;
}

.aero-subhead {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-text-dim, #999);
  margin: 1.4rem 0 0.6rem;
}

/* Excluded MM / treasury wallets — chips. */
.aero-mm-note {
  font-size: 0.85rem;
  color: var(--color-text-dim, #aaa);
  margin-bottom: 0.9rem;
  line-height: 1.5;
}

.aero-mm-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.aero-mm-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  background: var(--color-surface, rgba(255, 255, 255, 0.03));
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  border-radius: 6px;
  font-size: 0.8rem;
}

.aero-mm-label {
  font-size: 0.7rem;
  color: var(--color-text-dim, #888);
  padding-left: 0.4rem;
  border-left: 1px solid var(--color-border, rgba(255, 255, 255, 0.15));
}

/* ── Chapters: sticky nav + chapter headers (page IA) ─────────────────────── */
/* The page is organised into 5 chapters (Pulse · Valuation · Supply · Holders
 * · Provenance). The sticky nav jump-links to each; runtime.js scroll-spy adds
 * .is-active to the link whose chapter is in view. */
.aero-chapter-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.55rem 0.5rem;
  margin: 0 -0.5rem 1.25rem;
  background: color-mix(in srgb, var(--color-bg, #0b0d12) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
}
.aero-chapter-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-dim, #9aa0aa);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.aero-chapter-nav a:hover { color: var(--color-text, #f5f5f5); }
.aero-chapter-nav a.is-active {
  color: var(--color-text, #fff);
  background: var(--color-surface-2, rgba(255, 255, 255, 0.06));
  border-color: var(--color-border, rgba(255, 255, 255, 0.14));
}
.aero-chapter-nav-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--color-accent, #60a5fa);
  opacity: 0.85;
}

/* Chapter wrapper — scroll-margin so anchor jumps clear the sticky nav. */
.aero-chapter { scroll-margin-top: 4rem; }
.aero-chapter-head {
  display: flex;
  align-items: baseline;
  gap: 0.85rem;
  margin: 2.25rem 0 0.5rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
}
.aero-chapter:first-of-type .aero-chapter-head { margin-top: 0.5rem; }
.aero-chapter-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-accent, #60a5fa);
  opacity: 0.55;
}
.aero-chapter-titles { display: flex; flex-direction: column; gap: 0.15rem; }
.aero-chapter-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text, #f5f5f5);
}
.aero-chapter-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-text-dim, #9aa0aa);
  line-height: 1.4;
}

@media (max-width: 640px) {
  .aero-chapter-nav { gap: 0.25rem; padding: 0.45rem 0.4rem; overflow-x: auto; flex-wrap: nowrap; }
  .aero-chapter-nav a { padding: 0.28rem 0.55rem; font-size: 0.74rem; white-space: nowrap; }
  .aero-chapter-num { font-size: 1.25rem; }
  .aero-chapter-title { font-size: 1.2rem; }
}

/* ── Layout pass (BRAID-verified 2026-06-28): hero KPIs · two-column pair ·
 *    desktop nav context. Each change cleared a UX / a11y / technical / mobile
 *    critic before shipping. ────────────────────────────────────────────────── */

/* A — KPI grid leads Chapter 01 as the headline; bump the value to hero weight. */
.aero-kpi-value { font-size: 32px; letter-spacing: -0.02em; line-height: 1.05; }
.aero-kpi-grid { margin-top: 0.25rem; }

/* B — pair supply-dynamics ‖ unlock-cliff side-by-side on desktop. Mobile-first:
 *     single column. Charts are responsive:true so they reflow into the column.
 *     min-width:0 stops a wide chart canvas from blowing out the grid track. */
.aero-section-pair { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.aero-section-pair > .aero-section { margin: 0; min-width: 0; }
@media (min-width: 1024px) {
  .aero-section-pair { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* C — live price + P/F on the right of the sticky nav. Desktop-only: the mobile
 *     nav is already a tight horizontal-scroll of 5 chips (the mobile critic's
 *     call — adding metrics there forces a scroll-within-scroll). */
.aero-nav-context { display: none; }
@media (min-width: 1024px) {
  .aero-chapter-nav { align-items: center; }
  .aero-nav-context {
    display: inline-flex;
    gap: 0.9rem;
    margin-left: auto;          /* push to the right edge of the nav row */
    padding-right: 0.35rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
  }
  .aero-nav-ctx-item { display: inline-flex; gap: 0.35rem; align-items: baseline; }
  .aero-nav-ctx-label {
    font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--color-text-dim, #8f8f97);
  }
  .aero-nav-context #aero-nav-price,
  .aero-nav-context #aero-nav-pe { color: var(--color-text, #f5f5f5); font-weight: 600; }
}

/* Mobile compaction — stage 2b (2026-07-27): the surviving intel page still
 * measured 5,219 px at 390×844 after stage 2's section removals. This block
 * pins the KPI grid to 2 columns (default auto-fit stacks to 1 at 390px),
 * tightens tile + section geometry, and reclaims per-section padding/margin —
 * targeting sub-4,000-px first paint without hiding data. Progressive
 * disclosure of chapters is a separate follow-up (touches chapter-nav
 * scroll-spy). */
@media (max-width: 640px) {
  .aero-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 24px;
  }
  .aero-kpi { padding: 12px 14px; gap: 4px; }
  .aero-kpi-value { font-size: 22px; line-height: 1.05; }
  .aero-kpi-label { font-size: 10px; }
  .aero-kpi-sub { font-size: 11px; }
  .aero-section { padding: 16px; margin: 20px 0; }
}
