/* ==========================================================================
   AgentBurn v1.1 — design system
   No external dependencies. Dark, data-dense, "ember" accent.
   ========================================================================== */

:root {
  /* surfaces */
  --bg: #07080b;
  --bg-soft: #0a0c11;
  --surface: #101319;
  --surface-2: #151922;
  --surface-3: #1b202b;
  --border: #232838;
  --border-strong: #2f364a;

  /* text */
  --text: #e8ebf2;
  --text-dim: #a3adc2;
  --text-mute: #76829a;

  /* brand */
  --ember: #ff6a3d;
  --ember-2: #ff2e63;
  --ember-soft: rgba(255, 106, 61, 0.12);
  --ember-glow: rgba(255, 74, 60, 0.28);
  --grad-brand: linear-gradient(135deg, #ff8a3d 0%, #ff5a3c 45%, #ff2e63 100%);
  --grad-cool: linear-gradient(135deg, #5b9dff, #9b6bff);

  /* semantic */
  --up: #34d399;
  --down: #fb7185;
  --warn: #fbbf24;
  --info: #60a5fa;

  /* domain accents */
  --d-coding: #5b9dff;
  --d-research: #b070ff;
  --d-enterprise: #34d399;
  --d-marketing: #f472b6;
  --d-data: #fbbf24;
  --d-ops: #22d3ee;

  /* type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;

  /* shape */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 10px 30px -12px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 10px 40px -12px var(--ember-glow);

  --container: 1200px;
  --header-h: 64px;
}

*, *::before, *::after { 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(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(255, 90, 60, 0.16), transparent 62%),
    radial-gradient(760px 440px at 90% -12%, rgba(155, 107, 255, 0.10), transparent 60%),
    radial-gradient(700px 420px at 50% 110%, rgba(255, 46, 99, 0.07), transparent 62%);
}

main { position: relative; z-index: 1; flex: 1 0 auto; }

img, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
::selection { background: rgba(255, 106, 61, 0.32); color: #fff; }

:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
  border-radius: 6px;
}

/* --------------------------------------------------------------------------
   Layout utilities
   -------------------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 56px 0; }
.section-tight { padding: 32px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.spacer { flex: 1 1 auto; }
.hidden { display: none !important; }
.mt-0 { margin-top: 0 !important; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.mb-0 { margin-bottom: 0 !important; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; } .mb-32 { margin-bottom: 32px; }
.text-dim { color: var(--text-dim); } .text-mute { color: var(--text-mute); }
.text-sm { font-size: 13px; } .text-xs { font-size: 12px; }
.text-up { color: var(--up); } .text-down { color: var(--down); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ember);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; opacity: 0.6; }
.h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.035em; }
.h2 { font-size: clamp(22px, 3vw, 32px); letter-spacing: -0.03em; }
.h3 { font-size: 18px; }
.lead { color: var(--text-dim); font-size: 16px; max-width: 62ch; }
.section-head .h2 { margin-bottom: 4px; }
.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.mono-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-mute); font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(7, 8, 11, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad-brand);
  display: grid; place-items: center; font-size: 17px;
  box-shadow: 0 6px 18px -6px var(--ember-glow);
  flex: 0 0 auto;
}
.brand-name { font-weight: 800; letter-spacing: -0.02em; font-size: 17px; }
.brand-name span { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand-domain {
  font-size: 10px; color: var(--text-mute); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 999px; font-family: var(--font-mono);
  display: none;
}
@media (min-width: 900px) { .brand-domain { display: inline-block; } }

.nav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.nav-link {
  padding: 7px 11px; border-radius: 8px; font-size: 13.5px; font-weight: 500;
  color: var(--text-dim); transition: color .15s, background .15s; white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link[aria-current="page"] { color: var(--text); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-strong); }
.nav-link .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--up); margin-right: 6px; vertical-align: middle; animation: pulse 2s infinite; }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-toggle {
  display: none; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2);
  place-items: center; color: var(--text-dim);
}
.nav-toggle:hover { color: var(--text); }
.nav-drawer {
  display: none; border-top: 1px solid var(--border); background: var(--bg-soft);
  padding: 12px 0 18px;
}
.nav-drawer .container { display: flex; flex-direction: column; gap: 2px; }
.nav-drawer .nav-link { padding: 11px 12px; font-size: 15px; }
.nav-drawer .btn { margin-top: 10px; justify-content: center; }
.nav-drawer.is-open { display: block; }

@media (max-width: 940px) {
  .nav { display: none; }
  .nav-toggle { display: grid; }
  .header-actions .btn-ghost { display: none; }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; padding: 9px 15px; font-size: 13.5px; font-weight: 650;
  border: 1px solid transparent; transition: transform .12s, box-shadow .18s, background .18s, color .18s, border-color .18s;
  white-space: nowrap; line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad-brand); color: #160604; box-shadow: var(--shadow-glow); }
.btn-primary:hover { box-shadow: 0 14px 34px -10px var(--ember-glow); filter: brightness(1.07); }
.btn-ghost { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn-outline { border-color: var(--border-strong); color: var(--text-dim); }
.btn-outline:hover { border-color: var(--ember); color: var(--ember); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 9px; }

/* --------------------------------------------------------------------------
   Badges / chips / pills
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 6px; line-height: 1.4;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim);
  white-space: nowrap; font-family: var(--font-mono);
}
.badge-ember { color: #ffb08f; background: rgba(255, 106, 61, .10); border-color: rgba(255, 106, 61, .32); }
.badge-live { color: #6ee7b7; background: rgba(52, 211, 153, .10); border-color: rgba(52, 211, 153, .3); }
.badge-live::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
.badge-verified { color: #93c5fd; background: rgba(96, 165, 250, .10); border-color: rgba(96, 165, 250, .3); }
.badge-estimate { color: #fcd34d; background: rgba(251, 191, 36, .09); border-color: rgba(251, 191, 36, .28); }
.badge-sponsored { color: #ffd0b8; background: rgba(255, 90, 60, .16); border-color: rgba(255, 90, 60, .45); }
.badge-ghost { background: transparent; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
}
.chip.is-active { color: #1a0a06; background: var(--grad-brand); border-color: transparent; font-weight: 700; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }

.domain-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.domain-coding { --accent: var(--d-coding); }
.domain-research { --accent: var(--d-research); }
.domain-enterprise { --accent: var(--d-enterprise); }
.domain-marketing { --accent: var(--d-marketing); }
.domain-data { --accent: var(--d-data); }
.domain-ops { --accent: var(--d-ops); }
.domain-tag { color: var(--accent); font-weight: 600; }

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  position: relative;
}
.card-hover { transition: border-color .18s, transform .18s, box-shadow .18s; }
.card-hover:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.card-glow { box-shadow: var(--shadow-glow); border-color: rgba(255, 106, 61, .35); }
.panel { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.panel-inset { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; }

.project-card {
  display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; position: relative; overflow: hidden;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.project-card::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent, var(--ember)), transparent);
  opacity: .0; transition: opacity .2s;
}
.project-card:hover { border-color: var(--border-strong); transform: translateY(-3px); box-shadow: var(--shadow-2); }
.project-card:hover::after { opacity: .9; }
.project-card.is-sponsored { border-color: rgba(255, 106, 61, .45); box-shadow: var(--shadow-glow); }
.project-card.is-sponsored::after { opacity: .9; }
.card-head { display: flex; align-items: flex-start; gap: 12px; }
.card-icon {
  width: 42px; height: 42px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 20px;
  background: color-mix(in srgb, var(--accent, var(--ember)) 14%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent, var(--ember)) 30%, transparent);
}
.card-title { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.card-title a:hover { color: var(--ember); }
.card-sub { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.card-desc { font-size: 13px; color: var(--text-dim); line-height: 1.55; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-top: 1px solid var(--border); padding-top: 12px; font-size: 12px; color: var(--text-mute);
}
.card-foot .link { color: var(--ember); font-weight: 600; }

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.metric { background: var(--bg); padding: 10px 12px; }
.metric-label { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-mute); font-family: var(--font-mono); }
.metric-value { font-size: 15px; font-weight: 750; font-family: var(--font-mono); font-variant-numeric: tabular-nums; margin-top: 2px; }
.metric-value small { font-size: 10px; font-weight: 500; color: var(--text-mute); }
.metric-value.is-burn { color: #ff8f6e; }
.metric-value.is-cost { color: var(--up); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { position: relative; padding: 56px 0 40px; }
.hero-panel {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--r-xl);
  background:
    radial-gradient(700px 320px at 88% -20%, rgba(255, 106, 61, .22), transparent 65%),
    linear-gradient(160deg, #121620 0%, #0b0d13 70%);
  padding: 40px;
}
.hero-panel::after {
  content: ""; position: absolute; inset: auto -10% -60% 40%; height: 320px;
  background: radial-gradient(closest-side, rgba(255, 46, 99, .18), transparent);
  pointer-events: none;
}
.hero h1 { max-width: 18ch; }
.hero .lead { margin-top: 16px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.stat-value { font-size: clamp(20px, 2.4vw, 28px); font-weight: 800; font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat-label { font-size: 11px; color: var(--text-mute); margin-top: 4px; }
.stat-value.is-burn { color: #ff8f6e; }
.stat-value.is-cost { color: var(--up); }
.stat-value.is-fw { color: var(--d-research); }
.stat-value.is-proj { color: var(--d-coding); }
@media (max-width: 700px) {
  .hero-panel { padding: 26px 20px; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 16px; }
}

/* --------------------------------------------------------------------------
   Tabs / toolbar
   -------------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); padding: 4px; border-radius: 11px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 7px 13px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--text-mute); transition: color .15s, background .15s; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar .search { flex: 1 1 240px; max-width: 360px; }

.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-mute); }
.search input { padding-left: 34px; }
.input, .select, .search input, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; font-size: 13.5px; color: var(--text);
  transition: border-color .15s, box-shadow .15s; appearance: none;
}
.input::placeholder, .search input::placeholder, textarea::placeholder { color: var(--text-mute); }
.input:focus, .select:focus, .search input:focus, textarea:focus {
  outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px rgba(255, 106, 61, .14);
}
.select { padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2376829a' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
textarea { resize: vertical; min-height: 96px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.hint { font-size: 11.5px; color: var(--text-mute); }
.error-text { font-size: 11.5px; color: var(--down); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Tables / leaderboard
   -------------------------------------------------------------------------- */
.table-wrap { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.table-scroll { overflow-x: auto; }
table.rank { font-size: 13.5px; min-width: 640px; }
table.rank thead th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-mute); font-weight: 600; padding: 11px 14px; background: var(--bg-soft);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.rank tbody td { padding: 12px 14px; border-bottom: 1px solid rgba(35, 40, 56, .7); vertical-align: middle; }
table.rank tbody tr:last-child td { border-bottom: 0; }
table.rank tbody tr:hover { background: rgba(255, 255, 255, .018); }
table.rank .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-badge {
  display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: 7px; font-size: 11px; font-weight: 800; font-family: var(--font-mono);
  background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--border);
}
.rank-badge.top-1 { background: linear-gradient(135deg, #ffd166, #ff9f43); color: #2a1600; border-color: transparent; }
.rank-badge.top-2 { background: linear-gradient(135deg, #e2e8f0, #9aa7bd); color: #11151d; border-color: transparent; }
.rank-badge.top-3 { background: linear-gradient(135deg, #eba878, #c87b4c); color: #23120a; border-color: transparent; }
.rank-name { font-weight: 650; color: var(--text); }
.rank-name:hover { color: var(--ember); }
.delta { font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.bar { height: 5px; background: var(--surface-3); border-radius: 999px; overflow: hidden; min-width: 80px; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--grad-brand); }
.bar-fill.cool { background: var(--grad-cool); }

/* --------------------------------------------------------------------------
   Terminal / live feed
   -------------------------------------------------------------------------- */
.terminal {
  background: #06070a; border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; font-family: var(--font-mono);
}
.terminal-bar {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-mute);
}
.terminal-dots { display: flex; gap: 5px; }
.terminal-dots i { width: 9px; height: 9px; border-radius: 50%; background: #2b3244; display: block; }
.terminal-dots i:nth-child(1) { background: #ff5f57; }
.terminal-dots i:nth-child(2) { background: #febc2e; }
.terminal-dots i:nth-child(3) { background: #28c840; }
.terminal-body { padding: 12px 14px; height: 380px; overflow-y: auto; font-size: 12px; line-height: 1.75; scrollbar-width: thin; }
.terminal-body::-webkit-scrollbar { width: 8px; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
.log-line { display: grid; grid-template-columns: 74px 118px 1fr auto; gap: 10px; padding: 1px 0; animation: logIn .3s ease both; white-space: nowrap; }
.log-time { color: #4d5669; }
.log-agent { color: #9ec5ff; overflow: hidden; text-overflow: ellipsis; }
.log-msg { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; }
.log-tok { color: #ffa07a; text-align: right; }
.log-line.warn .log-msg { color: var(--warn); }
.log-line.err .log-msg { color: var(--down); }
.log-line.ok .log-msg { color: var(--up); }
@media (max-width: 760px) {
  .log-line { grid-template-columns: 62px 1fr auto; }
  .log-agent { display: none; }
}
.live-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--up); font-family: var(--font-mono); }
.live-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }

/* --------------------------------------------------------------------------
   Calculator
   -------------------------------------------------------------------------- */
.calc-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 24px; align-items: start; }
@media (max-width: 980px) { .calc-grid { grid-template-columns: 1fr; } }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--ember); }
.range-val { min-width: 74px; text-align: right; font-family: var(--font-mono); font-size: 13px; color: var(--text); }
.result-hero {
  border: 1px solid rgba(255, 106, 61, .3); border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(255, 106, 61, .08), rgba(255, 46, 99, .04));
  padding: 22px;
}
.result-hero .big { font-size: clamp(30px, 4vw, 42px); font-weight: 800; font-family: var(--font-mono); letter-spacing: -0.03em; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.result-cell { background: var(--bg); padding: 12px 14px; }
.result-cell .v { font-family: var(--font-mono); font-weight: 700; font-size: 16px; margin-top: 3px; }

/* --------------------------------------------------------------------------
   Pricing
   -------------------------------------------------------------------------- */
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 940px) { .pricing-grid { grid-template-columns: 1fr; } }
.price-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.price-card.is-featured { border-color: rgba(255, 106, 61, .5); box-shadow: var(--shadow-glow); position: relative; }
.price-card.is-featured::before {
  content: "MOST POPULAR"; position: absolute; top: -10px; left: 24px;
  background: var(--grad-brand); color: #1a0803; font-size: 9.5px; font-weight: 800;
  letter-spacing: .1em; padding: 3px 9px; border-radius: 999px;
}
.price { font-size: 34px; font-weight: 800; font-family: var(--font-mono); letter-spacing: -0.03em; }
.price span { font-size: 13px; font-weight: 500; color: var(--text-mute); font-family: var(--font-sans); }
.feature-list { display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; color: var(--text-dim); }
.feature-list li { display: flex; gap: 9px; align-items: flex-start; }
.feature-list li::before { content: "✓"; color: var(--up); font-weight: 800; flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   Modal / toast / misc states
   -------------------------------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(2, 3, 6, .74); backdrop-filter: blur(6px); }
.modal[hidden] { display: none; }
.modal-panel { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-xl); width: min(560px, 100%); max-height: 86vh; overflow-y: auto; padding: 26px; position: relative; box-shadow: var(--shadow-2); animation: modalIn .18s ease both; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 8px; color: var(--text-mute); display: grid; place-items: center; }
.modal-close:hover { background: var(--surface-3); color: var(--text); }

.toast-stack { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface-2); border: 1px solid var(--border-strong); border-left: 3px solid var(--ember);
  border-radius: 10px; padding: 11px 16px; font-size: 13px; box-shadow: var(--shadow-2);
  animation: toastIn .2s ease both; max-width: 340px;
}
.toast.ok { border-left-color: var(--up); }
.toast.err { border-left-color: var(--down); }

.empty { text-align: center; padding: 56px 20px; color: var(--text-mute); }
.empty .icon { font-size: 28px; opacity: .8; margin-bottom: 10px; }

.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite linear; border-radius: 8px; }
.skeleton-card { height: 260px; border-radius: var(--r-lg); }

/* --------------------------------------------------------------------------
   Prose / docs / code
   -------------------------------------------------------------------------- */
.prose { max-width: 76ch; color: var(--text-dim); font-size: 14.5px; }
.prose h2 { color: var(--text); font-size: 22px; margin: 38px 0 12px; scroll-margin-top: 90px; }
.prose h3 { color: var(--text); font-size: 16.5px; margin: 26px 0 8px; }
.prose p { margin: 10px 0; }
.prose ul, .prose ol { margin: 10px 0; padding-left: 20px; list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: 5px 0; }
.prose a { color: var(--ember); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 106, 61, .4); }
.prose code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-3); padding: 2px 5px; border-radius: 5px; color: #ffb08f; }
.prose table { font-size: 13px; margin: 14px 0; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.prose th { color: var(--text); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; }
.prose blockquote { border-left: 2px solid var(--ember); margin: 14px 0; padding: 2px 0 2px 14px; color: var(--text-dim); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 26px 0; }

.code-block { position: relative; background: #06070a; border: 1px solid var(--border); border-radius: var(--r-md); margin: 14px 0; overflow: hidden; }
.code-block pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; color: #cbd5e1; }
.code-block .copy {
  position: absolute; top: 9px; right: 9px; font-size: 11px; padding: 4px 9px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; color: var(--text-mute);
  opacity: 0; transition: opacity .15s;
}
.code-block:hover .copy { opacity: 1; }
.code-block .copy:hover { color: var(--text); border-color: var(--border-strong); }
.code-block .code-label { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-mute); padding: 8px 16px 0; letter-spacing: .06em; text-transform: uppercase; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: rgba(7, 8, 11, .6); margin-top: 60px; position: relative; z-index: 1; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; padding: 44px 0 30px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand p { font-size: 13px; color: var(--text-mute); margin-top: 12px; max-width: 34ch; }
.footer-col h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-mute); margin-bottom: 12px; font-family: var(--font-mono); }
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col a { font-size: 13px; color: var(--text-dim); }
.footer-col a:hover { color: var(--ember); }
.footer-bottom {
  border-top: 1px solid var(--border); padding: 18px 0 26px;
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-mute);
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes logIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; }
.reveal.in { animation: reveal .5s ease both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Responsive grid fallbacks
   -------------------------------------------------------------------------- */
@media (max-width: 980px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 40px 0; }
  .container { padding: 0 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .table-wrap { border-radius: var(--r-md); }
  .metric-grid { grid-template-columns: 1fr 1fr; }
}

/* --------------------------------------------------------------------------
   Page patterns (v1.1 additions)
   -------------------------------------------------------------------------- */
.page-head { padding: 40px 0 8px; }
.page-head .h1 { font-size: clamp(26px, 3.6vw, 40px); }
.page-head .lead { margin-top: 12px; }
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-mute); margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--ember); }
.breadcrumb .sep { opacity: .5; }

