/* ══════════════════════════════════════════════════════════════════
   PDÖ — single-page editorial layout (structure from avenoxai/sifirdan/site)
   Clinical palette: cool paper + navy ink + teal accent. Typography does most of the work.
   ══════════════════════════════════════════════════════════════════ */

/* variable fonts, served locally (works offline and over file://) */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('fonts/Fraunces-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('fonts/Fraunces-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400 900; font-display: swap; src: url('fonts/SchibstedGrotesk-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Schibsted Grotesk'; font-style: normal; font-weight: 400 900; font-display: swap; src: url('fonts/SchibstedGrotesk-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('fonts/JetBrainsMono-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('fonts/JetBrainsMono-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper:      #F4F7F8;
  --paper-2:    #E8EFF2;
  --surface:    #FFFFFF;
  --ink:        #132A3E;   /* navy, ~13:1 on paper */
  --ink-panel:  #0F2233;
  --muted:      #4E6274;   /* ~6:1 on paper */
  --faint:      #8497A8;
  --accent:     #0E7C74;   /* teal, ~4.9:1 on paper */
  --accent-2:   #13A397;
  --accent-soft:#CDEBE6;
  --sand:       #B8C7D3;
  --sand-soft:  #DCE6EC;
  --brick:      #B4472F;

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans:  'Schibsted Grotesk', -apple-system, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --mono:  'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  --rule: 1px solid rgba(19, 42, 62, .13);
  --rule-strong: 2px solid var(--ink);
  --maxw: 980px;
  --rail-w: 248px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(17px, .45vw + 14px, 20px);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  /* faint dot texture, as in the reference — barely visible */
  background-image:
    radial-gradient(circle at 12% 20%, rgba(184, 199, 211, .22) 0 1px, transparent 1px),
    radial-gradient(circle at 63% 71%, rgba(184, 199, 211, .16) 0 1px, transparent 1px);
  background-size: 7px 7px, 11px 11px;
}

::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
section:focus, section:focus-visible { outline: none; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 2px;
}
.skip:focus { top: 12px; }

/* ── typography ──────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--serif); font-weight: 900; letter-spacing: -.02em; margin: 0; color: var(--ink); }
h1 { font-size: clamp(2.8rem, 7.5vw, 6.2rem); line-height: .95; }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.05; }
h3 { font-size: 1.42rem; line-height: 1.2; font-weight: 600; }

p { margin: 0 0 1.05em; }
a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; }

.kicker {
  font-family: var(--sans); font-size: .72rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.lede { font-size: 1.22rem; line-height: 1.55; max-width: 58ch; }
.dim { color: var(--muted); }
.em { color: var(--accent); }

kbd {
  font-family: var(--mono); font-size: .7em;
  border: 1px solid rgba(19, 42, 62, .28); border-bottom-width: 2px;
  border-radius: 3px; padding: 0 4px; background: var(--surface);
}

/* ── shell + rail ────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 100vh; }

.rail {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  border-right: var(--rule);
  padding: 22px 18px;
  display: flex; flex-direction: column; gap: 18px;
  background: rgba(244, 247, 248, .9);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 20;
}
/* scroll progress along the rail edge */
.rail::after {
  content: ""; position: absolute; top: 0; right: -1px; width: 3px; height: 100%;
  background: var(--accent);
  transform: scaleY(var(--p, 0)); transform-origin: top;
}

.rail-top { display: flex; align-items: center; gap: 12px; }
.brand {
  display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 10px;
  text-decoration: none; color: var(--ink);
}
.brand .brand-mark { grid-row: span 2; }
.brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-weight: 700; font-size: 1.15rem;
}
.brand .wordmark { display: block; font-family: var(--serif); font-weight: 900; font-size: 1.1rem; letter-spacing: .04em; line-height: 1.1; }
.brand .sub { display: block; font-size: .58rem; line-height: 1.3; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.rail-now, .rail-toggle { display: none; }

#rail-nav { overflow-y: auto; margin: 0 -8px; padding: 0 8px; overscroll-behavior: contain; }
#rail-nav ol { list-style: none; margin: 0 0 6px; padding: 0; }
#rail-nav a {
  display: flex; gap: 9px; align-items: baseline;
  padding: 8px 9px; margin-left: -9px;
  min-height: 44px;
  text-decoration: none; border-radius: 3px;
  font-size: .82rem; line-height: 1.3;
  transition: background .14s ease, color .14s ease;
}
#rail-nav a .n { font-family: var(--mono); font-size: .64rem; color: var(--faint); flex: none; }
#rail-nav a:hover { background: var(--sand-soft); }
#rail-nav a.on { background: var(--ink); color: var(--paper); }
#rail-nav a.on .n { color: var(--accent-soft); }
.nav-home { font-weight: 700; align-items: center !important; }
.nav-group {
  margin: 14px 0 2px; font-size: .64rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
}

.rail footer { margin-top: auto; font-size: .68rem; color: var(--muted); line-height: 1.5; display: grid; gap: 8px; }

main { min-width: 0; }

/* ── sections ────────────────────────────────────────────────── */
section, .group-band {
  padding: 84px clamp(20px, 5vw, 72px);
  border-bottom: var(--rule);
  scroll-margin-top: 0;
}
.inner { max-width: var(--maxw); }
.topic .inner { max-width: 1320px; }

.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.sec-num {
  font-family: var(--mono); font-size: .76rem; font-weight: 700;
  color: var(--ink); background: var(--accent-soft);
  padding: 3px 9px; border-radius: 2px; white-space: nowrap;
}

/* ── hero ────────────────────────────────────────────────────── */
.hero {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: grid; align-content: center;
  border-bottom: var(--rule-strong);
  padding-bottom: 110px;
}
.ep-badge {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-family: var(--mono); font-size: .72rem; font-weight: 700; letter-spacing: .14em;
  border: 1.5px solid var(--ink); padding: 4px 10px; border-radius: 2px; margin-bottom: 18px;
}
.ep-badge .no { background: var(--ink); color: var(--paper); padding: 0 6px; margin-left: -4px; }
.hero h1 { margin: 14px 0 4px; }
.hero h1 .em { font-style: italic; font-weight: 400; }
.hero h1 .word { display: inline-block; white-space: nowrap; }
.hero-rule { height: 7px; background: var(--accent); width: min(520px, 100%); margin: 24px 0 28px; }

.stat-row { display: flex; flex-wrap: wrap; gap: 34px; margin: 34px 0 44px; }
.stat .n { font-family: var(--serif); font-weight: 900; font-size: 2.6rem; line-height: 1; display: block; font-variant-numeric: tabular-nums; }
.stat .l { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* contents cards on the hero */
.toc { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.toc-card {
  background: var(--surface); border: var(--rule); border-top: 3px solid var(--ink);
  padding: 16px 18px 8px;
  transition: box-shadow .25s var(--ease), transform .25s var(--ease), opacity .6s var(--ease);
}
.toc-title { font-size: 1.3rem; margin: 4px 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: flex; gap: 10px; align-items: baseline;
  padding: 10px 4px; min-height: 48px;
  border-top: var(--rule); text-decoration: none; line-height: 1.3; font-weight: 500;
  transition: background .14s ease, padding .2s var(--ease);
}
.toc a .n { font-family: var(--mono); font-size: .7rem; color: var(--accent); font-weight: 700; flex: none; }
.toc a:hover { background: var(--paper-2); padding-left: 10px; }
.toc a:active { background: var(--sand-soft); }
@media (hover: hover) {
  .toc-card:hover { box-shadow: 5px 5px 0 rgba(184, 199, 211, .5); transform: translate(-2px, -2px); }
}

.hero-cue {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.hero-cue-line { width: 2px; height: 34px; background: var(--ink); opacity: .5; transform-origin: top center; }
.hero-cue-t { font-family: var(--mono); font-size: .6rem; font-weight: 700; letter-spacing: .28em; color: var(--muted); }

/* ── group band ──────────────────────────────────────────────── */
.group-band {
  background: var(--ink); color: var(--paper);
  padding-top: 64px; padding-bottom: 64px; border-bottom: 0;
}
.group-band .sec-num { background: var(--accent-2); color: var(--ink-panel); }
.band-title { color: var(--paper); margin-top: 14px; font-size: clamp(2.2rem, 5vw, 3.8rem); }

/* ── topic sections ──────────────────────────────────────────── */
.topic-title { margin-bottom: 30px; max-width: 24ch; }
.subsec { margin: 0 0 38px; padding-top: 26px; border-top: var(--rule); }
.sub-title { margin-bottom: 14px; color: var(--ink); }
/* text and tables share one measure; the right side stays free for slide images */
.body > * { max-width: 70ch; }
.body > :first-child { margin-top: 0; }
.body ul, .body ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.body li { margin-bottom: .4em; }
.body li::marker { color: var(--accent); }
.body strong { font-weight: 700; }
.body h3 { font-size: 1.15rem; margin: 1.4em 0 .5em; }
.body h4 { font-family: var(--sans); font-size: 1rem; margin: 1.2em 0 .4em; }

/* tables: tablet-readable, scroll sideways when wide */
.table-scroll {
  overflow-x: auto; margin: 0 0 1.3em;
  border: var(--rule); border-top: 3px solid var(--ink);
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
caption {
  caption-side: top; text-align: left; padding: 10px 14px;
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); border-bottom: var(--rule);
}
/* min-width: wide tables scroll sideways instead of crushing columns into word stacks */
th, td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: var(--rule); min-width: 7.5em; }
thead th {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase;
  background: var(--paper-2); color: var(--ink);
}
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover { background: rgba(205, 235, 230, .35); }

/* only when a table really overflows (app.js sets .is-wide): sticky first column + edge hint */
.table-scroll.is-wide tr > :first-child {
  position: sticky; left: 0; z-index: 1;
  background: var(--surface);
  box-shadow: 6px 0 8px -6px rgba(15, 34, 51, .22);
}
.table-scroll.is-wide thead tr > :first-child { background: var(--paper-2); }
.table-scroll.is-wide tbody tr:hover > :first-child { background: #EEF7F5; }

/* callouts — editorial panels with a labelled left rule */
.note, .key {
  position: relative; margin: 0 0 1.3em; padding: 34px 22px 14px;
  border: var(--rule); border-left: 4px solid;
}
.note > :last-child, .key > :last-child { margin-bottom: 0; }
.note::before, .key::before {
  position: absolute; top: 11px; left: 22px;
  font-size: .66rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
}
.note { background: #E6F4F2; border-left-color: var(--accent); }
.note::before { content: "Klinik not"; color: var(--accent); }
.key { background: var(--ink-panel); color: #E6EEF3; border-color: var(--ink-panel); border-left-color: var(--accent-2); }
.key::before { content: "Akılda tut"; color: #8FD9CF; }
.key strong { color: #fff; }
.key a { color: #fff; }

figure { margin: 0 0 1.3em; }
figure img {
  display: block; max-width: 100%; height: auto;
  border: 1px solid rgba(19, 42, 62, .16); box-shadow: 5px 5px 0 rgba(184, 199, 211, .45);
  background: var(--surface);
}
figcaption { font-size: .8rem; color: var(--muted); margin-top: 12px; border-top: var(--rule); padding-top: 8px; max-width: 60ch; }

/* slide images: small thumbnails; consecutive ones wrap side by side */
.body .slide-img, .faq-a .slide-img, .media .slide-img {
  display: inline-block; vertical-align: top;
  width: min(260px, 100%); margin: 4px 14px 16px 0;
}

/* subsection with images: text left, sticky image column right (released when the subsection ends) */
.subsec.has-media {
  display: grid; grid-template-columns: minmax(0, 70ch) clamp(220px, 21vw, 320px);
  column-gap: clamp(28px, 3vw, 48px); align-items: start;
}
.subsec.has-media > .sub-title { grid-column: 1 / -1; }
.media { position: sticky; top: 24px; display: grid; gap: 4px; }
.media .slide-img { display: block; width: 100%; margin: 0 0 14px; }
.media .slide-img img { max-height: 260px; }
@media (max-width: 1100px) {
  .subsec.has-media { display: block; }
  .media { position: static; display: flex; flex-wrap: wrap; gap: 0 14px; margin-top: 4px; }
  .media .slide-img { width: min(240px, 100%); }
}
.slide-img .zoom {
  position: relative; display: block; width: 100%; padding: 0;
  border: 1px solid rgba(19, 42, 62, .18); border-radius: 8px; overflow: hidden;
  background: var(--surface); cursor: zoom-in;
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s;
}
.slide-img img {
  display: block; width: 100%; height: auto; max-height: 200px; object-fit: cover;
  border: 0; box-shadow: none; border-radius: 0;
}
/* magnifier badge */
.slide-img .zoom::after {
  content: ""; position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(15, 34, 51, .78) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5M10.5 8v5M8 10.5h5'/%3E%3C/svg%3E") center / 18px no-repeat;
  transition: transform .2s var(--ease);
}
.slide-img .zoom:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(15, 34, 51, .14); }
.slide-img .zoom:hover::after { transform: scale(1.1); }
.slide-img .zoom:active { transform: scale(.98); }
.slide-img figcaption { font-size: .72rem; line-height: 1.4; margin-top: 7px; padding-top: 0; border-top: 0; }

/* lightbox */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .7); transition: opacity .22s ease-in; }
.lightbox.closing::backdrop { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .lightbox[open]::backdrop { animation: lbFade .3s ease-out; }
}
@keyframes lbFade { from { opacity: 0; } }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lb-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 56px 16px 20px; }
.lb-fig img {
  display: block; max-width: 90vw; max-height: 80vh; max-height: 80dvh; width: auto; height: auto;
  border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); background: #fff;
}
.lb-fig figcaption {
  color: #EEF2F5; font-size: .9rem; text-align: center; max-width: min(70ch, 90vw);
  border: 0; margin: 0; padding: 0;
}
.lb-close {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.8rem; line-height: 1;
}
.lb-close:hover { background: rgba(255, 255, 255, .26); }
.lb-close:focus-visible { outline-color: #fff; }
html.lb-lock { overflow: hidden; }

.body .src, .faq-a .src {
  margin: .3em 0 1em; font-size: .72rem; line-height: 1.4; color: var(--faint);
}

/* ── FAQ accordion ───────────────────────────────────────────── */
.faq { margin-top: 10px; padding-top: 26px; border-top: var(--rule-strong); }
.faq-item { border-bottom: var(--rule); }
.faq-q {
  display: flex; align-items: center; gap: 14px;
  min-height: 60px; padding: 12px 4px;
  font-weight: 600; cursor: pointer; list-style: none;
  transition: background .14s ease;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::before {
  content: "S"; flex: none; width: 28px; height: 28px; border-radius: 2px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: .72rem; font-weight: 700;
  background: var(--accent-soft); color: var(--ink);
}
.faq-q span { flex: 1; }
.faq-q::after {
  content: "+"; flex: none; font-family: var(--mono); font-size: 1.3rem; color: var(--accent);
  transition: transform .25s var(--ease);
}
.faq-item[open]:not(.closing) > .faq-q::after { transform: rotate(45deg); }
.faq-q:hover { background: var(--paper-2); }
.faq-a { overflow: hidden; padding: 0 4px 0 46px; max-width: calc(70ch + 46px); }
.faq-a > :last-child { margin-bottom: 18px; }

/* ── end + buttons ───────────────────────────────────────────── */
.end { border-bottom: 0; padding-bottom: 120px; }
.end h2 { margin: 8px 0 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px;
  font-family: var(--sans); font-size: .86rem; font-weight: 700; letter-spacing: .04em;
  background: var(--ink); color: var(--paper); text-decoration: none;
  border: 2px solid var(--ink); border-radius: 2px; padding: 9px 18px; cursor: pointer;
  transition: transform .1s var(--ease), background .14s;
}
.btn:hover { background: #1E3C57; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--sand-soft); }
.btn.ghost[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.btn.sm { min-height: 44px; padding: 6px 12px; font-size: .74rem; justify-self: start; }
.btn[hidden] { display: none; }

.to-top {
  position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
  width: 52px; height: 52px; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--paper); border-radius: 50%;
  box-shadow: 0 4px 14px rgba(15, 34, 51, .22);
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity .24s var(--ease), transform .24s var(--ease);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ── compact rail: tablet portrait / phones ──────────────────── */
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: sticky; top: 0; height: auto; max-height: 100dvh;
    border-right: 0; border-bottom: var(--rule);
    padding: 10px max(16px, env(safe-area-inset-left)); gap: 0;
  }
  .rail::after { top: auto; bottom: -1px; right: auto; left: 0; width: 100%; height: 3px; transform: scaleX(var(--p, 0)); transform-origin: left; }
  .brand .sub { display: none; }
  .rail-now {
    display: block; flex: 1; min-width: 0; margin: 0;
    font-size: .8rem; font-weight: 600; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .rail-toggle {
    display: inline-flex; align-items: center; gap: 10px; flex: none;
    min-height: 46px; padding: 0 14px;
    font: inherit; font-size: .8rem; font-weight: 700; color: var(--ink);
    background: transparent; border: 1.5px solid var(--ink); border-radius: 2px; cursor: pointer;
  }
  .rail-toggle-bars, .rail-toggle-bars::before, .rail-toggle-bars::after {
    display: block; width: 16px; height: 2px; background: currentColor; position: relative;
    transition: transform .2s var(--ease), background .2s;
  }
  .rail-toggle-bars::before, .rail-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .rail-toggle-bars::before { top: -5px; }
  .rail-toggle-bars::after { top: 5px; }
  .rail.open .rail-toggle-bars { background: transparent; }
  .rail.open .rail-toggle-bars::before { transform: translateY(5px) rotate(45deg); }
  .rail.open .rail-toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

  #rail-nav, .rail footer { display: none; }
  .rail.open { background: var(--paper); box-shadow: 0 18px 40px rgba(15, 34, 51, .18); }
  .rail.open #rail-nav { display: block; max-height: calc(100dvh - 140px); padding-top: 8px; animation: drop .28s var(--ease); }
  .rail.open footer { display: grid; padding: 12px 0 6px; border-top: var(--rule); margin-top: 6px; }
  section, .group-band { scroll-margin-top: 66px; }
  .hero { min-height: auto; padding-top: 56px; }
  .hero-cue { display: none; }
}
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } }

/* ══════════════════════════════════════════════════════════════════
   MOTION — calm versions of the reference's reveal / hero animations
   ══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
  .rv { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
  .rv.in { opacity: 1; transform: none; }
  .rv.d1 { transition-delay: .08s; }
  .rv.d2 { transition-delay: .16s; }
  .rv.d3 { transition-delay: .24s; }

  /* blocks inside a subsection cascade in after it lands */
  .subsec .body > *, .faq-item { opacity: 0; transform: translateY(10px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
  .rv.in .body > *, .rv.in .faq-item { opacity: 1; transform: none; }
  .rv.in .body > :nth-child(2), .rv.in .faq-item:nth-of-type(2) { transition-delay: .07s; }
  .rv.in .body > :nth-child(3), .rv.in .faq-item:nth-of-type(3) { transition-delay: .14s; }
  .rv.in .body > :nth-child(4), .rv.in .faq-item:nth-of-type(4) { transition-delay: .21s; }
  .rv.in .body > :nth-child(5), .rv.in .faq-item:nth-of-type(5) { transition-delay: .28s; }
  .rv.in .body > :nth-child(n+6), .rv.in .faq-item:nth-of-type(n+6) { transition-delay: .34s; }

  .ep-badge { animation: stampIn .55s cubic-bezier(.2, 1.3, .4, 1) .05s backwards; }
  .hero .kicker { animation: kickIn .6s var(--ease) .15s backwards; }
  #hero-title .ch {
    display: inline-block;
    animation: chRise .7s cubic-bezier(.2, .75, .25, 1.05) backwards;
    animation-delay: calc(.3s + var(--i) * .04s);
  }
  #hero-title .em.ch { animation-name: chPop; }
  .hero-rule { transform-origin: left center; animation: ruledraw 1.1s var(--ease) .5s backwards; }
  .hero .lede { animation: fadeUp .8s var(--ease) .9s backwards; }
  .hero-cue { animation: fadeUp 1s ease 2s backwards; }
  .hero-cue-line { animation: cueDrip 1.8s cubic-bezier(.4, 0, .4, 1) infinite; }

  .rail::after { transition: transform .15s linear; }
}

@keyframes stampIn { 0% { opacity: 0; transform: scale(1.6) rotate(-5deg); } 60% { opacity: 1; transform: scale(.96) rotate(1deg); } 100% { opacity: 1; transform: none; } }
@keyframes kickIn { from { opacity: 0; transform: translateX(-16px); } }
@keyframes chRise { from { opacity: 0; transform: translateY(.5em) rotate(3deg); } to { opacity: 1; transform: none; } }
@keyframes chPop { 0% { opacity: 0; transform: scale(0); } 70% { opacity: 1; transform: scale(1.3); } 100% { opacity: 1; transform: none; } }
@keyframes ruledraw { from { transform: scaleX(0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } }
@keyframes cueDrip { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .rail, .to-top, .hero-cue, .skip { display: none !important; }
  .shell { display: block; }
  .rv, .subsec .body > *, .faq-item { opacity: 1 !important; transform: none !important; }
  .group-band { background: none; color: var(--ink); }
  .band-title { color: var(--ink); }
}
