:root {
  --ink: #3a2a1c;
  --muted: #7d654e;
  --rose: #9a5c4e;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #0c1418;
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  overflow: hidden;
  touch-action: none;
}
#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  touch-action: none;
}
.world {
  position: fixed;
  inset: 0;
  background: none;
  transform: none;
  pointer-events: none;
  z-index: 4;
}
.world.near, .world.read { transform: none; }
.book {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(360px, 84vw);
  aspect-ratio: 939 / 1265;
  transform: translate(-50%, -52%);
  perspective: 1800px;
  filter: drop-shadow(16px 28px 14px rgba(0, 0, 0, 0.72));
  z-index: 5;
  visibility: hidden;
  pointer-events: none;
}
body.revealed .book {
  visibility: visible;
  pointer-events: auto;
  transform: none;
  margin: 0;
}
.book { overflow: visible; }
.sheets { position: absolute; inset: 0; }
.face.front { position: absolute; inset: 0; }
.face.back { display: none; }
.sheet {
  position: absolute;
  inset: 5% 5% 4.5% 6%;
  display: none;
  z-index: 3;
}
.sheet.current[data-page="0"] {
  inset: -2.2% -2.6% -2% -2.8%;
  z-index: 4;
}
.sheet.under { display: block; z-index: 2; }
.sheet.peek,
.sheet.peek[data-page="0"],
.sheet.peek:not([data-page="0"]) {
  display: block;
  inset: auto;
  top: 5%;
  bottom: 4.5%;
  width: 11%;
  left: -4.2%;
  right: auto;
  clip-path: none;
  overflow: hidden;
  z-index: 4;
  pointer-events: none;
}
.sheet.peek .paper,
.sheet.peek .cover-photo {
  position: absolute;
  top: 0;
  right: 0;
  left: auto;
  width: 1000%;
  height: 100%;
  max-width: none;
  margin: 0;
}
.sheet.peek .cover-photo {
  object-fit: cover;
  object-position: right center;
}
.sheet.peek::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.02), rgba(30, 16, 6, 0.55));
  pointer-events: none;
}
.book.open::before {
  content: "";
  position: absolute;
  z-index: 7;
  left: 6%;
  top: 5%;
  bottom: 4.5%;
  width: 18px;
  transform: translateX(-58%);
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(12, 8, 4, 0.62) 0%,
    rgba(70, 46, 24, 0.4) 38%,
    rgba(255, 244, 220, 0.42) 58%,
    rgba(0, 0, 0, 0.12) 100%);
}
.peel {
  position: absolute;
  z-index: 6;
  pointer-events: none;
}
.peel[hidden] { display: none; }
.peel .roll {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 0 50% 50% 0 / 0 7% 7% 0;
  background: linear-gradient(90deg,
    rgba(36, 22, 10, 0.55) 0%,
    rgba(255, 248, 230, 0.72) 14%,
    #f4e7ce 40%,
    #c9b08a 72%,
    #6e5538 100%);
  box-shadow: 12px 0 16px rgba(0, 0, 0, 0.32), inset -7px 0 8px rgba(255, 255, 255, 0.35);
}
.peel .cast {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.fur-sheet { display: block; overflow: visible; background: transparent; }
.cover-photo {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  filter: brightness(0.8) contrast(1.06) saturate(0.82);
  pointer-events: none;
}
.cover-title {
  position: absolute;
  left: 57%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  color: #c6a15a;
  font-style: italic;
  font-size: 22px;
  letter-spacing: 0.14em;
  text-shadow: 0 1px 0 rgba(40, 24, 8, 0.65), 0 0 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 2;
}
.sheet.current, .sheet.under { display: block; }
.sheet.under { z-index: 1; }
.sheet.current { z-index: 3; }
.sheet.drag {
  z-index: 6;
  display: block;
  transition: none;
  filter: drop-shadow(-16px 10px 12px rgba(0, 0, 0, 0.35));
}
.sheet.settle {
  z-index: 6;
  display: block;
  transition: transform 0.46s cubic-bezier(.2, .7, .2, 1);
}
.paper {
  height: 100%;
  padding: 18% 12% 12% 14%;
  display: flex;
  flex-direction: column;
  position: relative;
  background: url("/art/paper.jpg") center/100% 100% no-repeat;
}
.cover { align-items: center; justify-content: center; text-align: center; }
.eyebrow {
  margin: 0;
  letter-spacing: 0.18em;
  font-size: 13px;
  color: var(--muted);
}
h1, h2 { font-weight: 500; margin: 8px 0 0; }
h1 { font-size: 46px; line-height: 0.95; }
h2 { font-size: 28px; }
.hint {
  margin-top: 14px;
  color: var(--muted);
  font-style: italic;
  font-size: 18px;
  line-height: 1.25;
}
.photos {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 1;
  min-height: 0;
}
.shot {
  margin: 0;
  background: #f7f1e4;
  padding: 5px 5px 7px;
  box-shadow: 0 6px 12px rgba(70, 40, 20, 0.08);
  overflow: hidden;
}
.shot:nth-child(1) { transform: rotate(-1.4deg); }
.shot:nth-child(2) { transform: rotate(1.2deg); }
.shot:nth-child(4) { transform: rotate(1deg); }
.shot:nth-child(5) { transform: rotate(-1deg); }
.shot.wide { grid-column: 1 / -1; transform: none; }
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-height: 78px;
  min-height: 42px;
}
.shot.wide img { max-height: 70px; }
.note {
  margin: 8px 0 0;
  text-align: center;
  font-style: italic;
  color: var(--muted);
  font-size: 18px;
}
.voice {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  border: 0;
  background: rgba(255, 250, 242, 0.72);
  border-radius: 999px;
  padding: 8px 14px 8px 8px;
  color: var(--ink);
  font: inherit;
  text-align: left;
}
.voice b { display: block; font-weight: 600; font-size: 20px; }
.voice small { color: var(--muted); font-size: 15px; }
.play {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--rose);
  color: #fffaf6;
  flex: none;
}
.blank { justify-content: flex-end; }
.blank-text { padding: 0 6px 16vh; }
.script {
  font-family: "Marck Script", cursive;
  font-size: 46px;
  margin: 0 0 6px;
  color: #6a3d34;
}
.blank-text p { margin: 0; font-size: 26px; line-height: 1.25; }
#dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 12;
  touch-action: none;
}
body.cleared #dust { display: none; }
.fog {
  position: fixed;
  inset: -12%;
  pointer-events: none;
  z-index: 6;
  background:
    radial-gradient(42% 32% at 24% 36%, rgba(214, 228, 232, 0.38), transparent 70%),
    radial-gradient(48% 36% at 72% 58%, rgba(186, 206, 214, 0.3), transparent 72%),
    radial-gradient(60% 40% at 50% 80%, rgba(150, 170, 178, 0.18), transparent 70%);
  filter: blur(10px);
  animation: drift 16s ease-in-out infinite;
  transition: opacity 1.5s ease;
}
body.cleared .fog { opacity: 0.04; }
@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-2%, 1.5%, 0); }
}
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 18% 78%, rgba(0, 0, 0, 0.45)),
    radial-gradient(70% 70% at 50% 45%, transparent 42%, rgba(0, 0, 0, 0.45) 100%);
}
.invite, .pager {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 22px;
  margin: 0;
  text-align: center;
  z-index: 8;
  color: rgba(232, 224, 206, 0.82);
  letter-spacing: 0.18em;
  font-size: 13px;
  text-transform: lowercase;
}
.pager { bottom: 22px; }
@media (max-height: 700px) {
  h1 { font-size: 48px; }
  h2 { font-size: 28px; }
  .shot img, .shot.wide img { max-height: 84px; }
  .paper { padding: 16px 14px 12px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .world, .fog { transition-duration: 0.01s !important; animation: none !important; }
}
