:root {
  --lab-bg: #f7f7f5;
  --lab-text: #171918;
  --lab-blue: #2447d8;
  --lab-blue-dark: #1936b0;
  --lab-muted: #686a67;
  --lab-line: #d8d9d5;
  --lab-white: #ffffff;
  --lab-max: 1440px;
  --lab-pad: clamp(20px, 3.4vw, 52px);
  --lab-font: "Helvetica Neue", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--lab-bg);
  color: var(--lab-text);
  font-family: var(--lab-font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select { font: inherit; }

a { color: inherit; }

button,
select { cursor: pointer; }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 12px;
  top: 12px;
  padding: 12px 16px;
  background: var(--lab-white);
  color: var(--lab-blue);
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

:focus-visible {
  outline: 3px solid var(--lab-blue);
  outline-offset: 3px;
}

.site-header,
main,
.site-footer {
  width: min(100%, var(--lab-max));
  margin-inline: auto;
}

.site-header {
  min-height: 70px;
  padding: 0 var(--lab-pad);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(24px, 4vw, 72px);
  border-bottom: 1px solid var(--lab-line);
}

.wordmark {
  color: var(--lab-text);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .22em;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav {
  min-height: 70px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: clamp(22px, 3vw, 48px);
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--lab-text);
  text-decoration: none;
  white-space: nowrap;
}

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

.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  height: 3px;
  inset: auto 0 0;
  background: var(--lab-blue);
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 48px;
  border: 0;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  text-decoration: none;
}

.primary-button {
  background: var(--lab-blue);
  color: var(--lab-white);
}

.primary-button:hover { background: var(--lab-blue-dark); }

.secondary-button {
  border: 1px solid var(--lab-text);
  background: transparent;
  color: var(--lab-text);
}

.secondary-button:hover { border-color: var(--lab-blue); color: var(--lab-blue); }

.text-button {
  padding-inline: 8px;
  background: transparent;
  color: var(--lab-muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-button:hover { color: var(--lab-text); }

main { padding-inline: var(--lab-pad); }

.lab-hero {
  min-height: 138px;
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(320px, .78fr);
  align-items: center;
  gap: clamp(48px, 9vw, 136px);
  border-bottom: 1px solid var(--lab-line);
}

.lab-hero h1 {
  margin: 0;
  font-size: clamp(3rem, 4.6vw, 4.25rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .98;
}

.lab-hero p {
  max-width: 43ch;
  margin: 0;
  font-size: clamp(1.2rem, 1.55vw, 1.5rem);
  line-height: 1.32;
}

.verdict {
  min-height: 120px;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(500px, 1fr);
  align-items: stretch;
  border-bottom: 1px solid var(--lab-line);
}

.verdict-statement {
  display: flex;
  align-items: center;
  border-left: 6px solid var(--lab-blue);
  padding: 20px 28px;
}

.verdict-statement h2 {
  margin: 0;
  font-size: clamp(1.65rem, 2.25vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.15;
}

.verdict-metrics {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.verdict-metrics div {
  min-width: 0;
  padding: 22px 18px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: center;
  text-align: center;
  border-left: 1px solid var(--lab-line);
}

.verdict-metrics dt { color: var(--lab-muted); font-size: 14px; }
.verdict-metrics dd { margin: 0 0 2px; font-size: clamp(1.25rem, 1.6vw, 1.65rem); line-height: 1.15; }

.scenario {
  padding: 20px 0;
  border-bottom: 1px solid var(--lab-line);
}

#scenario-form {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(310px, 1.25fr) minmax(180px, .72fr) auto;
  gap: 28px;
  align-items: end;
}

.field { min-width: 0; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field select,
.input-unit {
  width: 100%;
  min-height: 50px;
  border: 1px solid #9a9c98;
  border-radius: 0;
  background: transparent;
  color: var(--lab-text);
}

.field select,
.field input { padding: 11px 14px; }

.input-unit {
  display: flex;
  align-items: center;
}

.input-unit input {
  min-width: 0;
  border: 0;
  background: transparent;
}

.input-unit span {
  flex: 0 0 auto;
  padding-right: 14px;
  color: var(--lab-muted);
}

.calculate-button { min-width: 164px; }

.advanced-settings {
  border-top: 1px solid var(--lab-line);
  margin-top: 28px;
  padding-top: 14px;
}

.advanced-settings summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--lab-blue);
  font-weight: 500;
  cursor: pointer;
}

.advanced-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 28px;
}

.advanced-note,
.status {
  margin: 12px 0 0;
  color: var(--lab-muted);
  font-size: 14px;
}

.status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.comparison,
.analysis,
.economics,
.method,
.local-data,
.contact-band { border-bottom: 1px solid var(--lab-line); }

.comparison { padding: 20px 0 0; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  margin-bottom: 10px;
}

.section-heading h2,
.chart-panel h2,
.economics h2,
.method h2,
.local-data h2,
.contact-band h2 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-weight: 500;
  letter-spacing: -.025em;
  line-height: 1.15;
}

.section-heading p,
.local-data p,
.contact-band p { margin: 5px 0 0; color: var(--lab-muted); }

.section-heading a,
.text-link { color: var(--lab-blue); text-underline-offset: 4px; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; min-width: 850px; }

th,
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--lab-line);
  text-align: left;
  vertical-align: top;
}

