/* ============================================================
   BANYAN HOUSE — publishers of slow literature
   Book-paper, ochre/brick, ink. EB Garamond + Courier Prime.
   Print skeuomorphism with restraint: no leather, no gold.
   ============================================================ */

:root {
  --paper: #f8f4ec;
  --paper-deep: #efe8da;
  --paper-shade: #e6ddcb;
  --ink: #2f2a26;
  --ink-soft: #55493d;
  --brick: #8a3324;
  --brick-deep: #6d2418;
  --hairline: rgba(47, 42, 38, 0.22);
  --serif: "EB Garamond", "Iowan Old Style", Georgia, serif;
  --mono: "Courier Prime", "Courier New", monospace;
  --page-ease: cubic-bezier(0.66, 0, 0.22, 1); /* paper easing: heavy start, soft settle */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* anchor scrolling is handled by Lenis when active; native jumps otherwise */

body {
  background:
    /* faint laid-paper texture */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--brick); color: var(--paper); }

a { color: var(--brick); text-underline-offset: 3px; }
a:hover { color: var(--brick-deep); }

:focus-visible {
  outline: 2px solid var(--brick);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 200;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 1rem; font-family: var(--mono); font-size: 0.8rem;
  transition: top 0.25s;
}
.skip:focus { top: 1rem; color: var(--paper); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- ribbon bookmark (reading progress) ---------- */
.ribbon {
  position: fixed; top: 0; right: clamp(0.9rem, 3.4vw, 3rem);
  width: 14px; height: 100vh; height: 100svh;
  overflow: hidden; z-index: 90; pointer-events: none;
}
.ribbon-inner {
  position: absolute; left: 0; top: 0; width: 100%; height: calc(100% + 22px);
  background: linear-gradient(90deg, var(--brick-deep), var(--brick) 45%, var(--brick-deep));
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), 50% 100%, 0 calc(100% - 14px));
  transform: translateY(-101%);
  box-shadow: -2px 0 5px rgba(47, 42, 38, 0.25);
  will-change: transform;
}
@media (max-width: 720px) { .ribbon { width: 9px; } }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 1.1rem clamp(1.2rem, 4.5vw, 4rem);
  transition: background 0.4s, box-shadow 0.4s, padding 0.4s;
}
.nav.scrolled {
  background: rgba(248, 244, 236, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--hairline);
  padding-top: 0.75rem; padding-bottom: 0.75rem;
}
.nav-mark {
  font-family: var(--serif); font-weight: 600; font-size: 1.25rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
}
.nav-mark:hover { color: var(--brick); }
.nav nav { display: flex; gap: clamp(0.9rem, 2.4vw, 2rem); align-items: baseline; }
.nav nav a {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.06em;
  color: var(--ink-soft); text-decoration: none;
}
.nav nav a:hover { color: var(--brick); }
.nav-cta {
  color: var(--brick) !important;
  border-bottom: 1px solid var(--brick);
  padding-bottom: 2px;
}
@media (max-width: 720px) {
  .nav nav a:not(.nav-cta) { display: none; }
}

/* ============================================================
   HERO — the opening book
   ============================================================ */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 6.5rem 1.2rem 4.5rem;
  position: relative;
  background:
    radial-gradient(120% 90% at 50% 8%, rgba(255, 253, 247, 0.85), rgba(230, 221, 203, 0.55) 78%, rgba(214, 202, 178, 0.5));
}

.book-scene {
  perspective: 1900px;
  perspective-origin: 50% 42%;
}
.book {
  position: relative;
  width: min(26rem, 82vw);
  aspect-ratio: 5 / 7;
  transform-style: preserve-3d;
  transition: transform 2.1s var(--page-ease);
}
/* the block shifts right as the cover opens so the full spread stays centred */
.book.open { transform: translateX(38%); }
@media (max-width: 640px) {
  .book.open { transform: translateX(26%) scale(0.62); }
}

