/* ==========================================================================
   Site styles: patient-education pages
   Palette "green-black and bone": dark film for looking, bone paper for reading.
   One family (Archivo), square corners, no rules or shadows: tone steps only.
   ========================================================================== */

:root {
  /* colour roles */
  --film: #161c1a;          /* page ground, dark fields */
  --film-2: #1f2725;        /* stage panels, one step up from the ground */
  --paper: #e3e2da;         /* reading panels; also the ink on film */
  --paper-2: #d6d5cc;       /* one step down on paper: bars, nodes, tiles */
  --ink: #161c1a;           /* text on paper */
  --muted: #4f5753;         /* secondary text on paper (5.7:1) */
  --muted-film: #9aa099;    /* secondary text on film (6.5:1) */
  --jade: #9fc7b8;          /* accent on film */
  --jade-deep: #2c6a58;     /* accent on paper */
  --amber: #e2b04f;         /* caution marks on film */
  --amber-deep: #8a5d00;    /* caution marks on paper */

  /* drawing tones (sonogram language) */
  --tissue: #5b6560;
  --tissue-lit: #737d78;
  --echo: #0b0e0d;          /* anechoic black: the inside of a cyst */

  /* type */
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);   /* 14–15 */
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);     /* 17–19 */
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);       /* 20–26 */
  --step-head: clamp(2rem, 1.55rem + 1.3vw, 2.75rem);          /* 32–44 */
  --step-display: clamp(2.5rem, 1.6rem + 2.6vw, 3.5rem);       /* 40–56 */
  --step-figure: clamp(3rem, 1.8rem + 4vw, 6rem);              /* 48–96: lone numbers */

  /* space */
  --margin: 12px;
  --pad: clamp(1.25rem, 0.6rem + 3vw, 4.5rem);
  --section-gap: clamp(4.5rem, 3rem + 7vw, 11rem);

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 240ms;
  --t-reveal: 800ms;

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--film);
  color: var(--paper);
  font-family: var(--font);
  font-size: var(--step-body);
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
video { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; }

h1, h2, h3 {
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
  hyphens: none;
}

p { text-wrap: pretty; }

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
  transition: text-decoration-color var(--t-hover) ease, color var(--t-hover) ease;
}

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

.paper :focus-visible,
.on-paper :focus-visible { outline-color: var(--jade-deep); }

::selection { background: var(--jade); color: var(--film); }

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

.skip-link {
  position: absolute;
  left: 12px; top: -80px;
  z-index: 20;
  padding: 0.75em 1em;
  background: var(--jade);
  color: var(--film);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* paper panels hold the reading */
.paper {
  background: var(--paper);
  color: var(--ink);
}
.paper a { text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }

@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration-color: currentColor; }
}

/* --------------------------------------------------------------------------
   Buttons: flat, square, one fill per ground
   -------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0.7em 1.4em;
  border: 0;
  border-radius: 0;
  background: var(--jade-deep);
  color: var(--paper);
  font: 600 var(--step-body)/1.2 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease;
}
.button:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: #235748; }
}

.button--film { background: var(--jade); color: var(--film); }
@media (hover: hover) and (pointer: fine) {
  .button--film:hover { background: #b3d5c8; }
}

/* --------------------------------------------------------------------------
   Split stage: reading column on paper, a fixed picture panel beside it
   -------------------------------------------------------------------------- */

.split {
  padding: 0 var(--margin);
}

.split__read {
  background: var(--paper);
  color: var(--ink);
}

.split__stage { display: none; }

/* the picture each chapter brings, shown inline on phones and without script */
.inline-fig {
  margin: 0 calc(var(--pad) * -1) 2.5rem;
  background: var(--film-2);
  color: var(--paper);
  padding: 1.5rem var(--pad) 1.25rem;
}
.inline-fig > svg,
.inline-fig > img { margin-inline: auto; }
.inline-fig figcaption,
.frame__caption {
  margin-top: 0.9rem;
  color: var(--muted-film);
  font-size: var(--step-small);
  line-height: 1.45;
}

/* ultrasound and CT frames sit on the panel colour: their black falls away */
.scan { mix-blend-mode: lighten; filter: grayscale(1); }

