@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Newsreader:opsz,wght@6..72,500;6..72,650&display=swap");

:root {
  --ink: #172229;
  --muted: #617078;
  --paper: #f5f1e8;
  --surface: #fffdf8;
  --line: #d7d2c7;
  --teal: #0d615b;
  --teal-soft: #dcebe5;
  --saffron: #d8872f;
  --brick: #a7452f;
  --navy: #163447;
  --shadow: 0 18px 50px rgba(32, 43, 45, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 47px, rgba(167, 69, 47, 0.12) 47px 48px, transparent 48px),
    var(--paper);
  font-family: "Manrope", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  max-width: 100%;
  overflow-x: hidden;
}

button, select, input { font: inherit; }
a { color: inherit; }

.section-wrap {
  width: min(1460px, calc(100% - 64px));
  margin-inline: auto;
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(23, 34, 41, 0.12);
  background: rgba(245, 241, 232, 0.93);
  backdrop-filter: blur(14px);
}

.masthead-inner {
  width: min(1460px, calc(100% - 64px));
  min-height: 64px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.wordmark span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: white;
  background: var(--navy);
  border-radius: 50% 50% 50% 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.wordmark strong { font-size: 15px; }

.release-mark {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.release-mark span {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #3a8e62;
}

.hero {
  min-height: 410px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
  gap: 72px;
  align-items: end;
  padding-block: 72px 64px;
}
.hero-copy { min-width: 0; }

.kicker, .step-label {
  margin: 0 0 8px;
  color: var(--brick);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

h1, h2, h3 {
  margin-top: 0;
  font-family: "Newsreader", Georgia, serif;
  font-weight: 650;
  line-height: 1.04;
}

h1 {
  max-width: 900px;
  margin-bottom: 24px;
  font-size: clamp(48px, 6.4vw, 92px);
  letter-spacing: -0.045em;
}

h2 { font-size: clamp(29px, 3vw, 44px); letter-spacing: -0.025em; }
h3 { font-size: 25px; letter-spacing: -0.015em; }

.lede {
  max-width: 800px;
  margin: 0;
  color: #435158;
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.55;
}

.byline {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.hero-facts {
  display: grid;
  border-top: 4px solid var(--saffron);
  background: var(--navy);
  color: white;
  box-shadow: 14px 14px 0 rgba(13, 97, 91, 0.14);
}

.hero-facts div {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: baseline;
  gap: 14px;
  padding: 19px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.hero-facts div:last-child { border-bottom: 0; }
.hero-facts strong { font-family: "Newsreader", serif; font-size: 38px; }
.hero-facts span { color: rgba(255, 255, 255, 0.7); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }

.lab {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
  margin-bottom: 72px;
}

.controls, .results {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.controls {
  position: sticky;
  top: 86px;
  padding: 28px;
}

.controls-head h2 { margin-bottom: 22px; font-size: 31px; }

.mode-switch {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #eae5da;
  border-radius: 8px;
}

.mode-switch legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.mode-switch label { cursor: pointer; }
.mode-switch input { position: absolute; opacity: 0; }
.mode-switch span {
  display: block;
  padding: 10px 8px;
  border-radius: 7px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}
.mode-switch input:checked + span { color: white; background: var(--teal); }

.control-note, .download-note {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.control-field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.control-field > span, .standard-card > span {
  color: #3e4c52;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

select {
  width: 100%;
  min-height: 44px;
  padding: 9px 36px 9px 12px;
  border: 1px solid #c8c5bb;
  border-radius: 5px;
  color: var(--ink);
  background: white;
  outline: none;
}

select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13, 97, 91, 0.12); }

.standard-card {
  display: grid;
  gap: 5px;
  margin: 4px 0 22px;
  padding: 14px;
  border-left: 3px solid var(--saffron);
  background: #f3eee3;
}
.standard-card strong { font-size: 13px; }
.standard-card small { color: var(--muted); line-height: 1.45; }

.advanced-controls {
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.download-stack { display: grid; gap: 9px; margin-top: 22px; }
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--navy);
  border-radius: 4px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}
.button.primary { color: white; background: var(--navy); }
.button.primary:hover { background: #214a61; }
.button.secondary { color: var(--navy); background: transparent; }
.button.secondary:hover { background: #edf1f1; }
.download-note { margin-top: 10px; margin-bottom: 0; }

.results { min-width: 0; padding: clamp(24px, 4vw, 52px); }
.result-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.result-head h2 { margin-bottom: 12px; }
.signal-description { max-width: 800px; margin: 0; color: var(--muted); font-size: 16px; }
.method-pill {
  flex: 0 0 auto;
  max-width: 270px;
  padding: 7px 11px;
  border: 1px solid #b9d0c8;
  border-radius: 999px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.definition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 30px 0;
  background: var(--line);
  border: 1px solid var(--line);
}
.definition-grid div { padding: 18px 20px; background: #f8f5ed; }
.definition-grid span { color: var(--brick); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.definition-grid p { margin: 6px 0 0; font-size: 13px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.metric { min-width: 0; padding: 16px 18px; border-top: 3px solid var(--teal); background: #f1eee6; }
.metric span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.metric strong { display: block; margin-top: 4px; font-family: "Newsreader", serif; font-size: 29px; line-height: 1.1; }
.metric small { color: var(--muted); font-size: 10px; }

.chart-card { padding: 22px 22px 10px; border: 1px solid var(--line); background: white; }
.chart-head { display: flex; justify-content: space-between; gap: 20px; align-items: end; }
.chart-head h3 { margin-bottom: 0; }
.chart-head > p { margin: 0; color: var(--muted); font-size: 11px; }
.chart { width: 100%; min-height: 390px; margin-top: 10px; overflow: hidden; }
.chart svg { display: block; width: 100%; height: 390px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 18px; margin: -12px 0 12px 58px; font-size: 11px; }
.legend-swatch { display: inline-block; width: 18px; height: 3px; margin-right: 6px; vertical-align: middle; }
.empty { display: grid; place-items: center; min-height: 330px; color: var(--muted); }

.method-guide { margin-top: 22px; border: 1px solid var(--line); background: #f8f5ed; }
.method-guide summary { padding: 15px 18px; cursor: pointer; font-weight: 700; font-size: 13px; }
.method-explanation { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; padding: 0 18px 20px; }
.method-explanation p { margin: 0; color: #435158; font-size: 12px; }
.method-explanation strong { color: var(--ink); }

.data-table-section { margin-top: 30px; }
.table-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.table-head h3 { margin-bottom: 0; }
.table-head > p { max-width: 470px; margin: 0; color: var(--muted); font-size: 11px; text-align: right; }
.table-wrap { max-height: 560px; margin-top: 12px; overflow: auto; border: 1px solid var(--line); background: white; }
table { width: 100%; border-collapse: collapse; font-size: 11px; font-variant-numeric: tabular-nums; }
th { position: sticky; top: 0; z-index: 1; padding: 10px 12px; color: white; background: var(--navy); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
td { padding: 9px 12px; border-bottom: 1px solid #ece9e1; text-align: right; white-space: nowrap; }
tbody tr:nth-child(even) { background: #faf8f3; }

.reader-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 80px; background: var(--line); border: 1px solid var(--line); }
.reader-notes article { padding: 30px; background: #ece7dc; }
.reader-notes h2 { margin-bottom: 12px; font-size: 29px; }
.reader-notes p:last-child { margin-bottom: 0; color: var(--muted); font-size: 13px; }

footer { padding-block: 22px; color: rgba(255,255,255,0.72); background: var(--navy); font-size: 11px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; }
.footer-inner p { margin: 0; }

@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr; gap: 36px; }
  .hero-facts { grid-template-columns: repeat(3, 1fr); }
  .hero-facts div { grid-template-columns: 1fr; gap: 0; }
  .lab { grid-template-columns: 300px minmax(0, 1fr); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .reader-notes { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  body { background: var(--paper); }
  .section-wrap, .masthead-inner { width: calc(100% - 28px); max-width: 1460px; }
  .release-mark { display: none; }
  .hero { min-height: 0; padding-block: 48px 40px; }
  h1 { max-width: 100%; font-size: clamp(42px, 12vw, 54px); overflow-wrap: break-word; }
  .hero-facts { grid-template-columns: 1fr; box-shadow: 8px 8px 0 rgba(13, 97, 91, 0.14); }
  .hero-facts div { grid-template-columns: minmax(112px, max-content) 1fr; }
  .lab { display: block; }
  .controls { position: static; margin-bottom: 18px; }
  .results { padding: 24px 18px; }
  .result-head, .chart-head, .table-head { display: block; }
  .method-pill { display: inline-block; margin-top: 16px; }
  .definition-grid, .method-explanation { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .chart-card { padding: 18px 8px 8px; }
  .chart-head { padding-inline: 8px; }
  .chart-head > p { margin-top: 6px; }
  .chart { min-height: 320px; }
  .chart svg { height: 320px; }
  .chart-legend { margin-left: 48px; }
  .table-head > p { margin-top: 8px; text-align: left; }
  .reader-notes article { padding: 24px; }
  .footer-inner { display: block; }
}

@media (max-width: 440px) {
  .wordmark strong { font-size: 13px; }
  .controls { padding: 22px 18px; }
  .metrics { gap: 8px; }
  .metric { padding: 13px; }
  .metric strong { font-size: 24px; }
}