/* stacked page edges under the frontispiece — the text block */
.book-block {
  position: absolute; inset: 0;
  background: var(--paper);
  border-radius: 2px 6px 6px 2px;
  box-shadow:
    1.5px 1.5px 0 #efe9db, 3px 3px 0 #e9e1cf, 4.5px 4.5px 0 #efe9db,
    6px 6px 0 #e4dbc6, 7.5px 7.5px 0 #efe9db, 9px 9px 0 #ddd2b9,
    14px 20px 38px rgba(47, 42, 38, 0.28);
}

.frontispiece {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(47, 42, 38, 0.09), rgba(47, 42, 38, 0) 9%),
    var(--paper);
  border-radius: 2px 6px 6px 2px;
  border: 1px solid rgba(47, 42, 38, 0.12);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: clamp(1.2rem, 5vw, 2.6rem);
  overflow: hidden;
}
.exlibris { width: clamp(64px, 22%, 96px); color: var(--brick); }
.fp-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.1rem, 9vw, 3.4rem);
  line-height: 1.02; letter-spacing: 0.12em; text-transform: uppercase;
  margin-top: 1.1rem;
}
.fp-rule { color: var(--brick); font-size: 1.3rem; margin: 0.8rem 0 0.7rem; }
.fp-sub {
  font-style: italic; font-size: clamp(1rem, 3.4vw, 1.2rem);
  color: var(--ink-soft);
}
.fp-est {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-soft); margin-top: 1.3rem;
}
.fp-note {
  font-size: clamp(0.9rem, 2.8vw, 1.02rem); color: var(--ink-soft);
  margin-top: 2rem; max-width: 24ch; line-height: 1.5;
}
.fp-note .sp { display: none; }
.fp-ribbon {
  position: absolute; top: -4px; right: 14%;
  width: 15px; height: 34%;
  background: linear-gradient(90deg, var(--brick-deep), var(--brick) 45%, var(--brick-deep));
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 11px), 50% 100%, 0 calc(100% - 11px));
  box-shadow: 2px 3px 5px rgba(47, 42, 38, 0.28);
}

/* the folding cover */
.cover {
  position: absolute; inset: 0;
  transform-origin: left center;
  transform: rotateY(0.001deg);
  transform-style: preserve-3d;
  transition: transform 2.1s var(--page-ease);
  will-change: transform;
  z-index: 3;
}
.book.open .cover { transform: rotateY(-165deg); }

.cover-front, .cover-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 2px 6px 6px 2px;
}
.cover-front {
  background:
    /* cloth weave */
    repeating-linear-gradient(0deg, rgba(255, 244, 224, 0.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(20, 12, 8, 0.06) 0 1px, transparent 1px 3px),
    linear-gradient(120deg, #8f3a28, var(--brick) 45%, #78291b);
  box-shadow:
    inset 0 0 0 1px rgba(40, 16, 10, 0.35),
    inset 10px 0 18px rgba(40, 16, 10, 0.35),
    10px 18px 34px rgba(47, 42, 38, 0.35);
  display: flex; align-items: center; justify-content: center;
}
.cover-frame {
  position: absolute; inset: clamp(0.8rem, 3.4vw, 1.4rem);
  border: 1px solid rgba(244, 231, 215, 0.5);
  outline: 1px solid rgba(244, 231, 215, 0.22);
  outline-offset: 4px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: clamp(1.2rem, 5vw, 2.2rem) 1rem;
  text-align: center;
}
.cover-house {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.32em;
  text-transform: uppercase; color: #f0dfc9;
}
.cover-label {
  background: var(--paper);
  padding: clamp(0.9rem, 3.6vw, 1.4rem) clamp(1rem, 4.5vw, 1.8rem);
  box-shadow: 0 2px 8px rgba(40, 16, 10, 0.4);
}
.cover-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.35rem, 5.6vw, 2rem); line-height: 1.15;
  letter-spacing: 0.04em; color: var(--ink);
}
.cover-sea {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.3em;
  color: var(--brick); margin-top: 0.55rem;
}
.cover-orn { width: clamp(52px, 20%, 80px); color: #f0dfc9; }
.cover-back {
  transform: rotateY(180deg);
  background:
    /* endpaper: quiet combed pattern */
    repeating-radial-gradient(circle at 0 50%, rgba(138, 51, 36, 0.12) 0 2px, transparent 2px 11px),
    repeating-radial-gradient(circle at 100% 50%, rgba(47, 42, 38, 0.09) 0 2px, transparent 2px 13px),
    var(--paper-deep);
  box-shadow: inset 0 0 0 1px rgba(47, 42, 38, 0.14), inset -12px 0 20px rgba(47, 42, 38, 0.12);
}

/* soft page shadow cast by the moving cover */
.frontispiece::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(47, 42, 38, 0.4), rgba(47, 42, 38, 0) 55%);
  opacity: 1;
  transition: opacity 2.1s var(--page-ease);
  pointer-events: none;
}
.book.open .frontispiece::after { opacity: 0; }

