/* Core Medicare for All microsite.
   Follows ../design-samples/STYLE-GUIDE.md and matches the PDF: Archivo
   Expanded for display (standing in for GT America Expanded), Zilla Slab for
   text (standing in for Sentinel), tracked condensed caps for labels, a warm
   cream ground, brand red for costs and accents, green for savings. */

@font-face { font-family: "Archivo"; src: url(fonts/ArchivoExpanded-Black.ttf); font-weight: 900; font-stretch: 125%; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(fonts/ArchivoExpanded-Bold.ttf); font-weight: 700; font-stretch: 125%; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(fonts/ArchivoCondensed-SemiBold.ttf); font-weight: 600; font-stretch: 75%; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(fonts/Archivo-Regular.ttf); font-weight: 400; font-stretch: 100%; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(fonts/Archivo-SemiBold.ttf); font-weight: 600; font-stretch: 100%; font-display: swap; }
@font-face { font-family: "Zilla Slab"; src: url(fonts/ZillaSlab-Regular.ttf); font-weight: 400; font-display: swap; }
@font-face { font-family: "Zilla Slab"; src: url(fonts/ZillaSlab-Italic.ttf); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Zilla Slab"; src: url(fonts/ZillaSlab-SemiBold.ttf); font-weight: 600; font-display: swap; }

:root {
  --ink: #111111;
  --muted: #5a5a5a;
  --cream: #f4efe6;
  --paper: #fbf8f2;
  --rule: #d9cfbe;
  --tan: #cfc7b8;
  --red: #b5181a;
  --green: #2e6b3a;
  --green-light: #6b9a74;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --serif: "Zilla Slab", Georgia, serif;
  --measure: 40rem;
  --wide: min(64rem, 92vw);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.65;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red); }
img { max-width: 100%; display: block; }

/* Small tracked caps, used for labels throughout. */
.label, .hero-meta, .ex-label, .closing-kicker, .topbar-nav a, .book-label {
  font-family: var(--sans);
  font-stretch: 75%;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
}

/* ------------------------------------------------------------------ hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2.2rem 5vw 2rem;
  background-color: var(--cream);
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: -1px -1px;
  position: relative;
  overflow: hidden;
}
.hero::after { /* soften the grid so it reads as paper, not graph paper */
  content: ""; position: absolute; inset: 0; background: rgba(244, 239, 230, 0.55); pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-meta { display: flex; justify-content: space-between; color: var(--muted); }
.hero-meta span:first-child { color: var(--red); }
.hero-title {
  margin: 5vh 0 0;
  font-family: var(--sans);
  font-stretch: 125%;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(3rem, min(9vw, 13vh), 9rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
}
.hero-title span { display: block; opacity: 0; transform: translateY(0.35em); animation: rise 0.9s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-title span:nth-child(2) { animation-delay: 0.12s; }
.hero-title span:nth-child(3) { animation-delay: 0.24s; }
@keyframes rise { to { opacity: 1; transform: none; } }
.hero-motif { width: calc(100% + 10vw); margin: 3vh -5vw 0; height: clamp(170px, 27vh, 280px); flex: none; }
.hero-motif .station { font-family: var(--sans); font-stretch: 75%; font-weight: 600; font-size: 11px; letter-spacing: 0.16em; fill: var(--ink); }
.hero-motif .station.m4a { fill: var(--red); font-size: 14px; }
.hero-motif .trunk { stroke: var(--red); stroke-width: 16; stroke-linecap: butt; }
.hero-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-top: auto; padding: 1.5rem 3vw 2.2rem 0; }
.hero-deck { font-style: italic; font-size: clamp(1.3rem, 2.4vw, 2rem); line-height: 1.25; margin: 0 0 1rem; max-width: 28ch; }
.hero-author { font-family: var(--sans); font-stretch: 125%; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; margin: 0; font-size: 1rem; }

/* ------------------------------------------- the 3D report "book" (PDF link) */
.book { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); perspective: 1100px; }
.book-cover {
  /* The cover faces the reader, upright, with a thin page edge and a soft
     shadow so it reads as a printed report. It lifts slightly on hover. */
  display: block; width: 120px;
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), box-shadow 0.35s;
  box-shadow: 2px 2px 0 #e7e0d3, 4px 4px 0 #ddd5c6, 0 14px 26px rgba(0, 0, 0, 0.22);
}
.book:hover .book-cover, .book:focus .book-cover {
  transform: translateY(-6px);
  box-shadow: 2px 2px 0 #e7e0d3, 4px 4px 0 #ddd5c6, 0 22px 34px rgba(0, 0, 0, 0.26);
}
.book-label b { color: var(--red); }
.book-large .book-cover { width: 180px; }

