:root {
  --paper: #EDEAE1;
  --paper-raised: #F5F3EC;
  --ink: #1B2233;
  --ink-soft: #4A5063;
  --gold: #A9812E;
  --teal: #1F6F5C;
  --rust: #A63D40;
  --line: #D8D3C6;

  --font-display: 'Source Serif 4', Georgia, serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* --- Masthead --- */
.masthead {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 24px 24px;
  border-bottom: 1px solid var(--line);
}

.masthead-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.masthead-title { display: flex; align-items: baseline; gap: 10px; }

.masthead h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  margin: 0;
  letter-spacing: -0.01em;
}

.byline {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.pulse-rule {
  width: 200px;
  height: 28px;
  flex-shrink: 0;
}

.pulse-rule-empty {
  width: 200px;
  height: 1px;
  background: var(--line);
}

.tagline {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* --- Empty state --- */
.empty-state {
  margin-top: 48px;
  padding: 32px;
  background: var(--paper-raised);
  border: 1px dashed var(--line);
  border-radius: 4px;
}
.empty-state h2 { margin-top: 0; font-family: var(--font-display); }
.empty-state code {
  display: block;
  margin: 16px 0;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  border-radius: 3px;
}
.empty-note { color: var(--ink-soft); font-size: 0.9rem; }

/* --- Hero --- */
.hero {
  margin-top: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.hero-figure { display: flex; flex-direction: column; gap: 6px; }

.hero-number {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 4.5rem;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.hero-unit { font-size: 2.5rem; color: var(--gold); }

.hero-label {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.hero-delta {
  margin-top: 12px;
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 3px;
}
.hero-delta.up { color: var(--teal); background: rgba(31,111,92,0.1); }
.hero-delta.down { color: var(--rust); background: rgba(166,61,64,0.1); }

/* --- Sections --- */
section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 40px 0 16px;
}

/* --- Sector grid --- */
.sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.sector-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sector-label {
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sector-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.sector-caption {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

/* --- Trend --- */
.trend { margin-top: 8px; }

/* --- Table --- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}
th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}
td.num, th.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
td a { color: var(--gold); text-decoration: none; border-bottom: 1px solid var(--gold); }

/* --- Footer --- */
footer {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.82rem;
}
footer p { margin: 0 0 10px; }
.fetch-status { font-family: var(--font-mono); font-size: 0.75rem; }

/* --- Focus visibility --- */
a:focus-visible, code:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* --- Mobile --- */
@media (max-width: 600px) {
  .hero-number { font-size: 3rem; }
  .masthead h1 { font-size: 1.5rem; }
  .pulse-rule, .pulse-rule-empty { width: 120px; }
}
