@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-latin-400-italic.woff2") format("woff2");
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Inter Variable";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono Variable";
  src: url("fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}
html {
  scroll-behavior: smooth;
}
button,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
a {
  text-underline-offset: 4px;
}
.topbar {
  padding: 1rem var(--gutter);
}
.topbar__pill {
  max-width: 1240px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  gap: 1rem;
}
.mark {
  font:
    1.25rem "Instrument Serif",
    serif;
  text-decoration: none;
}
.navlinks {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.8125rem;
}
.navlinks a {
  text-decoration: none;
}
.theme {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  padding: 0.3rem 0.8rem;
  font:
    0.6875rem "JetBrains Mono Variable",
    monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.theme:before {
  content: " ";
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--rust);
  border-radius: 50%;
  margin-right: 8px;
}
.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 6rem;
  padding: 4.5rem 0 3.5rem;
  align-items: end;
}
h1 {
  font-size: clamp(3.2rem, 7vw, 5.4rem);
  margin: 1rem 0 1.4rem;
}
.lead {
  max-width: 48ch;
  font-size: 1.125rem;
  color: var(--ink-soft);
}
.hero-note {
  border-left: 1px solid var(--line);
  padding: 1rem 0 1rem 2rem;
}
.hero-note h2 {
  font-size: 2rem;
  margin: 0.8rem 0;
}
.hero-note p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}
.hero-note a {
  font-size: 0.8125rem;
}
.notice {
  border: 1px solid var(--line);
  background: var(--paper-raised);
  padding: 1rem 1.3rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
section.explorer,
section.performance,
section.models {
  margin-top: 3.5rem;
}
.models-intro {
  max-width: 80ch;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
section.models .table-scroll {
  max-height: none;
}
section.models td {
  vertical-align: top;
}
.model-name {
  white-space: normal;
  min-width: 18rem;
  font-weight: 600;
}
.model-name small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.25rem;
  max-width: 55ch;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
h2 {
  font-size: var(--step-h2);
}
.section-head h2 {
  margin-top: 0.7rem;
}
.controls {
  display: flex;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: end;
}
.date-label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.6875rem;
  color: var(--muted);
}
select {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.6rem;
  font-size: 0.8125rem;
}
.chart-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  background: var(--paper-raised);
}
.chart-top,
.chart-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  font-size: 0.8125rem;
}
.chart-top {
  margin-bottom: 1rem;
}
.legend {
  display: flex;
  gap: 1.2rem;
  white-space: nowrap;
}
.legend span:before {
  content: "";
  display: inline-block;
  width: 20px;
  margin-right: 7px;
  vertical-align: middle;
  border-top: 2px solid var(--rust);
}
.legend .actual-key:before {
  border-color: var(--ink-soft);
  border-top-style: dashed;
}
svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
svg text {
  fill: var(--muted);
  font:
    11px "JetBrains Mono Variable",
    monospace;
}
.grid-line {
  stroke: var(--line);
  stroke-width: 1;
}
.forecast-line {
  stroke: var(--rust);
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.actual-line {
  stroke: var(--ink-soft);
  fill: none;
  stroke-width: 1.7;
  stroke-dasharray: 5 4;
}
.crosshair {
  stroke: var(--muted);
  stroke-dasharray: 3 4;
}
.chart-bottom {
  min-height: 2rem;
}
output {
  font-size: 0.75rem;
  color: var(--ink-soft);
}
#slot {
  width: 100%;
  accent-color: var(--rust);
}
.slider-label {
  font-size: 0.6875rem;
  color: var(--muted);
}
.day-facts {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.75rem;
}
details {
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0 1rem;
}
summary {
  cursor: pointer;
  font-size: 0.8125rem;
}
summary span {
  float: right;
}
.table-scroll {
  max-height: 300px;
  overflow: auto;
  margin-top: 1rem;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.75rem;
  text-align: left;
}
th,
td {
  padding: 0.6rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
  padding: 1.6rem 0;
  gap: 1rem;
}
.metric-value {
  font:
    clamp(2.5rem, 4vw, 3.5rem) "Instrument Serif",
    serif;
  color: var(--rust);
}
.metric-value small {
  font:
    0.75rem "Inter Variable",
    sans-serif;
  color: var(--muted);
}
.muted {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 1rem;
}
.daily-errors {
  margin-top: 2rem;
}
#error-bars {
  display: flex;
  gap: 12px;
  align-items: end;
  height: 125px;
  margin-top: 1rem;
  overflow-x: auto;
  padding-bottom: 24px;
}
.error-day {
  flex: 1;
  min-width: 45px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  position: relative;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
}
.error-day .bar {
  background: var(--rust-tint);
  border-top: 2px solid var(--rust);
  width: 100%;
  min-height: 2px;
}
.error-day:hover .bar {
  background: var(--rust);
}
.error-day .value {
  font:
    10px "JetBrains Mono Variable",
    monospace;
  margin-bottom: 4px;
}
.error-day .day {
  position: absolute;
  bottom: -22px;
  font:
    10px "JetBrains Mono Variable",
    monospace;
}
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  padding-top: 2.5rem;
}
.bottom-grid h2 {
  margin: 1rem 0 1.2rem;
}
.bottom-grid p:not(.label):not(.muted) {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: 1rem;
  max-width: 53ch;
}
.job {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.job small {
  display: block;
  color: var(--muted);
  font-size: 0.6875rem;
}
.job-status {
  color: var(--rust);
  text-align: right;
}
.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-block: 2rem;
  margin-top: 4rem;
  border-top: 1px solid var(--line);
}
.foot a {
  font-size: 0.8125rem;
}
.foot .label a {
  font-size: inherit;
}
.empty {
  padding: 4rem 1rem;
  text-align: center;
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.skip {
  position: absolute;
  left: 1rem;
  top: -100px;
  background: var(--paper);
  padding: 1rem;
  z-index: 20;
}
.skip:focus {
  top: 1rem;
}
@media (max-width: 900px) {
  .hero {
    gap: 2rem;
    grid-template-columns: 1.5fr 1fr;
  }
  .section-head {
    align-items: start;
    flex-direction: column;
  }
  .controls {
    justify-content: start;
  }
  .bottom-grid {
    gap: 2.5rem;
  }
  .chart-panel {
    padding: 1rem;
  }
  .hero {
    padding-top: 3rem;
  }
}
@media (max-width: 600px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 2rem;
  }
  .hero-note {
    padding-left: 1.2rem;
  }
  .navlinks a {
    display: none;
  }
  .mark {
    font-size: 1.1rem;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
  }
  .bottom-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .chart-top,
  .chart-bottom {
    align-items: start;
    flex-direction: column;
    gap: 0.6rem;
  }
  .chart-bottom {
    margin-top: 0.8rem;
  }
  .controls {
    gap: 0.8rem;
  }
  .hero {
    gap: 1.5rem;
  }
  .chart-panel {
    padding: 0.8rem;
  }
  h1 {
    font-size: 3.7rem;
  }
  .label {
    letter-spacing: 0.1em;
  }
  #chart {
    min-height: 190px;
  }
  .day-facts {
    gap: 0.5rem 1rem;
  }
  /* Each model becomes a block: name and description on top, then role and
     errors side by side, so the numbers stay on screen without scrolling. */
  section.models thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  section.models table,
  section.models tbody {
    display: block;
  }
  section.models tr {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
  }
  section.models td {
    padding: 0;
    border: 0;
    white-space: normal;
  }
  section.models .model-name {
    grid-column: 1 / -1;
    min-width: 0;
  }
  section.models td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.2rem;
    font:
      0.625rem "JetBrains Mono Variable",
      monospace;
    color: var(--muted);
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}