@media (min-width: 1100px) {
  .split {
    display: grid;
    grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
    gap: var(--margin);
  }
  .split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

  .js .split__stage {
    display: block;
    position: sticky;
    top: var(--margin);
    height: calc(100svh - var(--margin) * 2);
    background: var(--film-2);
    overflow: hidden;
  }
  .js .split .inline-fig { display: none; }
}

/* frames stack inside the stage and cross-fade as their chapter arrives */
.frame {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 3vw, 3rem) clamp(1.25rem, 2.5vw, 3rem) calc(56px + 1.5rem);
  background: var(--film-2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 900ms var(--ease-soft), visibility 0s linear 900ms;
}
.frame.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 900ms var(--ease-soft), visibility 0s;
}
.frame > figure { width: 100%; max-width: 740px; }
.frame--hero > figure { max-width: 860px; }
.frame svg { width: 100%; max-height: calc(100svh - 180px); }
.frame img { margin-inline: auto; }
.frame figcaption { text-align: center; }

/* the bar across the stage's bottom edge: what you are looking at, and how current it is */
.stage-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
  padding: 0.5rem 1.25rem;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--step-small);
  line-height: 1.3;
}
.stage-bar__what { font-weight: 600; }

/* --------------------------------------------------------------------------
   Hero sheet, set like a printed card
   -------------------------------------------------------------------------- */

.hero-photo { display: none; }

.sheet {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: calc(100svh - var(--margin) * 2);
  padding: 1.25rem var(--pad) 2.5rem;
  text-align: center;
}

.topnav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  font-size: var(--step-small);
}
.topnav a { text-decoration: none; padding: 0.6rem 0; }
.topnav a:first-child { justify-self: start; }
.topnav a:last-child { justify-self: end; }
@media (hover: hover) and (pointer: fine) {
  .topnav a:hover { text-decoration: underline; }
}

.wordmark {
  font-size: var(--step-lead);
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.sheet__body {
  align-self: start;
  padding-top: clamp(4rem, 26svh, 15rem);
  display: grid;
  justify-items: center;
  gap: 1.5rem;
}

.hero-title {
  max-width: 14ch;
  font-size: var(--step-display);
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--jade-deep);
}
.hero-title .line { display: block; }

.hero-lead {
  max-width: 34ch;
  font-size: var(--step-body);
}

@media (min-width: 1100px) {
  .split--hero { padding-top: var(--margin); }
  html:not(.js) .split--hero .hero-photo {
    display: block;
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: var(--margin);
    height: calc(100svh - var(--margin) * 2);
    background: var(--film-2);
  }
  html:not(.js) .split--hero .hero-photo__img { position: absolute; inset: 0 0 56px; display: grid; place-items: center; padding: 3rem; }
  html:not(.js) .split--hero .split__read { grid-column: 1; grid-row: 1; }
}

/* phones: the picture leads, sticky, and the sheet slides up over it */
@media (max-width: 1099px) {
  .hero-photo {
    display: block;
    position: sticky;
    top: var(--margin);
    z-index: 0;
    height: 56svh;
    margin: var(--margin) 0 0;
    background: var(--film-2);
    overflow: hidden;
  }
  .hero-photo__img {
    position: absolute;
    inset: 0 0 56px;
    display: grid;
    place-items: center;
    padding: 1rem;
  }
  .hero-photo__img img { max-height: 100%; width: auto; }
  .hero-photo .stage-bar { padding: 0.5rem 1rem; }
  .split--hero .split__read { position: relative; z-index: 1; }
  .sheet { min-height: auto; padding-bottom: 3rem; }
  .sheet__body { padding-top: 3.5rem; }
  .wordmark { font-size: 1.1875rem; }
}

@media (max-width: 699px) {
  .hero-title { font-size: clamp(2.25rem, 9.6vw, 3rem); }
  .sheet__body .button { width: 100%; }
}

/* --------------------------------------------------------------------------
   Chapters in the reading column
   -------------------------------------------------------------------------- */

.chapter {
  padding: var(--section-gap) var(--pad) 0;
}
.chapter:last-child { padding-bottom: var(--section-gap); }

.chapter__title {
  font-size: var(--step-head);
  max-width: 16ch;
  margin-bottom: 2rem;
}