.hero-scroll {
  margin-top: clamp(2rem, 6vh, 3.6rem);
  display: flex; flex-direction: column; align-items: center; gap: 0.7rem;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-soft);
  opacity: 0;
  transition: opacity 1.2s ease 0.4s;
}
.hero.settled .hero-scroll { opacity: 1; }
.hero-scroll-line {
  width: 1px; height: 3rem;
  background: linear-gradient(var(--ink-soft), transparent);
}

/* ============================================================
   Shared chapter chrome
   ============================================================ */
section { padding: clamp(4.5rem, 11vh, 8rem) clamp(1.2rem, 6vw, 6rem); }

.chapter-head { max-width: 62rem; margin: 0 auto 3rem; }
.folio {
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--brick);
  margin-bottom: 1rem;
}
.folio::after {
  content: ""; display: block; width: 3.2rem; height: 1px;
  background: var(--brick); margin-top: 0.7rem; opacity: 0.6;
}
.chapter-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.9rem, 4.6vw, 3.2rem);
  line-height: 1.12; letter-spacing: 0.005em;
}
.chapter-sub {
  max-width: 46ch; margin-top: 1.1rem;
  color: var(--ink-soft); font-size: 1.05rem;
}

/* ============================================================
   LETTER — two-column manuscript with marginalia
   ============================================================ */
