/* =========================================================
   Process — writing your storybook
   ========================================================= */

/* ---------- 1 · the book opens ---------- */
.pr-hero { position: relative; height: 100svh; min-height: 620px; overflow: hidden; background: var(--linen); }
.pr-hero__stage { position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; align-items: center; justify-items: center; gap: clamp(10px, 2svh, 24px); padding: calc(var(--header-h) + 1svh) var(--gutter) clamp(18px, 4svh, 44px); }
.pr-hero__line { position: relative; width: 100%; margin: 0; font-family: var(--serif); font-weight: 300; font-size: clamp(2.3rem, min(6.4vw, 10svh), 7rem); line-height: 1; letter-spacing: -.03em; color: var(--ink); pointer-events: none; z-index: 3; }
.pr-hero__line--top { text-align: left; }
.pr-hero__line--bottom { text-align: right; }
.pr-hero__line em { font-style: italic; }
.pr-hero__hint { position: absolute; left: var(--gutter); bottom: 6vh; display: inline-flex; align-items: center; gap: 12px; font-size: .84rem; letter-spacing: .05em; color: var(--ink-faint); z-index: 3; }
.pr-hero__hint i { position: relative; width: 1px; height: 44px; background: var(--line); overflow: hidden; }
.pr-hero__hint i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--ink); animation: cue 2.2s var(--ease) infinite; }

.pr-book { position: relative; z-index: 2; height: 100%; max-height: 540px; width: auto; aspect-ratio: 3 / 4.15; }
.pr-book__page, .pr-book__cover { position: absolute; inset: 0; border-radius: 3px 8px 8px 3px; }
.pr-book__page { background: var(--paper); box-shadow: 0 40px 80px -36px rgba(47,27,9,.45), inset 14px 0 22px -16px rgba(47,27,9,.25), 3px 2px 0 -1px #efe5d3, 6px 4px 0 -2px #e5d8c1, 9px 6px 0 -3px #dccfb6; padding: 11% 10%; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.pr-book__page::before { /* gutter fold */ content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 22px; background: linear-gradient(90deg, rgba(47,27,9,.16), transparent); }
.pr-book__chapter { font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--terra); }
.pr-book__page h1 { font-size: clamp(1.7rem, 2.3vw, 2.3rem); line-height: 1.05; letter-spacing: -.01em; }
.pr-book__page p { margin: 0; font-size: .92rem; color: var(--ink-soft); }
.pr-book__sprig .sprig, .pr-book__page .sprig { width: 26px; height: 26px; margin-top: 6px; }
.pr-book__cover { transform-origin: 0% 50%; transform-style: preserve-3d; will-change: transform; }
.pr-book__front, .pr-book__back { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.pr-book__front { background: var(--night); color: var(--on-dark); box-shadow: 0 50px 90px -40px rgba(47,27,9,.7), 0 2px 6px rgba(47,27,9,.2); }
.pr-book__front img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pr-book__front::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 20px; z-index: 2; background: linear-gradient(90deg, rgba(0,0,0,.4), rgba(255,255,255,.12) 45%, rgba(0,0,0,.2)); }
.pr-book__front::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30,17,5,.6), rgba(30,17,5,0) 40%, rgba(30,17,5,.1) 60%, rgba(30,17,5,.7)); }
.pr-book__title { position: absolute; z-index: 3; left: 13%; right: 10%; top: 9%; }
.pr-book__title small { display: block; font-size: .62rem; letter-spacing: .26em; opacity: .85; margin-bottom: 12px; }
.pr-book__title b { font-family: var(--serif); font-weight: 300; font-size: clamp(2.2rem, 3.4vw, 3.4rem); line-height: .92; display: block; }
.pr-book__foot { position: absolute; z-index: 3; left: 13%; bottom: 7%; font-family: var(--serif); font-style: italic; font-size: 1.05rem; }
.pr-book__back { transform: rotateY(180deg); background: #EFE5D3; display: grid; place-items: center; padding: 14%; text-align: center; box-shadow: inset -14px 0 22px -16px rgba(47,27,9,.3), inset 0 0 0 14px #EFE5D3, inset 0 0 0 15px rgba(47,27,9,.14); }
.pr-book__back span { font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 1.6vw, 1.5rem); line-height: 1.35; color: var(--walnut); }
.no-gsap .pr-book__cover { display: none; }
@media (max-width: 900px) {
  .pr-hero { min-height: 560px; }
  .pr-book { height: auto; width: min(72vw, 44svh); max-height: none; }
  .pr-hero__line { font-size: clamp(2.2rem, 10.5vw, 3.2rem); }
  .pr-hero__stage { padding-bottom: 9svh; }
  .pr-hero__hint { left: 50%; transform: translateX(-50%); bottom: 3.5vh; white-space: nowrap; }
  .pr-book__page { padding: 12% 11%; gap: 12px; }
  .pr-book__page h1 { font-size: clamp(1.5rem, 6.6vw, 2rem); }
  .pr-book__page p { font-size: .86rem; }
}

