/* ------------------------------------------------------------------
   A⁷ handbook preview
   Colours, rules, radii and frames follow "Page Elements - Growth
   Family (Dark)": paper #131313, one ripple per element, open rules
   fade over their last 24 px, radii 2 / 6 / 18.
------------------------------------------------------------------- */
:root {
  --paper: #131313;
  --ink: #F2F0E6;
  --muted: #A9A89F;
  --faint: #77766F;
  --band: rgba(255, 255, 255, 0.08);
  --band-45: rgba(255, 255, 255, 0.036);   /* Sand at 45%: sidebar */
  --col1: rgba(255, 255, 255, 0.045);
  --br: rgba(255, 255, 255, 0.2);
  --cink: #86B8AC;                         /* teal */
  --oink: #E5C28F;                         /* amber */
  --rule: rgba(242, 240, 230, 0.34);
  --hair: rgba(242, 240, 230, 0.2);
  --max: 1480px;

  --display: "Rader", "PP Rader", "Jura", "Helvetica Neue", Arial, sans-serif;
  --body: "proxima-nova", "Proxima Nova", "Mulish", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

/* Rader: put a web-licensed rader.woff2 in /fonts, then remove the comment markers
   around the rule below and the display type switches to it.
@font-face { font-family: "Rader"; src: url("fonts/rader.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
*/

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -20%, rgba(134, 184, 172, 0.07), transparent 42rem),
    linear-gradient(180deg, #111111 0%, #141414 50%, #111111 100%);
  font-family: var(--body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.substrate {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("assets/substrate-field.webp");
  background-size: max(1120px, 100vw) auto;
  background-position: center top;
  background-repeat: repeat-y;
  opacity: 0.12;
  filter: saturate(0.4) brightness(0.72) contrast(0.92);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.75), rgba(0,0,0,.18) 34%, rgba(0,0,0,.08) 70%, rgba(0,0,0,.25));
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.75), rgba(0,0,0,.18) 34%, rgba(0,0,0,.08) 70%, rgba(0,0,0,.25));
}
.veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(10,10,10,.86) 0%, rgba(10,10,10,.16) 22%, rgba(10,10,10,.12) 78%, rgba(10,10,10,.84) 100%),
    linear-gradient(180deg, rgba(10,10,10,.15), rgba(10,10,10,.62));
}
.site-header, main, .site-footer { position: relative; z-index: 2; }

/* ---------- Rules: the ripple and the fade ---------- */
.rule { display: flex; align-items: center; color: var(--rule); min-width: 0; }
.rule .ln { display: block; flex: 1 1 auto; min-width: 0; height: 0.8px; background: currentColor; }
.rule .ln.hair { height: 0.5px; }
.rule .ln.fade   { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
.rule .ln.fade-l { -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(270deg, #000 calc(100% - 24px), transparent); }
.rp { flex: none; display: block; overflow: visible; fill: none; stroke: currentColor; stroke-width: 0.8px; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Header ---------- */
.site-header { width: min(calc(100% - 64px), var(--max)); margin: 0 auto; }
.site-header-row {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
}
.header-rule { margin-top: -6px; }
.header-rule .lead-120 { flex: 0 0 120px; }
.studio {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.studio-rune { width: 9px; height: 27px; display: block; }
.studio-word { width: 78px; height: 14px; display: block; }
.studio { opacity: .92; transition: opacity .2s ease; }
.studio:hover { opacity: 1; }
.header-meta { color: var(--muted); }

/* ---------- Hero ---------- */
.hero {
  width: min(calc(100% - 64px), var(--max));
  min-height: 56vh;
  margin: 0 auto;
  padding: clamp(84px, 12vh, 160px) 0 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero-mark { width: clamp(84px, 8vw, 116px); height: auto; margin-bottom: 30px; }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--cink);
  font-weight: 500;
  margin-bottom: 22px;
}
.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(56px, 8.6vw, 128px);
  line-height: .95;
  font-weight: 300;
  letter-spacing: -.02em;
}
.hero p { margin: 26px 0 0; color: var(--muted); font-size: clamp(15px, 1.3vw, 19px); letter-spacing: .01em; }
.hero-rule { width: min(440px, 72vw); margin: 44px 0 30px; color: var(--rule); }
.scroll-cue {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  transition: color .2s ease;
}
.scroll-cue span { margin-left: 8px; color: var(--cink); }
.scroll-cue:hover { color: var(--ink); }

/* ---------- Preview cards ---------- */
.previews {
  width: min(calc(100% - 64px), var(--max));
  margin: 0 auto;
  padding: 0 0 120px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(22px, 2.4vw, 40px);
}
.preview-card { min-width: 0; }
.preview-open { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; border-radius: 6px; }
.preview-image-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  outline: 0.8px solid var(--br);
  outline-offset: -0.8px;
  background: #1b1b1b;
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
.preview-image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s cubic-bezier(.2,.65,.2,1), filter .45s ease; }
.preview-hover {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 8px 12px 7px;
  color: var(--ink);
  background: rgba(19,19,19,.86);
  border: 0.8px solid var(--br);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity .25s ease, transform .25s ease;
}
.preview-open:hover .preview-image-wrap img { transform: scale(1.018); filter: brightness(.93); }
.preview-open:hover .preview-hover { opacity: 1; transform: translateY(0); }

/* E11 section heading on each card */
.preview-info { padding: 20px 1px 0; }
.index { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.heading-rule { display: flex; align-items: center; gap: 0; color: var(--rule); min-width: 0; }
.heading-rule h2 {
  margin: 0;
  flex: none;
  max-width: 78%;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(21px, 1.75vw, 28px);
  font-weight: 300;
  letter-spacing: -.005em;
  line-height: 1.1;
}
.heading-rule .ln { flex: 1 1 auto; height: 0.8px; background: currentColor; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); min-width: 12px; }
.heading-rule .rp { margin-left: 12px; }
.preview-card:has(.preview-open:hover) .heading-rule h2 { color: #fff; }
.preview-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--muted);
}
.token {
  display: inline-block;
  padding: 2px 6px 1px;
  border: 0.8px solid var(--br);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--ink);
}
.preview-actions { display: flex; gap: 10px; margin-top: 16px; }

