/* ─── Design tokens ──────────────────────────────────────────────────
   Dark-first, terminal-aesthetic palette.  Reuses clawmont.com type
   stack (Inter Tight + JetBrains Mono) so the dashboard feels like the
   same product, just more technical. */
:root {
  --bg:          #050607;
  --bg-raised:  #0d0f12;
  --bg-card:    #111418;
  --border:     #1c2028;
  --border-lit: #272c36;
  --text:       #e6e9ef;
  --text-dim:   #9096a1;
  --text-faint: #5c626d;

  --score-high: #2ade7a;  /* ≥8.0  — green */
  --score-mid:  #ffc859;  /* 6–7.9 — amber */
  --score-low:  #ff5a5f;  /* <6.0  — red   */

  --accent:     #6366f1;
  --threat:     #ef4444;

  --font-sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-lift: 0 1px 0 rgba(255,255,255,0.02) inset, 0 12px 32px -12px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

code, pre, kbd, samp, .mono { font-family: var(--font-mono); }

a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

/* ─── Top bar ───────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #0a0c0f, var(--bg));
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 14px; }
.brand-mark { color: var(--accent); font-size: 16px; }
.brand-name { font-weight: 700; letter-spacing: 0.5px; }
.brand-slash { color: var(--text-faint); }
.brand-tag { color: var(--text-dim); }
.topbar-right { display: flex; gap: 18px; }
.topbar-link { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); text-decoration: none; }
.topbar-link:hover { color: var(--text); }

/* ─── Layout ─────────────────────────────────────────────────────── */
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 28px 80px;
  display: flex; flex-direction: column; gap: 48px;
}

.preamble h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 14px; font-weight: 600; letter-spacing: -0.02em;
}
.preamble p { color: var(--text-dim); margin: 0; max-width: 68ch; line-height: 1.6; }
.preamble code { color: var(--text); background: var(--bg-raised); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); font-size: 0.9em; }

h2 { font-size: 18px; font-weight: 600; margin: 0 0 16px; letter-spacing: -0.01em; }

/* ─── Project tabs ─────────────────────────────────────────────── */
.project-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 2px; }
.project-tab {
  appearance: none; border: 0; background: transparent;
  padding: 10px 16px; margin-bottom: -1px;
  font-family: var(--font-mono); font-size: 13px;
  color: var(--text-dim); cursor: pointer;
  border-bottom: 2px solid transparent;
}
.project-tab:hover { color: var(--text); }
.project-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.project-tab.future { color: var(--text-faint); cursor: not-allowed; }
.project-tab.future::after { content: " · soon"; color: var(--text-faint); }

/* ─── Hero card ─────────────────────────────────────────────────── */
.hero-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
}
.hero-label { text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); }
.hero-grade-row { display: flex; align-items: baseline; gap: 18px; margin-top: 6px; }
.hero-grade { font-size: 96px; line-height: 0.9; font-weight: 700; font-family: var(--font-mono); letter-spacing: -0.04em; }
.hero-grade.grade-high { color: var(--score-high); }
.hero-grade.grade-mid  { color: var(--score-mid);  }
.hero-grade.grade-low  { color: var(--score-low);  }
.hero-score { font-size: 22px; color: var(--text-dim); font-family: var(--font-mono); }
.hero-meta { margin-top: 18px; color: var(--text-dim); font-family: var(--font-mono); font-size: 12px; }
.hero-meta .dot { margin: 0 8px; color: var(--text-faint); }

.hero-right { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; align-content: center; }
.hero-stat {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-raised);
}
.hero-stat-label { text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; color: var(--text-faint); font-family: var(--font-mono); }
.hero-stat-value { font-family: var(--font-mono); font-size: 20px; font-weight: 700; }

@media (max-width: 720px) {
  .hero-card { grid-template-columns: 1fr; }
  .hero-right { grid-template-columns: 1fr 1fr 1fr; }
}

