/* ============================================================
   Hilo y Memoria — Camila A.
   Dark gallery portfolio aesthetic
   ============================================================ */

:root {
  --paper:        #141414;
  --paper-deep:   #0a0a0a;
  --paper-edge:   #2a2a2a;
  --ink:          #fff;
  --ink-soft:     #fff;
  /* accent color: kept neutral — no colored highlights, plain type only */
  --huelga:       #fff;
  --huelga-deep:  #fff;
  --gold:         #fff;
  --sky:          #4a4a4a;

  /* Spectral for main headings & body; Courier New for the title,
     subtitles/eyebrows, captions, and other typewriter labels */
  --serif:    'Spectral', Georgia, serif;
  --display:  'Spectral', Georgia, serif;
  --slab:     'Spectral', Georgia, serif;
  --typer:    'Courier New', Courier, monospace;
}

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

html, body {
  height: 100%;
  font-family: var(--serif);
  color: var(--ink);
  background: #000;
  overflow: hidden;
}

body {
  /* moody gallery wall background */
  background:
    radial-gradient(ellipse at center, #1a1a1a 0%, #000 100%);
  background-attachment: fixed;
}

#app {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  perspective: 2400px;
}

/* ============================================================
   STAGE STATES — only one visible at a time
   ============================================================ */

.stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

#app[data-state="closed"] .stage-closed,
#app[data-state="opening"] .stage-closed,
#app[data-state="spread"]  .stage-spread,
#app[data-state="zooming"] .stage-zoom,
#app[data-state="zoomed"]  .stage-zoom {
  opacity: 1;
  pointer-events: auto;
}

#app[data-state="opening"] .stage-closed { transition-delay: 0s; }
#app[data-state="spread"]  .stage-spread { transition-delay: 0.4s; }

/* ============================================================
   STATE 1 — CLOSED BOOK
   ============================================================ */

.closed-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.book-3d {
  position: relative;
  width: 540px;
  height: 770px;
  cursor: pointer;
  transform-style: preserve-3d;
  transform: rotateX(8deg) rotateY(-22deg);
  transition: transform 0.8s cubic-bezier(0.7, 0, 0.3, 1);
  filter: drop-shadow(28px 38px 50px rgba(0,0,0,0.7));
}

.book-3d:hover {
  transform: rotateX(6deg) rotateY(-16deg) translateY(-6px);
}

.book-3d:focus { outline: none; }
.book-3d:focus-visible { outline: 3px solid var(--gold); outline-offset: 14px; }

#app[data-state="opening"] .book-3d {
  transform: rotateX(0deg) rotateY(0deg) translateZ(50px) scale(1.05);
}

.book-cover {
  position: absolute;
  inset: 0;
  background: #000;
  border-radius: 2px 6px 6px 2px;
  overflow: hidden;
  transform-origin: left center;
  transition: transform 0.9s cubic-bezier(0.6, 0, 0.2, 1);
  backface-visibility: hidden;
  box-shadow:
    inset 0 0 80px rgba(0,0,0,0.6),
    inset 8px 0 12px rgba(0,0,0,0.55);
}

#app[data-state="opening"] .book-cover {
  transform: rotateY(-160deg);
}

.cover-art-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;       /* show the whole poster, no cropping */
  object-position: center center;
  display: block;
  background: #000;
}

/* Title band sits over the collage's middle row, replacing that row
   of photos with the book's title. */
.cover-title-band {
  position: absolute;
  top: 39.5%;
  height: 21%;
  left: 0;
  right: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 2;
}
.cover-title {
  font-family: var(--typer);
  font-weight: 700;
  font-size: 42px;
  letter-spacing: 1px;
  color: var(--ink);
  line-height: 1;
  text-align: center;
}
.cover-sub {
  font-family: var(--typer);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--ink-soft);
  text-transform: lowercase;
  text-align: center;
}