.letter {
  border-top: 1px solid var(--hairline);
}
.manuscript {
  position: relative;
  max-width: 62rem; margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.8rem, 4.5vw, 3.8rem);
}
.ms-col p { margin-bottom: 1.25em; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.ms-col p:last-child { margin-bottom: 0; }

/* real drop cap */
.dropcap::first-letter {
  float: left;
  font-family: var(--serif);
  font-size: 3.55em; line-height: 0.82;
  padding: 0.06em 0.12em 0 0;
  color: var(--brick);
  font-weight: 500;
}

/* footnote markers */
.fn {
  font-family: var(--mono); font-size: 0.62em;
  vertical-align: super; line-height: 0;
  background: none; border: none; cursor: pointer;
  color: var(--brick); padding: 0 0.15em;
  border-bottom: 1px dotted var(--brick);
}
.fn:hover, .fn[aria-expanded="true"] { background: rgba(138, 51, 36, 0.12); }

/* marginalia — typewritten notes in the margin (desktop) */
.marginalia {
  font-family: var(--mono); font-size: 0.78rem; line-height: 1.55;
  color: var(--ink-soft);
  border-left: 2px solid var(--brick);
  padding-left: 0.8rem;
  max-width: 15rem;
  opacity: 0.35;
  transition: opacity 0.45s ease, transform 0.45s var(--page-ease);
}
.marginalia.lit { opacity: 1; transform: translateX(3px); color: var(--ink); }

@media (min-width: 1180px) {
  .manuscript { padding-right: 17rem; }
  .marginalia { position: absolute; right: 0; }
}
@media (max-width: 1179.98px) {
  .marginalia {
    display: none;
    margin: 0.4rem 0 1.4rem; max-width: none; opacity: 1;
  }
  .marginalia.lit { display: block; transform: none; }
}
@media (max-width: 820px) {
  .manuscript { grid-template-columns: 1fr; }
}

/* ============================================================
   CATALOGUE — shelf of spines
   ============================================================ */
.catalogue { background: linear-gradient(rgba(239, 232, 218, 0), rgba(239, 232, 218, 0.7)); }

.shelf-wrap { max-width: 62rem; margin: 0 auto; }
.shelf {
  display: flex; align-items: flex-end; justify-content: center;
  gap: clamp(0.45rem, 1.4vw, 0.9rem);
  height: clamp(19rem, 42vw, 26rem);
  padding: 0 clamp(0.4rem, 3vw, 2rem);
  list-style: none; margin: 0;
}
.shelf li { display: flex; align-items: stretch; }
.spine {
  position: relative;
  height: 100%;
  width: clamp(3rem, 9.5vw, 4.4rem);
  border: none; cursor: pointer;
  border-radius: 3px 3px 1px 1px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 250, 240, 0.05) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.3), rgba(255, 255, 255, 0.12) 18%, rgba(255, 255, 255, 0.06) 50%, rgba(0, 0, 0, 0.28)),
    var(--cloth);
  color: var(--cloth-ink);
  box-shadow: 2px 0 4px rgba(47, 42, 38, 0.28);
  display: flex; flex-direction: column;
  align-items: center; justify-content: space-between;
  padding: 1.1rem 0 0.9rem;
  transition: transform 0.5s var(--page-ease), box-shadow 0.5s var(--page-ease);
  transform-origin: bottom center;
}
.spine:hover, .spine:focus-visible {
  transform: translateY(-1.4rem);
  box-shadow: 3px 10px 18px rgba(47, 42, 38, 0.35);
}
.spine::before, .spine::after {
  /* head & tail bands */
  content: ""; position: absolute; left: 8%; right: 8%; height: 1px;
  background: currentColor; opacity: 0.55;
}
.spine::before { top: 0.6rem; }
.spine::after { bottom: 0.5rem; }
.spine-title {
  writing-mode: vertical-rl;
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(0.82rem, 2vw, 1.02rem);
  letter-spacing: 0.06em;
  max-height: 72%;
  overflow: hidden;
}
.spine-author {
  writing-mode: vertical-rl;
  font-family: var(--mono); font-size: 0.6rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  opacity: 0.85;
}
.shelf-board {
  height: 14px; margin-top: 0;
  background: linear-gradient(#4a3a2c, #33271d);
  border-radius: 2px;
  box-shadow: 0 10px 22px rgba(47, 42, 38, 0.3);
}
.shelf-note {
  text-align: center; margin-top: 1.6rem;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-soft);
}

/* ============================================================
   READING ROOM — the two-page spread dialog
   ============================================================ */
.reading-room { position: fixed; inset: 0; z-index: 300; }
.reading-room[hidden] { display: none; }
.rr-backdrop {
  position: absolute; inset: 0;
  background: rgba(41, 34, 27, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity 0.45s ease;
}
.reading-room.on .rr-backdrop { opacity: 1; }
.rr-desk {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: clamp(0.8rem, 3vw, 2.5rem);
  pointer-events: none;
}
.rr-desk > * { pointer-events: auto; }
.rr-close {
  align-self: flex-end;
  font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--hairline);
  padding: 0.55rem 0.9rem; cursor: pointer;
  margin-bottom: 0.8rem;
  border-radius: 2px;
}
.rr-close:hover { color: var(--brick); border-color: var(--brick); }

