/* ---------------------------------------------------------------
   Tokens
   --------------------------------------------------------------- */

:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --text: #16161a;
  --muted: #6b6b76;
  --line: #e6e6e1;
  --line-strong: #d5d5cf;

  --band-cooling: #2563eb;
  --band-easing: #0e8a94;
  --band-neutral: #64748b;
  --band-elevated: #c2710c;
  --band-high: #d0342c;

  --accent: var(--band-neutral);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;

  --shell: 1080px;
  --shell-narrow: 680px;
  --gutter: 1.5rem;

  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0f;
    --surface: #141417;
    --text: #ededef;
    --muted: #8e8e99;
    --line: #26262b;
    --line-strong: #35353c;

    --band-cooling: #6ea8fe;
    --band-easing: #3ec6d0;
    --band-neutral: #9aa6b6;
    --band-elevated: #f0a53c;
    --band-high: #ff6b60;
  }
}

[data-band="cooling"] { --accent: var(--band-cooling); }
[data-band="easing"] { --accent: var(--band-easing); }
[data-band="neutral"] { --accent: var(--band-neutral); }
[data-band="elevated"] { --accent: var(--band-elevated); }
[data-band="high"] { --accent: var(--band-high); }

/* ---------------------------------------------------------------
   Base
   --------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1 0 auto;
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

a:hover {
  text-decoration-color: currentColor;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

img,
svg {
  max-width: 100%;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

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

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shell--narrow {
  max-width: var(--shell-narrow);
}

.muted {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 34em;
}

.dot {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  vertical-align: middle;
  margin-inline: 0.15rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.6rem 1rem;
  background: var(--text);
  color: var(--bg);
  z-index: 10;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

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

.site-header {
  padding-block: 1.6rem;
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.wordmark {
  font-weight: 600;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 1.75rem;
  font-size: 0.925rem;
}

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

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

.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-footer {
  margin-top: 6rem;
  padding-block: 2rem 3rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}

.site-footer p {
  margin: 0;
}

.site-footer .muted {
  margin-top: 0.25rem;
  max-width: 40em;
}

/* ---------------------------------------------------------------
   Dashboard
   --------------------------------------------------------------- */

.page-dashboard .site-footer { margin-top: 3rem; }

.dash-head { padding-block: 2rem 1.25rem; }
.dash-head h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.6rem, 3.4vw, 2.15rem);
  max-width: 28em;
  letter-spacing: -0.025em;
}
.dash-head .lede { margin: 0; max-width: 42em; }

.status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.6rem;
  margin: 0 0 2.5rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}
.status-line--stale { color: var(--text); }
.status-line strong { color: var(--text); font-weight: 550; }

