/* ============================================================
   layout.css — page structure + sections + header + footer
   ============================================================ */

/* ---------- Containers ---------- */
.container        { width: 100%; padding-inline: var(--space-5); margin-inline: auto; }
.container-prose  { max-width: var(--w-prose); }

/* ---------- Brand mark — NOT a bar ----------
   No fixed bar, no background/blur/border. The site name simply sits on the paper at the top of the
   page in normal flow and scrolls away with it (the theme toggle is separate + fixed, below). */
.brand-mark {
  position: relative;
  z-index: var(--z-header);
  text-align: center;
  padding-block: var(--space-4);
}
/* Desktop: float the brand (out of flow, no layout height) so the hero pin centres in the FULL viewport
   and the flower can be large without the in-flow brand nudging it down / clipping it at the top. On
   mobile the brand stays in flow — there the disc stacks on top and the brand must not overlay it. */
@media (min-width: 861px) {
  .brand-mark { position: absolute; inset-inline: 0; inset-block-start: 0; }
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-400);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
/* Theme toggle — the one piece of permanent chrome: fixed to the viewport corner so it survives
   scroll instead of leaving with the brand mark. */
.theme-toggle {
  position: fixed;
  inset-block-start: var(--space-4);
  inset-inline-end: var(--space-5);
  z-index: var(--z-header);
  display: inline-flex; gap: 2px; align-items: center;
  padding: 3px;
  background: var(--bg-sunken);
  border-radius: 999px;
  border: 1px solid var(--rule);
}
.theme-toggle button {
  inline-size: 28px; block-size: 28px;
  display: grid; place-items: center;
  border-radius: 999px;
  color: var(--ink-faint);
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.theme-toggle button:hover { color: var(--ink); }
.theme-toggle button[aria-pressed="true"] {
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: var(--shadow-1);
}
.theme-toggle svg { inline-size: 14px; block-size: 14px; }

/* ---------- Hero — "The Receipt" (D43): one month of living, Jan 2019 → Dec 2025 ----------
   Asymmetric editorial split: framing text LEFT, the receipt RIGHT. The section is a tall track;
   the inner .hero__pin is sticky, so the PAGE DOES NOT MOVE while ReceiptHero.js scrubs the
   register — the date ticks month-by-month and every line climbs along its real Eurostat HICP
   category index (EU-27), TOTAL €100.00 → €135.64. Phone: receipt on top, text below.
   Reduced-motion: one static end-state screen (Dec 2025, struck 2019 prices, stamp drawn). */
.hero {
  position: relative;
  height: 600dvh;                /* ~5 screens of scrub across 84 months — 340→480→600dvh (owner: ticking still too fast); dvh matches the pin so the mobile URL-bar resize doesn't scrub the register against a mismatched track */
  margin: 0;
}
.hero__pin {
  position: sticky;
  inset-block-start: 0;
  block-size: 100vh; block-size: 100dvh;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(var(--space-5), 6vw, var(--space-10));
  padding-inline: clamp(var(--space-5), 7vw, var(--space-11));
  padding-block: var(--space-6);
  overflow: hidden;
}
/* LEFT — the framing text: eyebrow, headline, the €100 framing sentence, the closing question. */
.hero__text {
  flex: 1 1 38%;
  max-inline-size: 46ch;
  min-inline-size: 0;
  display: flex; flex-direction: column; align-items: flex-start;
  gap: var(--space-4);
  text-align: start;
}
.hero__eyebrow {
  font-family: var(--font-ui); font-size: var(--fs-200); font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); margin: 0;
}
/* Minimal hero (D45): NO visual headline — the h1 is .sr-only. The QUESTION owns the vacated
   headline slot: it sits above the lead in the DOM and lands at headline scale at q≥0.96,
   AFTER the stamp finishes — the screen resolves into the question the essay answers. */