.prose { max-width: 46ch; }
.prose p + p { margin-top: 1em; }
.prose .first { font-weight: 600; font-size: var(--step-lead); line-height: 1.35; }

.note {
  margin-top: 1.75rem;
  max-width: 46ch;
  color: var(--muted);
}

/* narrow column with plain facts: the intro */
.intro { max-width: 34ch; }
.intro p + p { margin-top: 1.15em; }
.intro .first { font-weight: 600; }
.intro p:not(.first) { color: var(--muted); }

.figure-note {
  margin-top: 0.6rem;
  font-size: var(--step-small);
  color: var(--muted);
}

/* the cyst-fluid slip: a printed lab result with a cut edge */
.slip {
  margin-top: 2.5rem;
  max-width: 440px;
  padding: 1.6rem 1.5rem 1.9rem;
  background: var(--paper-2);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), 95% 100%, 90% calc(100% - 12px), 85% 100%, 80% calc(100% - 12px), 75% 100%, 70% calc(100% - 12px), 65% 100%, 60% calc(100% - 12px), 55% 100%, 50% calc(100% - 12px), 45% 100%, 40% calc(100% - 12px), 35% 100%, 30% calc(100% - 12px), 25% 100%, 20% calc(100% - 12px), 15% 100%, 10% calc(100% - 12px), 5% 100%, 0 calc(100% - 12px));
}
.slip__title { font-size: var(--step-body); font-weight: 600; }
.slip__sub { color: var(--muted); font-size: var(--step-small); }
.slip__group { margin-top: 1.5rem; font-weight: 600; font-size: var(--step-small); }
.slip__rows { list-style: none; margin-top: 0.4rem; }
.slip__row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.3rem 0;
}
.slip__row::after { content: none; }
.slip__dots {
  flex: 1;
  align-self: center;
  margin-top: 0.4em;
  border-bottom: 3px dotted var(--muted);
  opacity: 0.75;
}
.slip__val { font-weight: 600; white-space: nowrap; }
.slip__val--no { color: var(--muted); font-weight: 400; }
.slip__result {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.4rem -1.5rem 0;
  padding: 0.7rem 1.5rem;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
}

/* pressure: one value against a 30 cm water column */
.pressure {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: end;
  margin-top: 3rem;
  max-width: 440px;
}
.pressure svg { width: 110px; }
.pressure p { max-width: 26ch; }
.pressure strong { display: block; font-size: var(--step-lead); font-weight: 600; line-height: 1.2; }

/* symptoms */
.symptoms { list-style: none; max-width: 40ch; }
.symptoms { margin-top: 2rem; }
.symptoms li { padding: 0.7rem 0; }
.symptoms strong { display: block; font-weight: 600; font-size: var(--step-body); }
.symptoms small { display: block; color: var(--muted); font-size: var(--step-small); }

.rare {
  margin-top: 2.25rem;
  padding: 1.25rem 1.4rem;
  background: var(--paper-2);
  max-width: 44ch;
}
.rare h3 { font-size: var(--step-body); font-weight: 600; letter-spacing: 0; margin-bottom: 0.35rem; }
.rare p { color: var(--ink); }

/* diagnosis: items that drive the stage frame */
.modality { padding: 2.25rem 0; max-width: 42ch; }
.modality:first-of-type { padding-top: 2.25rem; }
@media (min-width: 1100px) {
  .js .modality { min-height: 36svh; }
}
.modality h3 { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.01em; margin-bottom: 0.5rem; }
.modality > p { color: var(--ink); }
.modality .inline-fig { margin-top: 1.25rem; margin-bottom: 0; }
.modality.is-current h3 { color: var(--jade-deep); }

.blood {
  margin-top: 1.5rem;
  padding: 1.25rem 1.4rem;
  background: var(--paper-2);
  max-width: 44ch;
}
.blood h3 { font-size: var(--step-body); font-weight: 600; letter-spacing: 0; margin-bottom: 0.35rem; }

/* --------------------------------------------------------------------------
   The size tool (full width, on film)
   -------------------------------------------------------------------------- */