.sponsor-flag { position: absolute; top: 14px; right: 14px; z-index: 2; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-row .tag {
  font-size: 10.5px; font-family: var(--font-mono); color: var(--text-mute);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; background: var(--bg);
}
.section-alt { background: linear-gradient(180deg, rgba(255,255,255,.014), transparent); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cta-band {
  margin: 56px 0 0; padding: 34px;
  border: 1px solid rgba(255, 106, 61, .28); border-radius: var(--r-xl);
  background: linear-gradient(135deg, rgba(255, 106, 61, .10), rgba(255, 46, 99, .05) 55%, transparent);
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-band h2 { font-size: clamp(20px, 2.6vw, 26px); }
.cta-band p { color: var(--text-dim); font-size: 13.5px; margin-top: 6px; max-width: 56ch; }

.stat-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.stat-band > div { background: var(--surface); padding: 16px 18px; }
.stat-band .v { font-family: var(--font-mono); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.stat-band .l { font-size: 11px; color: var(--text-mute); margin-top: 3px; }
@media (max-width: 760px) { .stat-band { grid-template-columns: 1fr 1fr; } }

.two-col > * { min-width: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
@media (max-width: 1020px) { .two-col { grid-template-columns: 1fr; } }

.callout {
  border: 1px solid var(--border); border-left: 3px solid var(--ember);
  background: var(--surface); border-radius: var(--r-md); padding: 14px 16px;
  font-size: 13px; color: var(--text-dim);
}
.callout strong { color: var(--text); }
.callout.ok { border-left-color: var(--up); }
.callout.warn { border-left-color: var(--warn); }

.list-check { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--text-dim); }
.list-check li { display: flex; gap: 9px; align-items: flex-start; }
.list-check li::before { content: "✓"; color: var(--up); font-weight: 800; }

.detail-hero { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.detail-icon {
  width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; font-size: 30px;
  background: color-mix(in srgb, var(--accent, var(--ember)) 14%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent, var(--ember)) 32%, transparent);
}
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid rgba(35,40,56,.7); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--text-mute); }
.kv .v { font-family: var(--font-mono); color: var(--text); text-align: right; }

.workflow-step { display: grid; grid-template-columns: 28px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgba(35,40,56,.7); }
.workflow-step:last-child { border-bottom: 0; }
.workflow-step .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text-dim); }
.workflow-step .step-name { font-weight: 650; font-size: 14px; }
.workflow-step .step-detail { font-size: 12.5px; color: var(--text-mute); margin-top: 3px; }
.workflow-step .step-meta { text-align: right; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-mute); white-space: nowrap; }
.workflow-step .step-bar { grid-column: 2 / -1; height: 3px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.workflow-step .step-bar i { display: block; height: 100%; background: var(--grad-brand); border-radius: 99px; }

.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 3px; }
.segmented button { padding: 5px 10px; font-size: 12px; border-radius: 6px; color: var(--text-mute); font-weight: 600; }
.segmented button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }

.mini-list { display: flex; flex-direction: column; }
.mini-list a { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid rgba(35,40,56,.6); font-size: 13px; }
.mini-list a:last-child { border-bottom: 0; }
.mini-list a:hover { color: var(--ember); }

.dir-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .dir-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .dir-grid { grid-template-columns: 1fr; } }
.dir-card { border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px; background: var(--surface); transition: border-color .18s, transform .18s; }
.dir-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.dir-card .t { font-weight: 700; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.dir-card .c { font-size: 11px; color: var(--text-mute); margin-top: 4px; font-family: var(--font-mono); }

.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-mute); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq .a { color: var(--text-dim); font-size: 13.5px; margin-top: 8px; }
/* code inside .code-block must not inherit the inline-code styling */
.code-block pre code { background: none; padding: 0; color: inherit; font-size: inherit; font-family: inherit; }
/* inline text links inside rich surfaces */
.callout a, .card-desc a, .text-dim a, .feature-list a, .list-check a, .faq .a a, .kv a {
  color: var(--ember);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(255, 106, 61, .35);
}
.callout a:hover, .card-desc a:hover, .text-dim a:hover, .feature-list a:hover, .list-check a:hover, .faq .a a:hover, .kv a:hover {
  text-decoration-color: var(--ember);
}
/* keep project-card footers pinned to the bottom of equal-height cards */
.project-card .card-foot { margin-top: auto; }
/* --------------------------------------------------------------------------
   v1.2 — admin review console
   -------------------------------------------------------------------------- */