.hero__lead {
  font-family: var(--font-body); font-size: var(--fs-400); line-height: var(--lh-relaxed);
  color: var(--ink); margin: 0; max-inline-size: 36ch;
}
.hero__lead strong { color: var(--ink-strong); }
/* [owner request] Was Source Serif 4 ITALIC. Now the UI grotesk, upright — the plainest face in
   the system, so the line reads as a plain question rather than a flourish. A sans at display size
   needs its own tuning, not the serif's: tighter tracking (-0.015em vs -0.005em) because grotesk
   counters open up as they scale, weight 500 so it holds against the receipt beside it without
   shouting, and a touch more leading since the x-height is larger. */
.hero__question {
  font-family: var(--font-ui); font-style: normal; font-weight: 500;
  font-size: clamp(26px, 2.9vw, 38px); line-height: 1.32; letter-spacing: -0.015em;
  color: var(--ink-strong); margin: 0; max-inline-size: 20ch;
  opacity: 0; transform: translateY(14px);
  transition: opacity var(--dur-5) var(--ease-out), transform var(--dur-5) var(--ease-out);
}
.hero__question em { color: var(--accent); font-style: inherit; }
.hero__question.is-in { opacity: 1; transform: none; }
/* RIGHT — the receipt: a lit thermal-paper object dropped on the FT page (live type, no image),
   with the timeline scrubber beneath it (D45). */
.hero__stage {
  flex: 1 1 56%; margin: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 22px;
  min-inline-size: 0;
}
.receipt {
  position: relative;
  inline-size: clamp(300px, 27vw, 380px);
  transform: rotate(-1.2deg);
  filter: drop-shadow(0 18px 28px rgba(60,42,12,.16)) drop-shadow(0 3px 8px rgba(60,42,12,.12));
}
.rc-defs { position: absolute; inline-size: 0; block-size: 0; overflow: hidden; }
.receipt__paper {
  position: relative;
  background: var(--receipt-paper); color: var(--receipt-ink);
  padding: 28px 26px 20px;
}
/* Perforated / torn zigzag edges (pure CSS sawtooth, receipt-paper on transparent). */
.receipt__paper::before, .receipt__paper::after {
  content: ""; position: absolute; inset-inline: 0; block-size: 11px;
  background-size: 16px 11px; background-repeat: repeat-x;
}
.receipt__paper::before {
  inset-block-start: -11px;
  background-image:
    linear-gradient(135deg, transparent 8px, var(--receipt-paper) 8px),
    linear-gradient(-135deg, transparent 8px, var(--receipt-paper) 8px);
}
.receipt__paper::after {
  inset-block-end: -11px;
  background-image:
    linear-gradient(45deg, transparent 8px, var(--receipt-paper) 8px),
    linear-gradient(-45deg, transparent 8px, var(--receipt-paper) 8px);
}
/* NOTE: base.css paints p/ul with --ink-soft (which flips LIGHT in dark mode) — every receipt
   element states its ink explicitly so the print never washes out (owner attack, 2026-07-04). */
.receipt__head {
  font-family: var(--font-ui); font-size: 11px; font-weight: 600; color: var(--receipt-ink);
  letter-spacing: 0.24em; text-transform: uppercase; text-align: center; margin: 0;
}
.receipt__date {
  font-family: var(--font-mono); font-size: 21px; font-weight: 700; color: var(--receipt-ink);
  letter-spacing: 0.08em; text-align: center; margin: 10px 0 4px;
  font-variant-numeric: tabular-nums;
}
.receipt__rule { border: 0; border-block-start: 1.5px dashed var(--receipt-rule); margin: 10px 0 12px; }
/* Register message — events PRINT on the receipt like a till message (replaces the floating
   side-annotation the owner couldn't catch). Fixed one-line slot: no reflow, always same spot. */