/* Pills: cross-references and actions (full radius, teal like the guide's cross-refs) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px 7px;
  border: 0.8px solid rgba(134,184,172,.6);
  border-radius: 999px;
  background: transparent;
  color: var(--cink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.pill:hover { background: rgba(134,184,172,.12); border-color: var(--cink); color: var(--ink); }
.pill.quiet { border-color: var(--br); color: var(--muted); }
.pill.quiet:hover { border-color: var(--ink); color: var(--ink); background: var(--band); }

/* ---------- Editions: the printed handbook ---------- */
.editions {
  width: min(calc(100% - 64px), 1180px);
  margin: 0 auto;
  padding: 0 0 130px;
}
.editions-head { text-align: center; margin-bottom: clamp(34px, 4vw, 54px); }
.editions-head .eyebrow { margin-bottom: 14px; }
.editions-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(30px, 3.2vw, 46px);
  line-height: 1.05;
  letter-spacing: -.01em;
}
.editions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(22px, 3vw, 48px); }
.edition { margin: 0; min-width: 0; }
.edition-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  outline: 0.8px solid var(--br);
  outline-offset: -0.8px;
  background: #1b1b1b;
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
.edition-frame[data-deboss] { cursor: zoom-in; }
.edition-frame.is-detail { cursor: zoom-out; }
.edition-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.edition .heading-rule { margin-top: 20px; }
.edition h3 {
  margin: 0; flex: none; color: var(--ink);
  font-family: var(--display); font-weight: 300;
  font-size: clamp(21px, 1.75vw, 28px); line-height: 1.1;
}
.edition .preview-meta { margin-top: 12px; }

/* Debossing detail: the cover moves in on the mark, then the full-resolution crop takes over */
.edition-cover { transform-origin: 69.74% 24.73%; transition: transform .9s cubic-bezier(.3,.6,.2,1), opacity .35s ease .55s; }
.edition-detail { opacity: 0; transition: opacity .35s ease; }
.is-detail .edition-cover { transform: scale(3.375); opacity: 0; }
.is-detail .edition-detail { opacity: 1; transition-delay: .55s; }
.edition-switch {
  position: absolute; right: 14px; bottom: 14px;
  display: flex; padding: 3px; gap: 2px;
  background: rgba(19,19,19,.82);
  border: 0.8px solid var(--br);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.edition-switch button {
  padding: 7px 12px 6px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer;
  font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .12em; line-height: 1;
  transition: background .2s ease, color .2s ease;
}
.edition-switch button:hover { color: var(--ink); }
.edition-switch button[aria-pressed="true"] { background: rgba(134,184,172,.16); color: var(--ink); }

.editions-foot { margin-top: clamp(30px, 3.6vw, 46px); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; }
.editions-foot p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }

/* ---------- About: E3 pull quote, E12 stop line, E8 sidebar ---------- */
.about {
  width: min(calc(100% - 64px), var(--max));
  margin: 0 auto;
  padding: 0 0 130px;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 6vw, 110px);
  align-items: start;
}
.world-intro { margin-bottom: 56px; max-width: 34rem; }
.world-intro .eyebrow { margin-bottom: 18px; }
.world-intro p { margin: 0 0 12px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.world-intro p:first-of-type { color: var(--ink); font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; }
.pull-quote { margin: 0; }
.quote-rule { width: 150px; margin-bottom: 18px; }
.pull-quote blockquote { margin: 0; }
.pull-quote blockquote p {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.14;
  letter-spacing: -.01em;
}
.pull-quote blockquote p.go { margin-top: 18px; font-weight: 500; font-size: clamp(20px, 1.8vw, 26px); }
.pull-quote figcaption { margin-top: 20px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; color: var(--muted); }

.stop { margin-top: 64px; max-width: 520px; }
.stop p { margin: 0 0 14px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.stop-line {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
}
.stop-line span { flex: none; color: var(--muted); }
.stop-line span:first-child { color: var(--ink); }
.stop-line b { flex: 1 1 0; height: 2px; border-radius: 1px; background: var(--ink); }
.stop-line .ln { flex: 1 1 0; height: 0.5px; background: var(--rule); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
.cta { margin-top: 28px; padding: 13px 20px 12px; font-size: 12px; }

.sidebar {
  background: var(--band-45);
  border-radius: 6px;
  padding: 26px 28px 14px;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.sidebar h3 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 400; letter-spacing: 0; }
.sidebar-rule { margin: 10px 0 6px; }
.sidebar-rule .tail { flex: 0 0 22px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
.sidebar li {
  break-inside: avoid;
  padding: 12px 0 12px 16px;
  border-bottom: 0.5px solid var(--hair);
  position: relative;
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(242,240,230,.8);
}
.sidebar li::before { content: ""; position: absolute; left: 0; top: 20px; width: 5px; height: 5px; border: 0.8px solid var(--cink); border-radius: 50%; }

/* ---------- Footer ---------- */
.site-footer { width: min(calc(100% - 64px), var(--max)); margin: 0 auto; padding-bottom: 36px; }
.footer-rule { color: var(--rule); }
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px 24px;
  padding-top: 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
}
.footer-row a { color: inherit; text-decoration: none; transition: color .2s ease; }
.footer-row a:hover { color: var(--ink); }
.footer-links { display: flex; gap: 22px; }
.human-made { margin-top: clamp(56px, 6vw, 84px); gap: 22px; }
.human-made p { margin: 0; flex: none; max-width: 80%; text-align: center; color: var(--ink); font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; line-height: 1.7; }
.ks-note { max-width: 36rem; margin: 22px auto 0; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.65; }

/* ---------- Viewer ---------- */
.viewer {
  width: 100vw; max-width: none;
  height: 100vh; height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: #0e0e0e;
  color: var(--ink);
}
.viewer::backdrop { background: rgba(5,5,5,.88); backdrop-filter: blur(8px); }
.viewer[open] { animation: viewer-in .2s ease both; }
@keyframes viewer-in { from { opacity: 0; } to { opacity: 1; } }
.viewer-shell { width: 100%; height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
.viewer-header {
  min-height: 84px;
  padding: max(16px, env(safe-area-inset-top)) clamp(20px, 3vw, 48px) 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 0.5px solid var(--hair);
}
.viewer-heading { min-width: 0; }
.viewer-kicker { display: block; color: var(--cink); font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; margin-bottom: 6px; }
.viewer-header h2 { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 300; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-actions { display: flex; align-items: center; gap: 16px; flex: none; }
.viewer-close {
  color: var(--muted);
  font: 500 11px/1 var(--mono);
  letter-spacing: .1em;
  background: none;
  border: 0;
  padding: 10px 0;
  cursor: pointer;
}
.viewer-close:hover { color: var(--ink); }
.viewer-stage {
  min-height: 0;
  display: grid;
  grid-template-columns: 64px minmax(0,1fr) 64px;
  align-items: center;
  padding: clamp(18px, 3vh, 36px) clamp(8px, 2vw, 28px);
}
.spread-frame { min-width: 0; min-height: 0; height: 100%; display: flex; align-items: center; justify-content: center; cursor: zoom-in; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none; }
.spread-frame img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 24px 90px rgba(0,0,0,.55);
  background: #EFEDD8;
  -webkit-user-drag: none;
}
.is-zoomed .spread-frame { display: block; overflow: auto; cursor: zoom-out; touch-action: pan-x pan-y pinch-zoom; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.is-zoomed .spread-frame img { width: min(3200px, max(200%, 1500px)); max-width: none; max-height: none; height: auto; margin: 0 auto; }
.viewer-nav {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 200 44px/1 "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
  padding: 20px 8px;
  transition: color .2s ease;
}
.viewer-nav:hover:not(:disabled) { color: var(--ink); }
.viewer-nav:disabled { opacity: .15; cursor: default; }
.viewer-footer {
  min-height: 60px;
  padding: 10px clamp(20px, 3vw, 48px) max(10px, env(safe-area-inset-bottom));
  border-top: 0.5px solid var(--hair);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
}
.viewer-footer > * { flex: 1 1 0; }
.viewer-status { display: flex; gap: 18px; align-items: center; min-width: 0; }
.viewer-hint { color: var(--faint); }
.viewer-dots { display: flex; gap: 4px; align-items: center; justify-content: center; }
.viewer-dots button { width: 28px; height: 28px; border: 0; background: transparent; padding: 0; position: relative; cursor: pointer; }
.viewer-dots button::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; border: 0.8px solid var(--muted); }
.viewer-dots button.active::after { background: var(--cink); border-color: var(--cink); }
.viewer-next { display: flex; justify-content: flex-end; min-width: 0; }

/* Keyboard focus */
a:focus-visible, button:focus-visible { outline: 0.8px solid var(--cink); outline-offset: 4px; }
.preview-open:focus-visible { outline-offset: 6px; }

/* ---------- Narrower screens ---------- */
@media (max-width: 1100px) {
  .sidebar ul { columns: 1; }
}
@media (max-width: 980px) {
  .previews { grid-template-columns: 1fr; max-width: 760px; gap: 56px; }
  .about { grid-template-columns: 1fr; max-width: 760px; }
  .heading-rule h2 { font-size: 28px; }
  .hero { min-height: 50vh; }
}
@media (max-width: 620px) {
  .site-header, .hero, .previews, .about, .site-footer, .editions { width: min(calc(100% - 32px), var(--max)); }
  .editions { padding-bottom: 90px; }
  .editions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .edition .heading-rule { margin-top: 12px; }
  .edition h3 { font-size: 17px; white-space: normal; }
  .edition .heading-rule .rp, .edition .heading-rule .ln { display: none; }
  .edition .preview-meta { margin-top: 8px; gap: 6px; }
  .edition .token { font-size: 8.5px; padding: 2px 4px 1px; }
  .edition-switch { right: 6px; bottom: 6px; padding: 2px; }
  .edition-switch button { padding: 5px 7px 4px; font-size: 8.5px; letter-spacing: .08em; }
  .editions-foot { flex-direction: column; align-items: flex-start; }
  .human-made .ln { display: none; }
  .human-made p { max-width: none; flex: 1 1 auto; font-size: 11px; }
  .site-header-row { height: 68px; }
  .header-meta { display: none; }
  .header-rule .lead-120 { flex-basis: 40px; }
  .hero { min-height: 46vh; padding: 76px 0 64px; }
  .hero h1 { font-size: clamp(50px, 16vw, 76px); }
  .hero p { font-size: 14.5px; }
  .previews { padding-bottom: 90px; gap: 50px; }
  .preview-hover { display: none; }
  .about { padding-bottom: 90px; gap: 52px; }
  .stop { margin-top: 48px; }
  .sidebar { padding: 22px 18px 8px; }
  .viewer-header { min-height: 0; padding: max(12px, env(safe-area-inset-top)) 16px 12px; }
  .viewer-header h2 { font-size: 18px; }
  .viewer-kicker { display: none; }
  .viewer-actions { gap: 12px; }
  .viewer .pill .long { display: none; }
  .viewer .pill { padding: 7px 11px 6px; }
  .viewer-stage { grid-template-columns: 30px minmax(0,1fr) 30px; padding: 12px 0; }
  .viewer-nav { font-size: 34px; padding-inline: 2px; }
  .viewer-footer { min-height: 54px; padding-inline: 16px; gap: 8px; }
  .viewer-status { flex-direction: column; align-items: flex-start; gap: 6px; }
  .viewer-next .pill { white-space: normal; text-align: right; line-height: 1.35; padding: 7px 10px 6px; font-size: 10px; }
  .is-zoomed .viewer-stage { grid-template-columns: 0 minmax(0,1fr) 0; padding: 0; }
  .is-zoomed .viewer-nav { visibility: hidden; overflow: hidden; padding: 0; }
  .substrate { opacity: .09; background-size: auto 100vh; }
}

/* Narrow phones: the title keeps its own line above the reader buttons */
@media (max-width: 480px) and (orientation: portrait) {
  .viewer-header { flex-wrap: wrap; row-gap: 10px; }
  .viewer-heading { flex: 1 1 100%; }
  .viewer-actions { margin-left: auto; }
}

/* Phones held sideways: give the spread the room */
@media (max-height: 520px) and (orientation: landscape) {
  .viewer-header { min-height: 0; padding: 8px 16px; }
  .viewer-header h2 { font-size: 15px; }
  .viewer-kicker { display: none; }
  .viewer-footer { min-height: 40px; }
  .viewer-stage { padding: 6px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