/* book side / pages stack — give it 3D depth */
.book-side {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 24px;
  background: linear-gradient(to right, #1a1a1a, #333 30%, #1a1a1a);
  transform: rotateY(90deg) translateZ(-12px) translateX(12px);
  transform-origin: right center;
}

.book-pages {
  position: absolute;
  inset: 4px 14px 4px 4px;
  background: repeating-linear-gradient(
    to bottom,
    #222 0,
    #222 2px,
    #111 2px,
    #111 3px
  );
  transform: translateZ(-2px);
  z-index: -1;
}

.open-hint {
  font-family: var(--typer);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--ink);
  opacity: 0.65;
  text-transform: lowercase;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.85; }
}

/* ============================================================
   STATE 2 — OPEN SPREAD
   ============================================================ */

.spread-frame {
  width: min(96vw, 1100px);
  height: min(78vh, 660px);
  position: relative;
}

.spread-book {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  border-radius: 4px;
  background: #111;
  padding: 14px;
  box-shadow:
    0 30px 60px rgba(0,0,0,0.7),
    0 6px 12px rgba(0,0,0,0.4);
}

.spread {
  display: none;
  width: 100%;
  height: 100%;
  position: relative;
}

.spread.active {
  display: flex;
}

.spread::before {
  /* center spine shadow */
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 30px;
  transform: translateX(-50%);
  background: linear-gradient(to right,
    transparent,
    rgba(0,0,0,0.45) 50%,
    transparent);
  pointer-events: none;
  z-index: 5;
}

.page {
  flex: 1 1 50%;
  height: 100%;
  background: var(--paper);
  position: relative;
  cursor: zoom-in;
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  /* soft gallery-wall lighting via subtle gradients */
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(255,255,255,0.06), transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(0,0,0,0.3), transparent 60%);
}

.page.left  { border-radius: 3px 0 0 3px; box-shadow: inset -8px 0 14px rgba(0,0,0,0.4); }
.page.right { border-radius: 0 3px 3px 0; box-shadow: inset  8px 0 14px rgba(0,0,0,0.4); }

.page:hover {
  transform: translateY(-2px);
}

/* page small (preview) styling */
.page .page-inner {
  padding: 24px 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink);
  /* shrink content visually for preview */
  transform-origin: center;
}
.zoomed-page {
  display: flex;
  flex-direction: column;
}

.page .page-num {
  position: absolute;
  bottom: 14px;
  font-family: var(--typer);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--ink-soft);
  opacity: 0.8;
}
.page.left  .page-num { left: 24px; }
.page.right .page-num { right: 24px; }

.spread-nav {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.zoom-hint {
  margin-top: 12px;
  font-family: var(--typer);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--ink);
  opacity: 0.55;
}

.nav-btn {
  font-family: var(--typer);
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 8px 16px;
  cursor: pointer;
  text-transform: lowercase;
  transition: all 0.2s ease;
  border-radius: 2px;
}
.nav-btn:hover {
  background: var(--ink);
  color: var(--paper-deep);
}
.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.nav-btn.ghost {
  border-color: rgba(255,255,255,0.4);
  color: rgba(255,255,255,0.7);
}
.nav-btn.ghost:hover {
  background: rgba(255,255,255,0.15);
  color: var(--ink);
  border-color: var(--ink);
}

.page-indicator {
  font-family: var(--typer);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--ink);
  opacity: 0.7;
  min-width: 60px;
  text-align: center;
}

/* ============================================================
   STATE 3 — ZOOMED PAGE
   ============================================================ */

.zoomed-page {
  width: min(94vw, 820px);
  height: min(86vh, 1100px);
  background: var(--paper);
  border-radius: 3px;
  padding: 60px 70px;
  overflow-y: auto;
  position: relative;
  box-shadow:
    0 40px 80px rgba(0,0,0,0.7),
    0 8px 20px rgba(0,0,0,0.4);
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(255,255,255,0.07), transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(0,0,0,0.3), transparent 60%);
  transform: scale(0.85);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.6, 0, 0.2, 1), opacity 0.5s ease;
}

#app[data-state="zoomed"] .zoomed-page {
  transform: scale(1);
  opacity: 1;
}

.zoomed-page::-webkit-scrollbar { width: 8px; }
.zoomed-page::-webkit-scrollbar-track { background: transparent; }
.zoomed-page::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

