/* MARK: 1. Hero: the mantel at night */
.hero { height: 100svh; min-height: 620px; }
.hero-words { position: absolute; z-index: 3; left: var(--gutter); top: clamp(104px, 14vh, 170px); max-width: min(860px, 56vw); }
.hero-words .display.xl { font-size: clamp(44px, 5.6vw, 92px); }
.hero-words .lede { max-width: 30em; }
.hero-words .lede { margin-top: 26px; }
.hero-actions { display: flex; align-items: center; gap: 26px; margin-top: 34px; flex-wrap: wrap; }
.hero .shelf, .closing .shelf { z-index: 2; }
.hero .shelf { justify-content: flex-end; padding-right: max(var(--gutter), 6vw); }
.plaque { position: absolute; z-index: 3; left: 0; right: 0; text-align: center; margin: 0; }
.plaque::before { content: ""; }
.plaque { width: fit-content; margin: 0 auto; padding: 8px 16px; border: .5px solid rgba(217, 203, 178, .35); }

@media (max-width: 860px) {
  .hero-words { max-width: none; right: var(--gutter); top: 96px; }
  .hero .shelf { justify-content: center; padding: 0; }
  .hero-words .display.xl { font-size: clamp(40px, 10.5vw, 64px); }
  .hero-words .lede { margin-top: 16px; font-size: 15px; }
  .hero-actions { margin-top: 20px; }
}

/* Pinned chapters: the section is tall, its content stays put while the scroll drives it. */
.chapter { position: relative; }
.chapter .pin { position: sticky; top: 0; height: 100svh; overflow: hidden; display: grid; align-items: center; }
.chapter .wall { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* MARK: 2. Opening a card */
.open-chapter { height: 320vh; background: var(--room); }
.open-chapter .wall-shade { position: absolute; inset: 0; background: radial-gradient(ellipse 50% 70% at 64% 50%, rgba(248, 225, 183, .12), transparent 70%),
                                                         linear-gradient(90deg, rgba(12, 7, 4, .78), rgba(12, 7, 4, .25) 55%, rgba(12, 7, 4, .55)); }
.open-words { position: absolute; z-index: 2; left: var(--gutter); top: 50%; transform: translateY(-50%); width: min(470px, 36vw); }
.open-words .step { position: absolute; top: 50%; transform: translateY(-50%); }
.open-words .step .lede { margin-top: 22px; }
.open-chapter .book-stage { position: absolute; z-index: 2; left: 41%; right: 3%; top: 0; bottom: 0; display: grid; place-items: center; }
.open-chapter .book { --w: min(25vw, 58svh * 5 / 7); }
@media (max-width: 860px) {
  .open-words { left: var(--gutter); right: var(--gutter); width: auto; top: 13svh; transform: none; }
  .open-words .step { top: 0; transform: none; }
  .open-chapter .book-stage { left: 0; right: 0; top: 30svh; }
  .open-chapter .book { --w: min(40vw, 44svh * 5 / 7); }
}

/* MARK: 3. Scanning, in daylight */
.scan { position: relative; background: var(--paper); color: var(--print-ink); padding: clamp(90px, 13vw, 190px) var(--gutter);
        display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(40px, 6vw, 110px); align-items: center; }
.scan .lede { color: rgba(58, 46, 38, .8); margin-top: 24px; }
.scan-list { list-style: none; padding: 0; margin: 40px 0 0; }
.scan-list li { padding: 16px 0; border-top: .5px solid rgba(58, 46, 38, .25); color: rgba(58, 46, 38, .78); font-size: 15px; }
.scan-list li:last-child { border-bottom: .5px solid rgba(58, 46, 38, .25); }
.scan-list span { font-family: var(--serif); font-size: 20px; color: var(--print-ink); margin-right: 4px; }
.compare { position: relative; margin: 0; aspect-ratio: 800 / 561; border-radius: 2px; overflow: hidden; touch-action: pan-y;
           box-shadow: 0 30px 60px rgba(58, 46, 38, .28), 0 4px 10px rgba(58, 46, 38, .12); cursor: ew-resize; user-select: none; }
.compare > img, .compare .before img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--split, 50%)) 0 0); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 0; }
.compare .handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -.75px; width: 1.5px; background: var(--ember); }
.compare .handle span { position: absolute; top: 50%; left: 0; width: 34px; height: 34px; transform: translate(-50%, -50%); border-radius: 50%;
                        background: var(--ember); box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }
.compare .handle span::before, .compare .handle span::after { content: ""; position: absolute; top: 50%; width: 6px; height: 6px;
  border: solid var(--paper); border-width: 0 1.5px 1.5px 0; transform: translateY(-50%) rotate(135deg); left: 9px; }
.compare .handle span::after { transform: translateY(-50%) rotate(-45deg); left: auto; right: 9px; }
.compare figcaption { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 30px 16px 14px;
                      background: linear-gradient(transparent, rgba(0, 0, 0, .62)); pointer-events: none; }