.spread { perspective: 2200px; width: min(58rem, 96vw); }
.spread-book {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  transform-style: preserve-3d;
  /* NB: no filter here — a filter forces transform-style to flatten
     and would break the 3D page-turn */
}
.page-left, .page-right { box-shadow: 0 22px 40px rgba(24, 18, 12, 0.4); }
.flap-front, .flap-back { box-shadow: 0 22px 40px rgba(24, 18, 12, 0.4); }
.page-left, .page-right, .flap-front, .flap-back {
  min-height: min(34rem, 74vh);
  padding: clamp(1.3rem, 3.4vw, 2.6rem);
  overflow: hidden;
}
.page-left {
  background:
    linear-gradient(270deg, rgba(47, 42, 38, 0.14), rgba(47, 42, 38, 0) 12%),
    var(--paper);
  border-radius: 6px 1px 1px 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  /* invisible while the book is closed; appears as the cover turns over it */
  opacity: 0;
  transition: opacity 0.4s ease 0.7s;
}
.reading-room.turned .page-left { opacity: 1; }
.page-right {
  background:
    linear-gradient(90deg, rgba(47, 42, 38, 0.14), rgba(47, 42, 38, 0) 12%),
    var(--paper);
  border-radius: 1px 6px 6px 1px;
  display: flex; flex-direction: column;
}

/* the turning page */
.flap {
  position: absolute; top: 0; right: 0;
  width: 50%; height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  /* translateZ lifts the flap off the base pages to prevent z-fighting */
  transform: rotateY(0.001deg) translateZ(1px);
  transition: transform 1.05s var(--page-ease);
  will-change: transform;
}
.reading-room.turned .flap { transform: rotateY(-180deg) translateZ(1px); }
.flap-front, .flap-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flap-front { border-radius: 1px 6px 6px 1px; }
.flap-back {
  transform: rotateY(180deg);
  border-radius: 6px 1px 1px 6px;
  background:
    linear-gradient(270deg, rgba(47, 42, 38, 0.14), rgba(47, 42, 38, 0) 12%),
    var(--paper);
}

/* book cover face inside the spread (front of flap + left page content) */
.bk-cover {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  text-align: center;
  padding: clamp(1.4rem, 4vw, 2.4rem) 1.2rem;
  color: var(--cloth-ink, #f4e7d7);
  background:
    repeating-linear-gradient(0deg, rgba(255, 244, 224, 0.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(20, 12, 8, 0.06) 0 1px, transparent 1px 3px),
    linear-gradient(120deg, rgba(255, 255, 255, 0.09), rgba(0, 0, 0, 0.12)),
    var(--cloth, var(--brick));
  border: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(20, 12, 8, 0.3);
}
.bk-cover-frame {
  border: 1px solid currentColor;
  padding: clamp(1.4rem, 4vw, 2.4rem) clamp(1rem, 3vw, 2rem);
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem;
  opacity: 0.98;
}
.bk-house {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.3em;
  text-transform: uppercase; opacity: 0.85;
}
.bk-title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.5rem, 3.6vw, 2.3rem); line-height: 1.14;
}
.bk-author {
  font-style: italic; font-size: clamp(0.95rem, 2.2vw, 1.15rem); opacity: 0.9;
}
.bk-kind {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.22em;
  text-transform: uppercase; opacity: 0.8;
}
.bk-orn { font-size: 1.2rem; opacity: 0.9; }

/* recto: excerpt page */
.pg-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-soft);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 0.7rem; margin-bottom: 1.6rem;
}
.pg-excerpt {
  font-size: clamp(1rem, 1.6vw, 1.14rem); line-height: 1.7;
  text-align: justify; hyphens: auto; -webkit-hyphens: auto;
  flex: 1;
}
.pg-excerpt.verse { text-align: left; font-style: italic; white-space: pre-line; hyphens: none; }
.pg-excerpt.prose::first-letter {
  float: left; font-size: 3.4em; line-height: 0.82;
  padding: 0.06em 0.1em 0 0; color: var(--brick); font-weight: 500;
}
.pg-colophon {
  margin-top: 1.4rem; padding-top: 0.9rem;
  border-top: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em;
  color: var(--ink-soft);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem;
}
.pg-colophon .price { color: var(--brick); font-weight: 700; }