.zoom-nav {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ============================================================
   PAGE CONTENT — shared typography & layouts
   ============================================================ */

.page-content {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* The hero photo on a normal page should grow to fill the leftover
   vertical space — no awkward gaps. */
.page-content > .photo-figure.hero,
.page-content > .photo-figure.document {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.page-content > .photo-figure.hero img {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  min-height: 0;
}
.page-content > .photo-figure.document img {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  background: #000;
  min-height: 0;
}

/* leave room for the figcaption below the flexing image */
.page-content > .photo-figure figcaption {
  flex: 0 0 auto;
}

.page-content h1,
.page-content h2,
.page-content h3 {
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.page-content h1 { font-size: 48px; line-height: 0.95; margin-bottom: 14px; }
.page-content h2 { font-size: 28px; line-height: 1.05; margin-bottom: 12px; }
.page-content h3 { font-size: 18px; line-height: 1.15; margin-bottom: 8px; }

.page-content p {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 12px;
}

.page-content .eyebrow {
  font-family: var(--typer);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: lowercase;
  color: var(--huelga);
  margin-bottom: 8px;
}

.page-content .rule {
  border: none;
  border-top: 1px solid var(--ink);
  margin: 14px 0;
  opacity: 0.4;
}

.page-content .pull-quote {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.2;
  color: var(--huelga);
  border-left: 3px solid var(--huelga);
  padding: 4px 0 4px 18px;
  margin: 14px 0;
  font-style: italic;
}

.page-content .caption {
  font-family: var(--typer);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--ink-soft);
  margin-top: 6px;
}

/* small/preview adjustments — shrink type when page is in spread view */
.page .page-content h1 { font-size: 22px; }
.page .page-content h2 { font-size: 14px; }
.page .page-content h3 { font-size: 11px; }
.page .page-content p  { font-size: 8.5px; line-height: 1.45; margin-bottom: 6px; }
.page .page-content .eyebrow { font-size: 7px; margin-bottom: 4px; }
.page .page-content .pull-quote { font-size: 12px; padding-left: 9px; border-left-width: 2px; }
.page .page-content .caption    { font-size: 6.5px; }
.page .page-content .rule       { margin: 8px 0; }

.page-inner {
  padding: 22px 24px;
}
.zoomed-page .page-content { font-size: 16px; }

/* ============================================================
   SHARED PHOTO FIGURES
   ============================================================ */

.photo-figure {
  margin: 8px 0 6px;
  background: transparent;
  position: relative;
}
.photo-figure img {
  display: block;
  width: 100%;
  height: auto;
  filter: contrast(1.05) brightness(0.97);
  background: #000;
}
.photo-figure figcaption {
  font-family: var(--typer);
  font-size: 6.5px;
  letter-spacing: 0.3px;
  color: var(--ink-soft);
  padding: 3px 0 0;
  line-height: 1.4;
  text-transform: lowercase;
}
.photo-figure figcaption .pd {
  color: var(--huelga);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}
.zoomed-page .photo-figure {
  margin: 16px 0 10px;
}
.zoomed-page .photo-figure figcaption {
  font-size: 11px;
  padding: 8px 0 0;
}

/* hero (full-width) */
.photo-figure.hero img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  object-position: center 45%;
}
.zoomed-page .photo-figure.hero img {
  max-height: 720px;
}
/* full = even bigger, dominates the page */
.photo-figure.hero.full img {
  max-height: 260px;
}
.zoomed-page .photo-figure.hero.full img {
  max-height: 860px;
}
/* tall = vertical hero, for portraits */
.photo-figure.hero.tall img {
  max-height: 280px;
}
.zoomed-page .photo-figure.hero.tall img {
  max-height: 880px;
}
/* fullbleed = pure photo page, image fills nearly the whole page */
.photo-figure.fullbleed {
  margin: 0 -30px;
  flex: 1;
}
.photo-figure.fullbleed img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
}
.zoomed-page .photo-figure.fullbleed {
  margin: 8px -70px 0;
}
.zoomed-page .photo-figure.fullbleed img {
  max-height: 920px;
}

/* small inset (about 50% width, floats right) */
.photo-figure.inset {
  width: 45%;
  float: right;
  margin: 4px 0 6px 8px;
  clear: right;
}
.zoomed-page .photo-figure.inset {
  width: 40%;
  margin: 8px 0 14px 18px;
}

/* image-row: two photos side by side */
.image-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 6px 0;
}
.zoomed-page .image-row { gap: 14px; margin: 14px 0; }
.image-row .photo-figure { margin: 0; }
.image-row .photo-figure img { max-height: 90px; }
.zoomed-page .image-row .photo-figure img { max-height: 280px; }

