/* ==========================================================================
   Paper & Pie — DOG-EAR
   The site as a hardcover: oxblood bookcloth, gold foil, marbled endpapers,
   cream leaves. Libre Caslon Display (titles) · Spectral (text).
   ========================================================================== */

:root {
  --cloth:       #56121B;
  --cloth-deep:  #470E16;
  --cloth-edge:  #3A0B12;
  --foil-hi:     #E8C766;
  --foil:        #C9A227;
  --foil-deep:   #8F6E14;
  --paper:       #F5E6D3;
  --paper-hi:    #FAF0E0;
  --paper-deep:  #EEDCC2;
  --ink:         #211A15;
  --ink-soft:    #6B5D52;
  --teal:        #1F4E4A;
  --forest:      #1E3D2B;
  --navy:        #1E2A4A;
  --shelf:       #2A2119;
  --colophon-bg: #241C16;
  --font-display: "Libre Caslon Display", "Iowan Old Style", Georgia, serif;
  --font-text: "Spectral", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  overflow-x: clip;
}

img { max-width: 100%; display: block; }

::selection { background: var(--foil); color: var(--cloth-deep); }

a { color: inherit; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: fixed; top: -100%; left: 1rem; z-index: 200;
  background: var(--cloth); color: var(--paper);
  padding: 0.6rem 1.2rem; font-size: 0.9rem; text-decoration: none;
  transition: top 0.2s ease-out;
}
.skip-link:focus { top: 1rem; }

/* --------------------------------------------------------------------------
   Foil stamping — the material of a hardcover, not decoration.
   -------------------------------------------------------------------------- */

