/* Responsive reading layouts and a continuous, full-screen phone cinema. */
:root {
  --header-height: 84px;
  --gutter: clamp(20px, 4.5vw, 88px);
  --section-space: clamp(56px, 7vw, 110px);
}
html { scroll-padding-top: calc(var(--header-height) + 20px); }
body { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
.content-wrap > *, .editorial-grid > *, .book-layout > *, .sample-section > * { min-width: 0; }
.text-link { min-height: 44px; }
.button, .text-link { max-width: 100%; }
.text-link span, .button span { flex-shrink: 0; }
.site-header {
  height: var(--header-height);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  gap: 24px;
}
.site-header .wordmark { flex-shrink: 0; display: inline-flex; align-items: center; min-height: 44px; }
.header-panel { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.site-header nav { gap: 24px; margin: 0; }
.site-header nav a { display: flex; align-items: center; min-height: 44px; white-space: nowrap; }
.site-header .header-cta { flex-shrink: 0; white-space: nowrap; min-height: 44px; }
.site-header .compact-nav-link, .menu-toggle { display: none; }
.motion-toggle { min-height: 44px; cursor: pointer; }
.film-meta { display: contents; }
.film-play { display: none; }
.film-play:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.cinema-status:empty { display: none; }
.specimen-stage .specimen-label { min-height: 44px; padding-top: 3px; }
.close-dialog { flex-shrink: 0; min-width: 46px; }
.dialog-header > div { min-width: 0; }
.dialog-header form { flex-shrink: 0; }
.dialog-header h2 { overflow-wrap: anywhere; }
dialog {
  overscroll-behavior: contain;
  max-height: calc(100dvh - 32px);
  scrollbar-gutter: stable;
}
.dialog-header { position: sticky; top: -32px; z-index: 4; background: var(--paper); padding-block: 12px; }
.specimen-view, .plate-zoom { max-height: none; }
.cover-selected > img { max-height: 65dvh; object-fit: contain; }

/* A disclosure menu leaves room for the author and book link at every width. */
@media (max-width: 1100px), (max-aspect-ratio: 1/1) {
  :root { --header-height: calc(68px + env(safe-area-inset-top)); }
  .site-header { padding-top: env(safe-area-inset-top); gap: 14px; background: #171713f5; }
  .site-header .wordmark { margin-right: auto; font-size: 12px; letter-spacing: .17em; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 8px 10px; color: inherit; background: none; border: 1px solid currentColor; font: 500 13px/1.4 var(--sans); }
  .menu-toggle span { font-size: 16px; }
  .header-panel {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    padding: 12px var(--gutter) 24px;
    max-height: calc(100dvh - var(--header-height)); overflow-y: auto;
    display: block; color: var(--cinema-ink); background: #171713;
    border-bottom: 1px solid #ffffff30; box-shadow: 0 18px 25px #0002;
  }
  .site-header.over-reading .header-panel { color: var(--ink); background: #f4f7f7; border-color: var(--rule); }
  .site-header nav { display: grid; gap: 0; margin: 0 0 16px; }
  .site-header nav a, .site-header .compact-nav-link { display: flex; min-height: 52px; font-size: 21px; white-space: normal; padding: 10px 0; border-bottom: 1px solid #89939955; }
  .motion-toggle { margin: 0; padding: 10px 14px; font-size: 13px; }
  .site-header .header-cta { font-size: 13px; padding: 10px 14px; gap: 14px; }
  html:not(.js) .header-panel { position: static; box-shadow: none; max-height: none; }
  html:not(.js) .site-header { position: relative; height: auto; flex-wrap: wrap; padding-block: 20px; }
  html:not(.js) .header-panel { order: 3; width: 100%; padding: 0; }
}

/* Editorial content stacks before the columns become cramped. */
@media (max-width: 1100px) {
  .gallery-interior { display: block; min-height: 0; padding: var(--section-space) var(--gutter) 20px; }
  .gallery-copy { max-width: 640px; }
  .gallery-copy h2 { font-size: clamp(45px, 7.4vw, 66px); margin-bottom: 24px; }
  .gallery-copy > p:not(.eyebrow) { max-width: 560px; font-size: 20px; }
  .specimens.specimen-stage { width: calc(100% + 2 * var(--gutter)); max-width: 1000px; margin: 20px calc(-1 * var(--gutter)) 0; }
  .specimen-stage .specimen-label > span { font-size: clamp(15px, 3vw, 25px); }
  .gallery-credit { position: static; margin: 0; padding: 0 var(--gutter) 28px; max-width: 800px; }
  .reading-intro { padding: var(--section-space) var(--gutter); }
  .editorial-grid { grid-template-columns: 1fr; gap: 28px; }
  .editorial-grid h2 { max-width: 700px; font-size: clamp(38px, 6vw, 58px); }
  .editorial-grid h2 br { display: none; }
  .intro-body { padding: 0; max-width: 700px; }
  .intro-body p { font-size: 19px; }
  .intro-body .lead { font-size: clamp(22px, 3vw, 26px); }
  .contents-section { padding-top: var(--section-space); padding-bottom: var(--section-space); }
  .section-heading { display: block; margin-bottom: 30px; }
  .section-heading > p { margin-top: 22px; max-width: 550px; }
  .contents-section .section-heading h2 { font-size: clamp(39px, 6.5vw, 60px); }
  .contents-list summary { grid-template-columns: 28px 1fr auto; gap: 16px; padding: 24px 0; }
  .contents-list .chapter-list { padding-left: 44px; grid-template-columns: 1fr; }
  .contents-list .part-title { font-size: clamp(24px, 3vw, 31px); }
  .chapter-list li { font-size: 18px; }
  .afterlife-theatre { display: flex; flex-direction: column; min-height: 0; }
  .afterlife-theatre > .content-wrap { order: 0; padding: var(--section-space) var(--gutter) 10px; }
  .theatre-copy { width: 100%; max-width: 650px; }
  .theatre-copy h2 { font-size: clamp(45px, 7vw, 66px); margin-bottom: 24px; }
  .theatre-copy h2 br { display: none; }
  .theatre-copy p:not(.eyebrow) { max-width: 580px; font-size: 20px; }
  .afterlife-theatre:before { display: none; }
  .afterlife-theatre > .gallery-backdrop { position: relative; order: 1; inset: auto; z-index: 0; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; transform: none; object-position: center; mask-image: linear-gradient(transparent, #000 18%); }
  .readers-content { padding-top: 36px; padding-bottom: var(--section-space); }
  .reader-lead { font-size: clamp(23px, 3vw, 27px); margin-bottom: 32px; }
  .history-stories { grid-template-columns: 1fr; gap: 28px; }
  .history-stories article { display: grid; grid-template-columns: 1fr 1.25fr; column-gap: 7%; padding-top: 24px; }
  .history-stories .story-label { grid-column: 1; }
  .history-stories h3 { grid-column: 1; margin: 14px 0 0; font-size: 30px; max-width: 330px; }
  .history-stories article > p:not(.story-label):not(.story-source) { grid-column: 2; grid-row: 1 / 3; margin-top: 0; }
  .history-stories article > .story-source { grid-column: 2; grid-row: 3; margin-top: 16px !important; }
  .sample-section { display: block; padding-top: var(--section-space); padding-bottom: var(--section-space); }
  .sample-heading { position: static; display: grid; grid-template-columns: 1fr minmax(105px, 24%); gap: 0 28px; max-width: 700px; margin-bottom: 32px; }
  .sample-heading > .eyebrow { grid-column: 1 / -1; }
  .sample-heading h2 { font-size: clamp(42px, 7vw, 60px); }
  .sample-heading .sample-index { grid-column: 1; grid-row: 3; margin-top: 16px; line-height: 1.5; }
  .sample-detail { grid-column: 2; grid-row: 2 / 4; width: 100%; margin: 0; align-self: start; }
  .sample-detail span { font-size: 12px; line-height: 1.5; }
  .sample-prose { font-size: clamp(19px, 2.6vw, 22px); max-width: 700px; }
  .book-artisan-scene > .gallery-backdrop { display: none; }
  .book-artisan-scene:before { display: none; }
  .book-artisan-scene .book-layout { display: block; min-height: 0; padding-top: 0; padding-bottom: var(--section-space); }
  .book-stage-control { width: calc(100% + 2 * var(--gutter)); margin: 0 calc(-1 * var(--gutter)) 28px; height: auto; aspect-ratio: 1.18; max-height: 680px; background: url("/assets/gallery/book-stage-artisans.webp") 16% center / cover no-repeat; }
  .book-stage-control button > span { inset: auto 0 0; background: #e4edf3ed; padding: 14px var(--gutter); min-height: 50px; }
  .book-artisan-scene .book-description { padding: 0; max-width: 700px; margin: auto; }
  .book-artisan-scene .book-description h2 { font-size: clamp(43px, 7vw, 64px); }
  .book-description h2 br { display: none; }
  .book-description > p:not(.eyebrow) { max-width: 620px; }
  .book-actions .button { width: auto; flex: 1 1 240px; max-width: none; }
  .book-actions .epub-link { flex-basis: 100%; width: fit-content; flex-grow: 0; }
  .author-section { padding-top: var(--section-space); padding-bottom: var(--section-space); }
  .author-section .editorial-grid h2 { font-size: 42px; }
  .cover-comparison { grid-template-columns: 1fr; gap: 24px; }
  .cover-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .cover-choice { flex-direction: column; gap: 10px; padding: 10px 6px; text-align: center; }
  .cover-choice span { font-size: 15px; line-height: 1.4; }
  .cover-choice img { width: 64px; height: 95px; }
}

@media (max-width: 760px) {
  :root { --gutter: 22px; }
  .site-header { gap: 10px; padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  .site-header .wordmark { letter-spacing: .13em; font-size: 11px; white-space: nowrap; max-width: none; }
  .site-header .header-cta { font-size: 12px; padding-inline: 11px; gap: 10px; }
  .menu-toggle { font-size: 12px; padding-inline: 10px; }
  .menu-toggle span { display: none; }
  .chapter-scene, .has-cinema .chapter-scene { padding-top: 28px; padding-bottom: 20px; }
  .film-copy, .opening-title { display: block; padding-bottom: 24px; }
  .film-copy h1 { font-size: clamp(50px, 14vw, 76px); line-height: .92; margin-bottom: 18px; }
  .film-copy h2 { font-size: clamp(40px, 11.5vw, 58px); margin-bottom: 18px; }
  .film-copy .eyebrow { margin-bottom: 16px; }
  .film-copy .film-subtitle { font-size: 22px !important; }
  .film-copy > p:not(.eyebrow) { font-size: 18px; line-height: 1.5; }
  .film-copy .text-link { margin-top: 16px; }
  .film-meta { gap: 12px; }
  .film-caption { font-size: 12px; max-width: 220px; }
  .film-play { padding: 9px 11px; font-size: 12px; }
  .cinema-controls nav { gap: 12px; }
  .cinema-controls nav a { font-size: 12px; }
  .gallery-copy > p:not(.eyebrow) { font-size: 19px; }
  .intro-body .text-link { width: fit-content; text-align: left; gap: 14px; }
  .contents-list .part-count { font-size: 0; gap: 0; }
  .contents-list summary { grid-template-columns: 24px 1fr 24px; gap: 12px; }
  .contents-list .chapter-list { padding-left: 36px; }
  .history-stories article { display: block; }
  .history-stories h3 { margin: 14px 0 18px; max-width: none; }
  .history-stories article > p { font-size: 18px; }
  .history-stories article > .story-source { font-size: 13px !important; }
  .sample-heading { gap: 0 20px; }
  .sample-heading h2 { font-size: clamp(38px, 10vw, 52px); }
  .sample-detail { transform: none; }
  .sample-detail span { display: block; margin-top: 10px; }
  .sample-detail b { margin-left: 5px; }
  .book-stage-control { aspect-ratio: .8; background-position: 19% center; }
  .book-facts { gap: 10px 18px; }
  .book-actions { gap: 14px; }
  .book-actions .button { width: 100%; flex-basis: 100%; min-height: 50px; }
  .site-footer { padding-top: 25px; gap: 16px; }
  .site-footer > .wordmark { font-size: 11px; letter-spacing: .15em; }
  .site-footer > a:last-of-type { min-height: 44px; display: inline-flex; align-items: center; }
  .credits { padding-top: 5px; }
  dialog { width: calc(100% - 24px); max-width: none; max-height: calc(100dvh - 24px); padding: 16px; }
  .dialog-header { top: -16px; padding-block: 12px; margin-bottom: 12px; gap: 12px; }
  .dialog-header h2 { font-size: 27px; line-height: 1.1; letter-spacing: -.025em; }
  .dialog-header .eyebrow { font-size: 10px; }
  .specimen-view { padding: 6px; }
  .dialog-caption { font-size: 17px; margin-top: 20px; }
  .cover-choices { gap: 6px; }
  .cover-choice { padding: 8px 3px; }
  .cover-choice span { font-size: 13px; }
  .cover-choice img { max-width: 100%; height: 85px; }
  .cover-selected figcaption { font-size: 13px; }
}
@media (max-width: 359px) {
  :root { --gutter: 18px; }
  .site-header { gap: 8px; padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); }
  .site-header .wordmark { font-size: 10px; letter-spacing: .08em; }
  .site-header .header-cta span { display: none; }
  .film-copy h1 { font-size: 46px; }
  .film-copy .film-subtitle { font-size: 20px !important; }
  .cinema-controls nav { gap: 8px; }
  .film-meta { flex-wrap: wrap; gap: 8px; }
  .film-caption { flex: 1 1 135px; }
  .film-play { padding-inline: 9px; }
  .gallery-copy h2 { font-size: 42px; }
  .sample-heading { grid-template-columns: 1fr 95px; gap: 0 14px; }
}
/* One screen holds the complete journey on phones, tablets and landscape. */
@media (max-width: 1100px), (max-aspect-ratio: 1/1), (max-height: 580px) {
  .has-cinema .cinema { height: 1040svh; padding: 0; }
  .has-cinema .cinema-stage { position: sticky; top: 0; height: 100dvh; overflow: hidden; }
  .has-cinema .chapter-scene { position: absolute; inset: 0; height: 100%; min-height: 0; padding: 0; border: 0; }
  .has-cinema .film-art { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; }
  .has-cinema .film-art img, .has-cinema .film-art video { width: 100%; height: 100%; object-fit: cover; object-position: var(--film-focus, 50%) 50%; }
  .has-cinema .film-shade {
    display: block; opacity: var(--shade-opacity, 1);
    background: linear-gradient(180deg, #080b0a99, #080b0a88 30%, transparent 67%), linear-gradient(0deg, #080b0ae8, transparent 32%);
  }
  .has-cinema .film-copy {
    display: block; position: absolute; top: calc(var(--header-height) + 22px); bottom: auto;
    left: var(--gutter); right: var(--gutter); width: auto; max-width: 560px;
    padding: 0; transform: none; opacity: var(--copy-opacity, 1); text-shadow: 0 2px 24px #0008;
  }
  .has-cinema .film-copy h1 { font-size: clamp(48px, 13.5vw, 64px); line-height: .92; margin-bottom: 18px; }
  .has-cinema .film-copy h2 { font-size: clamp(42px, 10vw, 54px); line-height: .98; margin-bottom: 18px; }
  .has-cinema .film-copy .eyebrow { font-size: 11px; margin-bottom: 16px; }
  .has-cinema .opening-title > .eyebrow { display: none; }
  .has-cinema .film-copy > p:not(.eyebrow) { font-size: 18px; line-height: 1.45; max-width: 380px; }
  .has-cinema .film-copy .film-subtitle { font-size: clamp(20px, 5.3vw, 25px) !important; line-height: 1.25 !important; }
  .has-cinema .film-copy .film-intro, .has-cinema .film-copy > p + p:not(.film-subtitle) { display: none; }
  .has-cinema .film-copy .text-link { margin-top: 18px; min-height: 44px; font-size: 14px; }
  .has-cinema .film-meta { display: contents; }
  .has-cinema .film-play { display: none; }
  .has-cinema .film-caption { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(84px + env(safe-area-inset-bottom)); max-width: none; text-align: left; font-size: 12px; line-height: 1.4; opacity: var(--caption-opacity, 1); }
  .has-cinema .cinema-controls { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(16px + env(safe-area-inset-bottom)); width: auto; margin: 0; padding: 0; gap: 14px; }
  .has-cinema .cinema-controls nav { gap: 12px; max-width: none; }
  .has-cinema .cinema-controls nav a { min-width: 0; min-height: 48px; font-size: 12px; gap: 9px; justify-content: center; }
  .has-cinema .cinema-count, .has-cinema .cinema-instruction { display: none; }
  .has-cinema .cinema-status { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(110px + env(safe-area-inset-bottom)); margin: 0; }

  /* Motion off keeps every scene readable, with large square illustrations. */
  html:not(.has-cinema) .cinema { padding-top: var(--header-height); }
  html:not(.has-cinema) .chapter-scene { display: flex; flex-direction: column; height: auto; min-height: 0; padding: 28px 0 20px; }
  html:not(.has-cinema) .film-copy { position: static; width: auto; max-width: 650px; padding: 0 var(--gutter) 24px; }
  html:not(.has-cinema) .opening-title > .eyebrow { display: none; }
  html:not(.has-cinema) .film-art { position: relative; inset: auto; order: 1; width: 100%; aspect-ratio: 1; z-index: 0; }
  html:not(.has-cinema) .film-art img, html:not(.has-cinema) .film-art video { object-fit: cover; object-position: var(--film-focus, 50%) 50%; }
  html:not(.has-cinema) .film-shade, html:not(.has-cinema) .cinema-controls { display: none; }
  html:not(.has-cinema) .film-meta { display: flex; order: 2; align-items: center; justify-content: space-between; gap: 12px; padding: 12px var(--gutter) 0; }
  html:not(.has-cinema) .film-caption { position: static; margin: 0; font-size: 12px; text-align: left; }
  html:not(.has-cinema) .film-play { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 12px; background: none; border: 1px solid #aaa18e; color: var(--cinema-ink); font: 500 12px/1.5 var(--sans); }
  html:not(.has-cinema) .chapter-scene:not(.has-manual-frame) .film-art video { opacity: 0; }
}
/* Tablets have room for larger navigation and a wider editorial composition. */
@media (min-width: 601px) and (max-width: 1100px) and (min-height: 581px),
       (min-width: 1101px) and (max-aspect-ratio: 1/1) {
  :root { --header-height: calc(78px + env(safe-area-inset-top)); --gutter: clamp(30px, 5vw, 60px); }
  .site-header { gap: 18px; padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right)); }
  .site-header .wordmark { font-size: 13px; letter-spacing: .17em; }
  .menu-toggle { font-size: 14px; padding-inline: 14px; }
  .menu-toggle span { display: inline; }
  .site-header .header-cta { font-size: 14px; padding-inline: 20px; gap: 18px; }
  .has-cinema .film-copy { top: max(calc(var(--header-height) + 36px), 13dvh); max-width: min(68vw, 610px); }
  .has-cinema .film-copy h1 { font-size: clamp(64px, 9vw, 92px); line-height: .94; margin-bottom: 24px; }
  .has-cinema .film-copy h2 { font-size: clamp(54px, 7.4vw, 78px); margin-bottom: 24px; }
  .has-cinema .film-copy .eyebrow { font-size: 12px; margin-bottom: 22px; }
  .has-cinema .film-copy > p:not(.eyebrow) { font-size: 20px; max-width: 440px; }
  .has-cinema .film-copy .film-subtitle { font-size: clamp(25px, 3vw, 32px) !important; }
  .has-cinema .film-copy .text-link { font-size: 15px; margin-top: 24px; }
  .has-cinema .film-caption { font-size: 14px; text-align: right; bottom: calc(102px + env(safe-area-inset-bottom)); }
  .has-cinema .cinema-controls { bottom: calc(28px + env(safe-area-inset-bottom)); gap: 24px; align-items: center; }
  .has-cinema .cinema-controls nav { gap: 20px; }
  .has-cinema .cinema-controls nav a { font-size: 15px; }
  .has-cinema .cinema-count { display: block; }
  .history-stories article { display: grid; }
  .history-stories h3 { margin: 14px 0 0; }
  .book-actions .button { flex: 1 1 230px; width: auto; }
  .book-stage-control { aspect-ratio: 1.18; background-position: 16% center; }
  .cover-choice span { font-size: 15px; }
}
@media (min-width: 900px) and (max-width: 1100px) and (min-height: 581px) {
  .gallery-interior { display: grid; grid-template-columns: .8fr 1.2fr; gap: 4%; padding-bottom: 35px; }
  .gallery-copy h2 { font-size: clamp(46px, 5.4vw, 59px); }
  .specimens.specimen-stage { width: 100%; max-width: none; margin: 0; }
  .specimen-stage .specimen-label > span { font-size: 18px; }
  .reading-intro .editorial-grid, .author-section .editorial-grid { grid-template-columns: .85fr 1.15fr; gap: 6%; }
  .reading-intro .editorial-grid h2 { font-size: clamp(40px, 4.7vw, 51px); }
  .intro-body .lead { font-size: 23px; }
}
@media (max-height: 700px) and (max-width: 600px) {
  .has-cinema .film-copy { top: calc(var(--header-height) + 14px); }
  .has-cinema .film-copy h1 { font-size: 46px; margin-bottom: 14px; }
  .has-cinema .film-copy h2 { font-size: 40px; }
  .has-cinema .film-copy .film-subtitle { font-size: 19px !important; }
  .has-cinema .film-copy > p:not(.eyebrow) { font-size: 16px; }
  .has-cinema .film-copy .text-link { margin-top: 12px; }
}
@media (max-height: 580px) and (min-aspect-ratio: 1/1) {
  .has-cinema .film-copy { top: calc(var(--header-height) + 12px); width: 52%; }
  .has-cinema .film-copy h1 { font-size: clamp(32px, 6.5vh, 44px); margin-bottom: 10px; }
  .has-cinema .film-copy h2 { font-size: 34px; margin-bottom: 10px; }
  .has-cinema .film-copy h1 br { display: none; }
  .has-cinema .film-copy .eyebrow { margin-bottom: 10px; font-size: 10px; }
  .has-cinema .film-copy .film-subtitle { font-size: 18px !important; }
  .has-cinema .film-copy > p:not(.eyebrow) { font-size: 15px; line-height: 1.3; }
  .has-cinema .film-copy .text-link { margin-top: 8px; font-size: 12px; }
  .has-cinema .film-caption { text-align: right; left: 60%; bottom: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .button, .sample-detail, .gallery-backdrop { transition: none; transform: none; }
}
@media print { .film-play, .menu-toggle { display: none !important; } }
