/* Atkinson Hyperlegible — shared with comics site */
@font-face { font-family: "Atkinson Hyperlegible"; src: url(/assets/fonts/AtkinsonHyperlegible-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(/assets/fonts/AtkinsonHyperlegible-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

@font-face { font-family: "Atkinson Hyperlegible"; src: url(/assets/fonts/AtkinsonHyperlegible-Italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
:root {
  /* Palette aligned with comics site */
  --bg: #15171a;
  --fg: #e3e3e3;
  --fg-muted: #888;
  --accent: #b08be5;
  --accent-hover: #c4a5ed;
  --accent-muted: #8a6acd;
  --ok: #3fb950;
  --warn: #d29922;
  --crit: #f85149;
  --border: #2c2f33;
  --surface: #1d2024;
  --surface-inset: #11131a;
  --font-sans: "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --radius-panel: 8px;
  --radius-inner: 6px;
}

* { box-sizing: border-box; }

body {
  background-color: var(--bg);
  color: var(--fg);
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.4;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container { width: 100%; max-width: 72rem; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2rem) 3rem; }

.subsection {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  margin: 0 0 0.65rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--fg-muted);
}

.subsection-note {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--accent-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 1.35rem 1.4rem;
  display: flex;
  flex-direction: column;
}

.section-title {
  color: var(--fg-muted);
  text-transform: none;
  letter-spacing: 0.1em;
  font-size: 0.6875rem;
  font-weight: 700;
  margin: 0 0 1.15rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.section-badge {
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.bar-container { margin-bottom: 1rem; }
.bar-container:last-child { margin-bottom: 0; }

.bar-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  gap: 0.5rem;
  font-size: 0.8125rem;
}

.bar-label { color: var(--fg); font-weight: 700; }

.bar-val {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
}

.bar-bg {
  background: var(--surface-inset);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.bar-fill {
  height: 100%;
  min-width: 0;
  border-radius: 3px;
  width: calc(var(--bar-pct, 0) * 1%);
  background-color: var(--bar-fill-color, var(--accent));
  transition: width 0.35s cubic-bezier(0.33, 1, 0.68, 1);
}

.stat-spacer { flex-shrink: 0; min-height: 0.5rem; }

.stat-block {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.stat-block .stat-row + .subsection { margin-top: 1rem; }

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.8125rem;
  margin-bottom: 0.45rem;
}

.stat-row:last-child { margin-bottom: 0; }

.stat-label { color: var(--fg-muted); }

.stat-val {
  color: var(--fg);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.hero-io {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.hero-io-card {
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 0.85rem 0.9rem;
  text-align: center;
}

.hero-io-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  text-transform: none;
  margin-bottom: 0.35rem;
}

.hero-io-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.hero-io-unit {
  display: block;
  font-size: 0.6875rem;
  color: var(--fg-muted);
  margin-top: 0.2rem;
}

.accent { color: var(--accent); }
.warn { color: var(--warn); }
.crit { color: var(--crit); }
.dim { color: var(--fg-muted); }

.site-footer {
  grid-column: 1 / -1;
  margin-top: 1rem;
  padding-top: 1.25rem;
  text-align: center;
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  color: var(--fg-muted);
  border-top: 1px solid var(--border);
}

.footer-meta { color: var(--fg); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .bar-fill { transition: none; }
}

@media (max-width: 640px) {
  .hero-io { grid-template-columns: 1fr; }
}

/* ============ public archive stats additions ============ */

.page-header {
  text-align: center;
  margin: 0 0 1.6rem;
  padding: 0;
}

.page-header h1 { font-size: 48px; margin: 0; color: var(--accent); letter-spacing: -1px; text-align: center; font-weight: 700; }

.page-subtitle {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.875rem;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

/* Hero KPI row */
.hero-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 1.2rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.hero-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
}

.hero-cap {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: none;
  color: var(--fg-muted);
  font-weight: 700;
}

/* Subsection divider that spans the grid */
.grid-divider {
  grid-column: 1 / -1;
  margin-top: 1rem;
  margin-bottom: 0.1rem;
}

/* Wide panel (full-grid-width) */
.panel-wide {
  grid-column: 1 / -1;
}

/* Horizontal bar rows (publisher / decade) */
.hbar-row {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) 1fr minmax(3.5rem, auto);
  align-items: center;
  gap: 0.85rem;
  margin: 0.5rem 0;
  font-size: 0.85rem;
}

.hbar-label {
  color: var(--fg);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hbar-sub {
  font-size: 0.7rem;
  color: var(--fg-muted);
  font-family: var(--font-mono);
}

.hbar-track {
  background: var(--surface-inset);
  border: 1px solid var(--border);
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}

.hbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-muted), var(--accent));
  width: calc(var(--bar-pct, 0) * 1%);
  border-radius: 4px;
  transition: width 0.4s cubic-bezier(0.33, 1, 0.68, 1);
}

.hbar-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  color: var(--fg);
  text-align: right;
}

@media (max-width: 540px) {
  .hbar-row { grid-template-columns: minmax(5rem, 8rem) 1fr minmax(3rem, auto); gap: 0.6rem; font-size: 0.78rem; }
  .hero-num { font-size: 1.55rem; }
}

/* Chart wrap (SVG bar charts) */
.chart-wrap {
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 0.65rem 0.8rem;
  margin: 0.25rem 0 0.5rem;
}

.sparkline { display: block; width: 100%; height: auto; }
.bars-24h, .bars-7d { width: 100%; height: 60px; }

.trend-axis {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--fg-muted);
  margin-top: 0.2rem;
}

/* Server pulse panel — 4 cells in a row */
.pulse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
  margin-top: 0.25rem;
}

.pulse-cell {
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pulse-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: none;
  color: var(--fg-muted);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.pulse-sub {
  font-size: 0.65rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-muted);
  font-family: var(--font-mono);
}

.pulse-net .pulse-net-vals {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.pulse-net-rx { color: var(--ok); font-size: 1.05rem; font-weight: 700; }
.pulse-net-tx { color: var(--accent); font-size: 1.05rem; font-weight: 700; }
.pulse-unit { color: var(--fg-muted); font-weight: 400; font-size: 0.7rem; }

.pulse-load {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0;
}

.pulse-cell .bar-container { margin: 0; }

/* Fun stats grid */
.fun-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
  margin-top: 0.25rem;
}

.fun-cell {
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.fun-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: none;
  color: var(--fg-muted);
}

.fun-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--accent);
}

