:root {
  --ink: #2d4035;
  --muted: #596454;
  --rust: #95442f;
  --rule: #9d9b856b;
  --paper: #f3efe4;
  --gutter: clamp(24px, 5vw, 92px);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Gill Sans", "Trebuchet MS", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--ink); font-family: var(--serif);
  background: linear-gradient(#f7f4e8af,#f7f4e8af), url("assets/paper.webp"), var(--paper);
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 4px; }
[hidden] { display: none !important; }
/* One snap stop per chapter, so a scroll always settles on a finished page, never mid-fade. */
html { scroll-snap-type: y mandatory; }
.book { height: 500vh; height: 500svh; position: relative; }
.snaps { position: absolute; inset: 0; pointer-events: none; }
.snaps i { display: block; height: 100vh; height: 100svh; scroll-snap-align: start; scroll-snap-stop: always; }
.page {
  height: 100vh; height: 100svh; position: sticky; top: 0;
  display: grid; grid-template-rows: minmax(0, 1fr) auto;
}
.turn, .eyebrow, .plate, .register-title { display: flex; align-items: center; }
.eyebrow, .plate span, .register-title {
  font: 600 10px/1.4 var(--sans); text-transform: uppercase; letter-spacing: .17em;
}
.eyebrow i, .plate i { width: 25px; height: 1px; background: var(--rule); }
.stage { position: relative; overflow: hidden; isolation: isolate; }
.painting, #paintings, .chapter { position: absolute; inset: 0; }
.painting { pointer-events: none; }
.art-field { height: 100%; position: relative; margin-left: auto; width: 72%; }
.art {
  height: 100%; width: 100%; object-fit: cover; object-position: 60% 56%;
  mix-blend-mode: multiply; mask-image: linear-gradient(to right, transparent 0%, #000 26%);
}
.painting.side-1 .art-field { margin: 0 auto 0 0; }
.painting.side-1 .art { mask-image: linear-gradient(to left, transparent, #000 28%); }
#paintings { mix-blend-mode: multiply; }
.birds { position: absolute; left: 32%; top: 22%; width: 80px; opacity: .6; }
.chapter { padding: 0 var(--gutter); display: flex; align-items: center; pointer-events: none; }
.chapter.side-1 { justify-content: flex-end; }
.copy { width: 36%; max-width: 550px; }
.copy a { pointer-events: auto; }
.eyebrow { gap: 9px; color: var(--rust); }
.seal { border: 1px solid currentColor; padding: 2px 4px; letter-spacing: .06em; }
h1, p { margin: 0; }
h1 { font-weight: 400; font-size: clamp(54px, 6.7vw, 112px); line-height: .94; letter-spacing: -.065em; margin: .26em 0; }
h1 em { font-weight: 400; }
.detail { font: 600 clamp(13px, 1.1vw, 17px)/1.55 var(--sans); }
.detail-dot { padding: 0 .5em; color: var(--rust); }
.tale { font-size: clamp(16px,1.4vw,21px); line-height: 1.48; margin: 15px 0 22px; max-width: 33ch; }
.turn { gap: 10px; font: 600 14px var(--sans); width: fit-content; }
.round-arrow { border: 1px solid var(--rust); color: var(--rust); border-radius: 50%; width: 33px; height: 33px; display: grid; place-items: center; }
.turn:hover .round-arrow { background: var(--rust); color: var(--paper); }
.plate { position: absolute; right: var(--gutter); bottom: 2.8%; padding: 5px 9px; gap: 7px; background: #f3efdfeb; font: italic 13px var(--serif); }
.plate.on-left { right: auto; left: var(--gutter); }
.plate span { font-size: 9px; color: var(--rust); }
.register { margin-inline: var(--gutter); border-top: 1px solid var(--rule); padding: clamp(10px,2vh,20px) 0; }
.register-title { gap: 12px; color: var(--muted); }
.register-title i { flex: 1; height: 1px; background: var(--rule); }
#route-strip { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); padding-top: 10px; }
#route-strip a { position: relative; padding: 4px 8px 4px 15px; }
.route-node { position: absolute; left: 0; top: 11px; width: 7px; height: 7px; border: 1px solid var(--muted); border-radius: 50%; }
[aria-current] .route-node { background: var(--rust); border-color: var(--rust); }
.route-name, .route-time { display: block; }
.route-name { font-size: clamp(15px,1.4vw,21px); }
.route-time { color: var(--muted); font: 12px/1.5 var(--sans); margin-top: 2px; }
[aria-current] .route-name { color: var(--rust); }
@media (max-width: 700px) {
  :root { --gutter: 20px; }
  .plate { display: none; }
  .painting .art-field { width: 100%; height: 58%; }
  .painting .art-field .art { object-position: center 57%; mask-image: linear-gradient(#000 68%,transparent); }
  .chapter, .chapter.side-1 { align-items: flex-end; justify-content: flex-start; padding-bottom: 18px; }
  .copy { width: 100%; max-width: 100%; }
  h1 { font-size: clamp(39px,10vw,64px); line-height: 1; margin: 8px 0; }
  h1 br { display: none; }
  h1 br::after { content: ' '; }
  .tale { font-size: 16px; line-height: 1.35; margin: 10px 0 12px; max-width: 44ch; }
  .register { padding: 8px 0; }
  #route-strip { padding-top: 4px; gap: 5px; }
  #route-strip a { padding: 8px 0 3px; border-top: 2px solid var(--rule); }
  #route-strip [aria-current] { border-color: var(--rust); }
  .route-node, .route-time { display: none; }
  .route-name { font: 12px/1.15 var(--sans); }
}
@media (max-height: 540px), (max-width: 700px) and (max-height: 690px) {
  .book, .page { height: auto; }
  .page { position: static; display: block; }
  .stage { overflow: visible; }
  #paintings, .plate, .register, .snaps { display: none; }
  .chapter, .chapter.side-1 { display: block; position: static; padding: 0 var(--gutter) 30px; border-bottom: 1px solid var(--rule); }
  .chapter::before { content: ''; display: block; height: clamp(120px, 37vh, 270px); margin: 0 calc(-1 * var(--gutter)) 15px; background: var(--scene) center 57% / cover; mix-blend-mode: multiply; }
  .copy { width: 100%; max-width: 68ch; }
  h1 { font-size: clamp(39px,6vw,55px); }
  h1 br { display: none; }
  .tale { max-width: 54ch; }
}