.sizer {
  margin-top: var(--section-gap);
  padding: 0 var(--margin);
}
.sizer__inner {
  display: grid;
  gap: 2rem;
  background: var(--film-2);
  padding: clamp(1.25rem, 3vw, 3rem);
}
.sizer__plate { position: relative; background: var(--film); aspect-ratio: 1; }
.sizer__plate svg { width: 100%; height: 100%; }
.sizer__head { display: grid; gap: 1rem; }
.sizer__panel { display: flex; flex-direction: column; gap: 1.5rem; }

.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin-bottom: -0.75rem; }
.tab {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted-film);
  font: 400 var(--step-body)/1.2 var(--font);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 2px;
  transition: color var(--t-hover) ease, text-decoration-color var(--t-hover) ease;
}
.tab[aria-pressed="true"] { color: var(--paper); text-decoration-color: var(--jade); }
@media (hover: hover) and (pointer: fine) {
  .tab:hover { color: var(--paper); }
}

.sizer__title { font-size: var(--step-head); max-width: 13ch; }
.sizer__how { color: var(--muted-film); max-width: 40ch; }

.readout {
  display: grid;
  gap: 0.35rem;
  min-height: 9.5rem;
}
.readout__value {
  font-size: var(--step-figure);
  line-height: 1;
  letter-spacing: -0.03em;
}
.readout__like { font-size: var(--step-lead); line-height: 1.3; }
.readout__verdict { display: flex; gap: 0.6rem; align-items: start; max-width: 42ch; }
.readout__verdict svg { flex: none; width: 22px; height: 22px; margin-top: 0.15em; }

.slider { display: grid; gap: 0.6rem; }
.slider label { font-size: var(--step-small); color: var(--muted-film); }
.slider__row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; }
.slider input[type="range"] { width: 100%; accent-color: var(--jade); height: 44px; margin: 0; cursor: pointer; }
.slider input[type="number"] {
  width: 6.5rem;
  min-height: 48px;
  padding: 0.4rem 0.6rem;
  border: 0;
  border-radius: 0;
  background: var(--film);
  color: var(--paper);
  font: 600 1.125rem/1.2 var(--font);
  font-variant-numeric: tabular-nums;
}
.slider__scale {
  display: flex;
  justify-content: space-between;
  font-size: var(--step-small);
  color: var(--muted-film);
  font-variant-numeric: tabular-nums;
}