.rr-nav {
  width: min(58rem, 96vw);
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.9rem;
}
.rr-arrow {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em;
  background: none; border: none; cursor: pointer;
  color: var(--paper); padding: 0.5rem 0.4rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.rr-arrow:hover { color: #f0c9a8; }
.rr-count {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.2em;
  color: rgba(248, 244, 236, 0.8);
}

/* responsive line break helper */
@media (max-width: 720px) { .br-d { display: none; } }

/* mobile spread: stack pages, no flap */
@media (max-width: 760px) {
  .rr-desk { overflow-y: auto; justify-content: flex-start; padding-top: 4.2rem; }
  .spread { width: 100%; }
  .spread-book { grid-template-columns: 1fr; }
  .flap { display: none; }
  .page-left, .page-right { min-height: 0; border-radius: 4px; }
  .page-left { min-height: 21rem; margin-bottom: 2px; opacity: 1; transition: none; }
  .rr-nav { width: 100%; padding-bottom: 1.4rem; }
  .rr-close { position: sticky; top: 0.4rem; z-index: 2; }
}

/* ============================================================
   THE HOUSE — four rooms
   ============================================================ */
.house { border-top: 1px solid var(--hairline); }
.rooms {
  max-width: 62rem; margin: 0 auto;
  list-style: none;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 3.6rem) clamp(2rem, 6vw, 5rem);
}
.room { display: flex; gap: 1.3rem; align-items: flex-start; }
.room-no {
  font-family: var(--serif); font-size: 2.4rem; font-weight: 500;
  color: var(--brick); line-height: 1;
  min-width: 2.4rem; text-align: center;
  border-bottom: 2px solid var(--brick);
  padding-bottom: 0.35rem;
}
.room h3 {
  font-family: var(--serif); font-weight: 600; font-size: 1.3rem;
  margin-bottom: 0.5rem; letter-spacing: 0.01em;
}
.room p { color: var(--ink-soft); font-size: 1.02rem; }
@media (max-width: 820px) { .rooms { grid-template-columns: 1fr; } }

/* ============================================================
   SUBMISSIONS
   ============================================================ */
.submissions {
  background: linear-gradient(rgba(239, 232, 218, 0), rgba(239, 232, 218, 0.75));
  border-top: 1px solid var(--hairline);
}
.sub-grid {
  max-width: 62rem; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1.1fr;
  gap: clamp(2.2rem, 6vw, 5rem);
  align-items: start;
}
.tw-label {
  font-family: var(--mono); font-size: 0.76rem; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--brick); margin-bottom: 0.9rem;
}
.voice-list { list-style: none; margin-bottom: 2rem; }
.voice-list li {
  padding: 0.55rem 0 0.55rem 1.5rem; position: relative;
  color: var(--ink); font-size: 1.04rem;
  border-bottom: 1px dotted var(--hairline);
}
.voice-list li::before {
  content: "❧"; position: absolute; left: 0; top: 0.55rem;
  color: var(--brick); font-size: 0.9rem;
}
.voice-fine { font-style: italic; color: var(--ink-soft); font-size: 1rem; }