.fun-sub {
  font-size: 0.72rem;
  color: var(--fg-muted);
  font-family: var(--font-mono);
}

/* Pulse cell BAN numeric — used in compact server-pulse strip */
.pulse-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.pulse-unit {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--fg-muted);
  margin-left: 0.18rem;
}

.archive-footer {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
}
.archive-footer strong {
  color: var(--accent);
  font-weight: 700;
}

/* Hero 6-card grid */
.hero-6 {
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
}

.pulse-val-small {
  font-size: 0.95rem;
  letter-spacing: 0;
}

.pulse-footnote {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-muted);
  text-align: center;
}

/* Equalize pulse-cell visual rhythm */
.pulse-cell {
  min-height: 6.5rem;
  justify-content: space-between;
}
.pulse-cell .pulse-sub:empty::before {
  content: " ";
}

/* Pulse grid breakpoints — avoid orphan cells */
.pulse-grid {
  grid-template-columns: repeat(5, 1fr);  /* desktop: 5 columns × 2 rows */
}
@media (max-width: 1100px) {
  .pulse-grid { grid-template-columns: repeat(4, 1fr); }  /* 4 × 2 + 2 = a bit off but better than 3 */
}
@media (max-width: 880px) {
  .pulse-grid { grid-template-columns: repeat(2, 1fr); }  /* 2 × 5 perfect */
}
@media (max-width: 480px) {
  .pulse-grid { grid-template-columns: 1fr; }
}

/* ====== final pulse polish ====== */
.pulse-grid {
  align-items: stretch;
}
.pulse-cell {
  min-height: 7rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  text-align: center;
  align-items: center;
  transition: border-color 0.15s, transform 0.15s;
}
.pulse-cell:hover {
  border-color: var(--accent);
}
.pulse-cell .pulse-label {
  justify-content: center;
}
.pulse-cell .pulse-val {
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: -0.02em;
}
.pulse-val-small {
  font-size: 1.05rem !important;
}
.pulse-cell .pulse-sub {
  min-height: 0.9rem;
  font-size: 0.7rem;
  color: var(--fg-muted);
}

.archive-footer {
  margin-top: 1.5rem;
  padding: 1rem;
  text-align: center;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
}
.archive-footer strong { color: var(--accent); }

/* Tighter symmetric story panels */
.panel .stat-block { padding-top: 0.85rem; margin-top: 0.85rem; }
.panel .stat-row { font-size: 0.875rem; padding: 0.25rem 0; }

/* Story-so-far: force a 2-column grid for the pair of panels, span full width */
.story-pair {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
@media (max-width: 760px) {
  .story-pair { grid-template-columns: 1fr; }
}

/* Hero pair — two big anchor numbers */
.hero-pair {
  grid-template-columns: repeat(2, 1fr) !important;
}
.hero-big .hero-num { font-size: 3.5rem; }
.hero-big { padding: 1.5rem 1rem; }
@media (max-width: 760px) {
  .hero-pair { grid-template-columns: 1fr !important; }
}

/* Tighter chart wraps for inline pattern panels */
.chart-tight { padding: 0.35rem 0.5rem; }
.chart-tight .sparkline { height: 50px; }

/* Milestones strip */
.milestones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0;
}
.ms-cell {
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--fg-muted);
}
.ms-cell.ms-on {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 700;
}

@media (max-width: 720px) { .page-header h1 { font-size: 38px; } }

/* Server-specs panel grid: 6 cells in 3×2 at desktop, 2×3 at tablet, 1 col on mobile */
.specs-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 960px) { .specs-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .specs-grid { grid-template-columns: 1fr; } }

/* Snapshot freshness indicator — small, dim, lowercase to match site tone */
.snapshot-meta {
  text-align: center;
  font-size: 12px;
  color: var(--muted, #888);
  letter-spacing: 0.02em;
  margin: 0 0 16px;
  font-family: ui-monospace, "SF Mono", monospace;
}