thead th { font-size: 14px; font-weight: 600; border-bottom-color: var(--lab-text); }
tbody th { font-weight: 500; }
.selected-row th:first-child { border-left: 4px solid var(--lab-blue); }

.analysis {
  min-height: 365px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .96fr);
}

.chart-panel {
  margin: 0;
  padding: 24px 32px 20px 0;
  border-right: 1px solid var(--lab-line);
}

.chart-panel figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.legend { display: flex; gap: 20px; color: var(--lab-muted); font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 9px; }
.legend-line { width: 30px; border-top: 3px solid var(--lab-blue); }
.legend-line-dashed { border-top-style: dashed; }
#cost-chart { width: 100%; height: 240px; margin-top: 14px; overflow: visible; }
.chart-grid { stroke: var(--lab-line); stroke-width: 1; }
.chart-label { fill: var(--lab-muted); font-family: var(--lab-font); font-size: 12px; }
.chart-series { stroke: var(--lab-blue); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart-series-dashed { stroke-dasharray: 8 7; stroke-width: 2.5; }
.chart-point { fill: var(--lab-blue); }
.chart-point-secondary { fill: var(--lab-bg); stroke: var(--lab-blue); stroke-width: 2; }

.interpretation {
  padding: 28px 0 20px 44px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.interpretation h2 {
  max-width: 24ch;
  margin: 0 0 14px;
  font-size: clamp(2rem, 2.4vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -.035em;
  line-height: 1.08;
}

.interpretation p { max-width: 57ch; margin: 0 0 10px; font-size: 15px; }
.interpretation .text-link { margin-top: 6px; }
.interpretation .provenance { margin-top: auto; padding-top: 14px; color: var(--lab-muted); font-size: 12px; white-space: nowrap; }

.economics { padding: 48px 0; }

.economics-results {
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--lab-line);
}

.economics-results div { padding: 22px 20px 4px 0; border-right: 1px solid var(--lab-line); }
.economics-results div + div { padding-left: 20px; }
.economics-results div:last-child { border-right: 0; }
.economics-results dt { min-height: 48px; color: var(--lab-muted); }
.economics-results dd { margin: 8px 0 2px; font-size: clamp(1.5rem, 2.2vw, 2.2rem); line-height: 1.1; }
.economics-results small,
.method-list small { color: var(--lab-muted); font-size: 13px; }

.method {
  padding: 54px 0;
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 80px;
}

.method-copy p { max-width: 48ch; margin: 14px 0 0; color: var(--lab-muted); }
.method-list { margin: 0; }
.method-list div { display: grid; grid-template-columns: 1.4fr .8fr .8fr; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--lab-line); }
.method-list dt { font-weight: 500; }
.method-list dd { margin: 0; }

.local-data,
.contact-band {
  padding: 42px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 48px;
}

.local-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.contact-band { padding-block: 58px; }
.contact-band > div { max-width: 780px; }

.site-footer {
  min-height: 96px;
  padding: 0 var(--lab-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--lab-muted);
  font-size: 14px;
}

.site-footer span:first-child { color: var(--lab-text); font-weight: 600; letter-spacing: .14em; }

.benchmark-page { padding-bottom: 0; }

.breadcrumb {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--lab-line);
  color: var(--lab-muted);
  font-size: 14px;
}

.breadcrumb a { color: var(--lab-blue); text-underline-offset: 3px; }

.benchmark-hero {
  min-height: 390px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  align-items: center;
  gap: clamp(48px, 9vw, 136px);
  border-bottom: 1px solid var(--lab-line);
}

.benchmark-type { margin: 0 0 20px; color: var(--lab-blue); }

