/* Suncrest Isles tokenomics dashboard — stat tiles + one meter.
   Palette roles per the dataviz reference instance; light + dark are both
   selected (not auto-flipped). Text wears ink tokens; only marks wear hue. */

:root {
  --page:           #f9f9f7;
  --surface-1:      #fcfcfb;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --hairline:       #e1e0d9;
  --border:         rgba(11, 11, 11, 0.10);
  --accent:         #2a78d6;   /* categorical slot 1 (blue) — the one series hue */
  --accent-track:   #cde2fb;   /* blue step 100 — same-ramp meter track */
  --good:           #0ca30c;
  --warning:        #fab219;
  --warning-ink:    #4a3400;
  --banner-bg:      #fff3d6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page:           #0d0d0d;
    --surface-1:      #1a1a19;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --hairline:       #2c2c2a;
    --border:         rgba(255, 255, 255, 0.10);
    --accent:         #3987e5;  /* blue stepped for the dark surface */
    --accent-track:   #0d366b;  /* blue step 700 — same ramp, dark track */
    --good:           #0ca30c;
    --warning:        #fab219;
    --warning-ink:    #2b1f00;
    --banner-bg:      #33270a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 2px; }

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.92em;
}

/* ---- testnet banner: this page must never look like mainnet ---- */

.testnet-banner {
  background: var(--banner-bg);
  border-bottom: 1px solid var(--hairline);
  color: var(--text-primary);
  font-size: 0.875rem;
  padding: 8px 16px;
  text-align: center;
}

.testnet-pill {
  display: inline-block;
  background: var(--warning);
  color: var(--warning-ink);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  border-radius: 999px;
  padding: 1px 10px;
  margin-right: 8px;
  vertical-align: 1px;
}

/* ---- layout ---- */

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.page-head { margin-bottom: 28px; }

.eyebrow {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 2px 0 8px;
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0 0 12px;
  color: var(--text-secondary);
  max-width: 56ch;
}

/* ---- live / stale status ---- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex: none;
}

.status[data-state="live"]  .status-dot { background: var(--good); }
.status[data-state="stale"] .status-dot { background: var(--warning); }

.status[data-state="stale"] .status-badge {
  background: var(--warning);
  color: var(--warning-ink);
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 1px 8px;
}

/* Stale: hold the previous values at reduced opacity — no skeleton flash. */
body.is-stale .num,
body.is-stale .num-inline,
body.is-stale .meter-fill { opacity: 0.55; }

/* ---- stat tiles ---- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.tile,
.meter-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}

.tile-wide { grid-column: 1 / -1; }

.tile-label {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.tile-value {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.15;
  /* proportional figures on big standalone numbers — no tabular-nums here */
}

.unit {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-muted);
}

.tile-formula {
  margin: 0;
  font-size: 0.78125rem;
  color: var(--text-muted);
}

.tile-note {
  margin: 8px 0 0;
  font-size: 0.78125rem;
  color: var(--text-secondary);
  max-width: 72ch;
}

/* ---- meter (paid vs monthly cap) ---- */

.meter-card { margin-bottom: 28px; }

.meter-figures {
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}

.meter-lead {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.15;
}

.meter-cap {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.meter {
  height: 10px;
  border-radius: 5px;
  background: var(--accent-track); /* lighter step of the same blue ramp */
  overflow: hidden;
  margin-bottom: 10px;
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 5px;
  background: var(--accent);
  transition: width 400ms ease;
}

/* ---- contracts ---- */

.section-label {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.contract-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-1);
  overflow-x: auto;
}

.contract-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  padding: 9px 18px;
  font-size: 0.875rem;
}

.contract-list li + li { border-top: 1px solid var(--hairline); }

.contract-name {
  min-width: 130px;
  font-weight: 600;
  color: var(--text-secondary);
}

.contract-list a {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.8125rem;
  word-break: break-all;
}

/* ---- footer ---- */

.page-foot {
  color: var(--text-muted);
  font-size: 0.8125rem;
}
.page-foot p { margin: 0; }