.foil {
  background-image: linear-gradient(168deg,
    var(--foil-deep) 0%, var(--foil) 28%, var(--foil-hi) 50%,
    var(--foil) 68%, var(--foil-deep) 100%);
  background-size: 100% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.foil-soft { color: var(--foil-hi); }

/* --------------------------------------------------------------------------
   Headband — slim fixed bar, appears once the cover has been opened
   -------------------------------------------------------------------------- */

.headband {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  display: flex; align-items: center; gap: 2rem;
  padding: 0.65rem clamp(1rem, 4vw, 2.5rem);
  /* Right padding clears the ribbon bookmark's full footprint (its own
     right offset + width + a gap) so the call pill never sits under it. */
  padding-right: calc(clamp(1.25rem, 6vw, 5rem) + 38px + 14px);
  background: var(--cloth-deep);
  border-bottom: 1px solid rgba(201, 162, 39, 0.35);
  transform: translateY(-102%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.headband.is-visible { transform: translateY(0); }

.headband__mark {
  font-family: var(--font-display);
  font-size: 1.15rem; color: var(--foil-hi); text-decoration: none;
  letter-spacing: 0.01em;
}

.headband__nav { display: flex; gap: 1.5rem; margin-inline: auto; }
.headband__nav a {
  font-size: 0.88rem; color: var(--paper); text-decoration: none;
  letter-spacing: 0.06em; font-variant: small-caps;
}
.headband__nav a:hover { color: var(--foil-hi); }

.headband__call {
  font-size: 0.9rem; color: var(--foil-hi); text-decoration: none;
  border: 1px solid rgba(201, 162, 39, 0.5);
  padding: 0.35rem 0.9rem; border-radius: 2px;
  transition: background 0.25s ease-out, color 0.25s ease-out;
}
.headband__call:hover { background: var(--foil); color: var(--cloth-deep); }

/* --------------------------------------------------------------------------
   Ribbon bookmark
   -------------------------------------------------------------------------- */

.ribbon {
  position: fixed; top: 0; right: clamp(1.25rem, 6vw, 5rem); z-index: 95;
  width: 38px; height: 108px;
  border: 0; padding: 0; cursor: pointer;
  background:
    repeating-linear-gradient(90deg,
      #7E1B27 0 3px, #6A141F 3px 6px);
  box-shadow: 0 4px 10px rgba(26, 8, 10, 0.45);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 14px), 0 100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.ribbon:hover, .ribbon:focus-visible { transform: translateY(14px); }

.ribbon__label {
  position: absolute; left: 50%; top: 46%;
  transform: translate(-50%, -50%) rotate(90deg);
  font-family: var(--font-text); font-size: 0.62rem;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--foil-hi); white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Cover scene
   -------------------------------------------------------------------------- */

.cover-scene { position: relative; }

.cover-pin {
  position: relative;
  height: 100svh;
  overflow: clip;
  perspective: 1700px;
  background: var(--cloth-edge);
}

/* Pastedown (under the cover): marbled endpaper + bookplate */
.pastedown { position: absolute; inset: 0; }

.marble, .marble__svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.bookplate {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-1.2deg);
  background: var(--paper-hi);
  border: 1px solid var(--foil-deep);
  outline: 1px solid var(--foil-deep);
  outline-offset: 5px;
  padding: 2.2rem 3rem;
  text-align: center;
  box-shadow: 0 18px 44px rgba(26, 8, 10, 0.4);
  max-width: min(80vw, 26rem);
}
.bookplate__exlibris {
  margin: 0; font-family: var(--font-display);
  font-size: 1.9rem; color: var(--cloth);
}
.bookplate__owner {
  margin: 0.4rem 0 0; font-style: italic; color: var(--ink);
}
.bookplate__note {
  margin: 1.1rem 0 0; font-size: 0.8rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
}

/* The front board itself */
.cover-board {
  position: absolute; inset: 0;
  transform-origin: left center;
  transform-style: preserve-3d;
  background:
    radial-gradient(120% 90% at 50% 30%, rgba(255, 236, 200, 0.07), transparent 60%),
    repeating-linear-gradient(0deg,  rgba(0,0,0,0.10) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, var(--cloth) 0%, var(--cloth-deep) 78%);
  box-shadow: 26px 0 60px rgba(12, 4, 5, 0.55);
  will-change: transform;
}

.cover-board__spine {
  position: absolute; inset: 0 auto 0 0; width: 42px;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.5), rgba(0,0,0,0.12) 55%, rgba(255,255,255,0.06)),
    var(--cloth-deep);
}
.cover-board__spine::before {
  content: "";
  position: absolute; inset: 12% 8px;
  background: repeating-linear-gradient(180deg,
    transparent 0 calc(20% - 4px),
    rgba(232, 199, 102, 0.5) calc(20% - 4px) calc(20% - 2px),
    transparent calc(20% - 2px) 20%);
}

.cover-board__face {
  position: absolute; inset: clamp(1.25rem, 4vw, 3rem);
  margin-left: 42px;
  border: 1px solid rgba(201, 162, 39, 0.55);
  outline: 1px solid rgba(201, 162, 39, 0.3);
  outline-offset: 7px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: clamp(1rem, 4vw, 3rem);
}

.cover-press {
  margin: 0 0 2.2rem;
  font-size: clamp(0.72rem, 1.4vw, 0.9rem);
  letter-spacing: 0.42em; text-transform: uppercase;
  color: var(--foil-hi);
}

.cover-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(3.2rem, 11vw, 6rem);
  line-height: 1.02;
  letter-spacing: 0.02em;
  text-wrap: balance;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.55));
}
.cover-title__amp { font-style: italic; }

.cover-sub {
  margin: 1.4rem 0 0;
  font-style: italic;
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
}

.cover-rule {
  width: clamp(90px, 18vw, 200px); height: 1px;
  margin: 2.4rem 0;
  background: linear-gradient(90deg, transparent, var(--foil), transparent);
  position: relative;
}
.cover-rule::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 7px; height: 7px; background: var(--foil);
  transform: translate(-50%, -50%) rotate(45deg);
}

.cover-foot {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(0.68rem, 1.5vw, 0.95rem);
  letter-spacing: clamp(0.08em, 1.2vw, 0.18em);
  text-transform: uppercase;
  color: var(--paper);
  text-wrap: balance;
}
.cover-foot__city { white-space: nowrap; }

.cover-call {
  margin-top: 1.6rem;
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  text-decoration: none;
  border: 1px solid rgba(201, 162, 39, 0.6);
  padding: 0.7rem 1.6rem;
  letter-spacing: 0.08em;
  transition: background 0.25s ease-out, color 0.25s ease-out;
}
.cover-call:hover { background: var(--foil); color: var(--cloth-deep); }