.dash-section { margin: 0 0 3.25rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.dash-section--future { opacity: 0.85; }
.section-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.section-note { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.925rem; max-width: 48em; }

.tag {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 550;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: 0.12em;
}
.tag--observed { color: var(--text); border-color: color-mix(in srgb, var(--text) 25%, transparent); }
.tag--predicted { color: #1d4ed8; border-color: color-mix(in srgb, #1d4ed8 35%, transparent); }
.tag--warn { color: #9a3412; border-color: color-mix(in srgb, #9a3412 35%, transparent); }
@media (prefers-color-scheme: dark) {
  .tag--predicted { color: #93c5fd; }
  .tag--warn { color: #fdba74; }
}

.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem 2rem;
  margin: 1.25rem 0 2rem;
}
.figure__label { margin: 0 0 0.35rem; font-size: 0.8rem; color: var(--muted); display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.figure__value {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.figure__unit { font-size: 0.45em; font-weight: 500; margin-left: 0.15em; color: var(--muted); }
.figure__note { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--muted); }

.forecast { margin-top: 0.5rem; }
.forecast__title { margin: 0 0 0.4rem; font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.forecast__meta { margin: 0 0 0.9rem; font-size: 0.9rem; color: var(--muted); max-width: 46em; }

.notice {
  margin: 1.5rem 0;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.notice h2 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.notice p { margin: 0; }
.notice--inline { margin: 0.9rem 0 0; font-size: 0.9rem; color: var(--muted); }

.table-scroll { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 0.55rem 0.7rem 0.55rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table thead th { color: var(--muted); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.02em; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table--compact th, .data-table--compact td { font-size: 0.85rem; }
.row-muted { color: var(--muted); }
.row-primary th { font-weight: 600; }
.table-caption { margin: 1.25rem 0 0.4rem; font-size: 0.95rem; }

.data-details { margin-top: 1rem; }
.data-details summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.data-details summary:hover { color: var(--text); }

.explainer { margin: 1.25rem 0 0; max-width: 48em; font-size: 0.925rem; }
.explainer p { margin: 0 0 0.75rem; }

.facts { margin: 0; display: grid; gap: 0.85rem; }
.facts div { display: grid; grid-template-columns: 11rem 1fr; gap: 0.75rem; padding-bottom: 0.85rem; border-bottom: 1px solid var(--line); }
.facts dt { margin: 0; color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.facts dd { margin: 0; font-size: 0.9rem; }
.facts code { font-size: 0.85em; }

.chart { margin: 0.5rem 0 0; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .line--observed { stroke: var(--text); }
.chart .line--frozen { stroke: #1d4ed8; }
.chart .line--adaptive { stroke: #0f766e; }
.chart .dot-end { fill: var(--text); }
.chart .zero { stroke: var(--text); stroke-width: 1; opacity: 0.35; }
.chart .bar--up { fill: color-mix(in srgb, var(--text) 22%, transparent); }
.chart .bar--down { fill: color-mix(in srgb, var(--text) 12%, transparent); }
.chart .pending { fill: var(--bg); stroke-width: 2; }
.chart .pending--frozen { stroke: #1d4ed8; }
.chart .pending--adaptive { stroke: #0f766e; }
@media (prefers-color-scheme: dark) {
  .chart .line--frozen { stroke: #93c5fd; }
  .chart .line--adaptive { stroke: #5eead4; }
  .chart .pending--frozen { stroke: #93c5fd; }
  .chart .pending--adaptive { stroke: #5eead4; }
}

.legend { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; margin: 0.85rem 0 0; font-size: 0.8rem; color: var(--muted); }
.legend .key { display: inline-block; width: 1.1rem; height: 0.55rem; margin-right: 0.35rem; vertical-align: middle; border-radius: 1px; }
.key--bar { background: color-mix(in srgb, var(--text) 22%, transparent); height: 0.7rem; }
.key--frozen { background: #1d4ed8; }
.key--adaptive { background: #0f766e; }
.key--pending { background: transparent; border: 2px solid #1d4ed8; height: 0.45rem; width: 0.45rem; border-radius: 50%; }
@media (prefers-color-scheme: dark) {
  .key--frozen { background: #93c5fd; }
  .key--adaptive { background: #5eead4; }
  .key--pending { border-color: #93c5fd; }
}

.toc { margin: 1.5rem 0 2rem; padding: 1rem 1.1rem 1rem 2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.toc ol { margin: 0; }
.toc a { text-decoration: none; }
.formula { font-size: 1.05rem; }
.overline { text-decoration: overline; }
.excluded { margin: 1rem 0 0; }
.excluded div { margin: 0 0 0.9rem; }
.excluded dt { font-weight: 500; }
.excluded dd { margin: 0.2rem 0 0; color: var(--muted); max-width: 42em; }

.preview-banner {
  margin: 0 0 1.25rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: var(--surface);
}

/* ---------------------------------------------------------------
   Prose (About + blog posts)
   --------------------------------------------------------------- */

.section-head {
  padding-block: 2rem 3rem;
}

.section-head h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
}

.prose {
  padding-block: 2rem 1rem;
}

.prose h1 {
  margin: 0 0 1.25rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
}

.prose h2 {
  margin: 2.75rem 0 0.75rem;
  font-size: 1.25rem;
}

.prose h3 {
  margin: 2rem 0 0.5rem;
  font-size: 1.05rem;
}

.prose p,
.prose li {
  max-width: 36em;
}

.prose ul,
.prose ol {
  padding-left: 1.15rem;
}

.prose li {
  margin-block: 0.35rem;
}

.prose blockquote {
  margin: 1.75rem 0;
  padding-left: 1.15rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

.prose code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 0.875em;
  background: color-mix(in srgb, var(--text) 7%, transparent);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.prose pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.prose pre code {
  background: none;
  padding: 0;
}

.prose hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
}

.prose th,
.prose td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.post-meta {
  margin: 0 0 2.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.back-link {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.925rem;
}

/* Band legend on the About page */

.bands {
  margin: 1.5rem 0 0;
  border-top: 1px solid var(--line);
}

.bands__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.bands__row dt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 500;
}

.bands__row dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.bands__swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------------------------------------------------------------
   Blog index
   --------------------------------------------------------------- */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.post-list__item {
  border-bottom: 1px solid var(--line);
}

.post-list__link {
  display: block;
  padding: 1.9rem 0;
  text-decoration: none;
}

.post-list__date {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.post-list__period {
  display: inline-block;
  margin-left: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.post-list__title {
  margin: 0.4rem 0 0.5rem;
  font-size: 1.3rem;
}

.post-list__summary {
  margin: 0;
  max-width: 40em;
  color: var(--muted);
}

.post-list__more {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.875rem;
  color: var(--accent);
}

.post-list__link:hover .post-list__title {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
