:root {
  --ink: #161413;
  --night: #1c1b19;
  --graphite: #5a5754;
  --paper: #f4f3ef;
  --bone: #fffaf4;
  --chalk: #eae8e3;
  --shadow: 0 20px 60px rgba(20, 18, 16, 0.2);
  --serif: "Cormorant Garamond", Georgia, serif;
  --script: "Kalam", cursive;
  --sans: "Space Grotesk", "Trebuchet MS", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
}

button,
a,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

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

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 0.22rem;
}

.skip-link {
  position: fixed;
  top: -6rem;
  left: 0.85rem;
  z-index: 100;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  color: var(--bone);
  border-radius: 999px;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skip-link:focus,
.skip-link:focus-visible,
.skip-link.is-focused {
  top: 0.85rem !important;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.1;
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  background-size: 21px 21px;
  mix-blend-mode: multiply;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3.5rem);
  border-bottom: 1px solid rgba(22, 20, 19, 0.1);
  background: rgba(244, 243, 239, 0.9);
  backdrop-filter: blur(18px);
}

.brand,
.share-bar,
.hero-actions,
.reader-controls {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.55rem;
  min-width: 44px;
  min-height: 44px;
}

.brand-mark {
  display: flex;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  opacity: 0.72;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.005em;
}

.share-bar {
  justify-self: end;
  justify-content: flex-end;
  gap: 0.5rem;
}

.share-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.62rem 0.82rem;
  color: var(--bone);
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  cursor: pointer;
}

.share-button:hover {
  border-color: var(--graphite);
  background: var(--graphite);
}

.share-status {
  min-width: 4.8rem;
  color: rgba(22, 20, 19, 0.55);
  font-size: 0.75rem;
}

main {
  overflow-x: clip;
}

section[id],
article[id] {
  scroll-margin-top: 6.5rem;
}

h1,
h2,
h3,
blockquote {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.9;
}

h1 {
  max-width: 12ch;
  color: rgba(22, 20, 19, 0.92);
  font-size: clamp(4.4rem, 8.8vw, 8.8rem);
}

h2 {
  font-size: clamp(3rem, 7vw, 7rem);
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--graphite);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow-script {
  font-family: var(--script);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: none;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.25rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
}

.button-primary {
  color: var(--bone);
  background: var(--ink);
}

.button-primary:hover,
.button-primary:focus-visible {
  border-color: var(--graphite);
  background: var(--graphite);
}

.button-ghost {
  color: var(--ink);
  background: transparent;
}

.button-ghost:hover,
.button-ghost:focus-visible {
  color: var(--bone);
  background: var(--ink);
}

.section-observed {
  scroll-margin-top: 4.9rem;
  opacity: 0;
  transform: translateY(2rem);
  transition:
    opacity 700ms ease,
    transform 700ms ease;
}

.section-observed.is-visible,
.section-observed:target,
.home-hero.section-observed,
.reader-standalone.section-observed {
  opacity: 1;
  transform: none;
}

/* ── Home page ──────────────────────────────────────── */

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  min-height: calc(100svh - 4.7rem);
  padding: clamp(3rem, 7vw, 7rem) clamp(1rem, 5vw, 5rem);
}

.home-hero-copy {
  max-width: 44rem;
}

.home-lead {
  max-width: 40rem;
  margin: 1.2rem 0 0;
  color: rgba(22, 20, 19, 0.65);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.6;
}

.home-cover {
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-cover img {
  width: min(46vw, 28rem);
  border-radius: 1.2rem;
  box-shadow: var(--shadow);
  transform: rotate(-3deg);
  animation: floatPage 7s ease-in-out infinite;
}

.home-spread {
  padding: clamp(4rem, 8vw, 8rem) clamp(1rem, 5vw, 5rem);
}

.home-spread-head {
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.home-spread-head h2 {
  max-width: 16ch;
}

.spread-link {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
  border-radius: 1.4rem;
  background: white;
  box-shadow: var(--shadow);
  transition: transform 260ms ease, filter 260ms ease;
}

.spread-link:hover,
.spread-link:focus-visible {
  filter: contrast(1.04);
  transform: translateY(-0.35rem);
}

.spread-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Dark closing panel — mirrors the book's black quote pages */
.home-close {
  padding: clamp(4rem, 9vw, 7rem) clamp(1rem, 5vw, 5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  background: var(--night);
  color: var(--chalk);
}

.home-close .eyebrow {
  color: rgba(234, 232, 227, 0.45);
}

.home-close p:not(.eyebrow) {
  max-width: 36rem;
  margin: 0;
  color: rgba(234, 232, 227, 0.62);
  font-size: 1rem;
  line-height: 1.6;
}

.home-close .button-primary {
  color: var(--night);
  background: var(--chalk);
  border-color: var(--chalk);
}

.home-close .button-primary:hover,
.home-close .button-primary:focus-visible {
  color: var(--night);
  background: white;
  border-color: white;
}

/* ── Reader page shell (exhibition dark) ─────────────── */

body.reader-page-shell {
  background: var(--night);
}

body.reader-page-shell .site-header {
  background: rgba(22, 20, 19, 0.96);
  border-bottom-color: rgba(255, 250, 244, 0.06);
}

body.reader-page-shell .brand {
  color: rgba(234, 232, 227, 0.78);
}

body.reader-page-shell .share-button {
  color: var(--ink);
  border-color: rgba(234, 232, 227, 0.72);
  background: rgba(234, 232, 227, 0.82);
}

body.reader-page-shell .share-button:hover {
  border-color: var(--chalk);
  background: rgba(234, 232, 227, 0.92);
  color: var(--night);
}

body.reader-page-shell .share-status {
  color: rgba(234, 232, 227, 0.38);
}

/* ── Reader layout ───────────────────────────────────── */

.reader-view {
  display: flex;
  flex-direction: column;
  height: calc(100svh - 4.7rem);
}

.reader-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  flex-shrink: 0;
}

.reader-count {
  font-family: var(--serif);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(234, 232, 227, 0.32);
  text-align: center;
}

.reader-prev,
.reader-next {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  min-height: 44px;
  min-width: 44px;
  border: 1px solid rgba(234, 232, 227, 0.1);
  border-radius: 50%;
  background: transparent;
  color: rgba(234, 232, 227, 0.38);
  font-size: 1.05rem;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.reader-prev:hover,
.reader-next:hover,
.reader-prev:focus-visible,
.reader-next:focus-visible {
  border-color: rgba(234, 232, 227, 0.55);
  color: var(--chalk);
  background: rgba(234, 232, 227, 0.06);
}

.reader-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem clamp(1rem, 4vw, 3rem);
  cursor: zoom-in;
  min-height: 0;
}

.reader-frame {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

/* Page images */
.reader-page {
  display: block;
  max-height: 100%;
  width: auto;
  max-width: 100%;
  border-radius: 2px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
  object-fit: contain;
  background: white;
}

.reader-spread,
.reader-book {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 100%;
  width: min(100%, 72rem);
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
  background: white;
}

.reader-book {
  gap: 0;
  padding: clamp(0.4rem, 0.8vw, 0.75rem);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.09), transparent 5%, transparent 95%, rgba(0, 0, 0, 0.09)),
    #dddbd7;
}

.reader-book .book-page {
  position: relative;
  overflow: hidden;
  background: white;
}

.reader-book .book-page:first-child {
  border-radius: 1px 0 0 1px;
  box-shadow: inset -14px 0 20px rgba(22, 20, 19, 0.09);
}

.reader-book .book-page:last-child {
  border-radius: 0 1px 1px 0;
  box-shadow: inset 14px 0 20px rgba(22, 20, 19, 0.09);
}

.reader-book .book-page:first-child::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  content: "";
  background: rgba(22, 20, 19, 0.14);
}