.cover-open {
  position: absolute; bottom: 1.4rem; left: 50%;
  transform: translateX(-50%);
  margin: 0; font-size: 0.72rem; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--foil-hi);
  display: flex; flex-direction: column; align-items: center; gap: 0.55rem;
}
.cover-open__line {
  width: 1px; height: 34px;
  background: linear-gradient(180deg, var(--foil-hi), transparent);
  animation: openline 2.2s cubic-bezier(0.65, 0, 0.35, 1) infinite;
  transform-origin: top;
}
@keyframes openline {
  0%   { transform: scaleY(0);   opacity: 0; }
  35%  { transform: scaleY(1);   opacity: 1; }
  100% { transform: scaleY(1);   opacity: 0; }
}

/* --------------------------------------------------------------------------
   Contents — endpaper spread with the TOC leaf
   -------------------------------------------------------------------------- */

.contents {
  position: relative;
  padding: clamp(4rem, 10vh, 8rem) 1.5rem;
  background-color: var(--teal);
  background-image:
    radial-gradient(42% 34% at 12% 16%, rgba(86, 18, 27, 0.85), transparent 70%),
    radial-gradient(46% 36% at 85% 12%, rgba(201, 162, 39, 0.5), transparent 70%),
    radial-gradient(50% 40% at 70% 78%, rgba(86, 18, 27, 0.8), transparent 72%),
    radial-gradient(44% 36% at 18% 84%, rgba(201, 162, 39, 0.45), transparent 70%),
    radial-gradient(60% 50% at 50% 46%, rgba(239, 224, 203, 0.16), transparent 75%);
}

.contents .leaf--marble-edge {
  max-width: 44rem; margin: 0 auto;
  background: var(--paper-hi);
  padding: clamp(2rem, 6vw, 4rem) clamp(1.5rem, 5vw, 4rem);
  box-shadow: 0 24px 60px rgba(10, 24, 22, 0.5);
  transform: rotate(0.4deg);
}

.toc__title {
  margin: 0 0 2.2rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.9rem);
  text-align: center;
  color: var(--cloth);
}
.toc__title::after {
  content: ""; display: block; width: 72px; height: 1px;
  margin: 1.1rem auto 0; background: var(--foil-deep);
}

.toc__list { list-style: none; margin: 0; padding: 0; }
.toc__list li + li { margin-top: 0.35rem; }

.toc__list a {
  display: flex; align-items: baseline; gap: 0.6rem;
  padding: 0.45rem 0.5rem;
  text-decoration: none;
  transition: background 0.2s ease-out;
}
.toc__list a:hover { background: rgba(201, 162, 39, 0.16); }
.toc__list a:hover .toc__folio { color: var(--cloth); }

.toc__name { font-size: 1.02rem; }
.toc__dots { flex: 1; border-bottom: 2px dotted rgba(107, 93, 82, 0.55); transform: translateY(-4px); }
.toc__folio { font-style: italic; color: var(--ink-soft); font-size: 0.95rem; }

/* --------------------------------------------------------------------------
   Interior leaves
   -------------------------------------------------------------------------- */

.leaf-section { background: var(--paper); }

.leaf {
  position: relative;
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(4.5rem, 11vh, 8rem) clamp(1.5rem, 5vw, 4rem);
}

.leaf--tinted {
  max-width: none;
  background: var(--paper-deep);
}
.leaf--tinted > * { max-width: 72rem; margin-inline: auto; }

.measure { max-width: 62ch; }

.folio {
  position: absolute; bottom: 1.6rem; right: clamp(1.5rem, 5vw, 4rem);
  margin: 0; font-style: italic; font-size: 0.9rem; color: var(--ink-soft);
}

/* Title page */
.titlepage {
  text-align: center;
  padding-bottom: clamp(3rem, 8vh, 5.5rem);
  margin-bottom: clamp(3rem, 8vh, 5.5rem);
  border-bottom: 1px solid rgba(143, 110, 20, 0.4);
}
.titlepage__series {
  margin: 0 0 2rem; font-size: 0.8rem; letter-spacing: 0.4em;
  text-transform: uppercase; color: var(--ink-soft);
}
.titlepage__title {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 5rem); color: var(--cloth);
  line-height: 1.05;
}
.titlepage__sub { margin: 1rem 0 0; font-style: italic; font-size: 1.25rem; color: var(--ink); }
.titlepage__device { width: 56px; height: 56px; margin: 2.2rem auto 0; color: var(--foil-deep); display: block; }
.titlepage__imprint {
  margin: 2.2rem 0 0; font-size: 0.85rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-soft);
}