.cells { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: auto; }
.cell {
  min-height: 72px;
  border: 0;
  border-radius: 0;
  font: 600 var(--step-body)/1.2 var(--font);
  cursor: pointer;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease;
}
.cell:active { transform: scale(0.98); }
.cell--ink { background: var(--paper); color: var(--film); }
.cell--tone { background: var(--film); color: var(--paper); }
@media (hover: hover) and (pointer: fine) {
  .cell--ink:hover { background: #f0efe8; }
  .cell--tone:hover { background: #0f1312; }
}

.sizer__fine { color: var(--muted-film); font-size: var(--step-small); max-width: 52ch; }

@media (min-width: 900px) {
  .sizer__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "plate head" "plate panel";
    grid-template-rows: auto 1fr;
    gap: 1.5rem clamp(2rem, 4vw, 4.5rem);
    min-height: 88svh;
  }
  .sizer__head { grid-area: head; }
  .sizer__plate { grid-area: plate; align-self: center; }
  .sizer__panel { grid-area: panel; }
}
@media (max-width: 699px) {
  .cells .cell { min-height: 60px; }
}

/* --------------------------------------------------------------------------
   Accuracy: a picture with two figure tiles
   -------------------------------------------------------------------------- */

.accuracy { margin-top: var(--section-gap); padding: 0 var(--margin); }
.accuracy__title { font-size: var(--step-head); padding: 0 var(--pad) 2.5rem; max-width: 22ch; }
.mosaic { display: grid; }
.mosaic__pic { background: var(--film-2); padding: clamp(1.25rem, 3vw, 3rem); display: grid; place-items: center; }
.mosaic__pic figure { width: 100%; max-width: 760px; }
.mosaic__pic figcaption { margin-top: 1rem; color: var(--muted-film); font-size: var(--step-small); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { padding: 28px; display: flex; flex-direction: column; gap: 0.75rem; }
.tile--jade { background: var(--jade); color: var(--film); }
.tile--paper { background: var(--paper); color: var(--film); }
.tile__fig { font-size: var(--step-figure); line-height: 0.95; letter-spacing: -0.04em; }
.tile__cap { max-width: 22ch; font-size: var(--step-body); line-height: 1.4; }
.tile__dots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 1rem; }
.tile__dots span { width: 14px; height: 14px; border-radius: 50%; background: currentColor; }
.tile__dots span.off { background: transparent; border: 2px solid currentColor; }
.tile__dots + small { font-size: var(--step-small); }

@media (min-width: 1100px) {
  .mosaic { grid-template-columns: 2fr 1fr; min-height: 44vw; }
  .tiles { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
}
@media (max-width: 699px) {
  .tile { padding: 18px; }
  .tile__fig { font-size: 12vw; }
  .tile__cap { font-size: var(--step-small); }
  .tile__dots { gap: 4px; }
  .tile__dots span { width: 10px; height: 10px; }
}

/* --------------------------------------------------------------------------
   When more imaging is needed: one big word, filled bars
   -------------------------------------------------------------------------- */

.bigword {
  container-type: inline-size;
  margin-bottom: 20px;
}
.bigword h2 {
  font-stretch: 62%;
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.02;
  letter-spacing: 0;
  font-size: 18.5cqw;
  text-wrap: nowrap;
}
.bigword h2 .line { display: block; }

.bars { display: grid; gap: 6px; max-width: 640px; margin-top: 2rem; }
.bar { background: var(--paper-2); }
.bar summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
  padding: 0.6rem 18px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.bar summary::-webkit-details-marker { display: none; }
.bar summary .plus { position: relative; flex: none; width: 16px; height: 16px; }
.bar summary .plus::before,
.bar summary .plus::after {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 16px; height: 2px;
  background: currentColor;
  transition: transform var(--t-ui) var(--ease-out);
}
.bar summary .plus::after { transform: rotate(90deg); }
.bar[open] summary .plus::after { transform: rotate(0deg); }
.bar__list { list-style: none; padding: 0 18px 20px; display: grid; gap: 14px; }
.bar__item { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; }
.bar__item svg { width: 44px; height: 44px; }
.bar__item small { display: block; color: var(--muted); font-size: var(--step-small); }
.bar__photo { margin: 4px 18px 20px; }
.bar__photo img { width: 100%; max-width: 420px; }
.bar__photo figcaption { margin-top: 0.5rem; font-size: var(--step-small); color: var(--muted); }

@supports (interpolate-size: allow-keywords) {
  .bar { interpolate-size: allow-keywords; }
  .bar::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size 320ms var(--ease-out), content-visibility 320ms allow-discrete;
  }
  .bar[open]::details-content { block-size: auto; }
}

/* --------------------------------------------------------------------------
   What to do next: the decision chart
   -------------------------------------------------------------------------- */

.decide { margin-top: var(--section-gap); padding: 0 var(--margin); }
.decide__inner { padding: clamp(2rem, 5vw, 5rem) var(--pad); }
.decide__head { display: grid; gap: 1rem; margin-bottom: 2.5rem; }
.decide__head h2 { font-size: var(--step-head); max-width: 18ch; }
.decide__head p { color: var(--muted); max-width: 52ch; }
.flow { color: var(--ink); }
.flow svg text { font-family: var(--font); }
.flow--tall { display: none; }
@media (max-width: 899px) {
  .flow--wide { display: none; }
  .flow--tall { display: block; max-width: 420px; margin-inline: auto; }
}
.flow-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; margin-top: 1.75rem; font-size: var(--step-small); color: var(--ink); }
.flow-legend span { display: inline-flex; align-items: center; gap: 0.5rem; }
.flow-legend svg { width: 18px; height: 18px; }

@media (min-width: 900px) {
  .decide__head { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: end; }
}

/* --------------------------------------------------------------------------
   Treatment: the heading holds while the options pass
   -------------------------------------------------------------------------- */