.token-gate { max-width: 560px; margin: 48px auto; }
.token-gate .card { text-align: left; }
.admin-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.submission-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.submission-card .sub-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.submission-card .sub-name { font-size: 16px; font-weight: 700; }
.submission-card .sub-sub { font-size: 12px; color: var(--text-mute); margin-top: 3px; }
.sub-status { font-size: 10.5px; font-family: var(--font-mono); letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border); }
.sub-status.pending { color: #fcd34d; border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }
.sub-status.approved { color: #6ee7b7; border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.08); }
.sub-status.rejected { color: #fda4af; border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.08); }
.sub-fields { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 6px 14px; font-size: 12.5px; }
.sub-fields dt { color: var(--text-mute); }
.sub-fields dd { margin: 0; color: var(--text-dim); overflow-wrap: anywhere; }
.sub-fields dd a { color: var(--ember); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(255,106,61,.35); }
.sub-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; }
.sub-note { font-size: 12px; color: var(--text-mute); border-left: 2px solid var(--border-strong); padding-left: 10px; }
@media (max-width: 560px) { .sub-fields { grid-template-columns: 1fr; gap: 2px; } .sub-fields dt { margin-top: 8px; } }

/* --------------------------------------------------------------------------
   v1.2 — report / methodology
   -------------------------------------------------------------------------- */
.report-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr); gap: 28px; align-items: start; }
@media (max-width: 980px) { .report-hero { grid-template-columns: 1fr; } }
.report-cover {
  border: 1px solid rgba(255,106,61,.3); border-radius: var(--r-xl); padding: 28px;
  background:
    radial-gradient(420px 220px at 90% 0%, rgba(255,106,61,.2), transparent 65%),
    linear-gradient(160deg, #121620, #0b0d13 70%);
}
.report-cover .cover-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #ffb08f; }
.report-cover .cover-title { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; letter-spacing: -0.03em; margin-top: 12px; line-height: 1.08; }
.report-cover .cover-meta { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-mute); }
.report-cover .cover-meta b { display: block; color: var(--text); font-family: var(--font-mono); font-size: 15px; margin-bottom: 2px; }
.chapter-list { counter-reset: chapter; display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.chapter-list li { background: var(--surface); padding: 14px 16px; display: grid; grid-template-columns: 30px 1fr; gap: 12px; counter-increment: chapter; }
.chapter-list li::before { content: counter(chapter, decimal-leading-zero); font-family: var(--font-mono); color: var(--ember); font-size: 12px; font-weight: 700; }
.chapter-list .ct { font-weight: 650; font-size: 14px; }
.chapter-list .cd { font-size: 12.5px; color: var(--text-mute); margin-top: 2px; }
.timeline { border-left: 2px solid var(--border); padding-left: 20px; display: flex; flex-direction: column; gap: 20px; }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -26px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 4px rgba(255,106,61,.12); }
.timeline-item .when { font-family: var(--font-mono); font-size: 11px; color: var(--text-mute); letter-spacing: .04em; }
.timeline-item .what { font-weight: 650; font-size: 14px; margin-top: 3px; }
.timeline-item .detail { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