.preface { margin-inline: auto; }
.preface__head {
  font-family: var(--font-display); font-weight: 400;
  font-size: 1.9rem; color: var(--cloth); margin: 0 0 1.6rem;
}
.preface p { margin: 0 0 1.3rem; }

/* Drop cap — first letter set like an initial */
.dropcap::first-letter {
  font-family: var(--font-display);
  float: left;
  font-size: 4.6em;
  line-height: 0.78;
  padding: 0.08em 0.12em 0 0;
  color: var(--cloth);
}

/* Chapters */
.chapter__opening {
  text-align: center;
  margin-bottom: clamp(3rem, 8vh, 5rem);
}
.chapter__number {
  margin: 0 0 0.9rem; font-style: italic; font-size: 1.05rem;
  letter-spacing: 0.12em; color: var(--ink-soft);
}
.chapter__title {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.2rem); line-height: 1.08; color: var(--ink);
  text-wrap: balance;
}
.chapter__title::after {
  content: ""; display: block; width: 64px; height: 1px;
  margin: 1.4rem auto 0; background: var(--foil-deep);
}
.chapter__epigraph { margin: 1.5rem 0 0; font-style: italic; color: var(--ink-soft); }

.chapter__body {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.chapter__body--flip { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.chapter__body--flip .entries { order: 2; }
.chapter__body--flip .plate { order: 1; }

/* Menu entries — index lines with leader dots */
.entries { list-style: none; margin: 0; padding: 0; }
.entry + .entry { margin-top: 1.9rem; }

.entry__line {
  display: flex; align-items: baseline; gap: 0.6rem; margin: 0;
}
.entry__name {
  font-variant: small-caps;
  letter-spacing: 0.04em;
  font-weight: 500;
  font-size: 1.35rem;
}
.entry__dots { flex: 1; border-bottom: 2px dotted rgba(107, 93, 82, 0.5); transform: translateY(-5px); }
.entry__folio { font-style: italic; color: var(--ink-soft); font-size: 0.95rem; white-space: nowrap; }

.entry__desc {
  margin: 0.3rem 0 0; font-style: italic; color: var(--ink-soft);
  font-size: 1.02rem;
}

/* Tipped-in photo plates */
.plate { margin: 0; }
.plate__frame {
  position: relative;
  background: #FFFDF7;
  padding: clamp(0.7rem, 1.4vw, 1rem);
  padding-bottom: clamp(0.9rem, 1.8vw, 1.3rem);
  box-shadow: 0 14px 34px rgba(56, 34, 15, 0.22);
}
.plate__frame::before, .plate__frame::after {
  content: "";
  position: absolute; top: -12px; width: 74px; height: 26px;
  background: rgba(201, 162, 39, 0.34);
  box-shadow: 0 1px 3px rgba(56, 34, 15, 0.18);
}
.plate__frame::before { left: 8%; transform: rotate(-5deg); }
.plate__frame::after  { right: 8%; transform: rotate(4deg); }
.plate__frame img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.plate figcaption {
  margin-top: 0.8rem; text-align: center;
  font-style: italic; font-size: 0.92rem; color: var(--ink-soft);
}
.plate--tilt-l { transform: rotate(-1.4deg); }
.plate--tilt-r { transform: rotate(1.3deg); }

/* Plates gallery */
.plates__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.6rem, 4vw, 3rem);
  align-items: start;
}
.plates__grid .plate:nth-child(odd)  { transform: rotate(-1.1deg); }
.plates__grid .plate:nth-child(even) { transform: rotate(1.2deg) translateY(14px); }

/* --------------------------------------------------------------------------
   Appendix A — Reading Room
   -------------------------------------------------------------------------- */

.rr {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
  max-width: 72rem; margin-inline: auto;
}

.rr__table {
  width: 100%; border-collapse: collapse;
  margin: 2rem 0 2.4rem;
}
.rr__table tr { border-top: 1px solid rgba(107, 93, 82, 0.35); }
.rr__table tr:last-child { border-bottom: 1px solid rgba(107, 93, 82, 0.35); }
.rr__table th, .rr__table td { padding: 0.75rem 0.25rem; text-align: left; }
.rr__table th {
  font-weight: 500; font-variant: small-caps; letter-spacing: 0.05em;
  color: var(--ink-soft); width: 38%;
}
.rr__table td { color: var(--ink); }

