/* Performance site home page.

   Shares the palette and the status colours with the punctuality report so
   moving between them doesn't feel like two products. Same rule applies here:
   status colour never carries meaning alone, because the warning yellow sits
   below 3:1 on the light surface -- every status is also spelt out. */

.viz-root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --page: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --border: rgba(11, 11, 11, 0.1);
  --series-1: #2a78d6;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .viz-root {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --page: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --border: rgba(255, 255, 255, 0.1);
    --series-1: #3987e5;
  }
}

:root[data-theme="dark"] .viz-root {
  color-scheme: dark;
  --surface-1: #1a1a19;
  --page: #0d0d0d;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted: #898781;
  --grid: #2c2c2a;
  --border: rgba(255, 255, 255, 0.1);
  --series-1: #3987e5;
}

body.viz-root {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: var(--series-1);
}

.band-inner,
.site-head-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- Header ---------- */

.site-head {
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  position: sticky;
  top: 0;
  z-index: 5;
}

.site-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 58px;
}

.wordmark {
  font-weight: 700;
  font-size: 16.5px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text-primary);
}

/* ---------- Hero ---------- */

.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 22px 52px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.hero-sub {
  max-width: 620px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 16.5px;
}

.hero-status {
  margin: 26px 0 6px;
  min-height: 34px;
}

.hero-status .loading {
  color: var(--text-muted);
  font-size: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px 7px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-1);
  font-size: 14.5px;
  font-weight: 600;
}

.pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
}

.status-pill.good .pill-dot { background: var(--status-good); }
.status-pill.minor .pill-dot { background: var(--status-warning); }
.status-pill.severe .pill-dot { background: var(--status-critical); }
.status-pill.severe { color: var(--status-critical); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 22px;
}

.btn-primary,
.btn-quiet {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--page);
}

.btn-quiet {
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-quiet:hover {
  color: var(--text-primary);
}

/* ---------- Bands ---------- */

.band {
  padding: 46px 0;
  border-top: 1px solid var(--border);
}

.band.alt {
  background: var(--surface-1);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.015em;
}

.section-link {
  font-size: 14px;
  text-decoration: none;
}

.section-note {
  margin: 7px 0 20px;
  color: var(--text-secondary);
  font-size: 14.5px;
  max-width: 720px;
}

.empty-note {
  color: var(--text-muted);
  font-size: 14px;
}

/* ---------- Right now ---------- */

.status-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.status-cell {
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.band .status-cell {
  background: var(--surface-1);
}

.status-count {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.status-cell .status-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

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

.dot.good { background: var(--status-good); }
.dot.minor { background: var(--status-warning); }
.dot.severe { background: var(--status-critical); }
.dot.unknown { background: transparent; border: 1.5px dashed var(--text-muted); }

/* ---------- Tiles ---------- */

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

.tile {
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.band.alt .tile {
  background: var(--page);
}

.tile-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.tile-value {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-top: 2px;
}

.tile-note {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* ---------- Coverage ---------- */

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.coverage-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface-1);
}

.coverage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.coverage-name {
  font-weight: 600;
  font-size: 14.5px;
}

.coverage-pct {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text-secondary);
}

.coverage-meta {
  font-size: 12.5px;
  color: var(--text-muted);
}

.coverage-areas {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* ---------- Method ---------- */

.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px 30px;
  margin-top: 6px;
}

.method-item h3 {
  margin: 0 0 5px;
  font-size: 15px;
}

.method-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ---------- Footer ---------- */

.site-foot {
  border-top: 1px solid var(--border);
  padding: 26px 0 40px;
  color: var(--text-muted);
  font-size: 13px;
}

.site-foot p {
  margin: 0;
  max-width: 720px;
}