.spread-gutter {
  position: relative;
}

.spread-gutter::after {
  position: absolute;
  top: 0;
  right: -1px;
  bottom: 0;
  z-index: 1;
  width: 2px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(22, 20, 19, 0.14), transparent);
}

.reader-page,
.reader-spread img,
.reader-book img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}

/* Reader foot */
.reader-foot {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem clamp(1rem, 4vw, 3rem);
  border-top: 1px solid rgba(234, 232, 227, 0.05);
  flex-shrink: 0;
}

.reader-progress-range {
  flex: 1;
  min-height: 44px;
  accent-color: var(--chalk);
  cursor: pointer;
}

.reader-page-jump {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.reader-page-jump input {
  width: 3.4rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid rgba(234, 232, 227, 0.12);
  border-radius: 3px;
  background: rgba(234, 232, 227, 0.05);
  color: rgba(234, 232, 227, 0.55);
  font-size: 0.78rem;
  text-align: center;
  min-height: 44px;
}

.reader-page-jump button {
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(234, 232, 227, 0.12);
  border-radius: 3px;
  background: rgba(234, 232, 227, 0.05);
  color: rgba(234, 232, 227, 0.45);
  font-size: 0.78rem;
  cursor: pointer;
  min-height: 44px;
}

.reader-page-jump button:hover,
.reader-page-jump button:focus-visible {
  border-color: rgba(234, 232, 227, 0.45);
  color: var(--chalk);
}

/* ── Zoom overlay ────────────────────────────────────── */

.zoom-shell {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 14, 13, 0.97);
  padding: 2rem;
  cursor: zoom-out;
}

.zoom-shell[hidden] {
  display: none !important;
}

.zoom-dismiss {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(234, 232, 227, 0.16);
  border-radius: 50%;
  background: rgba(234, 232, 227, 0.05);
  color: rgba(234, 232, 227, 0.45);
  font-size: 1.3rem;
  cursor: pointer;
  z-index: 301;
  transition: border-color 160ms, color 160ms;
}

.zoom-dismiss:hover {
  border-color: rgba(234, 232, 227, 0.55);
  color: var(--chalk);
}

.zoom-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 96vw;
  max-height: 92vh;
  gap: 0;
}

.zoom-stage img {
  display: block;
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  background: white;
}

@keyframes floatPage {
  0%,
  100% {
    transform: rotate(-3deg) translateY(0);
  }
  50% {
    transform: rotate(-1.5deg) translateY(-0.75rem);
  }
}

@media (max-width: 980px) {
  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-cover img {
    width: min(72vw, 26rem);
  }
}

@media (max-width: 620px) {
  .site-header {
    gap: 0.65rem;
    padding: 0.85rem 1rem;
  }

  .brand span:last-child {
    display: none;
  }

  .share-status {
    display: none;
  }

  h1 {
    font-size: clamp(3.8rem, 18vw, 5.8rem);
  }

  h2 {
    font-size: clamp(2.8rem, 14vw, 4.6rem);
  }

  .home-hero,
  .home-spread,
  .home-close {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .spread-link {
    border-radius: 1rem;
  }

  .reader-bar {
    padding: 0.65rem 0.85rem;
  }

  .reader-stage {
    padding: 0.35rem 0.5rem;
  }

  .reader-foot {
    padding: 0.65rem 0.85rem;
    gap: 0.5rem;
  }

  .zoom-shell {
    padding: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