/* Library-stamp call button */
.stamp {
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 0.15rem;
  padding: 1rem 2rem;
  border: 2px solid var(--cloth);
  outline: 1px solid var(--cloth);
  outline-offset: 4px;
  color: var(--cloth);
  text-decoration: none;
  transform: rotate(-1.6deg);
  transition: background 0.22s ease-out, color 0.22s ease-out, transform 0.22s ease-out;
}
.stamp:hover {
  background: var(--cloth); color: var(--paper-hi);
  transform: rotate(0deg);
}
.stamp__action {
  font-size: 0.85rem; letter-spacing: 0.3em; text-transform: uppercase;
}
.stamp__phone {
  font-family: var(--font-display); font-size: 1.5rem; letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   Editions — three cloth spines on a shelf
   -------------------------------------------------------------------------- */

.editions {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.35), transparent 14%),
    var(--shelf);
  padding: clamp(4.5rem, 11vh, 8rem) clamp(1.5rem, 5vw, 4rem);
}

.editions__inner { max-width: 72rem; margin: 0 auto; }

.editions__head { text-align: center; margin-bottom: clamp(3rem, 7vh, 4.5rem); }
.editions__title {
  margin: 0; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.5));
}
.editions__sub { margin: 1.1rem 0 0; font-style: italic; color: #C9B49A; }

.shelf {
  display: flex; gap: 14px;
  align-items: stretch;
  min-height: 540px;
  padding-bottom: 22px;
  border-bottom: 10px solid #1B1510;
  box-shadow: 0 12px 0 -6px rgba(0, 0, 0, 0.4);
}

.spine {
  display: flex; align-items: stretch;
  transition: flex-grow 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  flex-grow: 0;
}
.spine.is-open { flex-grow: 1; }

/* No JS: nothing can re-open a collapsed spine, so every edition must ship
   open and reachable without horizontal scroll — stack instead of shelve. */
html:not(.has-js) .shelf { flex-direction: column; min-height: 0; gap: 12px; }
html:not(.has-js) .spine { flex-direction: column; }
html:not(.has-js) .spine__bar { width: 100%; height: 64px; }
html:not(.has-js) .spine__vertical { writing-mode: horizontal-tb; }
html:not(.has-js) .spine__pages { width: 100%; opacity: 1; }
html:not(.has-js) .spine__pages-in { min-width: 0; }

.spine__bar {
  width: clamp(72px, 9vw, 104px);
  flex-shrink: 0;
  border: 0; cursor: pointer;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.42), rgba(0,0,0,0.08) 30%, rgba(255,255,255,0.07) 50%, rgba(0,0,0,0.15) 80%, rgba(0,0,0,0.45)),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.12) 0 1px, transparent 1px 3px),
    var(--spine-cloth, var(--cloth));
  box-shadow: inset 0 8px 14px -8px rgba(255,255,255,0.25), 0 10px 22px rgba(0,0,0,0.45);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.spine__bar:hover { transform: translateY(-10px); }
.spine.is-open .spine__bar { transform: translateY(0); }

.spine--oxblood { --spine-cloth: var(--cloth); }
.spine--forest  { --spine-cloth: var(--forest); }
.spine--navy    { --spine-cloth: var(--navy); }

.spine__vertical {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  letter-spacing: 0.12em;
  color: var(--foil-hi);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

.spine__pages {
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(107,93,82,0.16) 0 1px, transparent 1px 5px) left / 14px 100% no-repeat,
    var(--paper-hi);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease-out,
    visibility 0s linear 0.35s;
}
/* Collapsed state only exists when JS can re-open it; visibility keeps
   closed pages (and their links) out of tab order and off screen readers. */
.has-js .spine:not(.is-open) .spine__pages { width: 0; opacity: 0; visibility: hidden; }
.spine.is-open .spine__pages { width: min(30rem, 60vw); opacity: 1; visibility: visible; transition-delay: 0s; }

.spine__pages-in {
  padding: clamp(1.6rem, 3.5vw, 3rem);
  padding-left: calc(clamp(1.6rem, 3.5vw, 3rem) + 14px);
  min-width: min(30rem, 60vw);
}