.pipeline {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  padding-top: 2.5rem;
}
.pipeline-intro {
  max-width: 80ch;
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.loop {
  margin: 1.75rem 0 0;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-raised);
}
.loop-svg {
  display: block;
  width: 100%;
  max-width: 1000px;
  height: auto;
  margin-inline: auto;
}

/* --- the drawing ---------------------------------------------------------
   Every colour comes from a token, so the loop follows the theme toggle
   without a second palette. */
.loop-card {
  fill: var(--paper);
  stroke: var(--line);
  stroke-width: 1;
}
.loop-card--planned {
  fill: none;
  stroke: var(--muted);
  stroke-dasharray: 5 4;
}
.loop-num {
  fill: var(--rust);
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.loop-num--planned {
  fill: var(--muted);
}
.loop-title {
  fill: var(--ink);
  font-family: "Inter Variable", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
}
.loop-tool {
  fill: var(--muted);
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: 11px;
}
.loop-track {
  fill: none;
  stroke: var(--rust);
  stroke-width: 1.5;
}
.loop-head {
  fill: var(--rust);
}
.loop-edge {
  fill: var(--rust);
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: 11px;
}
.loop-centre-label {
  fill: var(--muted);
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
}
.loop-centre {
  fill: var(--ink-soft);
  font-family: "JetBrains Mono Variable", ui-monospace, monospace;
  font-size: 11.5px;
}
.loop-inner {
  fill: none;
  stroke: var(--muted);
}
.loop-inner-title {
  fill: var(--ink-soft);
  font-family: "Inter Variable", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
}
.loop-inner-note {
  fill: var(--muted);
  font-family: "Inter Variable", system-ui, sans-serif;
  font-size: 12px;
}

/* The drawing is aria-hidden, so this list is what a screen reader reads. */
.loop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.stage-number {
  font:
    0.6875rem "JetBrains Mono Variable",
    monospace;
  color: var(--rust);
}
.tool {
  font:
    0.625rem/1.7 "JetBrains Mono Variable",
    monospace;
  color: var(--muted);
}

/* On phones the drawing is scaled down whole rather than rebuilt, so the
   loop keeps its shape; the panel padding shrinks to give it the full width. */
@media (max-width: 860px) {
  .loop {
    padding: 0.6rem;
  }
}
