:root {
  color-scheme: light;
  --cream: #f8f5ed;
  --paper: #fffcf5;
  --ink: #191a16;
  --quiet: #5f5c50;
  --line: #dcd5c6;
  --gold: #edc981;
  --bronze: #765421;
  --night: #171915;
  --masthead-height: 96px;
  scroll-padding-top: var(--masthead-height);
  font: 16px/1.58 system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
}
*, *::after, *::before { box-sizing: border-box; }
body { min-height: 100vh; margin: 0; display: flex; flex-direction: column; }
main { flex: 1; }
[hidden] { display: none !important; }
a { color: #6a481c; text-underline-offset: .24em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, .scroll:focus-visible {
  outline: 2px solid #a37435;
  outline-offset: 5px;
}
.skip-link {
  position: fixed; inset: 12px auto auto 12px; z-index: 6;
  transform: translateY(-150%); padding: 10px 16px; background: var(--paper);
}
.skip-link:focus { transform: none; }
.masthead {
  position: sticky; top: 0; z-index: 5;
  color: #f7f2e7; background: #181915; border-bottom: 1px solid #51432b;
}
.masthead-inner { max-width: 1440px; margin: auto; padding: 0 clamp(20px, 4.6vw, 68px); }
.wordmark {
  display: inline-block; margin: 19px 0 10px; color: #f8efe0;
  font: bold 1.34rem/1 Georgia, serif; letter-spacing: -.035em; text-decoration: none;
}
.app-nav { display: flex; gap: clamp(14px, 2vw, 30px); overflow-x: auto; scrollbar-width: thin; }
.tab-link {
  flex: none; padding: 10px 0 11px; border-bottom: 2px solid transparent;
  color: #d0ccbe; font-size: .9rem; font-weight: 600; text-decoration: none;
}
.tab-link:hover { color: #fff9eb; }
.tab-link[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }
.panel:focus { outline: none; }
.hero {
  background: radial-gradient(ellipse at 77% -8%, #7b653748, transparent 65%), #171915;
  color: #f9f1e3;
}
.hero-inner {
  max-width: 1440px; min-height: 0; margin: auto;
  padding: clamp(42px, 4.8vw, 68px) clamp(20px, 6vw, 90px);
  display: grid; grid-template-columns: .92fr 1.08fr; align-items: center; gap: clamp(30px, 4vw, 64px);
}
.hero h1 {
  margin: 0; font: bold clamp(3.05rem, 7.65vw, 7.3rem)/.83 Georgia, serif;
  letter-spacing: -.083em; white-space: nowrap;
}
.hero h1 span {
  display: block; margin-top: .28em;
  color: var(--gold); font: italic normal .64em/1 Georgia, serif; letter-spacing: -.066em;
}
.hero .savings-headline {
  margin: 24px 0 0; font: 800 clamp(1.08rem, 2.1vw, 1.55rem)/1.25 system-ui, sans-serif;
  letter-spacing: -.035em;
}
.savings-headline strong {
  display: block; white-space: nowrap; padding-top: .05em; color: #f3d28a;
  font: 900 clamp(2.35rem, 5.15vw, 5.1rem)/1.02 Georgia, serif; letter-spacing: -.075em;
}
.hero-copy p { margin: 16px 0 20px; max-width: 47ch; color: #e0d8c9; font-size: 1rem; }
.hero-link {
  display: inline-block; padding: 9px 16px; background: #e9c57e;
  border-radius: 4px; color: #241b10; font-weight: 720; text-decoration: none;
}
.hero-link:hover { background: #f5d99f; }
.share-link {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 8px 14px; border: 1px solid #938369; border-radius: 5px;
  font-weight: 720; color: #241b10; background: #fffaf0; text-decoration: none;
}
.share-link:hover { background: #f4ead5; }
.share-hero { margin: 8px 0 0 6px; }
.share-more { margin-top: 25px; }
.share-fixed {
  position: fixed; z-index: 4;
  right: calc(12px + env(safe-area-inset-right, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: #edc981; box-shadow: 0 3px 14px #17191545;
}
#share-viewer {
  width: min(470px, calc(100% - 26px)); padding: 20px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink);
}
#share-viewer::backdrop { background: #171915bb; }
.share-dialog-header, .share-options { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.share-dialog-header { margin-bottom: 14px; }
.share-dialog-header h2 { font-size: 1.65rem; margin: 0; }
#share-message { width: 100%; padding: 10px; background: var(--cream); font: inherit; resize: vertical; }
#share-viewer button {
  min-height: 44px; border: 1px solid #938369; border-radius: 5px; padding: 6px 12px;
  background: #fffaf0; color: var(--ink); font: inherit; cursor: pointer;
}
.share-options { margin-top: 8px; flex-wrap: wrap; }
#share-status { margin: 0; font-size: .875rem; }
#share-status:not(:empty) { margin-top: 8px; }
.protections-list { max-width: 76ch; padding-left: 1.7rem; }
.protections-list li { padding: 12px 0 12px .4rem; border-bottom: 1px solid var(--line); }
.protections-list li::marker { color: var(--bronze); font-weight: 750; }
.card-display { min-width: 0; align-self: stretch; display: grid; justify-items: center; align-content: center; }
.scene {
  position: relative; width: 100%; min-height: clamp(230px, 27vw, 375px);
  display: grid; place-items: center; perspective: 1050px;
}
.floor-shadow {
  position: absolute; top: 89%; left: 50%; width: 86%; height: 25px; border-radius: 50%;
  background: #000a; filter: blur(14px); transform: translateX(-50%) scaleX(var(--shadow-scale, .95));
  pointer-events: none;
}
.card {
  position: relative; width: min(95%, 590px); aspect-ratio: 1016 / 640;
  transform-style: preserve-3d; transform: rotateX(9deg) rotateY(-15deg);
}
.face, .edge { position: absolute; inset: 0; border-radius: 3.85% / 6.1%; }
.edge { background: #6c4a20; border: 1px solid var(--edge-color); transform: translateZ(var(--layer-z)); }
.face { overflow: hidden; backface-visibility: hidden; transform: translateZ(var(--face-z)) rotateY(var(--face-turn)); }
.front { --face-z: 2px; --face-turn: 0deg; }
.back { --face-z: -2px; --face-turn: 180deg; }
.card canvas { display: block; width: 100%; height: 100%; }
.face::before, .face::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.face::before { background: linear-gradient(145deg, #22180033, #110a03b3); opacity: var(--shade, 0); }
.face::after {
  background: radial-gradient(ellipse 66% 92% at var(--beam-x, 36%) 12%, #fff4cead, #ffe6a445 39%, transparent 77%);
  mix-blend-mode: screen; opacity: var(--glint, .55);
}
.home-evidence, .research {
  max-width: 1300px; margin: 0 auto; padding: clamp(34px, 5vw, 74px) clamp(20px, 6vw, 84px);
}
.home-evidence { padding-top: clamp(32px, 4.2vw, 56px); }
h2 {
  max-width: 28ch; margin: 0 0 22px;
  font: bold clamp(2.05rem, 4.55vw, 4.35rem)/1.04 Georgia, serif; letter-spacing: -.054em;
}
h3 { font: bold clamp(1.3rem, 2.7vw, 1.9rem)/1.15 Georgia, serif; margin: 34px 0 12px; letter-spacing: -.025em; }
.headline-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.headline-stats a { padding: 22px max(12px, 1.45vw); color: var(--ink); text-decoration: none; }
.headline-stats a:first-child { padding-left: 0; }
.headline-stats a + a { border-left: 1px solid var(--line); }
.headline-stats strong, .headline-stats span { display: block; }
.headline-stats strong, .metric b {
  color: var(--bronze); font: bold clamp(1.85rem, 4.2vw, 3rem)/1.15 Georgia, serif; letter-spacing: -.04em;
}
.headline-stats span { margin-top: 8px; max-width: 28ch; color: var(--quiet); }
.headline-stats a:hover span, .topic-list a:hover strong { text-decoration: underline; }
.topic-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-top: 24px; }
.topic-list a { color: var(--ink); text-decoration: none; }
.topic-list strong, .topic-list span { display: block; }
.topic-list span, .refs, small { color: var(--quiet); }
.research > p, .research details { max-width: 77ch; }
.research p { margin: .85em 0 1.1em; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(181px, 1fr)); gap: 12px; margin: 24px 0; }
.metric { background: #efe8d7; border-top: 2px solid #9c753a; padding: 15px 17px; }
.metric b { display: block; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 18px; }
.research figure { margin: 20px 0 0; border: 1px solid var(--line); border-radius: 5px; overflow: clip; background: var(--paper); }
.research figure img { display: block; width: 100%; height: auto; }
.research figcaption { padding: 8px 13px; font-size: .875rem; }
.research .refs { font-size: .875rem; }
.scroll { max-height: 41rem; overflow: auto; border: 1px solid var(--line); border-radius: 5px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .875rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; background: #eee7d7; z-index: 1; }
tr:nth-child(odd) td { background: var(--paper); }
#drug-table { min-width: 1020px; }
.table-search { display: grid; grid-template-columns: max-content minmax(190px, 300px) 1fr; align-items: center; gap: 13px; margin: 22px 0 12px; }
.table-search label { font-weight: 720; }
.table-search input { width: 100%; padding: 8px 11px; border: 1px solid #86795e; border-radius: 4px; background: var(--paper); font: inherit; color: var(--ink); }
.research .table-search p { margin: 0; color: var(--quiet); font-size: .875rem; }
summary { cursor: pointer; }
.research details { margin: 18px 0; }
.research details li { margin-bottom: .6em; }
.acronym { list-style: none; columns: 2 140px; max-width: 380px; padding: 0; font-weight: 680; }
.research .slogan { font: bold clamp(1.4rem, 4.1vw, 2.6rem)/1.12 Georgia, serif; color: #8d3526; }
.video-card { border: 1px solid var(--line); border-radius: 5px; overflow: clip; background: var(--paper); }
.video-card video { width: 100%; aspect-ratio: 16 / 9; display: block; background: #171915; }
.video-player { position: relative; }
.reveal-video-controls {
  position: absolute; inset: 0; width: 100%;
  border: 0; border-radius: 10px; padding: 0;
  background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.video-details { padding: 13px 15px; }
.video-details h3 { margin: 4px 0; }
.video-details p { margin: 5px 0; }
.video-links { color: var(--quiet); font-size: .875rem; }
.video-links { display: flex; gap: 12px; flex-wrap: wrap; }
.app-footer {
  display: flex; flex-wrap: wrap; gap: 12px 22px; background: #ede8db;
  padding: 22px max(104px, 6vw) 22px clamp(20px, 6vw, 90px);
  border-top: 1px solid var(--line); font-size: .875rem;
}
@media (max-width: 820px) {
  .hero-inner { min-height: 0; grid-template-columns: 1fr; gap: 25px; padding-block: 48px 28px; }
  .hero h1 { font-size: clamp(2.45rem, 11vw, 6.2rem); }
  .hero-copy p { margin-top: 21px; }
  .card-display { width: min(100%, 600px); justify-self: center; }
  .scene { min-height: clamp(228px, 60vw, 400px); }
  .card { width: min(93%, 540px); }
}
@media (max-width: 535px) {
  .headline-stats, .topic-list { grid-template-columns: 1fr; }
  .headline-stats a { padding: 15px 0; }
  .headline-stats a + a { border-left: 0; border-top: 1px solid var(--line); }
  .topic-list { gap: 17px; }
  .table-search { grid-template-columns: 1fr; gap: 8px; }
}

.hardship-stats article { padding: 20px max(12px, 1.45vw); }
.hardship-stats article:first-child { padding-left: 0; }
.hardship-stats article + article { border-left: 1px solid var(--line); }
.hardship-stats h3 { font: 700 1rem/1.3 system-ui, sans-serif; letter-spacing: 0; margin: 0 0 8px; }
.hardship-stats span { max-width: 34ch; }
.hardship-stats article a { display: inline-block; padding: 0; margin-top: 10px; font-size: .875rem; text-decoration: underline; color: var(--bronze); }
.system-stats { border-top: 0; }
@media (max-width: 535px) {
  .hardship-stats article { padding: 16px 0; }
  .hardship-stats article + article { border-left: 0; border-top: 1px solid var(--line); }
}

.home-statements { border-bottom: 1px solid var(--line); }
.home-statements h2 { font-size: clamp(1.85rem, 3.8vw, 3.3rem); }
.statement-body {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.statement-body .acronym { columns: auto; margin: 0; max-width: none; }
.statement-body .acronym li {
  display: grid;
  grid-template-columns: 1.55em 1fr;
  align-items: baseline;
  padding: .26em 0;
  font: 650 clamp(1rem, 1.45vw, 1.25rem)/1.1 system-ui, sans-serif;
  white-space: nowrap;
}
.acronym-letter {
  color: var(--bronze);
  font: bold 1.35em/.99 Georgia, serif;
}
.statement-copy p { margin: 0 0 12px; }
.statement-copy .slogan { font-size: clamp(1.45rem, 3vw, 2.6rem); }
.home-statements > .refs, #statements > .refs { max-width: none; margin-bottom: 0; }
@media (max-width: 640px) {
  .statement-body { grid-template-columns: 1fr; gap: 18px; }
  .statement-body .acronym { columns: 2; column-gap: 10px; }
  .statement-body .acronym li { break-inside: avoid; }
}

/* Keep each chart full width and let its artwork determine section height. */
.research .grid { display: block; }
.research figure.chart-screen {
  display: grid;
  gap: 8px;
  width: min(calc(100vw - 34px), 1420px);
  margin: 14px 0 18px;
  position: relative; left: 50%; transform: translateX(-50%);
  padding: 8px clamp(4px, 1vw, 14px) 10px;
  overflow: visible;
  border: 0;
  border-block: 1px solid var(--line);
  background: transparent;
}
.chart-image { min-width: 0; display: grid; place-items: center; }
.chart-image picture { display: grid; width: 100%; place-items: center; }
.research .chart-image img {
  object-fit: contain;
  width: 100%;
  height: auto;
  max-height: calc(100svh - var(--masthead-height) - 76px);
}
.research .chart-screen figcaption {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 12px 20px; padding: 0; min-height: 44px;
}
.expand-chart, .chart-viewer-bar button {
  border: 1px solid #938369;
  border-radius: 5px;
  background: #fffaf0;
  color: var(--ink);
  font: 650 .9rem/1.2 system-ui, sans-serif;
  padding: 10px 13px;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
}
.expand-chart:hover, .chart-viewer-bar button:hover { background: #f4ead5; }
#chart-viewer {
  box-sizing: border-box; width: 100%; height: 100%; max-width: none; max-height: none;
  border: 0; padding: 0; margin: 0; background: var(--paper); color: var(--ink);
}
#chart-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
#chart-viewer::backdrop { background: #171915; }
.chart-viewer-bar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px;
  padding: 8px clamp(9px, 2.7vw, 24px); align-items: center; border-bottom: 1px solid var(--line);
}
.chart-viewer-bar h2 { margin: 0; font: 750 clamp(.88rem, 2.5vw, 1.16rem)/1.2 system-ui, sans-serif; letter-spacing: 0; }
.chart-viewer-bar form { margin: 0; }
.chart-viewport { overflow: auto; background: #f8fafc; }
#viewer-image { display: block; width: var(--zoom, 100%); max-width: none; height: auto; margin: 0 auto; }
body:has(#chart-viewer[open]) { overflow: hidden; }

@media (max-width: 650px) and (orientation: portrait) {
  .research figure.chart-screen { width: calc(100vw - 12px); }
}
/* A spanned foldable browser exposes a viewport segment on each side of the hinge. */
@media (horizontal-viewport-segments: 2), (spanning: single-fold-vertical) {
  body {
    --pane-width: env(viewport-segment-width 0 0, env(fold-left, 100vw));
    width: var(--pane-width);
  }
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: clamp(2.7rem, 8vw, 4.1rem); }
  .research figure.chart-screen { width: calc(var(--pane-width) - 12px); }
  #chart-viewer { width: var(--pane-width); margin-right: auto; }
  .share-fixed { right: calc(100vw - var(--pane-width) + 12px); }
}

.video-feed {
  display: grid;
  gap: 0;
  max-width: 940px;
  margin: 16px auto 22px;
}
.video-feed .video-card {
  padding: 12px 0 18px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  overflow: visible;
}
.video-feed video {
  min-height: 0;
  max-height: min(67svh, calc(100svh - var(--masthead-height) - 16px));
  object-fit: contain;
  border-radius: 10px;
}
.video-feed .video-card:first-child { padding-top: 0; }
.video-feed .video-details { padding: 8px 0 0; }


.video-cc, .transcript-header button {
  min-height: 36px; padding: 5px 11px; border: 1px solid #938369; border-radius: 4px;
  background: #fffaf0; color: var(--ink); font: 700 .85rem/1.2 system-ui, sans-serif;
  cursor: pointer;
}
.video-cc[aria-pressed="true"] { background: #24221b; color: #f8db99; border-color: #24221b; }
.video-links { align-items: center; }
#transcript-viewer {
  width: min(720px, calc(100% - 24px)); max-height: min(82svh, 760px);
  border: 1px solid var(--line); border-radius: 8px; padding: 0; background: var(--paper); color: var(--ink);
}
#transcript-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
#transcript-viewer::backdrop { background: #171915b8; }
.transcript-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.transcript-header h2 { margin: 0; font-size: clamp(1.15rem, 3vw, 1.8rem); letter-spacing: -.03em; }
.transcript-scroll { overflow: auto; overscroll-behavior: contain; padding: 8px 16px 16px; }
.transcript-scroll p { display: grid; grid-template-columns: 3.2rem 1fr; gap: 8px; margin: 9px 0; }
.transcript-time { color: var(--bronze); font-variant-numeric: tabular-nums; }
#transcript-viewer footer { padding: 12px 16px; border-top: 1px solid var(--line); }
body:has(#transcript-viewer[open]) { overflow: hidden; }