.benchmark-hero h1 {
  max-width: 15ch;
  margin: 0;
  font-size: clamp(3rem, 5.3vw, 5.25rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .98;
}

.benchmark-hero > p {
  max-width: 42ch;
  margin: 0;
  font-size: clamp(1.35rem, 1.8vw, 1.75rem);
  line-height: 1.35;
}

.benchmark-answer {
  padding: 38px 0;
  display: grid;
  grid-template-columns: .55fr 1.4fr auto;
  align-items: center;
  gap: 40px;
  border-bottom: 1px solid var(--lab-line);
}

.benchmark-answer h2,
.benchmark-facts h2,
.benchmark-cost h2,
.benchmark-reading h2 {
  margin: 0;
  font-size: clamp(1.7rem, 2.4vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -.03em;
  line-height: 1.15;
}

.benchmark-answer p { margin: 0; font-size: 1.2rem; }
.benchmark-facts { padding: 52px 0; border-bottom: 1px solid var(--lab-line); }

.facts-list {
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--lab-text);
}

.facts-list div {
  display: grid;
  grid-template-columns: 1.1fr .9fr .9fr;
  gap: 18px;
  padding: 15px 18px 15px 0;
  border-bottom: 1px solid var(--lab-line);
}

.facts-list div:nth-child(odd) { border-right: 1px solid var(--lab-line); }
.facts-list div:nth-child(even) { padding-left: 18px; }
.facts-list dt { font-weight: 500; }
.facts-list dd { margin: 0; }
.facts-list small { color: var(--lab-muted); }

.benchmark-cost,
.benchmark-reading {
  padding: 56px 0;
  display: grid;
  grid-template-columns: .72fr 1.28fr;
  gap: 80px;
  border-bottom: 1px solid var(--lab-line);
}

.benchmark-cost p { max-width: 45ch; color: var(--lab-muted); }
.benchmark-cost dl { margin: 0; }
.benchmark-cost dl div { display: flex; justify-content: space-between; gap: 28px; padding: 14px 0; border-bottom: 1px solid var(--lab-line); }
.benchmark-cost dd { margin: 0; font-weight: 500; }
.benchmark-reading p { max-width: 62ch; }
.reading-lead { margin: 20px 0 0; font-size: clamp(1.45rem, 2vw, 2rem); line-height: 1.25; }

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

@media (max-width: 1120px) {
  .site-header { grid-template-columns: auto 1fr auto; gap: 24px; }
  .site-nav { justify-content: flex-end; gap: 22px; }
  .site-nav a:nth-child(1),
  .site-nav a:nth-child(2),
  .site-nav a:nth-child(4),
  .site-nav a:nth-child(5) { display: none; }
  .verdict { grid-template-columns: 1fr; }
  .verdict-metrics { border-top: 1px solid var(--lab-line); }
  #scenario-form { grid-template-columns: 1fr 1.2fr 1fr; }
  .calculate-button { grid-column: 3; }
  .economics-results { grid-template-columns: repeat(2, 1fr); }
  .economics-results div:nth-child(2) { border-right: 0; }
}

@media (max-width: 760px) {
  .site-header { min-height: 74px; grid-template-columns: 1fr auto; }
  .site-nav { display: none; }
  .wordmark { font-size: 16px; }
  .header-cta { min-height: 44px; padding-inline: 14px; }
  .lab-hero { min-height: 300px; grid-template-columns: 1fr; align-content: center; gap: 28px; }
  .lab-hero h1 { font-size: clamp(3rem, 14vw, 4.4rem); }
  .lab-hero p { font-size: 1.35rem; }
  .verdict-statement { padding: 24px 18px; }
  .verdict-metrics { grid-template-columns: 1fr; }
  .verdict-metrics div { min-height: 74px; border-left: 0; border-bottom: 1px solid var(--lab-line); text-align: left; }
  #scenario-form { grid-template-columns: 1fr; gap: 18px; }
  .calculate-button,
  .advanced-settings { grid-column: auto; grid-row: auto; }
  .advanced-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .analysis { grid-template-columns: 1fr; }
  .chart-panel { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--lab-line); }
  .chart-panel figcaption { align-items: flex-start; flex-direction: column; }
  .interpretation { padding-left: 0; }
  .interpretation h2 { font-size: 2rem; }
  .interpretation .provenance { white-space: normal; }
  .economics-results { grid-template-columns: 1fr; }
  .economics-results div,
  .economics-results div + div { padding: 18px 0; border-right: 0; border-bottom: 1px solid var(--lab-line); }
  .economics-results dt { min-height: 0; }
  .method { grid-template-columns: 1fr; gap: 32px; }
  .method-list div { grid-template-columns: 1fr; gap: 2px; }
  .local-data,
  .contact-band { align-items: flex-start; flex-direction: column; }
  .local-actions { align-items: stretch; justify-content: flex-start; flex-direction: column; width: 100%; }
  .contact-band .primary-button { width: 100%; }
  .site-footer { padding-block: 28px; align-items: flex-start; flex-direction: column; gap: 8px; }
  .benchmark-hero { min-height: 480px; grid-template-columns: 1fr; align-content: center; gap: 36px; }
  .benchmark-hero h1 { font-size: clamp(2.8rem, 13vw, 4.2rem); }
  .benchmark-answer { grid-template-columns: 1fr; gap: 20px; }
  .benchmark-answer .primary-button { width: 100%; }
  .facts-list { grid-template-columns: 1fr; }
  .facts-list div,
  .facts-list div:nth-child(even) { grid-template-columns: 1fr; gap: 2px; padding: 14px 0; border-right: 0; }
  .benchmark-cost,
  .benchmark-reading { grid-template-columns: 1fr; gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
