:root {
  color-scheme: dark;
  --ink: #14110e;
  --panel: #211a15;
  --paper: #fff1dc;
  --gold: #f2bf7b;
  --muted: #d3bca4;
  --rule: #72543d;
  --serif: Georgia, "Times New Roman", serif;
  font: 16px/1.5 system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ink); color: var(--paper); }
button { cursor: pointer; }
button {
  min-height: 42px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: .5rem .85rem;
  background: #281f18;
  color: var(--paper);
  font: inherit;
}
button:hover:enabled { border-color: var(--gold); background: #493422; }
button:disabled { opacity: .44; cursor: default; }
:where(button, a):focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
a { color: var(--gold); text-underline-offset: .22em; }
p { margin: 0 0 .85rem; }
h1, h2, h3 { margin: 0; }
h1, h2 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: .99;
  letter-spacing: -.05em;
  text-wrap: balance;
}
h2 { font-size: clamp(2.65rem, 5.3vw, 5.4rem); margin-bottom: clamp(1rem, 2.8vw, 1.75rem); }

.app {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  isolation: isolate;
  position: relative;
}
.stage, .shutter { grid-area: 2 / 1; }
.shutter {
  position: relative;
  overflow: hidden;
  pointer-events: none;
}
.shutter-blade {
  position: absolute;
  inset: 0;
  background: linear-gradient(168deg, #261b14, #080604 58%);
}
.shutter-blade:first-child {
  clip-path: polygon(0 0, 100% 0, 100% 39%, 0 62%);
  transform: translateY(-102%);
}
.shutter-blade:last-child {
  clip-path: polygon(0 60%, 100% 37%, 100% 100%, 0 100%);
  transform: translateY(102%);
}
.top, .bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .7rem clamp(1rem, 4vw, 3.75rem);
  background: #17120f;
  position: relative;
  z-index: 1;
}
.top { border-bottom: 1px solid #70553c80; }
.top-controls, .brand { display: flex; align-items: center; gap: .7rem; }
.brand {
  color: var(--paper);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
}
.counter { color: var(--muted); white-space: nowrap; }
.viewfinder {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  display: grid;
  place-items: center;
}
.viewfinder::after {
  content: "";
  width: 6px;
  height: 6px;
  border: 1px solid var(--gold);
  border-radius: 50%;
}
.counter { font-variant-numeric: tabular-nums; font-size: .82rem; }
.screen { background: transparent; font-size: .8rem; }
.bottom { border-top: 1px solid #70553c80; }
.bottom > button { min-width: 6.7rem; }
.progress { height: 2px; position: absolute; inset: -2px 0 auto; background: #4a3527; }
.progress span {
  display: block;
  width: calc(100% / 7);
  height: 100%;
  background: linear-gradient(90deg, #be7541, var(--gold));
  box-shadow: 0 0 12px #ecaa62a0;
  transition: width 420ms ease;
}
.dots { display: flex; gap: clamp(2px, .7vw, 10px); }
.dot {
  width: clamp(19px, 2.8vw, 38px);
  border: 1px solid transparent;
  background: transparent;
  min-height: 36px;
  padding: 0 3px;
  display: grid;
  place-items: center;
}
.dot::before {
  content: "";
  width: 100%;
  height: 4px;
  border-radius: 3px;
  background: #775945;
  transition: background 250ms ease, transform 250ms ease;
}
.dot[aria-current="true"]::before { background: var(--gold); transform: scaleY(1.6); }
.stage {
  display: flex;
  overflow: auto;
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
  background: radial-gradient(ellipse at 68% 32%, #312216, transparent 70%), var(--ink);
}
.slide {
  width: min(100%, 1440px);
  min-width: 0;
  margin: auto;
  padding: clamp(1.6rem, 5vw, 5rem) clamp(1.1rem, 5.5vw, 5.5rem);
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.4rem, 5vw, 5rem);
}
.kicker {
  color: var(--gold);
  font-size: clamp(.72rem, 1.2vw, .92rem);
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.copy > p:not(.kicker, .lead) {
  color: var(--muted);
  font-size: clamp(1.02rem, 1.72vw, 1.4rem);
  max-width: 48ch;
  text-wrap: pretty;
}
.lead {
  color: var(--paper);
  max-width: 39ch;
  font-size: clamp(1.13rem, 2.2vw, 1.65rem);
  line-height: 1.35;
  text-wrap: pretty;
}
.primary {
  background: var(--gold);
  border-color: transparent;
  color: #20160f;
  font-weight: 750;
  padding-inline: 1.05rem;
}
.primary:hover:enabled { background: #ffdb9c; }
.primary span { margin-left: .4rem; }
.active:not(.cover) :where(.copy, .photo, .quiz, .credits > *) {
  animation: frame-in 540ms cubic-bezier(.22,.7,.36,1) both;
}
.active :where(.photo, .quiz) { animation-delay: 105ms !important; }
@keyframes frame-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.cover {
  display: grid;
  place-items: center;
  isolation: isolate;
  position: relative;
  width: 100%;
  min-height: 100%;
  padding-block: clamp(1.25rem, 3vh, 3rem);
  overflow: hidden;
  background: #21150e;
}
.cover-image, .cover-image::after, .cover-image img { position: absolute; inset: 0; }
.cover-image {
  margin: 0;
  z-index: -2;
  overflow: hidden;
  animation: iris-open 1.55s cubic-bezier(.68,.02,.22,1) both;
}
.cover-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 51%;
  filter: sepia(.24) contrast(1.08) brightness(1.15);
  animation: pull-focus 2.15s cubic-bezier(.12,.62,.27,1) both;
}
.cover-image::after {
  content: "";
  background: linear-gradient(90deg, #140e0b 3%, #1b120ef4 29%, #21160eaa 57%, #24160c14 100%),
    linear-gradient(0deg, #120e0bcb, transparent 41%);
}
.opening-light {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: 0;
  background: linear-gradient(112deg, transparent 24%, #e17f434d 42%, #ffd29b6b 48%, transparent 58%);
  mix-blend-mode: screen;
  opacity: 0;
  animation: opening-sweep 1.7s .19s both;
}
.cover-grid {
  width: min(100%, 1260px);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 1.2rem;
}
.cover h1 {
  font-size: clamp(4rem, min(10vw, 18vh), 10rem);
  line-height: .91;
  margin-bottom: clamp(1rem, 3vw, 2rem);
}
.cover h1 em { display: block; color: var(--gold); font-weight: inherit; }
.cover-copy { animation: frame-in 850ms 390ms both; }
.start { display: inline-flex; gap: .65rem; align-items: center; }
.start .aperture-icon {
  width: 18px;
  height: 18px;
  margin: 0;
  display: inline-block;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: repeating-conic-gradient(from 25deg, #3e2818 0 2deg, transparent 3deg 60deg);
  transition: transform 450ms ease;
}
.start:hover .aperture-icon { transform: rotate(60deg); }
.byline {
  display: grid;
  width: fit-content;
  border-left: 2px solid var(--gold);
  padding-left: .85rem;
  margin: 1.45rem 0 1.6rem;
  color: var(--muted);
  font-size: .92rem;
}
.byline strong { color: var(--paper); font-size: 1.2rem; }
.cover-focus {
  width: 83%;
  justify-self: center;
  aspect-ratio: 1.22;
  position: relative;
  animation: find-focus 1.55s .12s both;
}
.focus-corner {
  position: absolute;
  width: 18%;
  height: 20%;
  border: solid #ffdfaaab;
  border-width: 1px 0 0 1px;
}
.focus-corner:nth-child(2) { right: 0; transform: scaleX(-1); }
.focus-corner:nth-child(3) { bottom: 0; transform: scaleY(-1); }
.focus-corner:nth-child(4) { right: 0; bottom: 0; transform: scale(-1); }
.focus-cross { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); color: #ffdfaa9c; }
.focus-caption {
  position: absolute;
  right: 0;
  bottom: -2.35em;
  color: var(--paper);
  text-shadow: 0 1px 6px #000;
  font: .73rem/1.4 ui-monospace, monospace;
}
@keyframes pull-focus {
  from { transform: scale(1.19); filter: sepia(.55) contrast(1.18) brightness(.66) blur(8px); }
  to { transform: scale(1); }
}
@keyframes iris-open {
  0% { clip-path: circle(0 at 68% 47%); }
  31% { clip-path: circle(12vmin at 68% 47%); }
  100% { clip-path: circle(150vmax at 68% 47%); }
}
@keyframes opening-sweep {
  0% { transform: translateX(-58%); opacity: 0; }
  40% { opacity: .8; }
  100% { transform: translateX(58%); opacity: 0; }
}
@keyframes find-focus {
  0%, 19% { transform: scale(1.22) translateX(4%); opacity: 0; }
  43% { transform: scale(.88) translateX(-2%); opacity: .86; }
  64% { transform: scale(1.03); }
  100% { transform: none; opacity: 1; }
}

.photo { margin: 0; }
.photo-frame {
  position: relative;
  overflow: hidden;
  padding: .55rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: #15100c;
  box-shadow: 0 22px 65px #0e0805a8;
}
.photo-frame img { display: block; width: 100%; max-height: 50vh; object-fit: contain; }
.photo figcaption, .hint {
  color: var(--muted);
  font-size: .85rem;
  line-height: 1.4;
}
.photo figcaption { margin-top: .75rem; }
.develop-mask, .develop-scan {
  position: absolute;
  inset: .55rem;
  pointer-events: none;
}
.develop-mask {
  background: radial-gradient(ellipse at 38% 30%, #6c2a1ac9, #24100dee 77%);
  backdrop-filter: brightness(.32) contrast(.72);
  clip-path: inset(0);
}
.develop-scan {
  background: linear-gradient(90deg, transparent 35%, #f8a06518 44%, #ffb67770 47%, #ffe1a6d9 49.7%, #9b422640 51%, transparent 54%);
  mix-blend-mode: screen;
  opacity: 0;
}
.develop.revealed .develop-mask {
  clip-path: inset(0 0 0 100%);
  animation: expose-photo 1.65s both;
}
.develop.revealed .develop-scan { animation: scan-photo 1.65s both; }
@keyframes expose-photo {
  from { clip-path: inset(0 0 0 0); }
  to { clip-path: inset(0 0 0 100%); }
}
@keyframes scan-photo {
  0% { transform: translateX(-50%); opacity: 0; }
  10%, 90% { opacity: 1; }
  100% { transform: translateX(50%); opacity: 0; }
}
.develop-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .85rem; margin-top: .9rem; }
.loupe-scene {
  --x: 48%;
  --y: 52%;
  --lens: clamp(32px, 8vw, 75px);
  position: relative;
  overflow: hidden;
}
.loupe-scene:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.loupe.zoomed .loupe-scene { cursor: crosshair; touch-action: none; }
.loupe-detail, .loupe-rim { position: absolute; pointer-events: none; visibility: hidden; }
.loupe.zoomed :is(.loupe-detail, .loupe-rim) { visibility: visible; }
.loupe-detail {
  inset: 0;
  clip-path: circle(var(--lens) at var(--x) var(--y));
}
.loupe-detail img {
  height: 100%;
  transform: scale(2.15);
  transform-origin: var(--x) var(--y);
}
.loupe-rim {
  top: var(--y);
  left: var(--x);
  width: calc(2 * var(--lens));
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 3px #201308b9, inset 0 0 14px #2310069c, 1px 5px 14px #100703c4;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: clamp(1.15rem, 3.5vh, 2.1rem) 0 0;
  padding: 0;
  list-style: none;
}
.timeline-intro { max-width: 54ch; }
.timeline li {
  padding: 1.75rem clamp(.8rem, 2vw, 1.5rem);
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: repeating-linear-gradient(90deg, #c38d5878 0 9px, transparent 9px 22px) 7px 5px / calc(100% - 14px) 4px no-repeat,
    repeating-linear-gradient(90deg, #c38d5878 0 9px, transparent 9px 22px) 7px calc(100% - 5px) / calc(100% - 14px) 4px no-repeat,
    linear-gradient(160deg, #38291d, #211915);
}
.active .timeline li { animation: advance-frame .72s cubic-bezier(.13,.74,.34,1) both; }
.active .timeline li:nth-child(2) { animation-delay: 110ms; }
.active .timeline li:nth-child(3) { animation-delay: 220ms; }
.active .timeline li:nth-child(4) { animation-delay: 330ms; }
@keyframes advance-frame {
  from { opacity: 0; transform: translateX(32px) skewX(-5deg); }
  to { opacity: 1; transform: none; }
}
.era { color: var(--gold); font-family: ui-monospace, monospace; font-size: .8rem; }
.timeline h3 { margin: .45rem 0; font: 400 clamp(1.4rem, 2.7vw, 2.1rem)/1.1 var(--serif); }
.timeline p {
  color: var(--muted);
  font-size: clamp(1rem, 1.48vw, 1.25rem);
  margin: 0;
  text-wrap: pretty;
}
.quiz-slide {
  max-width: 1240px;
  padding-block: clamp(1.15rem, 3.8vh, 3rem);
}
.quiz-slide h2 { font-size: clamp(2.7rem, 5vw, 4.65rem); }
.quiz {
  --quiz-padding: clamp(1.15rem, 4vw, 3.4rem);
  --quiz-accent: var(--gold);
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  min-height: min(390px, 56dvh);
  padding: clamp(1.35rem, 3.5vh, 3rem) var(--quiz-padding) 6rem;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: radial-gradient(ellipse at 86% 16%, #563b25, #281d16 65%);
  box-shadow: 0 24px 70px #100905a6;
}
.quiz[data-state="answer"] {
  --quiz-accent: #d7edbc;
  border-color: #70805c;
  background: radial-gradient(ellipse at 86% 16%, #3a4b30, #242c1e 72%);
}
.quiz-question {
  max-width: 30ch;
  font: 400 clamp(1.85rem, 4.2vw, 4.2rem)/1.06 var(--serif);
  text-wrap: balance;
  letter-spacing: -.025em;
  margin-bottom: 0;
}
.quiz[data-state="answer"] .quiz-question {
  color: #ebdcc7;
  font: 650 clamp(.96rem, 1.7vw, 1.4rem)/1.3 system-ui, sans-serif;
  max-width: 50ch;
  letter-spacing: normal;
}
.quiz-answer {
  max-width: 45ch;
  margin: .65em 0 0;
  color: var(--quiz-accent);
  font: 400 clamp(1.65rem, 3.5vw, 3.2rem)/1.12 var(--serif);
  text-wrap: pretty;
}
.quiz-touch {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem;
  border: 0;
  border-radius: inherit;
  padding: 1.05rem var(--quiz-padding);
  background: transparent;
  color: var(--quiz-accent);
  font-size: clamp(.95rem, 2.2vw, 1.5rem);
  font-weight: 750;
  text-align: left;
  touch-action: manipulation;
}
.quiz-touch:hover:enabled { background: #e9cfa10a; }
.quiz-touch:focus-visible { outline-offset: -5px; }
.quiz-touch::before {
  content: "";
  position: absolute;
  inset: auto var(--quiz-padding) 4.35rem;
  height: 1px;
  background: color-mix(in srgb, var(--quiz-accent) 35%, transparent);
}
.quiz-touch #quiz-action { align-self: flex-end; margin-bottom: .35rem; }
.quiz-arrow {
  display: grid;
  place-items: center;
  flex: 0 0 2.65rem;
  min-height: 2.65rem;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.credits { max-width: 1000px; }
.credits .lead { margin-bottom: .85rem; }
.closing-message {
  max-width: 49ch;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  text-wrap: pretty;
}
.closing-name { font: 400 clamp(1.35rem, 3vw, 2rem)/1.2 var(--serif); color: var(--gold); }
.closing-name span { font: .95rem system-ui, sans-serif; color: var(--muted); }

@media (max-width: 760px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .timeline li { padding: 1.05rem .85rem; }
  .cover-grid { grid-template-columns: minmax(0, 1fr); }
  .cover-focus { display: none; }
  .cover h1 { font-size: clamp(3.55rem, 13vw, 6.15rem); }
  .cover-image::after {
    background: linear-gradient(90deg, #160e0aee, #1d130d9e 75%, #23170d75),
      linear-gradient(0deg, #150f0cc9, transparent 85%);
  }
  .photo-frame img { max-height: 35vh; }
  .top, .bottom { padding-inline: .75rem; gap: .35rem; }
  .screen span { display: none; }
  .top-controls { gap: .35rem; }
  .bottom > button { min-width: auto; font-size: .87rem; padding-inline: .52rem; }
  .brand { font-size: .64rem; letter-spacing: .07em; gap: .4rem; }
}
@media (max-width: 360px) {
  .dot { width: 16px; }
  .bottom > button span { display: none; }
}
@media (max-height: 640px) and (min-width: 761px) {
  .slide { padding-block: 1.5rem; }
  h2 { font-size: clamp(2.5rem, 4.45vw, 4.6rem); }
  .cover h1 { font-size: clamp(4rem, 8vw, 6.8rem); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  :root { color-scheme: light; --paper: #17100c; --muted: #4d3e32; --gold: #683d1f; }
  .app, .stage { display: block; height: auto; overflow: visible; background: #fff; }
  .top, .bottom, button, .cover-image, .cover-focus, .opening-light, .develop-mask,
  .develop-scan, .shutter, .loupe-detail, .loupe-rim { display: none !important; }
  .slide, .slide[hidden] { display: block !important; break-after: page; animation: none; }
  .slide:last-child { break-after: auto; }
  .cover, .quiz, .timeline li, .photo-frame { background: #fff; box-shadow: none; }
}