.compare figcaption .label { color: #fff; font-size: 12px; }
@media (max-width: 860px) { .scan { grid-template-columns: 1fr; } }

/* MARK: 4. The phone, half open */
.duo-chapter { height: 260vh; background: radial-gradient(ellipse 70% 60% at 62% 60%, #241912, var(--room-deep) 72%); }
.duo-words { position: absolute; z-index: 2; left: var(--gutter); top: 50%; transform: translateY(-50%); width: min(460px, 34vw); }
.duo-words .lede { margin-top: 22px; }
.duo-words .lede.small { font-size: 15px; color: rgba(243, 235, 219, .6); margin-top: 14px; }
.duo-stage { position: absolute; left: 38%; right: 0; top: 0; bottom: 0; display: grid; place-items: center; perspective: 1800px; perspective-origin: 50% 30%; }
.duo { --w: min(44vw, 92svh); position: relative; width: var(--w); aspect-ratio: 2034 / 1398; transform-style: preserve-3d;
       transform: rotateX(16deg) translateY(4%); }
.duo-top, .duo-base { position: absolute; left: 0; right: 0; height: 100%; border-radius: calc(var(--w) * .045); transform-style: preserve-3d;
                      background: linear-gradient(160deg, #2b2b2e, #121214); padding: calc(var(--w) * .022); }
.duo-top { bottom: 0; transform-origin: 50% 100%; transform: rotateX(calc(var(--fold, 15) * 1deg));
           box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.duo-base { top: 100%; transform-origin: 50% 0; transform: rotateX(90deg); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 40px 80px rgba(0, 0, 0, .6); }
.duo-screen, .duo-glass { width: 100%; height: 100%; border-radius: calc(var(--w) * .03); overflow: hidden; background: #050505; }
.duo-screen img { width: 100%; height: 100%; object-fit: cover; }
.duo-glass { background: linear-gradient(180deg, #0b0b0c, #151518 60%, #0b0b0c); }
.duo-glass::after { content: ""; display: block; height: 100%; background: linear-gradient(160deg, rgba(255, 255, 255, .06), transparent 40%); }
@media (max-width: 860px) {
  .duo-words { left: var(--gutter); right: var(--gutter); width: auto; top: 12svh; transform: none; }
  .duo-stage { left: 0; top: 34svh; }
  .duo { --w: 84vw; }
}

/* MARK: 5. Sending */
.send-chapter { height: 300vh; background: #d8d3c4; }
.send-chapter .wall { filter: brightness(.86); }
.send-words { position: absolute; z-index: 2; left: var(--gutter); top: 50%; transform: translateY(-50%); width: min(470px, 36vw); color: var(--print-ink); }
.send-words .lede { color: rgba(58, 46, 38, .92); margin-top: 22px; }
.send-stage { position: absolute; left: 42%; right: 2%; top: 0; bottom: 0; display: grid; place-items: center; }
.send-stage .envelope { --w: min(40vw, 64svh); }
@media (max-width: 860px) {
  .send-words { left: var(--gutter); right: var(--gutter); width: auto; top: 12svh; transform: none; }
  .send-stage { left: 0; right: 0; top: 34svh; }
  .send-stage .envelope { --w: 82vw; }
}

/* MARK: Covers */
.covers { background: var(--room-deep); padding: clamp(90px, 11vw, 160px) 0 clamp(80px, 9vw, 130px); }
.covers h2 { padding: 0 var(--gutter); max-width: 18em; }
.cover-rail { display: flex; gap: 22px; padding: 46px var(--gutter) 30px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
.cover-rail::-webkit-scrollbar { display: none; }
.cover-rail figure { flex: 0 0 auto; margin: 0; width: clamp(150px, 15vw, 210px); scroll-snap-align: start; }
.cover-rail figure > div { aspect-ratio: 5 / 7; border-radius: 2px; overflow: hidden; box-shadow: 0 16px 34px rgba(0, 0, 0, .5);
                           transition: transform .6s var(--ease-out); }
.cover-rail figure:hover > div { transform: translateY(-6px); }
.cover-rail img { width: 100%; height: 100%; object-fit: cover; }
.cover-rail figcaption { margin-top: 14px; font-family: var(--serif); font-size: 17px; color: var(--label-bright); }
.cover-rail figcaption .label { display: block; font-size: 11px; margin-top: 3px; color: rgba(217, 203, 178, .7); }

/* MARK: 6. Closing */
.closing { height: 92svh; min-height: 560px; }
.closing-words { position: absolute; z-index: 3; left: 0; right: 0; top: clamp(90px, 16vh, 170px); text-align: center; color: var(--print-ink); }
.closing-words h2 { margin-bottom: 30px; }
.closing .store { background: var(--print-ink); color: var(--paper) !important; }

/* The printed verse inside the sample card (CardArt.christmasVerse). */
.verse { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7cqw;
         container-type: inline-size; padding: 0 8%; text-align: center; }
.face:has(.verse) { container-type: inline-size; }
.verse p { margin: 0; font-family: var(--serif); font-size: 5cqw; line-height: 1.4; color: var(--print-ink); }
.verse i { width: 3cqw; aspect-ratio: 1; background: var(--burgundy); transform: rotate(45deg); }

/* Reduced motion: chapters lay out at their resting state, without pinning. */
.still .chapter { height: auto; }
.still .chapter .pin { position: relative; height: auto; min-height: 100svh; }