/* ─── Chart ─────────────────────────────────────────────────────── */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.chart-legend { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.legend-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.legend-label { margin-right: 10px; }

.chart-wrap {
  margin: 0;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
#score-chart { width: 100%; height: 260px; display: block; }
.chart-caption { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); margin-top: 10px; min-height: 1.4em; }

/* SVG chart element styles */
.chart-axis { stroke: var(--border); stroke-width: 1; }
.chart-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; opacity: 0.6; }
.chart-tick { fill: var(--text-faint); font-family: var(--font-mono); font-size: 10px; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart-area { fill: var(--accent); opacity: 0.08; }
.chart-point { fill: var(--bg); stroke: var(--accent); stroke-width: 2; cursor: pointer; transition: r 0.15s; }
.chart-point:hover, .chart-point.active { r: 6; fill: var(--accent); }
.chart-point.high { stroke: var(--score-high); }
.chart-point.mid  { stroke: var(--score-mid);  }
.chart-point.low  { stroke: var(--score-low);  }
.chart-point.high:hover, .chart-point.high.active { fill: var(--score-high); }
.chart-point.mid:hover,  .chart-point.mid.active  { fill: var(--score-mid);  }
.chart-point.low:hover,  .chart-point.low.active  { fill: var(--score-low);  }
.chart-hitbox { fill: transparent; cursor: pointer; }

/* ─── Category cards ────────────────────────────────────────────── */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.category-card {
  padding: 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card); display: flex; flex-direction: column; gap: 12px;
}
.category-card:hover { border-color: var(--border-lit); }
.cat-name { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }
.cat-score-row { display: flex; align-items: baseline; justify-content: space-between; font-family: var(--font-mono); }
.cat-score { font-size: 26px; font-weight: 700; }
.cat-max { color: var(--text-faint); font-size: 14px; }
.cat-bar { height: 4px; background: var(--bg-raised); border-radius: 2px; overflow: hidden; }
.cat-bar-fill { height: 100%; transition: width 0.4s ease; }
.cat-blurb { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

.score-high .cat-score, .score-high .cat-bar-fill { color: var(--score-high); background: var(--score-high); }
.score-mid  .cat-score, .score-mid  .cat-bar-fill { color: var(--score-mid);  background: var(--score-mid);  }
.score-low  .cat-score, .score-low  .cat-bar-fill { color: var(--score-low);  background: var(--score-low);  }

/* ─── Timeline ──────────────────────────────────────────────────── */
.timeline-note { color: var(--text-dim); font-size: 13px; margin: 0 0 18px; }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.timeline-item {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 18px;
  padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card); align-items: center;
}
.timeline-date { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.timeline-summary { font-size: 14px; line-height: 1.5; }
.timeline-delta { font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.timeline-delta.up   { color: var(--score-high); }
.timeline-delta.down { color: var(--score-low);  }
.timeline-delta.flat { color: var(--text-faint); }

/* ─── Disclosure ────────────────────────────────────────────────── */
.footer-disclosure {
  padding: 24px; border: 1px dashed var(--border); border-radius: var(--radius-lg);
  background: var(--bg-raised);
}
.footer-disclosure h3 { margin: 0 0 10px; font-size: 14px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-dim); }
.footer-disclosure p { margin: 0; color: var(--text-dim); line-height: 1.6; font-size: 14px; }

/* ─── Footer bar ────────────────────────────────────────────────── */
.footer-bar {
  margin-top: 40px; padding: 20px 28px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--text-dim);
}
.footer-bar a { color: var(--text-dim); }
.footer-bar a:hover { color: var(--text); }

/* ─── Responsive tweaks ─────────────────────────────────────────── */
@media (max-width: 520px) {
  .timeline-item { grid-template-columns: 1fr; }
  .hero-right { grid-template-columns: 1fr; }
  .hero-grade { font-size: 72px; }
  .footer-bar { flex-direction: column; gap: 8px; }
}