.treat { margin-top: var(--section-gap); padding: 0 var(--pad); }
.treat__inner { display: grid; gap: 2.5rem; }
.treat__title {
  font-size: clamp(3.5rem, 2rem + 6vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.035em;
}
.treat__lead { margin-top: 1.25rem; max-width: 30ch; color: var(--muted-film); font-size: var(--step-lead); line-height: 1.35; }
.option { display: grid; gap: 1.25rem; }
.option + .option { margin-top: clamp(4rem, 7vw, 7.5rem); }
.option h3 { font-size: var(--step-lead); font-weight: 600; letter-spacing: -0.01em; }
.option__row { display: grid; gap: 1.25rem; }
.option__pic { background: var(--film-2); }
.option__pic img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.option__pic svg { width: 100%; }
.option__pic figcaption { padding: 0.6rem 0.75rem 0.75rem; font-size: var(--step-small); color: var(--muted-film); }
.option__list { list-style: none; display: grid; gap: 14px; font-size: var(--step-body); }
.option__list li { padding-left: 1.4rem; position: relative; }
.option__list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--jade);
}

@media (min-width: 1100px) {
  .treat__inner { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 var(--margin); }
  .treat__side { grid-column: 1 / span 5; }
  .treat__sticky { position: sticky; top: 32px; }
  .treat__options { grid-column: 7 / span 6; }
  .option__row { grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 2rem; }
  .option__row--flip { grid-template-columns: minmax(0, 1fr) 220px; }
  .option__row--flip .option__pic { order: 2; }
  .option__pic img { aspect-ratio: 3 / 4; }
}

/* --------------------------------------------------------------------------
   Questions beside a tall picture
   -------------------------------------------------------------------------- */

.faq { margin-top: var(--section-gap); padding: 0 var(--margin); }
.faq__inner { display: grid; gap: 3rem; padding: 0 var(--pad) clamp(3rem, 6vw, 6rem); }
.faq__copy { padding-top: clamp(3rem, 6vw, 6rem); }
.faq__copy h2 { font-size: var(--step-head); max-width: 14ch; margin-bottom: 1.5rem; }
.facts { list-style: none; display: grid; gap: 0.4rem; font-size: var(--step-body); margin-bottom: 2.25rem; }
.facts strong { font-weight: 600; }
.qa { display: grid; gap: 0; max-width: 48ch; }
.qa details { padding: 14px 0; }
.qa summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  align-items: center;
  font-size: var(--step-body);
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}
.qa summary::-webkit-details-marker { display: none; }
.chev { position: relative; flex: none; width: 14px; height: 14px; transition: transform var(--t-ui) var(--ease-out); }
.chev::before,
.chev::after { content: ""; position: absolute; top: 5px; width: 9px; height: 2px; background: currentColor; }
.chev::before { left: 0; transform: rotate(45deg); }
.chev::after { right: 0; transform: rotate(-45deg); }
.qa details[open] .chev { transform: rotate(180deg); }
.qa details p { margin-top: 0.5rem; color: var(--muted); }
.faq__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: 2rem; }

.faq__pics { position: relative; }
.faq__tall { background: var(--paper-2); overflow: hidden; }
.faq__tall img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.faq__square {
  position: absolute;
  right: 6%;
  bottom: -40px;
  width: 38%;
  background: var(--film);
}
.faq__square img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.faq__credit { margin-top: 56px; font-size: var(--step-small); color: var(--muted); max-width: 40ch; }

@media (min-width: 1100px) {
  .faq__inner { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0 var(--margin); padding-bottom: 80px; }
  .faq__copy { grid-column: 1 / span 5; }
  .faq__pics { grid-column: 7 / span 6; margin-top: calc(var(--section-gap) * -0.35); }
  .faq__square { left: -40px; right: auto; width: 33%; bottom: 120px; }
}

/* --------------------------------------------------------------------------
   Contact: the number as display type
   -------------------------------------------------------------------------- */