/* --------------------------------------------------------------- top bar */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; gap: 2rem;
  padding: 0.7rem 5vw;
  background: rgba(251, 248, 242, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
  transform: translateY(-100%);
  transition: transform 0.3s;
}
.topbar.is-on { transform: none; }
.topbar-title { font-family: var(--sans); font-stretch: 125%; font-weight: 900; text-transform: uppercase; color: var(--ink); text-decoration: none; font-size: 0.9rem; }
.topbar-nav { display: flex; gap: 1.4rem; margin-left: auto; }
.topbar-nav a { color: var(--muted); text-decoration: none; }
.topbar-nav a.is-current { color: var(--red); }
.topbar-pdf { font-family: var(--sans); font-weight: 600; font-size: 0.8rem; color: #fff; background: var(--red); padding: 0.45rem 0.9rem; text-decoration: none; }
.progress { position: absolute; left: 0; bottom: -1px; height: 3px; width: 0; background: var(--red); }

/* ------------------------------------------------------------------ essay */
.essay { padding-bottom: 4rem; }
.essay section > p:not(.ex-note), .essay section > h3, .essay .lede > p:not(.ex-note) { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.essay p { margin-top: 0; margin-bottom: 1.1em; }

/* Part openers: a full-width red band with a big white title. */
.essay { counter-reset: part; }
.essay section.level2 > h2 {
  counter-increment: part;
  margin: 0 0 4rem;
  padding: 22vh 5vw 8vh;
  background: var(--red);
  color: #fff;
  font-family: var(--sans);
  font-stretch: 125%;
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(2.6rem, 8vw, 7rem);
  line-height: 0.92;
  background-image: repeating-linear-gradient(0deg, transparent 0 9px, rgba(255,255,255,0.12) 9px 10px);
  background-size: 100% 30%;
  background-repeat: no-repeat;
  background-position: bottom;
}
.essay section.level2 > h2::before {
  content: "Part " counter(part, upper-roman);
  display: block; margin-bottom: 1.4rem;
  font-family: var(--sans); font-stretch: 75%; font-weight: 600; font-size: 0.85rem; letter-spacing: 0.18em;
}
.essay section#footnotes > h2, .essay section.footnotes > h2 { display: none; }

/* Section headings: a short red rule over an expanded sans heading. */
.essay h3 {
  font-family: var(--sans); font-stretch: 125%; font-weight: 700;
  font-size: 1.45rem; line-height: 1.2; margin-top: 3.2rem; margin-bottom: 1rem;
}
.essay h3::before { content: ""; display: block; width: 2.2rem; height: 4px; background: var(--red); margin-bottom: 0.9rem; }

/* Introduction and conclusion: larger text. Every part opens with a drop cap. */
.lede > p:not(.ex-note) { font-size: 1.32rem; }
.lede > p:first-child::first-letter,
.essay section.level2 > h2 + p::first-letter {
  float: left; font-family: var(--sans); font-stretch: 125%; font-weight: 900;
  font-size: 4.6em; line-height: 0.82; margin: 0.06em 0.12em 0 0; color: var(--red);
}

/* -------------------------------------------------------------- exhibits */
.exhibit {
  /* Wider than the text: centered on the page by offsetting half its width.
     Horizontal margins stay zero so the offset is not applied twice. */
  width: var(--wide);
  margin: 3.5rem 0;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.exhibit figcaption { margin-bottom: 1.2rem; }
.ex-label { display: block; color: var(--red); margin-bottom: 0.3rem; }
.ex-title { display: block; font-style: italic; font-size: 1.5rem; line-height: 1.25; }
.ex-note, .exhibit + .ex-note {
  width: var(--wide); margin: -2.2rem 0 3rem; position: relative; left: 50%; transform: translateX(-50%);
  font-family: var(--sans); font-size: 0.78rem; line-height: 1.5; color: var(--muted);
}
.exhibit .ex-note { width: auto; margin: 1rem 0 0; left: 0; transform: none; }
/* Static figures fit on one screen: no taller than 70 percent of the window. */
.ex-body > img { width: auto; max-width: 100%; max-height: 70vh; height: auto; margin: 0 auto; }

/* Tables */
.table-wrap { overflow-x: auto; }
.exhibit table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.86rem; }
.exhibit th {
  text-align: right; font-stretch: 75%; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.72rem; padding: 0.55rem 0.6rem; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink);
  vertical-align: bottom;
}
.exhibit td { text-align: right; padding: 0.5rem 0.6rem; border-bottom: 1px solid #e4dccd; font-variant-numeric: tabular-nums; }
.exhibit th:first-child, .exhibit td:first-child { text-align: left; }
.exhibit tbody tr:last-child td { border-bottom: 2px solid var(--ink); }
.exhibit tr:hover td { background: rgba(181, 24, 26, 0.04); }

/* Reveal-on-scroll for exhibits. */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s, transform 0.7s; }
.exhibit.reveal { transform: translate(-50%, 24px); }
.reveal.is-in { opacity: 1; transform: none; }
.exhibit.reveal.is-in { transform: translateX(-50%); }

/* Big numbers used by several exhibits. */
.big { font-family: var(--sans); font-stretch: 125%; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.small-label { font-family: var(--sans); font-stretch: 75%; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.68rem; color: var(--muted); }

/* Headline numbers */
.headline { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 1.6rem 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2.6rem; }
.headline .big { color: var(--green); font-size: clamp(2.2rem, 4.6vw, 3.6rem); margin: 0.5rem 0 0.7rem; }
/* Each half is a column whose description stretches, so the two bars line up
   even when one description wraps to more lines than the other. */
.headline > div { display: flex; flex-direction: column; }
.headline p { font-style: italic; font-size: 1.05rem; line-height: 1.35; margin: 0 0 1.2rem; flex: 1; }
.scale { display: flex; gap: 2px; height: 18px; }
.scale > span { height: 100%; transition: flex-grow 1.4s cubic-bezier(.2,.7,.2,1); }
.scale-foot { display: flex; justify-content: space-between; margin-top: 0.4rem; font-family: var(--sans); font-size: 0.72rem; color: var(--muted); }
.scale-foot b { color: var(--green); }

/* Table 1: typical vs. Core M4A */
.checks { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 0.95rem; }
.checks th, .checks td { border: 0; padding: 0.65rem 0.9rem; text-align: center; }
.checks td:first-child { text-align: left; }
.checks tbody tr:not(.group):not(.end) td { border-bottom: 1px solid var(--rule); }
.checks thead th { font-stretch: 75%; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.78rem; padding-bottom: 0.6rem; width: 9rem; }
.checks thead th:first-child { width: auto; }
.checks thead th.core { background: var(--ink); color: #fff; padding-top: 0.7rem; }
.checks td.core { background: #fff; border-left: 2px solid var(--ink); border-right: 2px solid var(--ink); }
.checks tr.end td { padding: 0; height: 0; border: 0 !important; }
.checks tr.group th { text-align: left; font-stretch: 75%; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.72rem; padding: 1.1rem 0.9rem 0.3rem 0; border-bottom: 2px solid; }
.checks tr.group.saves th, .checks tr.group.saves td.core { color: var(--green); border-bottom: 2px solid var(--green); }
.checks tr.group.costs th, .checks tr.group.costs td.core { color: var(--red); border-bottom: 2px solid var(--red); }
.checks tbody tr:nth-last-child(2) td.core { border-bottom: 2px solid var(--ink); }
.checks .tick { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; color: #fff; font-weight: 700; font-size: 0.95rem; transform: scale(0); transition: transform 0.4s cubic-bezier(.3,1.6,.5,1); }
.checks tr.saves .tick { background: var(--green); }
.checks tr.costs .tick { background: var(--red); }
.checks .none { color: var(--tan); }
.is-in .checks .tick { transform: scale(1); }

/* Money flows toggle */
.toggle { display: inline-flex; border: 2px solid var(--ink); margin-bottom: 1.2rem; font-family: var(--sans); }
.toggle button { font: inherit; font-weight: 600; font-size: 0.85rem; border: 0; padding: 0.55rem 1.1rem; background: transparent; cursor: pointer; }
.toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.flows { position: relative; max-width: min(100%, calc(70vh * 1000 / 660)); margin: 0 auto; }
/* Fits the diagram on one screen: no taller than 70 percent of the window. */
.flows img { transition: opacity 0.6s; }
.flows img + img { position: absolute; inset: 0; }
.flows img.is-hidden { opacity: 0; }
.flows-caption { font-family: var(--sans); font-size: 0.85rem; line-height: 1.55; color: var(--muted); margin: 0.8rem 0 0; min-height: 3.1em; }

/* Equation */
.equation { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 1.4rem; align-items: center; }
.equation .op { font-family: var(--sans); font-weight: 900; font-size: 3rem; color: var(--muted); }
.equation .big { font-size: clamp(2rem, 4.2vw, 3.4rem); margin-bottom: 0.5rem; }
.equation .result .big { color: var(--green); }

/* Uninsured steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.steps .step { border-top: 3px solid var(--ink); padding-top: 0.8rem; }
.steps .step:last-child { border-color: var(--red); }
.steps .step:last-child .big { color: var(--red); }
.steps .big { font-size: clamp(1.5rem, 2.8vw, 2.3rem); margin-bottom: 0.4rem; }
.split { display: flex; margin-top: 2rem; font-family: var(--sans); font-size: 0.9rem; color: #fff; }
.split > div { padding: 0.8rem 1rem; }

/* Ten-year bars */
.decade { display: grid; grid-template-columns: 13rem 1fr; gap: 2.4rem; align-items: end; }
.decade .big { color: var(--green); font-size: 3.2rem; }
.bars { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; align-items: end; height: 240px; }
.bars .bar { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; font-family: var(--sans); }
.bars .bar i { display: block; width: 100%; background: var(--green); height: 0; transition: height 1.2s cubic-bezier(.2,.7,.2,1); }
.bars .bar.ext i { background: var(--green-light); }
.bars .bar b { font-size: 0.78rem; margin-bottom: 0.3rem; }
.bars .bar small { font-size: 0.7rem; color: var(--muted); margin-top: 0.35rem; text-align: center; line-height: 1.3; }

/* Benchmarks table colored headers */
.bench th.c0 { background: var(--ink); color: #fff; }
.bench th.c1 { background: var(--green); color: #fff; }
.bench th.c2 { background: var(--red); color: #fff; }
.bench th { border-top: 0; padding: 0.7rem 0.6rem; }

/* Plan builder */
.builder { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.6rem; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 1.8rem 0; }
.builder fieldset { border: 0; padding: 0; margin: 0 0 1.6rem; }
.builder legend { padding: 0; margin-bottom: 0.6rem; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  font-family: var(--sans); font-size: 0.85rem; font-weight: 600; cursor: pointer;
  border: 2px solid var(--ink); background: transparent; padding: 0.5rem 0.8rem;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg button[data-v="cbo_low"][aria-pressed="true"] { background: var(--green); border-color: var(--green); }
.seg button[data-v="medicare"][aria-pressed="true"] { background: var(--red); border-color: var(--red); }
.builder input[type=range] { width: 100%; accent-color: var(--ink); }
.av-readout { display: flex; justify-content: space-between; font-family: var(--sans); font-size: 0.78rem; color: var(--muted); }
.av-readout b { color: var(--ink); font-size: 1rem; }
.result { align-self: center; }
/* Sized so the widest result (−$1,460B) stays on one line. */
.result .big { font-size: clamp(2.2rem, 3.7vw, 3.7rem); white-space: nowrap; transition: color 0.3s; }
.result .big.saves { color: var(--green); }
.result .big.costs { color: var(--red); }
.result p { font-style: italic; font-size: 1.05rem; line-height: 1.4; margin: 0.8rem 0 0; }
.meter { position: relative; height: 10px; background: #e4dccd; margin-top: 1.4rem; }
.meter i { position: absolute; top: 0; bottom: 0; transition: all 0.5s; }
.meter .zero { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--ink); }
.checkbox { display: flex; align-items: center; gap: 0.6rem; font-family: var(--sans); font-size: 0.9rem; cursor: pointer; }
.checkbox input { width: 1.1rem; height: 1.1rem; accent-color: var(--ink); }

/* Cross-references and footnotes */
a.xref { color: inherit; text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; }
a.footnote-ref { text-decoration: none; }
a.footnote-ref sup { font-family: var(--sans); font-weight: 600; font-size: 0.62em; color: var(--red); padding: 0 1px; }
.popover {
  position: absolute; z-index: 30; max-width: 26rem; padding: 1rem 1.1rem; background: #fff; border-top: 3px solid var(--red);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18); font-family: var(--sans); font-size: 0.82rem; line-height: 1.5;
}
.popover p { margin: 0 0 0.5em; } .popover p:last-child { margin: 0; }
.popover .footnote-back { display: none; }
section.footnotes, section#footnotes { max-width: var(--measure); margin: 4rem auto 0; font-family: var(--sans); font-size: 0.82rem; line-height: 1.55; color: #333; }
section.footnotes::before, section#footnotes::before { content: "Notes"; display: block; font-family: var(--sans); font-stretch: 125%; font-weight: 900; text-transform: uppercase; font-size: 1.6rem; margin-bottom: 1rem; color: var(--ink); }
section.footnotes hr { display: none; }
section.footnotes li { margin-bottom: 0.7em; }

/* ---------------------------------------------------------------- closing */
.closing { background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; gap: 4rem; padding: 6rem 5vw; flex-wrap: wrap; }
.closing-kicker { color: #e9a3a4; margin: 0; }
.closing-title { font-family: var(--sans); font-stretch: 125%; font-weight: 900; text-transform: uppercase; font-size: 2.4rem; line-height: 1; margin: 0.6rem 0 0.8rem; }
.closing-text { font-style: italic; margin: 0 0 1.4rem; color: #ddd; }
.button { display: inline-block; background: var(--red); color: #fff; font-family: var(--sans); font-weight: 600; font-size: 0.9rem; padding: 0.8rem 1.3rem; text-decoration: none; }
.closing-org { font-family: var(--sans); font-size: 0.75rem; color: #aaa; margin: 2rem 0 0; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 760px) {
  body { font-size: 1.08rem; }
  .topbar-nav { display: none; }
  .topbar-pdf { margin-left: auto; white-space: nowrap; }
  .topbar-title { font-size: 0.72rem; }
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .headline, .builder, .decade { grid-template-columns: 1fr; }
  .equation { grid-template-columns: 1fr; }
  .equation .op { font-size: 2rem; }
  .steps { grid-template-columns: 1fr 1fr; }
  .lede > p { font-size: 1.15rem; }
  /* Keep body text off the screen edges. */
  .essay section > p:not(.ex-note), .essay section > h3, .essay .lede > p:not(.ex-note),
  section.footnotes, section#footnotes { padding-left: 16px; padding-right: 16px; }
  /* The bar: let the title shrink so the PDF button stays on screen. */
  .topbar { gap: 0.8rem; padding: 0.6rem 16px; }
  .topbar-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-stretch: 100%; }
  /* Part openers: long words like INTRODUCTION must fit the width. */
  .essay section.level2 > h2 { font-size: 10.5vw; font-stretch: 100%; padding-left: 16px; padding-right: 16px; overflow-wrap: anywhere; }
  /* Wide tables scroll inside their own box instead of widening the page. */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .exhibit table { font-size: 0.78rem; }
  .footnotes li, #footnotes li { overflow-wrap: anywhere; }
}
/* Nothing should ever widen the page sideways. */
html, body { overflow-x: clip; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .hero-title span, .reveal { opacity: 1; transform: none; }
}

/* Links to the calculator page */
.topbar-calc { font-family: var(--sans); font-weight: 600; font-size: 0.8rem; color: var(--ink); text-decoration: none; border: 2px solid var(--ink); padding: 0.32rem 0.8rem; }
.hero-links { display: flex; align-items: flex-end; gap: 2.4rem; }
/* The calculator link mirrors the PDF "book": an upright object of the same
   size with the same caption style, drawn as a miniature of the calculator
   (three sliders and a result) on the cream report paper. */
.calc-face {
  display: flex; flex-direction: column; justify-content: space-between;
  width: 120px; aspect-ratio: 8.5 / 11; padding: 12px 11px 10px;
  background: var(--paper); border: 1px solid var(--rule);
  box-shadow: 2px 2px 0 #e7e0d3, 4px 4px 0 #ddd5c6, 0 14px 26px rgba(0, 0, 0, 0.22);
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), box-shadow 0.35s;
}
.calc-book:hover .calc-face, .calc-book:focus .calc-face { transform: translateY(-6px); box-shadow: 2px 2px 0 #e7e0d3, 4px 4px 0 #ddd5c6, 0 22px 34px rgba(0, 0, 0, 0.26); }
.calc-face-t { font-family: var(--sans); font-stretch: 125%; font-weight: 900; text-transform: uppercase; font-size: 0.62rem; line-height: 1.05; color: var(--ink); }
.calc-face-s { position: relative; display: block; height: 3px; background: var(--tan); }
.calc-face-s i { position: absolute; left: 0; top: 0; height: 3px; width: var(--v); background: var(--ink); transition: width 0.6s cubic-bezier(.2,.7,.2,1); }
.calc-face-s i::after { content: ""; position: absolute; right: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.calc-book:hover .calc-face-s:nth-of-type(2) i { width: 40%; }
.calc-book:hover .calc-face-s:nth-of-type(3) i { width: 70%; }
.calc-book:hover .calc-face-s:nth-of-type(4) i { width: 25%; }
.calc-face-n { font-family: var(--sans); font-stretch: 125%; font-weight: 900; font-size: 0.95rem; color: var(--green); }
.button-ghost { background: transparent; border: 2px solid #fff; margin-left: 0.6rem; }
.calc-link { display: inline-block; margin-top: 1rem; font-family: var(--sans); font-weight: 600; font-size: 0.95rem; color: var(--red); text-decoration: none; border-bottom: 2px solid var(--red); }
@media (max-width: 760px) { .topbar-calc { display: none; } .hero-links { gap: 1.4rem; } }

/* ------------------------------------------------------------ the video */
/* The hero's video link sits beside the PDF "book" as an object of the same
   size: a still from the video with a play button on it. */
button.video-open { font: inherit; cursor: pointer; }
button.book { background: none; border: 0; padding: 0; }
/* The top bar's video button is the PDF button's outlined twin: the same type,
   the same height and width of padding, with a small play triangle. The
   2px border is taken out of the padding so the two boxes match exactly. */
button.topbar-video {
  font: 600 0.8rem/1.65 var(--sans); color: var(--ink); background: none;
  border: 2px solid var(--ink); padding: calc(0.45rem - 2px) calc(0.9rem - 2px);
  margin-right: -1.2rem; white-space: nowrap;
}
button.topbar-video::before { content: ""; display: inline-block; margin-right: 0.5em; border-style: solid; border-width: 0.32em 0 0.32em 0.52em; border-color: transparent transparent transparent var(--red); }
/* On a phone both buttons stay, with one-word labels so the title keeps
   some room. The video button takes over pushing the pair to the right. */
.topbar .short { display: none; }
@media (max-width: 760px) {
  .topbar .long { display: none; }
  .topbar .short { display: inline; }
  button.topbar-video { margin-left: auto; margin-right: 0; }
  .topbar-pdf { margin-left: 0; }
}
button.button { border: 0; }
/* The closing band's video button is the PDF button's outlined twin. The
   type is restated here because button.video-open's "font: inherit" would
   otherwise outrank .button and give it the body's serif. */
button.button-ghost { font-family: var(--sans); font-weight: 600; font-size: 0.9rem; border: 2px solid #fff; padding: calc(0.8rem - 2px) calc(1.3rem - 2px); }
.video-face {
  position: relative; display: block; width: 120px; aspect-ratio: 8.5 / 11; overflow: hidden;
  border: 1px solid var(--rule);
  box-shadow: 2px 2px 0 #e7e0d3, 4px 4px 0 #ddd5c6, 0 14px 26px rgba(0, 0, 0, 0.22);
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), box-shadow 0.35s;
}
.video-face img { width: 100%; height: 100%; object-fit: cover; object-position: center 66%; }
.book:hover .video-face, .book:focus .video-face { transform: translateY(-6px); box-shadow: 2px 2px 0 #e7e0d3, 4px 4px 0 #ddd5c6, 0 22px 34px rgba(0, 0, 0, 0.26); }
/* The still is cropped to leave a clear strip under the figure, and the play
   button sits in that strip's corner so it covers none of the text. */
.video-play { position: absolute; right: 6px; bottom: 5px; width: 28px; height: 28px; border-radius: 50%; background: var(--red); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
.video-play::after { content: ""; position: absolute; left: 11px; top: 8px; border-style: solid; border-width: 6px 0 6px 9px; border-color: transparent transparent transparent #fff; }

/* The lightbox. On a landscape screen the wide video floats over a dark
   backdrop. On a portrait screen (a phone held upright) the vertical video
   fills the whole screen, on the video's own cream background so the bands
   above and below it on a tall phone blend in. */
.lightbox { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(17, 17, 17, 0.92); }
.lightbox[hidden] { display: none; }
.lightbox video { display: block; max-width: min(92vw, 1280px); max-height: 84vh; background: var(--paper); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.lightbox-close { position: absolute; top: 14px; right: 16px; z-index: 1; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.14); color: #fff; font: 400 30px/1 var(--sans); cursor: pointer; }
.lightbox.is-vertical { background: var(--paper); }
.lightbox.is-vertical video { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; object-fit: contain; box-shadow: none; }
.lightbox.is-vertical .lightbox-close { background: rgba(17, 17, 17, 0.75); }