/* ===== big magazine-style blockquotes ===== */
blockquote {
  margin: 10px 0;
  padding: 6px 0 6px 12px;
  border-left: 2px solid var(--ink);
  font-family: var(--display);
  font-size: 11px;
  line-height: 1.25;
  font-style: italic;
  color: var(--ink);
}
.zoomed-page blockquote {
  margin: 22px 0;
  padding: 10px 0 10px 22px;
  border-left-width: 3px;
  font-size: 22px;
}
blockquote cite {
  display: block;
  font-family: var(--typer);
  font-style: normal;
  font-size: 7px;
  letter-spacing: 0.5px;
  color: var(--huelga);
  text-transform: lowercase;
  margin-top: 4px;
}
.zoomed-page blockquote cite {
  font-size: 11px;
  margin-top: 10px;
}

/* big = oversized magazine pull-quote */
blockquote.big {
  font-size: 18px;
  border-left: none;
  padding-left: 0;
  text-align: left;
  margin: 14px 0 8px;
  line-height: 1.1;
}
.zoomed-page blockquote.big {
  font-size: 48px;
  margin: 32px 0 18px;
}

/* red = huelga red */
blockquote.red,
blockquote.red.big { color: var(--huelga); }
blockquote.red { border-left-color: var(--huelga); }

/* centered text */
blockquote.centered {
  text-align: center;
  border-left: none;
  padding: 8px 0;
}
blockquote.centered cite { text-align: center; }

/* ============================================================
   PAGE-SPECIFIC LAYOUTS
   ============================================================ */

/* ---- BLANK SPACER PAGE ---- */
.layout-blank {
  background: var(--paper);
  cursor: default;
}
.layout-blank .page-num { display: none; }
.layout-blank::after { display: none !important; }
.layout-blank:hover { transform: none; }

/* ---- QUOTE-ONLY PAGE (single quote dominates the page) ----
   These selectors deliberately use !important so they win against
   the smaller `.page .page-content p` preview rule. */
.layout-quote {
  background: var(--paper);
  position: relative;
}
.layout-quote .page-inner,
.zoomed-page.layout-quote {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  height: 100% !important;
  text-align: center !important;
  padding: 24px !important;
}
.layout-quote .page-content {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  height: 100% !important;
  width: 100% !important;
}
.layout-quote .big-quote {
  font-family: var(--display) !important;
  font-weight: 700 !important;
  font-size: 36px !important;
  line-height: 1.0 !important;
  color: var(--ink);
  max-width: 92%;
  text-align: center;
  letter-spacing: -0.015em;
  margin: 0 !important;
  padding: 0 12px;
}
.zoomed-page .layout-quote .big-quote {
  font-size: 110px !important;
  max-width: 92%;
  line-height: 0.98 !important;
  padding: 0 24px;
}
.layout-quote .big-quote.red {
  color: var(--huelga);
}
.layout-quote .quote-attribution {
  font-family: var(--typer) !important;
  font-size: 9px !important;
  letter-spacing: 1.5px !important;
  color: var(--huelga) !important;
  text-transform: lowercase;
  margin-top: 22px !important;
}
.zoomed-page .layout-quote .quote-attribution {
  font-size: 18px !important;
  margin-top: 48px !important;
}
.layout-quote .quote-rule {
  width: 40px;
  height: 2px;
  background: var(--huelga);
  margin: 22px 0 0;
}
.zoomed-page .layout-quote .quote-rule {
  width: 80px;
  height: 4px;
  margin: 36px 0 0;
}

