/* Sections already reserve room for the fixed masthead: do not offset them twice. */
html { scroll-padding-top: 0; }

/* Fit desktop chapters to the available height while keeping their natural flow.
   Open detail tables and narrow/mobile layouts can still grow and scroll. */
@media screen and (min-width: 1100px) {
  :root { --deck-gap: clamp(14px, 2.2dvh, 26px); }
  .masthead { height: 64px; }
  .identity img { height: 54px; }
  .chapter {
    min-height: 100dvh;
    padding: clamp(84px, 10.5dvh, 114px) 6vw clamp(66px, 8dvh, 90px);
  }
  h2 { font-size: clamp(38px, 5.9dvh, 66px); }
  .section-heading { margin-bottom: var(--deck-gap); }
  .section-heading .eyebrow { margin-bottom: 12px; }
  .section-heading h2 { margin-bottom: 14px; }
  .lead { font-size: clamp(14px, 1.8dvh, 19px); line-height: 1.5; max-width: 870px; }
  .footnote { margin-top: 16px; font-size: 11px; line-height: 1.5; }
  .chart-heading { margin-bottom: 18px; }
  .hero { min-height: 100dvh; }
  .hero h1 { font-size: clamp(66px, 11dvh, 118px); }
  .hero .eyebrow { margin-bottom: 20px; }
  .hero-deck { font-size: clamp(16px, 2.2dvh, 22px); margin: 22px 0; }
  .hero-stage { margin-top: 0; }
  .program-card { width: min(28vw, 39dvh); max-width: 400px; }
  .floating-metric { width: min(340px, 34dvh); padding: 18px 22px; }
  .floating-metric b { font-size: clamp(48px, 7dvh, 70px); letter-spacing: -.065em; }
  .floating-metric div > span { font-size: 11px; }
  .floating-metric small { font-size: 7px; }
  .commission { margin-top: 25px; }
  .hero-bottom { bottom: 22px; padding-top: 12px; }
  .hero-bottom > span:last-child { padding-right: 140px; }
  .giant-number { font-size: clamp(120px, 18dvh, 190px); }
  .data-stat h3 { font-size: 29px; margin: 4px 0 12px; }
  .data-stat p { font-size: 13px; margin-bottom: 10px; }
  .source-stack article { padding: 14px 0; gap: 18px; }
  .source-stamp { flex-basis: 52px; width: 52px; height: 52px; font-size: 10px; }
  .source-stack h3 { font-size: 18px; margin: 0 0 5px; }
  .source-stack p { font-size: 12px; line-height: 1.5; }
  .evidence-strip { margin-top: 24px; padding-top: 18px; gap: 28px; }
  .evidence-strip b { font-size: 29px; }
  .missing-grid { gap: 28px; }
  .missing-grid article { padding-top: 18px; }
  .index { font-size: 36px; margin-bottom: 16px; }
  .missing-grid h3 { font-size: 21px; margin-bottom: 10px; }
  .missing-grid p { font-size: 13px; line-height: 1.55; }
  .missing-grid small { margin-top: 18px; }
  .pull-quote { font-size: clamp(27px, 3.7dvh, 40px); margin: 26px 0 4px; padding: 10px 0; }
  .assumption-grid article { padding: 18px 10px 16px 0; }
  .assumption-grid h3 { font-size: 29px; margin: 15px 0; }
  .assumption-grid p { font-size: 12px; line-height: 1.5; }
  .formula { padding: 14px 18px; margin-top: 16px; }
  .formula b { padding: 8px 12px; }
  .cost-layout { gap: 7vw; }
  .cost-layout h2 { font-size: clamp(92px, 14dvh, 154px); margin: 22px 0; }
  .cost-layout .lead { font-size: clamp(14px, 1.9dvh, 18px); }
  .cost-equation { margin-top: 22px; }
  .axis-row { margin-bottom: 21px; }
  .chart-note { margin-top: 22px; }
  .ticker { margin-top: 45px; padding: 18px 0; font-size: 22px; }
  .funding-row { padding: 13px 0; }
  .funding-row h3 { font-size: 16px; }
  .funding-row p { line-height: 1.5; }
  .funding-row > b { font-size: 23px; }
  .funding-orb { width: clamp(180px, 25dvh, 240px); height: clamp(180px, 25dvh, 240px); padding: 21px; margin: 20px auto; }
  .funding-orb b { font-size: 35px; }
  .funding-summary > p { font-size: 12px; margin-top: 15px; }
  .editor-note { margin-top: 24px; padding: 14px 20px; }
  .editor-note p { font-size: 12px; line-height: 1.5; }
  .chart-legend { margin: 10px 0 18px; }
  .annual-pair { height: clamp(145px, 22dvh, 220px); }
  .annual-columns { padding-top: 12px; padding-bottom: 20px; }
  .three-notes { gap: 30px; margin-top: 22px; }
  .three-notes p { font-size: 11px; line-height: 1.5; margin-top: 8px; }
  .data-details { margin-top: 12px; }
  .debt-box { padding: 18px 24px 8px; }
  .debt-svg { max-height: clamp(180px, 26dvh, 300px); }
  .debt-box .chart-heading { margin-bottom: 10px; }
  .debt-box .chart-legend { margin: 10px 0; }
  .debt-callouts { margin-top: 18px; gap: 26px; }
  .debt-callouts article, .debt-callouts .pink-panel { padding-top: 15px; padding-bottom: 15px; }
  .debt-callouts b { font-size: clamp(23px, 3dvh, 30px); }
  .debt-callouts p { font-size: 11px; line-height: 1.5; margin-top: 7px; }
  .sim-controls { padding: 0; }
  .segmented { margin-bottom: 18px; }
  .sim-controls label { margin: 15px 0 4px; }
  .sim-controls input[type=range] { height: 30px; }
  .sim-assumptions { margin-top: 10px; padding-top: 13px; line-height: 1.5; }
  .sim-results { padding: 25px 30px; }
  .sim-main { margin: 18px 0 24px; }
  .sim-main b { font-size: clamp(72px, 11dvh, 114px); }
  .sim-mini { padding-top: 17px; }
  .sim-results > p { margin-top: 18px; font-size: 11px; line-height: 1.6; }
  .proof-grid { gap: 15px 55px; }
  .proof-grid article { padding: 16px 0; }
  .proof-grid h3 { font-size: 21px; max-width: none; margin: 12px 0 8px; }
  .proof-grid p { font-size: 13px; line-height: 1.5; }
  .verification-banner { margin-top: 20px; padding: 20px 25px; }
  .verification-banner b { font-size: 29px; }
  .conditions-list article { padding: 17px 0; gap: 24px; }
  .conditions-list h3 { font-size: 20px; }
  .conditions-list p { font-size: 12px; line-height: 1.5; }
  .final-brand { margin-bottom: 20px; }
  .final-brand img { width: 100px; height: 50px; }
  .final-chapter h2 { font-size: clamp(58px, 8.4dvh, 92px); margin: 16px 0 22px; }
  .final-deck { font-size: 14px; line-height: 1.55; max-width: 760px; }
  .final-actions { margin-top: 24px; }
  .final-foot { margin-top: 32px; padding-top: 18px; }
}

@media screen and (min-width: 1100px) and (max-height: 850px) {
  .funding-row { padding: 10px 0; }
  .funding-orb { margin: 12px auto; }
  .funding-summary > p { margin-top: 10px; }
  .editor-note { margin-top: 16px; padding-top: 12px; padding-bottom: 12px; }
  .annual-pair { height: 20dvh; }
  /* Give the dense debt chapter two columns instead of squeezing its chart. */
  #dette {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    column-gap: 4vw;
    row-gap: 18px;
    align-content: center;
    align-items: center;
  }
  #dette .section-heading { margin-bottom: 0; }
  #dette .debt-box { padding: 18px 14px 8px; }
  #dette .debt-svg { max-height: none; }
  #dette .chart-label, #dette .debt-end { font-size: 16px; }
  #dette .debt-box .chart-heading { flex-wrap: wrap; gap: 8px; }
  #dette .debt-box .chart-legend { gap: 10px 14px; }
  #dette .debt-callouts, #dette .footnote { grid-column: 1 / -1; margin-top: 0; }
}