/* ---------- 2 · four chapters ---------- */
.pr-chapters { padding: clamp(80px, 9vw, 140px) 0; }
.pr-chapters__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 6vw, 110px); }
.pr-visual { position: sticky; top: calc(var(--header-h) + 28px); height: calc(100svh - var(--header-h) - 56px); display: flex; flex-direction: column; gap: 18px; }
.pr-visual__frame { position: relative; flex: 1; border-radius: var(--arch); overflow: hidden; background: var(--night); }
.pr-visual__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; clip-path: inset(100% 0% 0% 0%); transform: scale(1.2); transition: clip-path .85s cubic-bezier(.65, 0, .35, 1), transform 1.4s var(--ease-out); }
.pr-visual__frame img.is-shown { clip-path: inset(0% 0% 0% 0%); transform: scale(1); }
.pr-visual__frame img:first-child { clip-path: inset(0% 0% 0% 0%); transform: scale(1); }
.pr-visual__frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(30,17,5,.55), rgba(30,17,5,0) 45%); pointer-events: none; }
.pr-visual__num { position: absolute; z-index: 2; left: 8%; bottom: 3%; height: clamp(7rem, 13vw, 12rem); overflow: hidden; font-family: var(--serif); font-weight: 300; font-size: clamp(7rem, 13vw, 12rem); line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(244,236,223,.85); font-variant-numeric: lining-nums; }
.pr-visual__num span { display: block; height: 1em; transition: transform .8s cubic-bezier(.65, 0, .35, 1); transform: translateY(calc(var(--ch, 0) * -100%)); }
.pr-visual__ui { display: flex; align-items: center; gap: 18px; font-size: .88rem; color: var(--ink-faint); }
.pr-visual__count { white-space: nowrap; font-variant-numeric: lining-nums; }
.pr-visual__count b { font-weight: 400; color: var(--ink); }
.pr-visual__bar { flex: 1; height: 1px; background: var(--line); position: relative; }
.pr-visual__bar i { position: absolute; inset: 0; background: var(--terra); transform-origin: left; transform: scaleX(.25); transition: transform .9s var(--ease-out); }

.pr-ch { min-height: 80svh; display: flex; flex-direction: column; justify-content: center; padding: 40px 0; transition: opacity .6s var(--ease); }
.has-gsap .pr-ch:not(.is-active) { opacity: .26; }
.pr-ch__img { display: none; }
.pr-ch__label { display: block; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--terra); margin-bottom: 8px; }
.pr-ch .num { display: none; }
.pr-ch h2 { font-size: clamp(2.4rem, 4vw, 3.8rem); line-height: 1.02; letter-spacing: -.015em; margin: 0 0 22px; max-width: 14ch; }
.pr-ch p { color: var(--ink-soft); max-width: 48ch; margin: 0 0 1em; font-size: 1.06rem; }
.pr-ch .quote { font-family: var(--serif); font-style: italic; font-size: 1.5rem; color: var(--walnut); padding-left: 20px; border-left: 1px solid var(--terra); }
.pr-stack__ui { display: none; }

/* mobile: a pinned stack of pages that turn as you scroll */
@media (max-width: 900px) {
  .pr-chapters { padding: 0; }
  .pr-chapters > .wrap { padding: 0; }
  .pr-chapters__grid { display: block; }
  .pr-visual { display: none; }
  .pr-stack { position: relative; height: 100svh; overflow: hidden; perspective: 1600px; background: var(--linen); }
  .pr-ch { position: absolute; left: 10px; right: 10px; top: calc(var(--header-h) - 6px); bottom: 64px; min-height: 0; padding: 0; justify-content: flex-start; border-radius: 50vw 50vw 6px 6px / 30vw 30vw 6px 6px; overflow: hidden; background: var(--paper); box-shadow: 0 30px 60px -30px rgba(47,27,9,.45); transform-origin: 50% 0%; will-change: transform; opacity: 1 !important; }
  .pr-ch:nth-child(1) { z-index: 4; } .pr-ch:nth-child(2) { z-index: 3; } .pr-ch:nth-child(3) { z-index: 2; } .pr-ch:nth-child(4) { z-index: 1; }
  .pr-ch__img { display: block; position: relative; height: 46%; overflow: hidden; }
  .pr-ch__img img { width: 100%; height: 100%; object-fit: cover; }
  .pr-ch__img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30,17,5,0) 50%, rgba(30,17,5,.35)); }
  .pr-ch .num { display: block; position: absolute; right: 18px; top: calc(46% - 2.4rem); z-index: 2; font-family: var(--serif); font-weight: 300; font-size: 5.6rem; line-height: 1; color: var(--paper); font-variant-numeric: lining-nums; text-shadow: 0 10px 30px rgba(30,17,5,.35); }
  .pr-ch__body { padding: 24px 22px 20px; }
  .pr-ch__label { font-size: 1.05rem; }
  .pr-ch h2 { font-size: clamp(1.9rem, 8.4vw, 2.5rem); margin-bottom: 12px; }
  .pr-ch p { font-size: .94rem; line-height: 1.6; margin-bottom: .7em; }
  .pr-ch .quote { font-size: 1.2rem; padding-left: 14px; }
  .pr-stack__ui { display: flex; position: absolute; z-index: 10; left: 20px; right: 20px; bottom: 22px; justify-content: space-between; align-items: center; font-size: .84rem; color: var(--ink-faint); font-variant-numeric: lining-nums; }
  .pr-stack__count b { font-weight: 400; color: var(--ink); }
  .pr-stack__dots { display: flex; gap: 8px; }
  .pr-stack__dots i { width: 22px; height: 2px; background: var(--line); transition: background-color .4s, width .5s var(--ease-out); }
  .pr-stack__dots i.is-on { background: var(--terra); width: 34px; }
  /* without motion libraries: plain readable list */
  .no-gsap .pr-stack { height: auto; overflow: visible; }
  .no-gsap .pr-ch { position: relative; inset: auto; margin: 0 10px 16px; height: auto; }
}
.pr-close .h-close__inner h2 { font-size: clamp(2.3rem, 5.4vw, 5.6rem); max-width: 17ch; }