.spine__name {
  margin: 0 0 1rem; font-family: var(--font-display); font-weight: 400;
  font-size: 1.8rem; color: var(--cloth);
}
.spine__address { margin: 0 0 1rem; }
.spine__hours { margin: 0 0 1.4rem; font-style: italic; color: var(--ink-soft); }
.spine__map {
  color: var(--cloth); text-decoration: none; font-weight: 500;
  border-bottom: 1px solid var(--foil-deep);
  padding-bottom: 1px;
}
.spine__map:hover { color: var(--foil-deep); }

/* --------------------------------------------------------------------------
   Colophon
   -------------------------------------------------------------------------- */

.colophon {
  position: relative;
  background: var(--colophon-bg);
  color: var(--paper);
  text-align: center;
  padding: clamp(4.5rem, 12vh, 8rem) 1.5rem clamp(5rem, 12vh, 8rem);
}

.colophon__inner { max-width: 40rem; margin: 0 auto; }

.colophon__title {
  margin: 0 0 1.8rem; font-family: var(--font-display); font-weight: 400;
  font-size: clamp(2rem, 5vw, 3rem); color: var(--foil-hi);
}
.colophon__line { margin: 0 0 2.6rem; font-style: italic; color: #D8C6AC; }

.colophon__phone {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.4rem);
  text-decoration: none;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.5));
}
.colophon__phone:hover { filter: drop-shadow(0 2px 6px rgba(232, 199, 102, 0.45)); }

.colophon__hours { margin: 1.2rem 0 2.4rem; color: #D8C6AC; }

.colophon__ig {
  color: var(--foil-hi); text-decoration: none;
  border-bottom: 1px solid rgba(201, 162, 39, 0.5);
  padding-bottom: 2px;
}
.colophon__ig:hover { border-color: var(--foil-hi); }

.colophon__legal { margin: 3rem 0 0; font-size: 0.85rem; color: #B7A288; }

/* Dog-ear back-to-cover */
.dogear {
  position: absolute; right: 0; bottom: 0;
  width: 84px; height: 84px;
  border: 0; padding: 0; background: transparent; cursor: pointer;
  overflow: visible;
}
.dogear__fold {
  position: absolute; right: 0; bottom: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 0 84px 84px;
  border-color: transparent transparent var(--paper) transparent;
  filter: drop-shadow(-4px -4px 8px rgba(0, 0, 0, 0.4));
  transition: border-width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.dogear:hover .dogear__fold, .dogear:focus-visible .dogear__fold {
  border-width: 0 0 104px 104px;
}
.dogear__hint {
  position: absolute; right: 12px; bottom: 96px;
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #D8C6AC; white-space: nowrap;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
  pointer-events: none;
}
.dogear:hover .dogear__hint, .dogear:focus-visible .dogear__hint {
  opacity: 1; transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .chapter__body, .chapter__body--flip, .rr { grid-template-columns: 1fr; }
  .chapter__body--flip .entries { order: 1; }
  .chapter__body--flip .plate { order: 2; }
  .plates__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .headband__nav { display: none; }

  /* Editions become a stacked shelf */
  .shelf { flex-direction: column; min-height: 0; gap: 12px; }
  .spine { flex-direction: column; }
  .spine__bar {
    width: 100%; height: 64px;
  }
  .spine__vertical { writing-mode: horizontal-tb; }
  .spine__pages { width: 100%; }
  .has-js .spine:not(.is-open) .spine__pages { width: 100%; height: 0; visibility: hidden; }
  .spine.is-open .spine__pages { width: 100%; height: auto; opacity: 1; visibility: visible; }
  .spine__pages-in { min-width: 0; }
}

@media (max-width: 560px) {
  body { font-size: 1.05rem; }
  .plates__grid { grid-template-columns: 1fr; }
  .plates__grid .plate:nth-child(even) { transform: rotate(1.2deg); }
  .ribbon { right: 1rem; height: 84px; }
  .bookplate { padding: 1.6rem 1.4rem; }
  .cover-board__spine { width: 22px; }
  .cover-board__face { margin-left: 22px; }
  .entry__name { font-size: 1.18rem; }
  .dogear { width: 64px; height: 64px; }
  .dogear__fold { border-width: 0 0 64px 64px; }
  .dogear__hint { bottom: 74px; }
}

/* --------------------------------------------------------------------------
   Reduced motion — the book is complete, just still
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cover-open__line { animation: none; }
}