/* the form: a typewritten office form */
.ms-form {
  background: var(--paper);
  border: 1px solid var(--hairline);
  box-shadow: 3px 3px 0 var(--paper-shade), 6px 6px 0 rgba(230, 221, 203, 0.55), 10px 16px 30px rgba(47, 42, 38, 0.14);
  padding: clamp(1.4rem, 4vw, 2.4rem);
  font-family: var(--mono);
}
.form-head {
  border-bottom: 2px solid var(--ink); padding-bottom: 0.8rem; margin-bottom: 1.4rem;
  color: var(--ink);
}
.field { margin-bottom: 1.25rem; }
.field label {
  display: block; font-size: 0.7rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 0.4rem;
}
.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--mono); font-size: 0.95rem; color: var(--ink);
  background: transparent;
  border: none; border-bottom: 1px solid var(--ink-soft);
  border-radius: 0;
  padding: 0.45rem 0.1rem;
}
.field textarea {
  border: 1px solid var(--ink-soft);
  padding: 0.7rem;
  background:
    repeating-linear-gradient(transparent 0 calc(1.6em - 1px), rgba(47, 42, 38, 0.12) calc(1.6em - 1px) 1.6em);
  line-height: 1.6;
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brick);
  box-shadow: 0 1px 0 var(--brick);
}
.field-count {
  font-size: 0.68rem; letter-spacing: 0.12em; color: var(--ink-soft);
  text-align: right; margin-top: 0.35rem;
}
.ms-submit {
  font-family: var(--mono); font-size: 0.82rem; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  background: var(--brick); color: var(--paper);
  border: none; cursor: pointer;
  padding: 0.95rem 1.6rem; width: 100%;
  transition: background 0.3s;
}
.ms-submit:hover { background: var(--brick-deep); }
.ms-confirm {
  margin-top: 1rem; font-size: 0.88rem; line-height: 1.6;
  color: var(--brick); font-style: italic;
  font-family: var(--serif); font-size: 1.05rem;
}
@media (max-width: 900px) { .sub-grid { grid-template-columns: 1fr; } }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--hairline);
  text-align: center;
  padding: 3.5rem 1.4rem 3rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}
.exlibris-foot { width: 66px; color: var(--brick); margin-bottom: 1.1rem; }
.footer nav { margin: 0.8rem 0; }
.footer nav a { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; }
.footer-fine { font-size: 0.82rem; margin-top: 1.2rem; opacity: 0.85; }

/* ============================================================
   GUIDE + 404
   ============================================================ */
.guide-body {
  max-width: 46rem; margin: 0 auto;
  padding: 5rem 1.4rem 4rem;
}
.guide-body .back {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em;
  text-decoration: none;
}
.guide-body h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.1rem, 6vw, 3rem); line-height: 1.1;
  margin: 1.6rem 0 1.2rem;
}
.guide-body h2 {
  font-family: var(--serif); font-weight: 600; font-size: 1.45rem;
  margin: 2.6rem 0 0.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--hairline);
}
.guide-body p, .guide-body li { color: var(--ink); margin-bottom: 0.8em; }
.guide-body ul, .guide-body ol { padding-left: 1.4rem; }
.guide-body code {
  font-family: var(--mono); font-size: 0.85em;
  background: var(--paper-deep); padding: 0.1em 0.35em; border-radius: 2px;
}
.guide-body strong { font-weight: 600; }

.lost {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 2rem 1.4rem;
}
.lost-folio {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--brick); margin: 1.6rem 0 0.8rem;
}
.lost h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(2rem, 7vw, 3.4rem); line-height: 1.1;
  max-width: 18ch;
}
.lost p { max-width: 42ch; margin-top: 1.1rem; color: var(--ink-soft); }
.lost a.lost-home {
  display: inline-block; margin-top: 2rem;
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.16em;
  text-transform: uppercase; text-decoration: none;
  border: 1px solid var(--brick); padding: 0.85rem 1.5rem;
  color: var(--brick);
  transition: background 0.3s, color 0.3s;
}
.lost a.lost-home:hover { background: var(--brick); color: var(--paper); }

/* ============================================================
   Reduced motion — static but complete
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.001s !important;
    animation-duration: 0.001s !important;
  }
  .cover, .flap, .book { transition: none !important; }
  .hero-scroll { opacity: 1; transition: none; }
}

/* qa / instant mode: no entrance ceremony */
.instant .cover, .instant .book,
.instant .frontispiece::after, .instant .hero-scroll,
.instant .flap, .instant .page-left { transition: none !important; }