.contact {
  position: relative;
  margin-top: var(--section-gap);
  min-height: 100svh;
  padding: clamp(1.5rem, 3vw, 2.5rem) var(--pad);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--paper);
  color: var(--ink);
}
.contact__ask { font-size: var(--step-lead); font-weight: 400; letter-spacing: 0; max-width: 30ch; line-height: 1.35; }
.contact__big {
  align-self: end;
  margin-bottom: 12vh;
  display: block;
  font-size: clamp(3.5rem, 16vw, 16rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--t-hover) ease;
}
@media (hover: hover) and (pointer: fine) {
  .contact__big:hover { color: var(--jade-deep); }
}
@media (max-width: 699px) {
  .contact__big { font-size: 22vw; white-space: normal; }
  .contact__big span { display: block; }
}
.contact__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  font-size: var(--step-body);
}
.contact__foot div { display: grid; gap: 0.25rem; }
.contact__foot a { text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
.contact :focus-visible { outline-color: var(--jade-deep); }
.sample { color: var(--muted); }

/* --------------------------------------------------------------------------
   Footer: a quiet close
   -------------------------------------------------------------------------- */

.site-foot {
  padding: 30svh var(--pad) 30px;
  color: var(--muted-film);
  font-size: var(--step-small);
}
.site-foot__line {
  display: grid;
  gap: 0.5rem;
}
.site-foot__links { display: flex; flex-wrap: wrap; gap: 0.25rem 24px; }
.site-foot__links a { color: var(--paper); }
.site-foot__notes { margin-top: 2.5rem; display: grid; gap: 0.75rem; max-width: 72ch; }
.site-foot__notes a { color: var(--paper); }

@media (min-width: 900px) {
  .site-foot__line { grid-template-columns: 1fr auto 1fr; align-items: baseline; }
  .site-foot__line > :last-child { justify-self: end; }
}

/* --------------------------------------------------------------------------
   Home page: the article index
   -------------------------------------------------------------------------- */

.library { padding: var(--section-gap) var(--pad); }
.library h2 { font-size: var(--step-head); margin-bottom: 2rem; }
.index { list-style: none; position: relative; }
.index__row {
  display: grid;
  gap: 1rem;
  padding: 1.5rem 0;
  text-decoration: none;
}
.index__name { font-size: var(--step-figure); line-height: 1; letter-spacing: -0.035em; text-decoration: underline; text-decoration-thickness: 0.04em; text-underline-offset: 0.12em; text-decoration-color: transparent; transition: text-decoration-color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) {
  .index__row:hover .index__name { text-decoration-color: currentColor; }
}
.index__desc { max-width: 40ch; }
.index__meta { color: var(--muted); font-size: var(--step-small); }
.index__thumb { background: var(--film-2); max-width: 420px; }
.index__thumb img { width: 100%; }
.index__next { margin-top: 2.5rem; padding: 1.25rem 1.4rem; background: var(--paper-2); max-width: 44ch; }



.about { padding: 0 var(--pad) var(--section-gap); }
.about h2 { font-size: var(--step-head); margin-bottom: 1.5rem; }
.about p { max-width: 46ch; }
.about p + p { margin-top: 1em; }

/* a picture that fills its panel edge to edge, under the bar */
.frame--cover { padding: 0; }
.frame__cover { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 42%; }
.hero-photo__img .frame__cover { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; }
.hero-photo__img:has(.frame__cover) { padding: 0; }

/* --------------------------------------------------------------------------
   Motion: written so the finished state is the default
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  /* hero: the two headline lines rise from behind their baselines */
  .js .hero-title .line { overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
  .js .hero-title .line > span {
    display: block;
    transform: translateY(105%);
    animation: line-up 900ms var(--ease-out) forwards;
    animation-delay: calc(var(--i, 0) * 110ms + 150ms);
  }
  .js [data-rise] {
    opacity: 0;
    transform: translateY(18px);
    animation: rise var(--t-reveal) var(--ease-out) forwards;
    animation-delay: calc(var(--i, 0) * 90ms + 380ms);
  }
  .js .hero-photo__img img,
  .js .frame--hero img {
    animation: settle 1600ms var(--ease-soft) both;
  }

  /* sections: parts arrive in reading order, once */
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out);
    transition-delay: calc(var(--i, 0) * 75ms);
  }
  .js [data-reveal].is-in { opacity: 1; transform: none; }

  /* pictures open from the top edge */
  .js [data-shutter] {
    clip-path: inset(0 0 100% 0);
    transition: clip-path 1100ms var(--ease-in-out);
  }
  .js [data-shutter] img { transform: scale(1.08); transition: transform 1500ms var(--ease-soft); }
  .js [data-shutter].is-in { clip-path: inset(0); }
  .js [data-shutter].is-in img { transform: none; }

  /* diagram strokes draw themselves when their figure arrives */
  .draw-ready .is-in .draw,
  .draw-ready .frame.is-active .draw { animation: draw 1400ms var(--ease-out) both; animation-delay: 250ms; }

  /* the treatment heading drifts a little as it passes */
  @supports (animation-timeline: view()) {
    .drift { animation: drift linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
  }
}