/* ---- TITLE-ONLY PAGE (just a chapter heading) ---- */
.layout-title {
  background: #000;
  position: relative;
}
.layout-title .page-inner {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  height: 100% !important;
  text-align: center !important;
  padding: 24px !important;
}
.layout-title .page-content {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  height: 100% !important;
  width: 100% !important;
  text-align: center !important;
}
.layout-title .chapter-num {
  font-family: var(--typer) !important;
  font-size: 11px !important;
  letter-spacing: 3px !important;
  text-transform: uppercase !important;
  color: var(--huelga) !important;
  margin-bottom: 18px !important;
}
.zoomed-page .layout-title .chapter-num {
  font-size: 20px !important;
  margin-bottom: 42px !important;
  letter-spacing: 6px !important;
}
.layout-title h1 {
  font-family: var(--typer) !important;
  font-size: 64px !important;
  line-height: 0.95 !important;
  color: var(--ink) !important;
  margin: 0 !important;
  text-align: center;
  font-weight: 700 !important;
}
.zoomed-page .layout-title h1 {
  font-size: 150px !important;
}
.layout-title .chapter-sub {
  font-family: var(--typer) !important;
  font-size: 9px !important;
  letter-spacing: 1.2px !important;
  color: var(--ink-soft) !important;
  text-transform: lowercase;
  margin-top: 22px !important;
  text-align: center;
  max-width: 80%;
}
.zoomed-page .layout-title .chapter-sub {
  font-size: 16px !important;
  margin-top: 48px !important;
}

/* ---- PURE PHOTO PAGE (full bleed, no padding, no gaps) ---- */
.layout-pure {
  background: #000;
  position: relative;
}
/* kill all padding for pure pages, image fills page edge to edge */
.layout-pure .page-inner {
  padding: 0 !important;
  height: 100%;
}
.zoomed-page.layout-pure {
  padding: 0 !important;
}
.page-content.pure {
  height: 100% !important;
  width: 100% !important;
  position: relative !important;
  padding: 0 !important;
  margin: 0 !important;
  display: block !important;
}
.page-content.pure .photo-figure,
.page-content.pure .photo-figure.fullbleed,
.page-content.pure .photo-figure.hero,
.page-content.pure .photo-figure.document {
  margin: 0 !important;
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
}
.page-content.pure .photo-figure img,
.page-content.pure .photo-figure.fullbleed img,
.page-content.pure .photo-figure.hero img {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain !important;
  display: block !important;
}
.page-content.pure .photo-figure.document img {
  object-fit: contain !important;
  background: #000 !important;
}
.page-content.pure .photo-figure figcaption {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  background: rgba(0,0,0,0.82);
  color: var(--ink);
  padding: 4px 8px;
  font-size: 6.5px;
  letter-spacing: 0.5px;
  z-index: 5;
  text-align: right;
}
.zoomed-page .page-content.pure .photo-figure figcaption {
  font-size: 11px;
  padding: 10px 22px;
}
.page-content.pure .photo-figure figcaption .pd {
  color: var(--gold);
}

.corner-label {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 6;
  font-family: var(--typer);
  font-size: 6.5px;
  letter-spacing: 1px;
  color: var(--ink);
  background: rgba(0,0,0,0.78);
  padding: 3px 6px;
  text-transform: lowercase;
}
.zoomed-page .corner-label {
  top: 22px;
  left: 28px;
  font-size: 11px;
  padding: 6px 12px;
}

/* document/scan photos — preserve aspect ratio, contain rather than crop */
.photo-figure.document {
  background: #000;
  margin: 8px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.photo-figure.document img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  background: #000;
  filter: contrast(1.05);
}
.zoomed-page .photo-figure.document img {
  max-height: 920px;
}

/* ---- PIECE (heading + one or more uncropped photos, evenly split) ---- */
.layout-piece {
  background: var(--paper);
}
.layout-piece .page-content > .photo-figure.document {
  margin: 8px 0;
}

/* ---- COLOPHON ---- */
.layout-colophon {
  background:
    linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
}
.page .layout-colophon .eyebrow { font-size: 10px; }
.page .layout-colophon h2 { font-size: 18px; }
.layout-colophon .meta-line {
  font-family: var(--typer);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.3px;
  color: var(--ink);
  margin-top: 8px;
}
.layout-colophon .meta-line strong {
  color: var(--huelga);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.zoomed-page .layout-colophon .meta-line {
  font-size: 16px;
  margin-top: 12px;
}
.layout-colophon code {
  font-family: var(--typer);
  font-size: 0.95em;
  background: rgba(255,255,255,0.08);
  padding: 1px 4px;
}

.layout-colophon .contact-sheet {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  margin: 6px 0;
}
.zoomed-page .layout-colophon .contact-sheet {
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin: 14px 0 18px;
}
.layout-colophon .contact-sheet img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: #000;
  filter: contrast(1.05) brightness(0.96);
}

