/* ============================================================================
   MPP Predictor — site design
   Palette: ivoire chaud + encre + oxblood + bleu d'archive.
   Type: Fraunces (display serif with character) + IBM Plex Sans (body) + IBM Plex Mono (data).
   ============================================================================ */

:root {
  --bg: #f5f2eb;
  --bg-alt: #ebe6da;
  --ink: #1b1a17;
  --muted: #5c5a54;
  --rule: #cec8b8;
  --accent: #7d2018;          /* deep oxblood — the one bold color */
  --data: #1e3a5f;            /* dark archival blue for numbers */
  --highlight: #f0d872;        /* muted saffron for text highlights */

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;

  --max-w: 68rem;
  --gutter: clamp(1.25rem, 3vw, 2.5rem);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}
a:hover { color: var(--ink); }

::selection { background: var(--highlight); color: var(--ink); }

/* ---------- Masthead ---------- */
.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.masthead-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.masthead-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
  order: 2;
}
.masthead-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  font-variation-settings: "opsz" 40;
  margin: 0;
  letter-spacing: -0.01em;
  order: 1;
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5.5rem) var(--gutter) clamp(2.5rem, 4vw, 4rem);
  border-bottom: 1px solid var(--rule);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.hero-headline {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96, "SOFT" 30;
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  color: var(--ink);
}
.hero-headline-em {
  font-style: italic;
  font-variation-settings: "opsz" 96, "SOFT" 100;
  color: var(--accent);
  font-weight: 400;
}
.hero-lede {
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
  max-width: 42ch;
}
.hero-lede em {
  color: var(--ink);
  font-style: italic;
}

.hero-stats {
  border-left: 1px solid var(--rule);
  padding-left: clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.stat-value {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96;
  font-weight: 500;
  font-size: clamp(2.25rem, 4vw, 2.75rem);
  line-height: 1;
  color: var(--data);
  letter-spacing: -0.02em;
}
.stat-unit {
  font-family: var(--font-mono);
  font-size: 0.55em;
  color: var(--muted);
  margin-left: 0.15em;
  font-weight: 400;
  vertical-align: super;
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  max-width: 22ch;
  line-height: 1.4;
}

/* ---------- Sections ---------- */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(3rem, 5vw, 4.5rem) var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.section:last-of-type { border-bottom: none; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--ink);
}
.section-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.section-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60;
  font-weight: 500;
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  margin: 0;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.section-body {
  display: grid;
  grid-template-columns: minmax(0, 62ch);
  gap: 1.25rem;
}
.section-body p { margin: 0; }
.section-body strong { font-weight: 600; color: var(--ink); }
.section-body em { font-style: italic; }

.highlight {
  background: linear-gradient(180deg, transparent 55%, var(--highlight) 55%);
  padding: 0 0.15em;
}

/* Wide sections that need to breathe for charts */
.section-wide .section-body { grid-template-columns: minmax(0, 62ch); }

/* ---------- Equation block ---------- */
.equation {
  margin: 0.5rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--ink);
  overflow-x: auto;
}
.equation .eq-line {
  display: block;
  white-space: nowrap;
}
.equation .eq-cont {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--rule);
  color: var(--muted);
}
.equation sub {
  font-family: var(--font-mono);
  font-size: 0.75em;
}

/* ---------- Chart figures ---------- */
.chart {
  margin: 2rem 0 0;
  padding: 0;
}
.chart img {
  width: 100%;
  border: 1px solid var(--rule);
  background: #fff;
  padding: 0.5rem;
}
.chart figcaption {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 62ch;
}
.chart figcaption strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Benchmark table ---------- */
.benchmark-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.benchmark-table th,
.benchmark-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}
.benchmark-table th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--ink);
}
.benchmark-table td.num {
  font-family: var(--font-mono);
  color: var(--data);
  font-weight: 500;
}
.benchmark-table .row-self {
  background: var(--bg-alt);
}
.benchmark-table .row-self td { color: var(--ink); }
.benchmark-table .delta-good { color: #2d6a4f; font-family: var(--font-mono); font-size: 0.9rem; }
.benchmark-table .delta-bad { color: var(--accent); font-family: var(--font-mono); font-size: 0.9rem; }

/* ---------- Footer ---------- */
.footer {
  background: var(--ink);
  color: var(--bg);
  padding: 3rem var(--gutter) 2rem;
  margin-top: 4rem;
}
.footer-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 2.5rem;
}
.footer-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 0.5rem;
}
.footer-desc {
  color: #a8a49a;
  font-size: 0.9rem;
  margin: 0;
}
.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a8a49a;
  margin: 0 0 0.75rem;
}
.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
}
.footer a {
  color: var(--bg);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.footer a:hover { border-bottom-color: var(--highlight); color: var(--highlight); }

/* ---------- Responsive: mobile ---------- */
@media (max-width: 780px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .hero-stats {
    border-left: none;
    border-top: 1px solid var(--rule);
    padding-left: 0;
    padding-top: 2rem;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.75rem 3rem;
  }
  .stat { flex: 1 1 8rem; }
  .stat-value { font-size: 2.1rem; }
  .masthead-inner { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .masthead-eyebrow { order: unset; }
  .masthead-title { order: unset; }
  .benchmark-table { font-size: 0.85rem; }
  .benchmark-table th, .benchmark-table td { padding: 0.6rem 0.5rem; }
}

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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