/* William James Bookseller — "The Card Drawer". Independent concept by CofeeUI.
   Base styles render every scene in its resolved state (no JS, reduced motion, print).
   cinematic.js adds .scenes-ready and drives section-local custom properties. */

@font-face { font-family: "Cormorant"; src: url("./fonts/cormorant.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("./fonts/cormorant-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("./fonts/courier-prime.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("./fonts/courier-prime-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("./fonts/caveat.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --ink: #181e20;
  --ink-2: #20282a;
  --cream: #ecdcba;
  --cream-soft: #d9c8a6;
  --paper: #ece2cb;
  --paper-2: #e2d5b8;
  --card: #f7efdc;
  --rust: #ac5a3c;
  --rust-deep: #8c4127;
  --rust-ink: #84391f;
  --brass: #d7b678;
  --brass-hi: #f0d79e;
  --walnut: #4a2f23;
  --walnut-2: #5d3c2b;
  --oak: #8a5e3e;
  --rule-red: #c0563a;
  --rule-blue: #93a9b4;
  --graphite: #3e3c39;
  --type-ink: #23201d;

  --display: "Cormorant", "Cormorant Garamond", Garamond, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Courier Prime", "Courier New", Courier, monospace;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;

  --hd: 64px;
  --gutter: clamp(16px, 5vw, 88px);
  --focus: #f3cf85;
  color-scheme: light;
  scroll-padding-top: calc(var(--hd) + 16px);
}
@media (prefers-reduced-motion: no-preference) { :root { scroll-behavior: smooth; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font: 17px/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { overflow-wrap: break-word; hyphens: manual; margin: 0; }
p { margin: 0 0 1em; }
[hidden] { display: none !important; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}
main:focus { outline: none; }
/* Focus Not Obscured: every focus target clears the sticky header, in both Tab directions. */
:where(a[href], button, input, select, textarea, summary) { scroll-margin-top: calc(var(--hd) + 20px); scroll-margin-bottom: 24px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 12px; top: -80px; z-index: 100;
  background: var(--cream); color: var(--ink); padding: 12px 18px; font: 700 15px/1 var(--sans);
  --focus: var(--ink);
}
.skip:focus { top: 12px; }

/* ---------- Surfaces: each owns its text and focus colours ---------- */
.s-dark, .hero, .about, .close, .site-header, .site-footer { --focus: #f3cf85; }
.collection, .want, .owner { background: var(--paper); color: var(--ink); --focus: #7a3520; }
.visit { background: var(--rust-deep); color: #fff3dc; --focus: #ffe2a3; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgb(24 30 32 / .96);
  border-bottom: 1px solid rgb(215 182 120 / .28);
}
@supports (backdrop-filter: blur(1px)) { .site-header { background: rgb(24 30 32 / .9); backdrop-filter: saturate(1.2) blur(10px); } }
.hd-row {
  height: calc(var(--hd) - 1px);
  display: flex; align-items: center; gap: clamp(10px, 2vw, 28px);
  padding: 0 var(--gutter);
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
  position: relative;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; flex: 0 1 auto; min-width: 0; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font: 600 23px/1 var(--display); letter-spacing: .01em; white-space: nowrap; }
.brand-sub { font: 600 11px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--cream-soft); white-space: nowrap; padding-top: 3px; }
.site-nav { margin-left: auto; display: flex; gap: clamp(14px, 2vw, 30px); }
.site-nav a {
  font: 600 13px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center; color: var(--cream);
}
.site-nav a:hover { color: var(--brass-hi); text-decoration: underline; }
.menu-btn {
  margin-left: auto; min-height: 44px; min-width: 44px; padding: 0 14px;
  border: 1px solid rgb(215 182 120 / .7); background: transparent; color: var(--cream);
  font: 700 13px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
}
.menu-btn[aria-expanded="true"] { background: var(--cream); color: var(--ink); }
.hd-cta {
  min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; flex: none;
  background: var(--brass); color: var(--ink); text-decoration: none;
  font: 700 13px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
}
.hd-cta:hover { background: var(--brass-hi); }

@media (max-width: 899px) {
  .nav-enhanced .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; gap: 0; padding: 8px var(--gutter) 18px;
    background: var(--ink); border-bottom: 1px solid rgb(215 182 120 / .35);
    box-shadow: 0 18px 30px rgb(0 0 0 / .35);
  }
  .nav-enhanced .site-nav.open { display: flex; }
  .nav-enhanced .site-nav a { min-height: 48px; font-size: 14px; border-bottom: 1px solid rgb(236 220 186 / .14); }
  .brand-sub { display: none; }
  /* Without scripts the links stay visible and wrap onto a second header row. */
  html:not(.nav-enhanced) .hd-row { height: auto; min-height: var(--hd); flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
  html:not(.nav-enhanced) .site-nav { order: 3; flex-basis: 100%; margin: 0; flex-wrap: wrap; gap: 0 18px; }
  html:not(.nav-enhanced) .hd-cta { margin-left: auto; }
  html:not(.nav-enhanced) { --hd: 112px; }
}
@media (min-width: 900px) { .menu-btn { display: none !important; } }
@media (max-width: 400px) {
  .hd-row { gap: 8px; }
  .brand { gap: 7px; }
  .brand-name { font-size: 18.5px; }
  .brand-mark { width: 24px; height: 24px; }
  .hd-cta, .menu-btn { padding: 0 9px; letter-spacing: .06em; }
}

/* ---------- Shared type and controls ---------- */
.eyebrow { font: 700 12px/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; margin-bottom: 18px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.eyebrow .num { font: italic 600 20px/1 var(--display); letter-spacing: 0; }
.chapter { position: relative; padding: clamp(80px, 11vw, 160px) var(--gutter); overflow: clip; }
.chapter-head { container-type: inline-size; max-width: 760px; }
@media (min-width: 960px) {
  .chapter-head.split { max-width: none; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); column-gap: clamp(40px, 6vw, 110px); align-items: end; }
  .chapter-head.split > .eyebrow { grid-column: 1 / -1; }
  .chapter-head.split h2 { font-size: clamp(44px, 5.4vw, 84px); margin-bottom: 0; }
  .chapter-head.split > :last-child { margin-bottom: .4em; }
}
.chapter h2 { font: 500 clamp(38px, 11cqi, 84px)/1.02 var(--display); letter-spacing: -.012em; margin: 0 0 26px; text-wrap: balance; }
.intro { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.6; max-width: 62ch; }
.small { font: 14px/1.55 var(--sans); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0; }
.btn {
  min-height: 48px; padding: 12px 22px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 13px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; text-align: center;
  border: 1.5px solid transparent; border-radius: 0; cursor: pointer; transition: background-color .2s, color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-brass { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.btn-brass:hover { background: var(--brass-hi); border-color: var(--brass-hi); }
.btn-line { background: transparent; color: var(--cream); border-color: rgb(236 220 186 / .75); }
.btn-line:hover { background: rgb(236 220 186 / .1); }
.btn-ink { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.btn-ink:hover { background: #2c3437; }
.btn-line-ink { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-line-ink:hover { background: rgb(24 30 32 / .07); }
.visit .btn-ink { background: #fff1d6; color: #3a1d12; border-color: #fff1d6; }
.visit .btn-line-ink { color: #fff3dc; border-color: #fff3dc; }

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100svh - var(--hd));
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center;
  gap: clamp(24px, 4vw, 72px);
  padding: clamp(40px, 6vw, 84px) var(--gutter) clamp(48px, 6vw, 90px);
  position: relative; overflow: clip;
  background:
    radial-gradient(60% 70% at 78% 40%, rgb(215 182 120 / .13), transparent 70%),
    linear-gradient(180deg, var(--ink), #151a1c);
}
.hero-copy { container-type: inline-size; min-width: 0; }
.hero .eyebrow { color: var(--brass); }
.hero-title { font: 500 clamp(54px, 16.5cqi, 148px)/.9 var(--display); letter-spacing: -.02em; margin: 0 0 26px; color: #f2e4c4; }
.hero-title em { display: block; font-style: italic; font-weight: 500; color: var(--brass); }
.lead { font-size: clamp(18px, 1.7vw, 21px); line-height: 1.55; max-width: 34em; color: #efe0bf; }
.facts { margin: 6px 0 18px; display: grid; gap: 0; border-top: 1px solid rgb(215 182 120 / .3); max-width: 36em; }
.facts > div { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid rgb(215 182 120 / .3); }
.facts dt { font: 700 12px/1.6 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--brass); padding-top: 2px; }
.facts dd { margin: 0; font-size: 16px; line-height: 1.5; }
.fact-note { display: block; font: 13px/1.45 var(--sans); color: #cbbb99; }
.concept-note { font: 13px/1.5 var(--sans); color: #cbbb99; max-width: 40em; margin: 0; }
.hero-art { min-width: 0; display: grid; justify-items: center; }
.art-caption { font: 12px/1.4 var(--sans); color: #b9aa8a; margin: 4px 0 0; text-align: center; }

/* ---------- Card-catalogue cabinet (hero + close). Geometry in --u units. ---------- */
.cab-scene {
  --u: clamp(.5px, calc((100vw - 60px) / 540), 1px);
  --pull: 1;            /* 0 closed → 1 out; JS owns during scenes */
  --lean: 5;            /* card lean in degrees; JS spring adds inertia */
  position: relative;
  width: calc(540 * var(--u)); height: calc(470 * var(--u));
  perspective: calc(1900 * var(--u));
  perspective-origin: 52% 8%;
}
@media (min-width: 960px) { .cab-scene { --u: clamp(.72px, calc(41vw / 560), 1.08px); } }
.cab {
  position: absolute; left: calc(62 * var(--u)); top: calc(96 * var(--u));
  width: calc(380 * var(--u)); height: calc(300 * var(--u));
  transform-style: preserve-3d;
  transform: rotateX(-15deg) rotateY(-27deg);
}
.cab > div, .cab-face, .drawer, .drawer > div, .dr-cards, .mc { transform-style: preserve-3d; }
.cab-face {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, 1fr);
  gap: calc(12 * var(--u)); padding: calc(18 * var(--u));
  background:
    repeating-linear-gradient(91deg, rgb(0 0 0 / .07) 0 calc(3 * var(--u)), transparent 0 calc(9 * var(--u))),
    linear-gradient(180deg, #6a4430, #4a2f23 70%, #3f281e);
  box-shadow: inset 0 0 0 calc(4 * var(--u)) #3a2419;
}
.cab-top {
  position: absolute; left: 0; top: 0; width: 100%; height: calc(280 * var(--u));
  transform-origin: 50% 0; transform: rotateX(-90deg);
  background:
    repeating-linear-gradient(90deg, rgb(255 255 255 / .04) 0 calc(5 * var(--u)), transparent 0 calc(13 * var(--u))),
    linear-gradient(180deg, #a2734f, #7d553a);
}
.cab-side {
  position: absolute; left: 100%; top: 0; width: calc(280 * var(--u)); height: 100%;
  transform-origin: 0 50%; transform: rotateY(90deg);
  background:
    repeating-linear-gradient(90deg, rgb(0 0 0 / .08) 0 calc(4 * var(--u)), transparent 0 calc(11 * var(--u))),
    linear-gradient(90deg, #3d271c, #2d1c14);
}
.cab-front, .dr-front {
  position: relative; display: grid; justify-items: center; align-content: center; gap: calc(6 * var(--u));
  background:
    linear-gradient(180deg, rgb(255 255 255 / .06), transparent 30%),
    repeating-linear-gradient(92deg, rgb(0 0 0 / .06) 0 calc(2 * var(--u)), transparent 0 calc(7 * var(--u))),
    linear-gradient(180deg, #8a5e3e, #6f4a31);
  box-shadow: inset 0 0 0 calc(2 * var(--u)) #5a3a27, inset 0 calc(-3 * var(--u)) 0 rgb(0 0 0 / .18);
}
.cab-slot { background: radial-gradient(80% 90% at 50% 40%, #120c09, #050403); box-shadow: inset 0 calc(6 * var(--u)) calc(10 * var(--u)) #000; }
.holder {
  min-width: calc(62 * var(--u)); padding: calc(3 * var(--u)) calc(8 * var(--u));
  background: #efe3c6; color: #2b2520; text-align: center;
  font: 700 calc(12 * var(--u))/1.15 var(--mono); letter-spacing: .04em;
  border: calc(3 * var(--u)) solid #c9a464; border-radius: calc(2 * var(--u));
  box-shadow: 0 calc(1 * var(--u)) 0 #6e5226;
  white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis;
}
.pull { display: block; width: calc(46 * var(--u)); height: calc(11 * var(--u)); border-radius: 0 0 calc(30 * var(--u)) calc(30 * var(--u)); background: linear-gradient(180deg, #f1d89c, #b58a45); box-shadow: 0 calc(2 * var(--u)) calc(2 * var(--u)) rgb(0 0 0 / .35); }
.knob { display: block; width: calc(9 * var(--u)); height: calc(9 * var(--u)); border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fbe7b4, #a77c3a 70%); box-shadow: 0 calc(1 * var(--u)) calc(2 * var(--u)) rgb(0 0 0 / .4); }

.drawer-entry {
  position: absolute; left: calc(196 * var(--u)); top: calc(110 * var(--u));
  width: calc(166 * var(--u)); height: calc(80 * var(--u));
}
.drawer {
  position: absolute; inset: 0;
  transform: translateZ(calc(var(--pull) * 196 * var(--u)));
}
.dr-front { position: absolute; inset: 0; transform: translateZ(calc(1 * var(--u))); }
.dr-side {
  position: absolute; top: calc(30 * var(--u)); width: calc(262 * var(--u)); height: calc(50 * var(--u));
  transform-origin: 0 50%;
  background: linear-gradient(180deg, #9b6d48, #6d4930);
}
.dr-l { left: calc(5 * var(--u)); transform: rotateY(90deg); filter: brightness(.82); }
.dr-r { left: calc(161 * var(--u)); transform: rotateY(90deg); }
.dr-floor {
  position: absolute; left: calc(5 * var(--u)); top: calc(78 * var(--u)); width: calc(156 * var(--u)); height: calc(262 * var(--u));
  transform-origin: 50% 0; transform: rotateX(-90deg);
  background: linear-gradient(180deg, #3b2519, #24160f);
}
.dr-back { position: absolute; left: calc(5 * var(--u)); top: calc(30 * var(--u)); width: calc(156 * var(--u)); height: calc(50 * var(--u)); transform: translateZ(calc(-262 * var(--u))); background: #5a3a28; }
.dr-rod {
  position: absolute; left: calc(82 * var(--u)); top: calc(70 * var(--u)); width: calc(262 * var(--u)); height: calc(4 * var(--u));
  transform-origin: 0 50%; transform: rotateY(90deg);
  background: linear-gradient(180deg, #f5dca0, #9b7436);
}
.dr-cards { position: absolute; inset: 0; }
.mc {
  position: absolute; left: calc(11 * var(--u)); bottom: calc(3 * var(--u));
  width: calc(144 * var(--u)); height: calc(98 * var(--u));
  transform-origin: 50% 94%;
  transform: translateZ(calc((-26 - var(--i) * 25) * var(--u))) rotateX(calc(var(--lean) * 1deg));
  background:
    linear-gradient(var(--rule-red), var(--rule-red)) 0 calc(24 * var(--u)) / 100% calc(1.4 * var(--u)) no-repeat,
    repeating-linear-gradient(180deg, transparent 0 calc(12 * var(--u)), rgb(147 169 180 / .55) 0 calc(13 * var(--u))) 0 calc(26 * var(--u)) / 100% 100% no-repeat,
    linear-gradient(180deg, #faf3e2, #eadcbc);
  box-shadow: inset 0 0 0 calc(.6 * var(--u)) rgb(90 70 50 / .35);
}
.mc::before { /* staggered guide tab: five cut positions, as on real guide cards */
  content: ""; position: absolute; top: calc(-9 * var(--u)); height: calc(10 * var(--u)); width: 19%;
  left: calc(2% + var(--tab) * 19.5%);
  background: #f4e9cf; border-radius: calc(2 * var(--u)) calc(2 * var(--u)) 0 0;
}
.mc::after { content: ""; position: absolute; left: 50%; bottom: calc(4 * var(--u)); width: calc(6 * var(--u)); height: calc(6 * var(--u)); border-radius: 50%; background: #2a1d16; transform: translateX(-50%); }
.mc-yours {
  height: calc(104 * var(--u));
  background:
    linear-gradient(var(--rule-red), var(--rule-red)) 0 calc(24 * var(--u)) / 100% calc(1.4 * var(--u)) no-repeat,
    repeating-linear-gradient(180deg, transparent 0 calc(12 * var(--u)), rgb(147 169 180 / .6) 0 calc(13 * var(--u))) 0 calc(26 * var(--u)) / 100% 100% no-repeat,
    #fffaf0;
  transform: translateZ(calc((-26 - var(--i) * 25) * var(--u))) translateY(calc(var(--drop, 0) * -1 * var(--u))) rotateX(calc(var(--lean) * 1deg)) rotateZ(calc(var(--sway, 0) * 1deg));
}
.mc-yours::before { width: 44%; left: calc(2% + var(--tab) * 18%); background: #fffaf0; height: calc(15 * var(--u)); top: calc(-14 * var(--u)); }
.mc-title {
  position: absolute; top: calc(-13 * var(--u)); width: 42%; left: calc(3% + var(--tab) * 18%);
  font: 700 calc(9.5 * var(--u))/calc(14 * var(--u)) var(--mono); color: var(--type-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.cab-shadow {
  position: absolute; left: 12%; right: 6%; bottom: calc(18 * var(--u)); height: calc(46 * var(--u));
  background: radial-gradient(50% 50% at 50% 50%, rgb(0 0 0 / .55), transparent 70%);
  filter: blur(calc(6 * var(--u))); z-index: -1;
}

/* Load-time entry: the drawer slides out on its runners (CSS owns .drawer-entry, JS owns .drawer). */
@keyframes drawer-runner { from { transform: translateZ(calc(-150 * var(--u))); } to { transform: translateZ(0); } }
.motion .hero .drawer-entry { animation: drawer-runner 1.4s cubic-bezier(.3, .1, .2, 1) .25s both; }
.motion .hero .drawer-entry { transform-style: preserve-3d; }
.drawer-entry { transform-style: preserve-3d; }

/* ---------- 01 The drawer: riffle scene ---------- */
.collection { background: linear-gradient(180deg, var(--paper), #e6d9bd); }
.collection .eyebrow { color: var(--rust-ink); }
.riffle { margin-top: clamp(32px, 5vw, 64px); }
.riffle-stage { display: grid; gap: clamp(24px, 4vw, 64px); }
.riffle-side { max-width: 34em; }
.riffle-count { font: italic 500 clamp(44px, 6vw, 72px)/1 var(--display); margin: 0 0 18px; color: var(--rust-ink); }
.rc-of { font-size: .45em; font-style: normal; color: #5b5146; }
.riffle-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.rtab {
  min-height: 44px; padding: 0 16px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  font: 700 13px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  border-radius: 6px 6px 0 0;
}
.rtab[aria-pressed="true"] { background: var(--ink); color: var(--cream); text-decoration: underline; text-underline-offset: 4px; }
.riffle-hint { font: 14px/1.5 var(--sans); color: #4b443c; }
.riffle-after { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: clamp(28px, 4vw, 48px) 0 0; }
.riffle-after .small { color: #4b443c; }
.riffle-side .riffle-count, .riffle-side .riffle-tabs, .riffle-side .riffle-hint { display: none; }

/* Flat, readable card grid: the default for no JS, reduced motion and short screens. */
.rz-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 22px 18px; }
.gc { position: relative; container-type: inline-size; }
.gc-face {
  position: relative; min-height: 210px; height: 100%;
  padding: 34px 20px 30px;
  background:
    linear-gradient(var(--rule-red), var(--rule-red)) 0 66px / 100% 2px no-repeat,
    repeating-linear-gradient(180deg, transparent 0 25px, rgb(147 169 180 / .5) 0 26px) 0 68px / 100% 100% no-repeat,
    var(--card);
  color: var(--type-ink);
  box-shadow: 0 1px 0 rgb(0 0 0 / .08), 0 10px 22px rgb(60 40 20 / .12);
  margin-top: 16px;
}
.gc-face::after { content: ""; position: absolute; left: 50%; bottom: 10px; width: 12px; height: 12px; border-radius: 50%; background: #2c241f; transform: translateX(-50%); }
.gc-tab {
  position: absolute; top: -16px; height: 18px; width: 28%; left: calc(3% + var(--tab) * 23%);
  background: var(--card); border-radius: 5px 5px 0 0;
  font: 700 11px/18px var(--mono); text-align: center; letter-spacing: .06em; text-transform: uppercase; color: var(--type-ink);
}
.gc h3 { font: 600 clamp(24px, 9cqi, 34px)/1.05 var(--display); margin: 0 0 14px; color: #1e1a17; }
.gc p { font: 16px/26px var(--mono); margin: 0; color: #2d2823; }
.gc-blank .gc-face { background: repeating-linear-gradient(180deg, transparent 0 25px, rgb(147 169 180 / .5) 0 26px) 0 68px / 100% 100% no-repeat, #fffaf0; }
.gc-back, .rz-floor, .rz-wall, .rz-block, .rz-rod { display: none; }

/* 3D riffle: enabled by JS only when motion is allowed and the screen is tall enough. */
.riffle.is-3d { height: calc(100svh + 4 * 72svh); margin-top: 24px; }
.riffle.is-3d .riffle-stage {
  position: sticky; top: var(--hd); height: calc(100svh - var(--hd));
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); align-items: center;
  padding-bottom: 12px;
}
.riffle.is-3d .riffle-count, .riffle.is-3d .riffle-hint { display: block; }
.riffle.is-3d + .riffle-after { margin-top: calc(-1 * clamp(40px, 12svh, 140px)); position: relative; }
.riffle.is-3d .riffle-tabs { display: flex; }
.riffle.is-3d .riffle-view { display: grid; place-items: center; min-width: 0; height: 100%; overflow: clip; }
.riffle.is-3d .rz {
  --cw: min(500px, 46vw); --ch: calc(var(--cw) * .62); --gap: calc(var(--cw) * .052);
  --front: calc(var(--ch) * .4); --wall: calc(var(--ch) * .36); --depth: calc(var(--front) + 5 * var(--gap) + var(--ch) * .16);
  position: relative; width: var(--cw); height: calc(var(--ch) * 1.62);
  perspective: calc(var(--cw) * 2.4); perspective-origin: 50% -30%;
}
.riffle.is-3d .rz-world { position: absolute; inset: 0; transform-style: preserve-3d; transform: translateY(calc(var(--ch) * .02)) rotateX(-38deg); }
.riffle.is-3d .rz-cards { display: block; position: absolute; inset: 0; transform-style: preserve-3d; }
.riffle.is-3d .gc {
  position: absolute; left: 0; bottom: 26%; width: var(--cw); height: var(--ch);
  transform-style: preserve-3d; transform-origin: 50% 94%;
  transform: translateZ(calc(var(--i) * -1 * var(--gap))) rotateX(calc(var(--a, 6) * 1deg));
}
.riffle.is-3d .gc-face {
  position: absolute; inset: 0; min-height: 0; margin: 0; padding: calc(var(--ch) * .12) 6% 0;
  background:
    linear-gradient(var(--rule-red), var(--rule-red)) 0 calc(var(--ch) * .33) / 100% 2px no-repeat,
    repeating-linear-gradient(180deg, transparent 0 calc(var(--ch) * .108), rgb(147 169 180 / .5) 0 calc(var(--ch) * .108 + 1px)) 0 calc(var(--ch) * .335) / 100% 100% no-repeat,
    linear-gradient(180deg, #fbf5e6, #efe3c7);
  box-shadow: inset 0 0 0 1px rgb(90 70 50 / .25);
}
.riffle.is-3d .gc-blank .gc-face { background: repeating-linear-gradient(180deg, transparent 0 calc(var(--ch) * .108), rgb(147 169 180 / .5) 0 calc(var(--ch) * .108 + 1px)) 0 calc(var(--ch) * .335) / 100% 100% no-repeat, #fffaf0; }
.riffle.is-3d .gc-face::after { width: calc(var(--ch) * .045); height: calc(var(--ch) * .045); bottom: calc(var(--ch) * .035); }
.riffle.is-3d .gc-face::before { content: ""; position: absolute; inset: 0; background: #2a1d14; opacity: var(--shade, 0); pointer-events: none; }
.riffle.is-3d .gc-tab {
  top: calc(var(--ch) * -.13); height: calc(var(--ch) * .13 + 1px); line-height: calc(var(--ch) * .13);
  font-size: clamp(11px, 2.7cqi, 14px); background: linear-gradient(180deg, #fffaf0, #fbf5e6);
  box-shadow: inset 0 1px 0 #fff, 0 -1px 0 rgb(90 70 50 / .2);
}
.riffle.is-3d .gc h3 { font-size: clamp(22px, 7.2cqi, 36px); margin-bottom: calc(var(--ch) * .07); }
.riffle.is-3d .gc p { font-size: clamp(12.5px, 3.3cqi, 16px); line-height: calc(var(--ch) * .108); max-width: 40ch; }
.riffle.is-3d .gc-back {
  display: grid; place-items: start center; position: absolute; inset: 0; transform: rotateX(180deg);
  padding-top: calc(var(--ch) * .2);
  background: linear-gradient(180deg, #f1e6cc, #e4d5b2);
  box-shadow: inset 0 0 0 1px rgb(90 70 50 / .3);
}
/* Which side faces the camera is decided from the card's angle (JS adds .flipped), not by
   backface-visibility, so a browser that flattens 3D still shows the readable face. */
.riffle.is-3d .gc.flipped .gc-face, .riffle.is-3d .gc:not(.flipped) .gc-back { visibility: hidden; }
/* Ignored by true 3D sorting; keeps the front card on top if a browser flattens the scene. */
.riffle.is-3d .gc { z-index: calc(10 - var(--i)); }
.riffle.is-3d .gc.flipped { z-index: calc(20 + var(--i)); }
.riffle.is-3d .gc-back i { font: 600 clamp(20px, 6cqi, 30px)/1 var(--hand); font-style: normal; color: #55514b; transform: rotate(-3deg); }
.riffle.is-3d .gc-back::after { content: ""; position: absolute; inset: 0; background: #1d130d; opacity: var(--shade, 0); }
.riffle.is-3d .rz-floor, .riffle.is-3d .rz-wall, .riffle.is-3d .rz-block, .riffle.is-3d .rz-rod { display: block; position: absolute; }
.riffle.is-3d .rz-floor {
  left: -3%; width: 106%; top: 74%; height: var(--depth);
  transform-origin: 50% 0; transform: translateZ(var(--front)) rotateX(-90deg);
  background: repeating-linear-gradient(90deg, rgb(0 0 0 / .1) 0 3px, transparent 0 11px), linear-gradient(180deg, #4f3122, #2e1c13);
}
.riffle.is-3d .rz-wall { height: var(--wall); bottom: 26%; background: repeating-linear-gradient(91deg, rgb(0 0 0 / .07) 0 2px, transparent 0 8px), linear-gradient(180deg, #9a6a48, #6f4a31); }
.riffle.is-3d .rz-wall-f {
  left: -3%; width: 106%; transform: translateZ(var(--front));
  display: grid; justify-items: center; align-content: center; gap: 5px;
  box-shadow: inset 0 3px 0 rgb(255 255 255 / .12), inset 0 0 0 2px #5a3a27;
  --u: calc(var(--cw) / 240);
}
.riffle.is-3d .rz-wall-f .holder { font-size: clamp(11px, calc(var(--cw) * .03), 15px); }
.riffle.is-3d .rz-wall-f .knob { width: 12px; height: 12px; }
.riffle.is-3d .rz-wall-l, .riffle.is-3d .rz-wall-r { width: var(--depth); transform-origin: 0 50%; filter: brightness(.78); }
.riffle.is-3d .rz-wall-l { left: -3%; transform: translateZ(var(--front)) rotateY(90deg); }
.riffle.is-3d .rz-wall-r { left: 103%; transform: translateZ(var(--front)) rotateY(90deg); }
.riffle.is-3d .rz-block { left: 2%; width: 96%; height: calc(var(--ch) * .55); bottom: 26%; transform: translateZ(calc(-5 * var(--gap) - 6px)); background: linear-gradient(180deg, #7a5236, #57382a); }
.riffle.is-3d .rz-rod {
  left: 50%; bottom: calc(26% + var(--ch) * .052); width: var(--depth); height: 5px; margin-left: -2px;
  transform-origin: 0 50%; transform: translateZ(var(--front)) rotateY(90deg);
  background: linear-gradient(180deg, #f6dea4, #8f6a30); border-radius: 3px;
}
@media (max-width: 859px) {
  .riffle.is-3d .riffle-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; gap: clamp(8px, 4svh, 40px); padding-top: 8px; }
  .riffle.is-3d .riffle-side { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 16px; max-width: none; }
  .riffle.is-3d .riffle-count { font-size: 40px; margin: 0; grid-row: span 2; }
  .riffle.is-3d .riffle-tabs { margin: 0; gap: 6px; }
  .riffle.is-3d .rtab { min-height: 36px; padding: 0 10px; font-size: 12px; }
  .riffle.is-3d .riffle-hint { font-size: 13px; margin: 0; }
  .riffle.is-3d .rz { --cw: min(calc(100vw - 2 * var(--gutter) - 24px), 460px); }
  .riffle.is-3d .riffle-view { height: auto; }
}

/* ---------- 02 About: pencilled endpaper ---------- */
.about {
  background:
    repeating-linear-gradient(45deg, rgb(255 255 255 / .018) 0 2px, transparent 0 5px),
    radial-gradient(70% 80% at 70% 50%, #24302f, #172021);
  color: var(--cream);
}
.about .eyebrow { color: var(--brass); }
.about-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.about-social { font: 15px/1.55 var(--sans); color: #d6c6a3; border-left: 2px solid var(--brass); padding-left: 14px; max-width: 34em; }
.endpapers { margin: 0; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); box-shadow: 0 30px 50px rgb(0 0 0 / .4); position: relative; }
.endpapers::after { content: ""; position: absolute; top: 0; bottom: 0; left: 40%; width: 26px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, rgb(0 0 0 / .28) 48%, rgb(255 255 255 / .1) 52%, transparent); pointer-events: none; }
.pastedown {
  position: relative; min-height: 100%;
  background: #3a2a22 url("./marbled.jpg") center / cover;
  display: grid; place-items: center; padding: 24px;
}
.ex-libris {
  display: grid; gap: 4px; justify-items: center; text-align: center; padding: 14px 18px;
  background: #f4ead2; color: #2b2520; border: 3px double #6b4a2c; max-width: 82%;
  font: italic 600 22px/1 var(--display); box-shadow: 0 4px 8px rgb(0 0 0 / .3);
}
.ex-libris b { font: 700 11px/1.3 var(--sans); letter-spacing: .2em; text-transform: uppercase; font-style: normal; }
.flyleaf {
  position: relative; padding: clamp(26px, 4vw, 44px) clamp(20px, 3vw, 40px);
  background:
    radial-gradient(120% 90% at 0% 50%, rgb(150 110 60 / .16), transparent 55%),
    linear-gradient(180deg, #f6eedb, #efe3c8);
  color: var(--graphite); --focus: #7a3520;
}
.pencil-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pl { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 5px 0; border-bottom: 1px dashed rgb(62 60 57 / .2); }
.pl-text { font: 500 clamp(22px, 2.3vw, 28px)/1.15 var(--hand); color: #34322f; clip-path: inset(-.2em calc((1 - var(--w, 1)) * 100%) -.3em -.2em); }
.pl-src { font: 700 11px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #5f564b; opacity: var(--src, 1); }
.pencil { position: absolute; left: 0; top: 0; width: 120px; height: 16px; transform-origin: 0 50%; opacity: 0; pointer-events: none; filter: drop-shadow(2px 6px 4px rgb(0 0 0 / .25)); }
.endpapers figcaption { grid-column: 1 / -1; background: #11181a; color: #cdbd9b; padding: 14px 18px; font: 13px/1.6 var(--sans); }
.endpapers figcaption a { color: #f0d79e; }

/* ---------- 03 Your card: typewriter inquiry ---------- */
.want { background: linear-gradient(180deg, #efe6d1, var(--paper)); }
.want .eyebrow { color: var(--rust-ink); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; max-width: 46em; }
.steps li { counter-increment: step; position: relative; padding-left: 2.6em; font-size: 17px; line-height: 1.5; }
.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: -.05em; font: italic 600 23px/1.2 var(--display); color: var(--rust-ink); }
.want-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 80px); margin-top: clamp(36px, 5vw, 64px); align-items: start; }
.want-form { display: grid; gap: 22px; }
.tabset { border: 0; padding: 0; margin: 0; min-width: 0; }
.tabset legend, .field label { font: 700 13px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px; padding: 0; color: #2a2724; }
.tab-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; scroll-margin-top: calc(var(--hd) + 24px); }
.opt span {
  display: flex; align-items: center; min-height: 48px; padding: 10px 14px 10px 38px; position: relative;
  border: 1.5px solid #6d6457; background: #fbf6ea; font: 600 15px/1.25 var(--sans); color: #24211e;
  border-radius: 8px 8px 0 0;
}
.opt span::before { content: ""; position: absolute; left: 13px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border: 1.5px solid #4f4840; border-radius: 50%; background: #fff; }
.opt input:checked + span { background: var(--ink); color: var(--cream); border-color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.opt input:checked + span::before { border-color: var(--brass); background: radial-gradient(circle, var(--brass) 0 4px, var(--ink) 4.5px); }
.opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.opt input:disabled + span { opacity: .55; cursor: not-allowed; }
.field { margin: 0; display: grid; }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.opt-tag { font-weight: 500; letter-spacing: .04em; text-transform: none; color: #5d554b; }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 1.5px solid #6d6457; border-radius: 0; background: #fffdf7; color: #1f1c19;
  font: 16px/1.4 var(--mono); scroll-margin-top: calc(var(--hd) + 24px);
}
.field textarea { resize: vertical; min-height: 76px; }
.hint { font: 13px/1.45 var(--sans); color: #574f45; margin-top: 6px; }

.want-out { display: grid; gap: 22px; min-width: 0; }
.feeder { --feed: 1; position: relative; padding-bottom: 30px; }
.feed-window { padding-top: 26px; clip-path: inset(-60px -60px 0 -60px); }
.icard {
  --tab: 0; container-type: inline-size;
  position: relative; aspect-ratio: 5 / 3.1; min-height: 250px; width: calc(100% - 8px); margin-inline: auto;
  padding: 11% 6% 8%;
  background:
    linear-gradient(var(--rule-red), var(--rule-red)) 0 24% / 100% 2px no-repeat,
    repeating-linear-gradient(180deg, transparent 0 calc(12.4% - 1px), rgb(147 169 180 / .55) 0 12.4%) 0 25% / 100% 76% no-repeat,
    #fffaf0;
  color: var(--type-ink);
  box-shadow: 0 1px 0 rgb(0 0 0 / .1), 0 18px 34px rgb(60 40 20 / .18);
  transform: translateY(calc((1 - var(--feed)) * 78%)) rotate(-.6deg) translateY(var(--jolt, 0px));
}
.icard-tab {
  position: absolute; top: -22px; height: 24px; width: 26%; left: calc(3% + var(--tab) * 23.5%);
  background: #fffaf0; border-radius: 6px 6px 0 0; text-align: center;
  font: 700 13px/24px var(--mono); letter-spacing: .06em; text-transform: uppercase; transition: left .45s cubic-bezier(.4, 0, .2, 1);
}
.icard-head { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 3.2%; font: 700 clamp(11px, 2.7cqi, 14px)/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.icard-head span:last-child { color: var(--rule-red); border: 1.5px solid currentColor; padding: 1px 6px; transform: rotate(-3deg); }
.icard-lines { margin: 0; display: grid; }
.icard-lines > div { display: grid; grid-template-columns: 7ch minmax(0, 1fr); gap: 8px; min-height: 0; }
.icard-lines dt, .icard-lines dd { font: clamp(13px, 3.4cqi, 17px)/1.62 var(--mono); margin: 0; }
.icard-lines dt { color: #6a5f53; text-transform: uppercase; font-size: clamp(11px, 2.7cqi, 13px); letter-spacing: .08em; padding-top: .2em; }
.icard-lines dd { overflow-wrap: anywhere; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icard-lines dd.typing::after { content: ""; display: inline-block; width: .55em; height: 1em; margin-left: 1px; vertical-align: -.12em; background: var(--rule-red); animation: caret .6s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.icard-hole { position: absolute; left: 50%; bottom: 4%; width: 12px; height: 12px; border-radius: 50%; background: #3b322b; transform: translateX(-50%); }
.platen {
  position: absolute; left: 0; right: 0; bottom: 0; height: 40px; border-radius: 20px;
  background: linear-gradient(180deg, #3a4447, #111618 55%, #262e31);
  box-shadow: 0 10px 20px rgb(0 0 0 / .3), inset 0 2px 0 rgb(255 255 255 / .12);
}
.platen i { position: absolute; inset: 9px 30px; border-radius: 12px; background: repeating-linear-gradient(90deg, rgb(255 255 255 / .05) 0 2px, transparent 0 7px); }
.ready { background: rgb(255 253 247 / .6); border: 1px solid rgb(109 100 87 / .4); padding: 18px 20px; }
.ready h3 { font: 700 13px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 8px; color: #2a2724; }
.ready ul { margin: 0; padding-left: 1.2em; font-size: 16px; line-height: 1.6; }
.want-out .actions { margin: 0; }
.js-only[hidden] { display: none !important; }

/* ---------- 04 Visit: deliberately calm ---------- */
.visit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.visit .eyebrow { color: #ffe2a3; }
.visit .chapter-head h2 { font-size: clamp(38px, 10cqi, 80px); }
.visit-card { background: rgb(0 0 0 / .14); border: 1px solid rgb(255 243 220 / .3); padding: clamp(20px, 3vw, 36px); }
.visit-facts { margin: 0; display: grid; }
.visit-facts > div { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 14px; padding: 13px 0; border-bottom: 1px solid rgb(255 243 220 / .25); }
.visit-facts dt { font: 700 12px/1.6 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #ffe2a3; padding-top: 2px; }
.visit-facts dd { margin: 0; font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }
.visit .fact-note { color: #f6dcc0; }
.visit a { color: #fff3dc; }

/* ---------- 05 Close: the card is filed ---------- */
.close {
  background:
    radial-gradient(55% 65% at 70% 55%, rgb(215 182 120 / .12), transparent 70%),
    linear-gradient(180deg, #151a1c, var(--ink));
}
.close .eyebrow { color: var(--brass); }
.close-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.close-copy { container-type: inline-size; }
.close h2 { font: 500 clamp(36px, 10cqi, 76px)/1.03 var(--display); margin-bottom: 22px; text-wrap: balance; }
.close-summary { font: italic 500 clamp(21px, 2.2vw, 27px)/1.35 var(--display); color: #f0dfba; overflow-wrap: anywhere; }
.close-summary strong { font-weight: 700; color: var(--brass-hi); }
.close .small { color: #cbbb99; }
.close-art { display: grid; justify-items: center; min-width: 0; }
.close .cab-scene { --pull: 0; --u: clamp(.48px, calc((100vw - 76px) / 560), .82px); height: calc(500 * var(--u)); }
@media (min-width: 960px) { .close .cab-scene { --u: clamp(.66px, calc(38vw / 560), .86px); } }
.close .cab { top: calc(160 * var(--u)); }
.close .holder.stamped { animation: stamp .5s cubic-bezier(.2, 1.4, .4, 1) both; background: #fff3d6; }
@keyframes stamp { from { transform: scale(1.35); filter: brightness(1.25); } to { transform: scale(1); } }

/* ---------- Owner panel and footer ---------- */
.owner { padding: clamp(56px, 7vw, 96px) var(--gutter); border-top: 6px solid var(--rust); }
.owner-inner { max-width: 820px; }
.owner .eyebrow { color: var(--rust-ink); }
.owner h2 { font: 600 clamp(30px, 4vw, 44px)/1.1 var(--display); margin-bottom: 16px; }
.owner p { max-width: 62ch; }
.owner-mail { font: 16px/1.6 var(--sans); }
.selectable { user-select: all; -webkit-user-select: all; font-weight: 700; background: #fffaf0; padding: 2px 6px; border: 1px dashed #6d6457; }
.copy-mini { min-height: 36px; padding: 0 12px; margin-left: 6px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font: 700 12px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.site-footer { background: #111618; color: #d9c8a6; padding: clamp(40px, 5vw, 64px) var(--gutter) calc(clamp(40px, 5vw, 64px) + env(safe-area-inset-bottom)); }
.ft-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 32px; font: 15px/1.65 var(--sans); }
.ft-name { font: 600 26px/1.1 var(--display); color: var(--cream); margin-bottom: 10px; }
.site-footer a { color: #f0d79e; }
.to-top { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* ---------- Scene-ready enhancement states (set by JS) ---------- */
.scenes-ready .pl-text { will-change: clip-path; }

/* ---------- Responsive ---------- */
@media (max-width: 959px) {
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; padding-top: 34px; }
  .hero-art { margin-top: 8px; }
  .about-grid, .want-grid, .visit-grid, .close-grid { grid-template-columns: minmax(0, 1fr); }
  .close-art { order: -1; }
}
@media (max-width: 599px) {
  body { font-size: 16px; }
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .field-pair { grid-template-columns: minmax(0, 1fr); }
  .tab-options { grid-template-columns: minmax(0, 1fr); }
  .endpapers { grid-template-columns: minmax(0, 1fr); }
  .endpapers::after { display: none; }
  .pastedown { min-height: 150px; }
  .visit-facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ft-grid { grid-template-columns: minmax(0, 1fr); }
  .actions .btn { flex: 1 1 auto; }
  .icard { min-height: 0; aspect-ratio: auto; padding: 46px 18px 34px; }
  .icard-head { margin-bottom: 10px; }
  .icard-lines dd { white-space: normal; }
}
/* Short or landscape screens: no sticky stage. */
@media (max-height: 560px) {
  .riffle.is-3d { height: auto; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .btn:hover { transform: none; }
}

/* ---------- Forced colours ---------- */
@media (forced-colors: active) {
  .btn, .rtab, .opt span, .hd-cta, .menu-btn, .copy-mini { border: 2px solid ButtonText; }
  .rtab[aria-pressed="true"], .opt input:checked + span { outline: 3px solid Highlight; text-decoration: underline; }
  .icard, .gc-face, .flyleaf, .visit-card { border: 1px solid CanvasText; }
  .cab-scene, .pencil { forced-color-adjust: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header { position: static; }
  .skip, .menu-btn, .hero-art, .close-art, .riffle-tabs, .riffle-count, .riffle-hint, .platen, .pencil, .owner .actions, .js-only { display: none !important; }
  body, .hero, .collection, .about, .want, .visit, .close, .owner, .site-footer { background: #fff !important; color: #000 !important; }
  .chapter, .hero { padding: 18px 0; min-height: 0; overflow: visible; }
  .riffle, .riffle.is-3d { height: auto !important; }
  .riffle-stage { position: static !important; height: auto !important; display: block !important; }
  .rz, .rz-world, .rz-cards, .gc { all: revert; }
  .gc-face { box-shadow: none; border: 1px solid #000; }
  .gc-back, .rz-floor, .rz-wall, .rz-block, .rz-rod { display: none !important; }
  .pl-text { clip-path: none !important; }
  .icard { transform: none !important; box-shadow: none; border: 1px solid #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 11px; }
}