/* ============================================================
   LIGHTBOX — click a zoomed-page photo to magnify & pan
   ============================================================ */

.zoomed-page .photo-figure img { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.97);
  display: none;
  overflow: auto;
  overscroll-behavior: contain;
}
/* fit mode: whole photo on screen, click it to magnify */
.lightbox.open.fit {
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox.fit img {
  max-width: 94vw;
  max-height: 92vh;
  cursor: zoom-in;
}
/* mag mode: oversized image, native scrolling pans around it */
.lightbox.open.mag { display: block; }
.lightbox.mag img {
  display: block;
  cursor: zoom-out;
  /* width set inline by JS */
}
.lb-close {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 210;
  font-family: var(--typer);
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--ink);
  padding: 8px 14px;
  cursor: pointer;
  text-transform: lowercase;
  border-radius: 2px;
}
.lb-close:hover {
  background: var(--ink);
  color: #000;
}

/* ============================================================
   SMALL SCREENS
   ============================================================ */
@media (max-width: 900px) {
  .book-3d { width: 360px; height: 520px; }
  .cover-title { font-size: 28px; }
  .cover-sub { font-size: 9px; }
}
@media (max-width: 720px) {
  .book-3d { width: 280px; height: 400px; }
  .spread-frame { height: min(70vh, 520px); }
  .zoomed-page { padding: 36px 28px; }
  .cover-title { font-size: 22px; }
  .cover-sub { font-size: 8px; }
}

/* ------------------------------------------------------------
   PHONES — the two-page book doesn't fit side by side, so we
   drop the spread metaphor and present every page in one
   vertical scroll at natural height. Nothing gets cropped, and
   tapping a page still opens the full-screen zoom view.
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  /* the spread stage becomes the scroll container */
  .stage-spread {
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 0 24px;
  }

  .spread-frame {
    width: 100%;
    height: auto;
  }
  .spread-book {
    flex-direction: column;
    height: auto;
    background: #000;
    padding: 0;
    box-shadow: none;
    gap: 12px;
  }

  /* show every spread (not just the active one), stacked */
  .spread {
    display: flex !important;
    flex-direction: column;
    height: auto;
    gap: 12px;
  }
  .spread::before { display: none; } /* no center spine */

  /* each page: full width, natural height, its own framed block */
  .page,
  .page.left,
  .page.right {
    display: block;
    flex: none;
    width: 100%;
    height: auto;
    min-height: 40vh;
    border-radius: 2px;
    box-shadow: none;
  }

  /* let the stacked photos show in full instead of being cropped */
  .page-content > .photo-figure.document,
  .page-content > .photo-figure.hero,
  .layout-piece .page-content > .photo-figure.document {
    flex: none;
  }
  .page-content > .photo-figure.document img,
  .page-content > .photo-figure.hero img,
  .photo-figure.document img {
    height: auto;
    max-height: none;
    object-fit: contain;
  }
  /* pure/full-bleed pages (title, collage, poppies, embrace) */
  .layout-pure .page-inner,
  .zoomed-page.layout-pure { height: auto !important; }
  .page-content.pure { min-height: 60vh; }
  .page-content.pure .photo-figure,
  .page-content.pure .photo-figure.fullbleed,
  .page-content.pure .photo-figure.document {
    position: relative !important;
    inset: auto !important;
    height: auto !important;
  }
  .page-content.pure .photo-figure img,
  .page-content.pure .photo-figure.fullbleed img,
  .page-content.pure .photo-figure.document img {
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
  }

  /* skip the title page on phones — the collage of every piece
     leads instead, since the big title reads awkwardly on a narrow
     screen. (Desktop still opens on the title/collage spread.) */
  .page.layout-title { display: none; }

  /* the arrows/counter don't apply to a scroll feed */
  .spread-nav { display: none; }
}