.receipt__msg {
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase; text-align: center;
  color: var(--receipt-ink); min-block-size: 15px; margin: 2px 0 0; opacity: 0;
}
.receipt__lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--receipt-ink); }
.receipt__line {
  display: flex; align-items: center; gap: 8px; margin: 0;
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.rc-glyph { inline-size: 17px; block-size: 17px; flex: none; color: var(--receipt-ink); }
.rc-name { white-space: nowrap; }
.rc-dots { flex: 1; min-inline-size: 12px; border-block-end: 2px dotted var(--receipt-rule); margin-block-end: 3px; }
.rc-price {
  font-family: var(--font-mono); font-size: 13.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
/* The Jan-2019 price, struck through — shown only in the static (reduced-motion) end state. */
.rc-was {
  display: none;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--receipt-ink-soft);
  text-decoration: line-through; margin-inline-start: 2px;
}
.receipt__total { display: flex; align-items: baseline; gap: 10px; margin-block-start: 2px; position: relative; }
.receipt__total .rc-name {
  font-family: var(--font-ui); font-size: 13px; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
}
.rc-total-num {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(30px, 2.7vw, 38px); letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
/* The claret stamp — a hand-drawn ellipse around the total; ReceiptHero.js scrubs the dash. */
.rc-stamp {
  position: absolute; pointer-events: none; overflow: visible;
  inline-size: 62%; block-size: 200%;
  inset-inline-end: -4%; inset-block-start: -55%;
  transform: rotate(-3deg);
}
.rc-stamp ellipse {
  fill: none; stroke: var(--receipt-stamp); stroke-width: 3;
  stroke-linecap: round; opacity: 0.9;
}
.receipt__note {
  font-family: var(--font-ui); font-size: 9px; line-height: 1.55; letter-spacing: 0.04em;
  color: var(--receipt-ink-soft); text-align: center; margin: 16px 0 0;
}

/* ===== CODA — the receipt, six years on (brief §7). Reuses .receipt ~70%; static, no scrub. ===== */
.section-prose--tight { padding-block: var(--space-6) 0; }
.section-coda { text-align: center; }
.coda-lede {
  font-family: var(--font-display); font-style: italic; font-weight: 600;
  font-size: var(--fs-700); line-height: 1.12; color: var(--ink-strong);
  margin: 0 auto var(--space-8); max-inline-size: 22ch;
}
.coda-receipt { display: flex; justify-content: center; margin-block-end: var(--space-8); }
.receipt--coda { inline-size: min(84vw, 288px); transform: rotate(-1deg); }
.receipt--coda .rc-was { display: inline; }             /* the struck 2019 column, always shown here */
.section-coda .about-lede { margin-inline: auto; }
@media (prefers-reduced-motion: reduce) { .receipt--coda { transform: none; } }
/* Timeline scrubber (D45) — hairline 2019→2025 under the receipt: ▸/■ icon button (no words),
   claret playhead synced to the eased register clock, event ticks, click-to-seek. FT grammar. */
.hero__timeline {
  display: flex; align-items: center; gap: 12px;
  inline-size: clamp(300px, 27vw, 380px);
  font-family: var(--font-mono);
  transform: rotate(-1.2deg);           /* same tilt as the receipt — one object family (D46) */
}
.rc-tl-play {
  inline-size: 30px; block-size: 30px; flex: none; padding: 0;
  display: grid; place-items: center;
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--rule-bold); border-radius: 999px; cursor: pointer;
  transition: color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
/* [P4.4] State-changing hovers are gated to devices that actually have a hover. On a touch
   screen a tap synthesises :hover and it STICKS until the next tap elsewhere, so these read as
   a control left switched on. Only the ones that swap colours are gated; opacity-only hovers
   are left alone, since a lingering fade is not misleading. */
@media (hover: hover) and (pointer: fine) {
  .rc-tl-play:hover { color: var(--accent); border-color: var(--accent); }
}

.rc-tl-play svg { inline-size: 11px; block-size: 11px; fill: currentColor; }
.rc-tl-play .rc-tl-ic-stop { display: none; }
.rc-tl-play[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.rc-tl-play[aria-pressed="true"] .rc-tl-ic-play { display: none; }
.rc-tl-play[aria-pressed="true"] .rc-tl-ic-stop { display: block; }
/* [D90-I1] --ink-soft, not --ink-faint: at 9.5px these are small text and need 4.5:1, but
   --ink-faint is documented (tokens.css) as ">=18px text or graphics only" and measures 3.87:1
   on paper -- the one contrast failure Lighthouse and axe both flagged in the hero. --ink-soft
   is 8.15:1 light / 8.83:1 dark. Size and weight unchanged; only the ink darkens. */
.rc-tl-year { font-size: 9.5px; letter-spacing: 0.06em; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.rc-tl-line { position: relative; flex: 1; block-size: 20px; cursor: pointer; touch-action: none; }
.rc-tl-line:active { cursor: grabbing; }
.rc-tl-line::before {
  content: ""; position: absolute; inset-inline: 0; inset-block-start: 50%;
  block-size: 1.5px; background: var(--rule);
}
.rc-tl-tick {
  position: absolute; inset-block-start: 50%;
  inline-size: 4px; block-size: 4px; margin: -2px 0 0 -2px;
  border-radius: 50%; background: var(--ink-fainter);
}
.rc-tl-head {
  position: absolute; inset-block-start: 50%;
  inline-size: 9px; block-size: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg);
}

/* Phone / narrow — stack with the RECEIPT ON TOP, text below (column-reverse: figure is 2nd in the DOM). */
@media (max-width: 860px) {
  .hero__pin { flex-direction: column-reverse; gap: var(--space-4); }
  .hero__text { flex-basis: auto; max-inline-size: 100%; align-items: center; text-align: center; gap: var(--space-2); }
  .hero__lead { font-size: var(--fs-300); max-inline-size: 34ch; }
  .hero__question { font-size: clamp(19px, 5.4vw, 24px); max-inline-size: 24ch; }
  .hero__stage { flex-basis: auto; gap: 14px; }
  .receipt { inline-size: min(78vw, 300px); }
  .receipt__paper { padding: 20px 20px 14px; }
  .receipt__lines { gap: 7px; }
  .rc-total-num { font-size: 27px; }
  .hero__timeline { inline-size: min(78vw, 300px); }
}

/* Reduced-motion (or .hero--static set by ReceiptHero.js): no pin, no dead scroll track — one
   static screen at the resolved end-state (DEC 2025, struck 2019 column, stamp drawn, question shown). */
.hero--static { height: auto; min-block-size: 100vh; }
.hero--static .hero__pin { position: static; block-size: auto; min-block-size: 100vh; }
.hero--static .rc-was { display: inline; }
.hero--static .hero__question { opacity: 1; transform: none; }
.hero--static .receipt__msg { display: none; }
.hero--static .hero__timeline { display: none; }
@media (prefers-reduced-motion: reduce) {
  .hero { height: auto; min-block-size: 100vh; }
  .hero__pin { position: static; block-size: auto; min-block-size: 100vh; }
  .rc-was { display: inline; }
  .hero__question { opacity: 1; transform: none; }
  .receipt__msg { display: none; }
  .hero__timeline { display: none; }
}

/* Perf (owner STEP-1) — keep the footer (below the fold, static) out of the initial render budget.
   Scoped to the footer only; chart chapters need live getBoundingClientRect sizing + scroll motion. */
.site-footer { content-visibility: auto; contain-intrinsic-size: 0 420px; }

/* About section (right after the hero) — centred credit block + one short inflation paragraph (owner review PART C). */
.section-about { text-align: center; }
.about-credit { margin-block: var(--space-7) var(--space-7); }
.about-credit__by {                       /* minimal — not big/bold (owner request) */
  font-family: var(--font-ui); font-weight: 500; font-size: var(--fs-300);
  color: var(--ink); letter-spacing: 0; margin: 0;
}
.about-credit__role {
  font-family: var(--font-ui); font-size: var(--fs-200); color: var(--ink-soft);
  margin: var(--space-1) 0 0;
}
.about-credit__meta {
  font-family: var(--font-ui); font-size: var(--fs-200); color: var(--ink-soft);
  margin: var(--space-1) 0 0;
}
.about-credit__logo {
  display: block; margin: var(--space-5) auto 0;
  inline-size: clamp(190px, 24vw, 280px); block-size: auto;   /* transparent SVG — no frame; real proportions */
}
/* [debug 2026-07-07] Supervisor name is a real <a> (unlike the InfoPop-flagged triggers around it,
   which are plain spans) so it needs an explicit override of the global a{} link style — invisible
   at rest to match this task's affordance rule; cursor:help is the only tell. */
.ac-plain-link { color: inherit; text-decoration: none; cursor: help; }

/* UniGe logo lightbox (owner feature request) — enlarged image over a paper backdrop, fades + scales
   in together on --dur-4/--ease-out. Reduced-motion: appears instantly (see StaticInfoPops.js). */
.unige-lightbox {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-overlay);
  opacity: 0; transition: opacity var(--dur-4) var(--ease-out);
}
.unige-lightbox.is-in { opacity: 1; }
.unige-lightbox[hidden] { display: none; }
.unige-lightbox__img {
  inline-size: min(560px, 82vw); block-size: auto; max-block-size: 82vh;
  transform: scale(0.88); transition: transform var(--dur-4) var(--ease-out);
}
.unige-lightbox.is-in .unige-lightbox__img { transform: scale(1); }
.unige-lightbox__close {
  position: absolute; top: var(--space-5); right: var(--space-5);
  inline-size: 36px; block-size: 36px; border-radius: 50%; border: 1px solid var(--rule);
  background: var(--bg-elev); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer;
}
.unige-lightbox__close:hover { background: var(--bg-sunken); }
@media (prefers-reduced-motion: reduce) {
  .unige-lightbox, .unige-lightbox__img { transition: none; }
}
.about-lede {
  font-family: var(--font-body); font-size: var(--fs-400); color: var(--ink);
  line-height: var(--lh-relaxed); max-inline-size: 56ch; margin-inline: auto; text-wrap: pretty;
}

/* Reveal-on-scroll (owner request) — credit lines + logo + lede fade/rise in when scrolled into view.
   A generic IntersectionObserver in main.js adds .is-in. Reduced-motion: shown immediately, no transition. */
.reveal-up {
  opacity: 0; transform: translateY(18px);
  transition: opacity var(--dur-5) var(--ease-out), transform var(--dur-5) var(--ease-out);
}
.reveal-up.is-in { opacity: 1; transform: none; }
.about-credit .reveal-up:nth-child(2) { transition-delay: 90ms; }
.about-credit .reveal-up:nth-child(3) { transition-delay: 180ms; }
.about-credit .reveal-up:nth-child(4) { transition-delay: 270ms; }
@media (prefers-reduced-motion: reduce) {
  .reveal-up { opacity: 1; transform: none; transition: none; }
}

/* Very short screens — keep the pinned receipt within one viewport. */
@media (max-height: 640px) {
  .receipt { inline-size: min(46vh, 80vw, 330px); }
  .receipt__paper { padding: 20px 22px 16px; }
  .receipt__lines { gap: 7px; }
  .rc-total-num { font-size: 28px; }
  .hero__pin { gap: var(--space-4); }
}

/* ---------- Generic prose section ---------- */
.section-prose {
  padding-block: var(--space-10);
}
.section-prose .container { max-width: var(--w-prose); }
/* Methodology subhead (replaces an inline style= on the #methodology h3). */
.methodology-subhead {
  margin-block-start: var(--space-6);
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-500);
  font-weight: 400;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-block-start: var(--space-12);
  padding-block: var(--space-9) var(--space-7);
  border-block-start: 1px solid var(--rule);
  background: var(--bg-sunken);
  color: var(--ink-soft);
}
.site-footer .container { max-width: var(--w-content); }
.site-footer h4 {
  font-family: var(--font-display);
  font-size: var(--fs-400);
  margin-block-end: var(--space-3);
  color: var(--ink);
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--space-7);
  margin-block-end: var(--space-7);
}
.site-footer .footer-grid p,
.site-footer .footer-grid li { font-size: var(--fs-200); color: var(--ink-soft); }
.site-footer ul { list-style: none; padding: 0; }
/* [R2·1e] Footer "Data/Built with" links used --accent (3.86:1 on cream — fails AA);
   the AA-safe deep terracotta passes. */
.site-footer a { color: var(--accent-text); }
.site-footer .legal {
  border-block-start: 1px solid var(--rule);
  padding-block-start: var(--space-5);
  font-size: var(--fs-100);
  color: var(--ink-soft);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4);
}