@keyframes line-up { to { transform: none; } }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dashoffset: var(--len, 600); } to { stroke-dashoffset: 0; } }
@keyframes drift { from { transform: scale(1.08) translateY(-3%); } to { transform: scale(1.08) translateY(3%); } }

.draw-ready .draw { stroke-dasharray: var(--len); }

/* annotations on the hero ultrasound appear one at a time, like a finger pointing */
.callout { transition: opacity 700ms var(--ease-soft); }
.js .annotate[data-step] .callout { opacity: 0.18; }
.js .annotate[data-step="1"] .callout--1,
.js .annotate[data-step="2"] .callout--2,
.js .annotate[data-step="3"] .callout--3,
.js .annotate[data-step="4"] .callout--4,
.js .annotate[data-step="all"] .callout { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .frame { transition: opacity 200ms linear, visibility 0s linear 200ms; }
  .frame.is-active { transition: opacity 200ms linear, visibility 0s; }
  .callout { transition: none; }
}

/* --------------------------------------------------------------------------
   Print: paper only
   -------------------------------------------------------------------------- */

@media print {
  body { background: #fff; color: #000; }
  .split__stage, .hero-photo, .sizer, .contact__big, .skip-link { display: none !important; }
  .inline-fig { background: #fff; color: #000; }
}

/* --------------------------------------------------------------------------
   Figures: labels, annotated scans, pairs
   -------------------------------------------------------------------------- */

.fig svg text { font-family: var(--font); }
.lbl { font-size: 19px; }
@media (max-width: 699px) {
  .lbl { font-size: 24px; }
}

/* a real scan with drawn pointers around it; the picture sits at a fixed place in the box */
.annobox { position: relative; width: 100%; aspect-ratio: 760 / 600; }
.annobox > img { position: absolute; left: 10.53%; top: 9%; width: 78.95%; height: auto; }
.annobox__ink { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.annobox--ct { aspect-ratio: 560 / 500; }
.annobox--ct > img { left: 14.11%; top: 4%; width: 71.79%; }
.frame .annobox { width: min(100%, calc((100svh - 190px) * 760 / 600)); margin-inline: auto; }
.frame .annobox--ct { width: min(100%, calc((100svh - 190px) * 560 / 500)); }
.frame .annobox__ink { max-height: none; }

.pair { display: grid; gap: 1.5rem; }
.pair__label { margin-bottom: 0.5rem; font-size: var(--step-small); font-weight: 600; color: var(--paper); }
.pair img { width: 100%; }
.frame .pair img { width: auto; max-height: 32svh; }
.frame .pair__item { display: grid; justify-items: center; }

/* the typical-cyst drawing names its features in the picture on wide screens, as a list on small ones */
.typ-list { display: none; }
@media (max-width: 699px) {
  .typ-labels, .typ-leaders { display: none; }
  .typ-list { display: grid; gap: 0.35rem; list-style: none; margin-top: 1.25rem; font-size: var(--step-body); color: var(--paper); }
  .typ-list li { padding-left: 1.2rem; position: relative; }
  .typ-list li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 7px; height: 7px; border-radius: 50%; background: var(--jade); }
}

.flow-note { margin-top: 1.5rem; max-width: 60ch; color: var(--ink); }
.option__intro { color: var(--muted-film); }
.option__list--wide { font-size: var(--step-lead); gap: 10px; }
.option__list--wide li::before { top: 0.6em; }

/* contents: the article is long, so the parts are one tap away */
.toc { margin-top: 2.75rem; max-width: 34ch; }
.toc__label { font-weight: 600; margin-bottom: 0.5rem; }
.toc ul { list-style: none; display: grid; }
.toc a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink);
}
.toc a::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--jade-deep); }
@media (hover: hover) and (pointer: fine) {
  .toc a:hover { text-decoration: underline; text-decoration-color: currentColor; }
}
