:root {
  --ink: #1d1b17;
  --ink-soft: #5d574c;
  --paper: #efe8da;
  --card: #f7f2e7;
  --tape: rgba(232, 222, 196, 0.82);
  --deep: #10283a;
  --blue: #2453c9;
  --red: #d8343c;
  --line: #c3d1e4;
  --sans: "Work Sans", system-ui, sans-serif;
  --mono: "Sometype Mono", ui-monospace, monospace;
  --hand: "Nothing You Could Do", "Bradley Hand", cursive;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.45 0 0 0 0 0.38 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #0d0c0a;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }

.mono { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; }
.hand { font-family: var(--hand); }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------ scene layers */

#gl, #fallback {
  position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh;
  touch-action: none; cursor: grab;
}
body.dragging #gl { cursor: grabbing; }
.hs { touch-action: none; }
#fallback { width: auto; height: auto; max-width: none; transform-origin: 0 0; }
.hotspots, .lift { position: fixed; inset: 0; pointer-events: none; }
.hotspots { z-index: 5; transition: opacity 0.5s; }
.hotspots.hide { opacity: 0; }
.lift { z-index: 25; }
.lift img {
  position: absolute; left: 0; top: 0; transform-origin: 50% 0;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.35));
  transition: transform 0.9s var(--ease), opacity 0.45s;
}

/* hotspot: soft white dot with a breathing ring */
.hs {
  position: absolute; left: 0; top: 0; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border: 0; padding: 0; background: none; pointer-events: auto; border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.hs .dot {
  position: absolute; inset: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: inset 0.35s var(--ease); display: grid; place-items: center; color: var(--ink);
}
.hs .ring {
  position: absolute; inset: 12px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.9);
  animation: breathe 2.6s ease-in-out infinite;
}
.hs .ring.b { animation: ping 2.6s ease-out infinite; }
@media (hover: hover) { .hs:hover .dot { inset: 18px; } .hs:hover .label { opacity: 1; transform: translate(-50%, 0) rotate(-2deg); } }
.hs:focus-visible .dot { inset: 18px; }
.hs:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.hs .dot svg { width: 14px; height: 14px; opacity: 0; transition: opacity 0.3s; stroke-width: 2.2; }
.hs.done .dot { inset: 19px; }
.hs.done .dot svg { opacity: 1; }
.hs.done .ring { animation: none; opacity: 0.45; inset: 15px; }
.hs.done .ring.b { display: none; }
.hs .label {
  position: absolute; left: 50%; top: calc(100% - 6px); white-space: nowrap;
  transform: translate(-50%, 4px) rotate(-2deg); opacity: 0;
  background: var(--card); color: var(--ink); padding: 6px 9px 5px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25); transition: opacity 0.25s, transform 0.25s var(--ease);
  pointer-events: none;
}
.hs:focus-visible .label { opacity: 1; transform: translate(-50%, 0) rotate(-2deg); }
@keyframes breathe { 0%, 100% { transform: scale(0.82); opacity: 0.9; } 50% { transform: scale(1.08); opacity: 0.55; } }
@keyframes ping { 0% { transform: scale(0.7); opacity: 0.7; } 80%, 100% { transform: scale(1.7); opacity: 0; } }

/* ------------------------------------------------------------ HUD */

.hud {
  position: fixed; z-index: 35; left: 0; right: 0; top: 0;
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 16px 0;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.tag, .sq, .rect-btn {
  border: 0; background: var(--card); color: var(--ink);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.tag { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; transform: rotate(-1.5deg); font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; }
.tag:hover { transform: rotate(0deg) translateY(-1px); }
.counter.bump { animation: bump 0.6s var(--ease); }
@keyframes bump { 40% { transform: rotate(-4deg) scale(1.15); } }
.sq { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; transform: rotate(2deg); }
.sq:hover { transform: rotate(0deg) translateY(-1px); }
.scene-title {
  position: absolute; left: 50%; top: max(20px, calc(env(safe-area-inset-top) + 4px)); transform: translateX(-50%);
  text-align: center; color: #fff; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45); pointer-events: none;
}
.scene-title .mono { display: block; font-size: 10px; opacity: 0.9; }
.scene-title b { font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 15px; }

.rect-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 13px 20px;
  font-size: 14px; font-weight: 500; letter-spacing: 0.01em;
}
.rect-btn:hover { transform: translateY(-2px) rotate(-1deg); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28); }
.rect-btn.light { background: #fff; }
.rect-btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.change {
  position: fixed; z-index: 20; left: 50%; bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
}
.change:hover { transform: translateX(-50%) translateY(-2px); }
.sound { position: fixed; z-index: 35; right: 16px; bottom: max(18px, env(safe-area-inset-bottom)); }
.sound .off, .sound.muted .on { display: none; }
.sound.muted .off { display: block; }

/* paper card */
.card {
  background: var(--card); color: var(--ink);
  background-image: var(--noise); background-blend-mode: multiply;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}
.hint, .toast {
  position: fixed; z-index: 22; left: 50%; bottom: calc(max(18px, env(safe-area-inset-bottom)) + 64px);
  width: min(340px, calc(100vw - 32px)); padding: 18px 20px 18px 18px;
  display: grid; grid-template-columns: 48px 1fr; gap: 14px; align-items: center;
  transform: translateX(-50%) rotate(-1.2deg);
  animation: cardIn 0.6s var(--ease) both;
}
.toast { grid-template-columns: 48px 1fr; transform: translateX(-50%) rotate(1deg); }
.hint .badge, .toast .badge {
  width: 48px; height: 48px; border-radius: 50%; background: #fff; display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.hint p, .toast p { margin: 0; font-size: 14px; line-height: 1.4; }
.hint em, .toast em { font-style: normal; color: var(--blue); }
.toast .actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: center; }
.toast .rect-btn { padding: 9px 14px; font-size: 13px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
@keyframes cardIn { from { opacity: 0; transform: translateX(-50%) translateY(18px) rotate(-4deg); } }
.card.leaving { animation: cardOut 0.35s ease-in both; }
@keyframes cardOut { to { opacity: 0; transform: translateX(-50%) translateY(14px) rotate(2deg); } }

/* ------------------------------------------------------------ screens */

.screen { position: fixed; inset: 0; z-index: 30; overflow: auto; }
.paper {
  background-color: var(--paper);
  background-image: var(--noise), radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(80, 60, 30, 0.22));
  background-blend-mode: multiply, normal;
}

/* intro */
.intro {
  background: var(--deep); color: #f4eee2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 90px 20px 40px; gap: 34px; text-align: center;
}
.sound-note {
  position: absolute; top: max(28px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; margin: 0; text-align: left; font-size: 10.5px; line-height: 1.35; opacity: 0.85; white-space: nowrap;
}
.sound-note .ic { width: 22px; height: 22px; }
.title-grid {
  display: grid; grid-template-columns: auto auto; justify-content: space-between; row-gap: 0.32em;
  width: min(520px, 86vw); font-weight: 700; text-transform: uppercase;
  font-size: clamp(30px, 7vw, 50px); letter-spacing: 0.06em; line-height: 1.12; text-align: left;
}
.title-grid .small { font-size: clamp(13px, 2.4vw, 17px); letter-spacing: 0.2em; align-self: end; margin-bottom: 0.4em; }
.title-grid .r { text-align: right; }
.w, .intro-sub, .intro .rect-btn { opacity: 0; animation: wordIn 0.9s var(--ease) forwards; animation-delay: calc(var(--d) * 0.16s + 0.2s); }
@keyframes wordIn { from { opacity: 0; transform: translateY(10px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.intro-sub { margin: 0; font-size: 14px; line-height: 1.5; opacity: 0.85; max-width: 320px; }
.intro .rect-btn { color: var(--ink); }

/* chapter select */
.chapters { display: flex; flex-direction: column; padding: max(24px, env(safe-area-inset-top)) 0 32px; }
.ch-header { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 64px 20px 8px; text-align: center; }
.ch-header .hand { font-size: 24px; color: var(--ink-soft); transform: rotate(-2deg); }
.ch-list {
  scrollbar-width: none;
  flex: 1; display: flex; align-items: center; justify-content: center; gap: clamp(24px, 4vw, 64px);
  padding: 24px clamp(16px, 4vw, 56px) 40px;
}
.ch { display: flex; flex-direction: column; align-items: center; gap: 18px; width: min(var(--w, 360px), 32vw); text-align: center; }
.ch-label .mono { display: block; margin-bottom: 4px; color: var(--ink-soft); }
.ch-label h2 { margin: 0; font-size: 26px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.print {
  position: relative; margin: 0; background: #fbf8f1; padding: 12px 12px 14px;
  box-shadow: 0 18px 40px rgba(60, 40, 10, 0.28), 0 2px 4px rgba(0, 0, 0, 0.12);
  transform: rotate(var(--r, -2deg)); transition: transform 0.45s var(--ease), box-shadow 0.45s;
  cursor: pointer; width: 100%;
}
.print img { width: 100%; aspect-ratio: var(--ar, 4 / 5); object-fit: cover; }
.ch:hover .print { transform: rotate(0deg) translateY(-6px) scale(1.02); box-shadow: 0 28px 50px rgba(60, 40, 10, 0.32); }
.print .tape { top: -12px; left: 50%; margin-left: -48px; }
.ch-progress { margin: 0; color: var(--ink-soft); }
.ch.soon .print { cursor: default; background: transparent; box-shadow: none; border: 1.5px dashed rgba(29, 27, 23, 0.35); }
.ch.soon .print .blank { aspect-ratio: 4 / 5; display: grid; place-items: center; font-family: var(--hand); font-size: 22px; color: var(--ink-soft); padding: 20px; transform: rotate(-3deg); }
.ch.soon:hover .print { transform: rotate(var(--r)); box-shadow: none; }
.ch.soon .ch-label { opacity: 0.55; }

.tape {
  position: absolute; width: 96px; height: 26px; background: var(--tape);
  background-image: var(--noise); background-blend-mode: multiply;
  clip-path: polygon(2% 8%, 8% 0, 16% 10%, 24% 2%, 33% 9%, 44% 1%, 55% 8%, 66% 0, 76% 9%, 86% 2%, 94% 10%, 100% 4%, 98% 92%, 90% 100%, 81% 90%, 70% 99%, 60% 91%, 49% 100%, 38% 92%, 27% 100%, 17% 91%, 7% 99%, 0 90%);
  transform: rotate(var(--tr, -3deg)); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); z-index: 2;
}

/* ------------------------------------------------------------ project viewer */

.overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; overflow: auto; }
.ov-backdrop {
  position: fixed; inset: 0; background: rgba(14, 12, 9, 0.55);
  backdrop-filter: blur(10px) saturate(0.9); -webkit-backdrop-filter: blur(10px) saturate(0.9);
  animation: fadeIn 0.6s ease both;
}
.overlay.closing .ov-backdrop { animation: fadeOut 0.45s ease both; }
.overlay.closing .ov-body { animation: bodyOut 0.4s ease-in both; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes bodyOut { to { opacity: 0; transform: translateY(20px) scale(0.98); } }
.ov-close { position: fixed; z-index: 3; top: max(16px, env(safe-area-inset-top)); right: 16px; }
.ov-body {
  position: relative; z-index: 2; width: min(1180px, 100%); padding: 72px clamp(16px, 4vw, 48px) 48px;
  display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: clamp(24px, 4vw, 56px); align-items: center;
  animation: bodyIn 0.8s var(--ease) both 0.1s;
}
.ov-body.photo { grid-template-columns: minmax(0, 1fr) 330px; }
@keyframes bodyIn { from { opacity: 0; transform: translateY(28px) scale(0.97); } }

/* viewfinder */
.vf { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5); }
.vf-screen { position: absolute; inset: 0; overflow: hidden; }
.vf-screen > img, .vf-screen > video { display: block; width: 100%; height: 100%; object-fit: cover; }
.vf-screen > img { animation: swapIn 0.6s ease both, kenburns 16s ease-in-out infinite alternate; }
.vf-screen > img.photo { object-fit: contain; animation: swapIn 0.6s ease both; }
.vf-screen > video { background: #000; animation: swapIn 0.6s ease both; cursor: pointer; }
.media { min-width: 0; }
.media.square { width: min(100%, calc(100vh - 250px)); width: min(100%, calc(100dvh - 250px)); margin: 0 auto; }
.vf.is-photo .rec, .vf.is-photo .x { visibility: hidden; }
.vf-ui .bar { left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, 0.18); }
.vf-ui .bar i { display: block; height: 100%; width: 0; background: var(--red); }
.vf:not(.is-video) .bar { display: none; }
.vf-ui .state { top: 50%; left: 50%; transform: translate(-50%, 22px); display: none; }
.vf.paused .state { display: block; }
.vf.paused .rec::before { animation: none; opacity: 0.35; }
.vf-sound {
  position: absolute; z-index: 2; left: 50%; bottom: 44px; transform: translateX(-50%);
  border: 0; background: rgba(0, 0, 0, 0.55); color: #fff; padding: 8px 12px; white-space: nowrap;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
@keyframes kenburns { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.18) translate(-2.5%, -1.5%); } }
@keyframes swapIn { from { opacity: 0; } }
.vf-ui { position: absolute; inset: 0; color: #fff; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); pointer-events: none; }
.vf-ui > span { position: absolute; }
.vf-ui .rec { top: 18px; left: 22px; display: flex; align-items: center; gap: 8px; }
.vf-ui .rec::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.vf-ui .tr { top: 18px; right: 22px; }
.vf-ui .tc { bottom: 18px; left: 22px; font-size: 13px; }
.vf-ui .brr { bottom: 18px; right: 22px; }
.vf-ui .ph { bottom: 18px; left: 50%; transform: translateX(-50%); opacity: 0.75; font-size: 10px; }
.vf-ui .c { width: 26px; height: 26px; border: 0 solid rgba(255, 255, 255, 0.85); }
.vf-ui .c1 { top: 44px; left: 44px; border-width: 1.5px 0 0 1.5px; }
.vf-ui .c2 { top: 44px; right: 44px; border-width: 1.5px 1.5px 0 0; }
.vf-ui .c3 { bottom: 44px; left: 44px; border-width: 0 0 1.5px 1.5px; }
.vf-ui .c4 { bottom: 44px; right: 44px; border-width: 0 1.5px 1.5px 0; }
.vf-ui .x { top: 50%; left: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.vf-ui .x::before, .vf-ui .x::after { content: ""; position: absolute; background: rgba(255, 255, 255, 0.7); }
.vf-ui .x::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.vf-ui .x::after { top: 50%; left: 0; right: 0; height: 1px; }
.stills { display: flex; gap: 16px; margin-top: 22px; flex-wrap: wrap; }
.still {
  position: relative; border: 0; padding: 7px 7px 9px; background: #fbf8f1; width: 116px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3); transform: rotate(var(--r)); transition: transform 0.3s var(--ease);
}
.still img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.still:hover, .still.on { transform: rotate(0deg) translateY(-4px); }
.stills.many { flex-wrap: nowrap; overflow-x: auto; padding: 8px 6px 16px; margin-top: 14px; scrollbar-width: thin; }
.stills.many .still { flex: none; width: 92px; }
.stills.many .still img { aspect-ratio: 1; }
.still .len {
  position: absolute; left: 7px; right: 7px; bottom: 9px; padding: 3px 5px; background: rgba(0, 0, 0, 0.62); color: #fff;
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; text-align: left;
}
.still.on::after { content: ""; position: absolute; left: 50%; bottom: -10px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #fff; }

/* polaroid stack */
.stack-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.stack { position: relative; width: min(360px, 74vw); aspect-ratio: 0.82; cursor: pointer; }
.pol {
  position: absolute; inset: 0; margin: 0; background: #fbf8f1; padding: 14px 14px 0;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  transform: rotate(var(--r)) translate(var(--x, 0), var(--y, 0));
  transition: transform 0.55s var(--ease), opacity 0.4s;
}
.pol img { width: 100%; aspect-ratio: 4 / 4.2; object-fit: cover; background: #ddd; }
.pol figcaption { font-family: var(--hand); font-size: 21px; padding: 10px 4px 0; color: #2b2a26; }
.pol.out { transform: rotate(14deg) translate(115%, -8%); }
.stack-hint { color: rgba(255, 255, 255, 0.85); margin: 0; }

/* credits card */
.credits { position: relative; padding: 34px 28px 26px; transform: rotate(1.6deg); }
.credits .tape { top: -13px; left: 50%; margin-left: -48px; }
.credits .kicker { color: var(--ink-soft); margin: 0 0 8px; }
.credits h2 { font-family: var(--hand); font-weight: 400; font-size: 38px; line-height: 1.05; margin: 0 0 18px; transform: rotate(-1.5deg); }
.credits .sub { margin: -10px 0 16px; color: var(--ink-soft); }
.credits .quote { margin: 0 0 20px; font-family: var(--hand); font-size: 23px; line-height: 1.2; color: var(--blue); transform: rotate(-1deg); }
.credits .quote cite { display: block; margin-top: 6px; font-family: var(--mono); font-style: normal; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.credits .link { padding: 10px 14px; font-size: 13px; text-decoration: none; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.credits dl { display: grid; grid-template-columns: 96px 1fr; gap: 9px 12px; margin: 0 0 18px; font-size: 13.5px; }
.credits dt { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); padding-top: 3px; }
.credits dd { margin: 0; }
.credits p.blurb { margin: 0 0 20px; font-size: 14.5px; line-height: 1.55; }
.stamp {
  display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red); border: 1.5px solid currentColor; padding: 4px 7px; transform: rotate(-3deg); opacity: 0.8;
}

/* ------------------------------------------------------------ shot list */

.shotlist { position: fixed; inset: 0; z-index: 45; }
.sl-backdrop { position: absolute; inset: 0; background: rgba(14, 12, 9, 0.45); animation: fadeIn 0.4s ease both; }
.sl-sheet {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); overflow: auto;
  background-color: #fbf8f0;
  background-image: var(--noise), linear-gradient(90deg, transparent 52px, rgba(216, 52, 60, 0.35) 52px, rgba(216, 52, 60, 0.35) 53.5px, transparent 53.5px),
    repeating-linear-gradient(180deg, transparent 0 33px, var(--line) 33px 34px);
  background-blend-mode: multiply, normal, normal;
  background-position: 0 0, 0 0, 0 14px;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.35);
  padding: 34px 26px 40px 68px;
  animation: sheetIn 0.55s var(--ease) both;
}
.shotlist.closing .sl-sheet { animation: sheetOut 0.35s ease-in both; }
.shotlist.closing .sl-backdrop { animation: fadeOut 0.35s ease both; }
@keyframes sheetIn { from { transform: translateX(100%); } }
@keyframes sheetOut { to { transform: translateX(100%); } }
.sl-close { position: absolute; top: 18px; right: 18px; }
.sl-head h2 { font-family: var(--hand); font-weight: 400; font-size: 46px; margin: 0; line-height: 1.1; transform: rotate(-2deg); }
.sl-head p { margin: 6px 0 22px; }
.sl-head .bar { height: 3px; background: rgba(29, 27, 23, 0.12); margin: 10px 0 0; }
.sl-head .bar i { display: block; height: 100%; background: var(--ink); transition: width 0.6s var(--ease); }
.sl-chapter { margin: 26px 0 6px; color: var(--ink-soft); }
.sl-item {
  display: grid; grid-template-columns: 28px 1fr 54px; gap: 10px; align-items: center; width: 100%;
  min-height: 68px; padding: 6px 0; border: 0; background: none; text-align: left;
}
.sl-item .n { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); }
.sl-item .t { font-family: var(--hand); font-size: 25px; line-height: 1.1; position: relative; }
.sl-item .t small { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); margin-top: 4px; }
.sl-item.found .t::after {
  content: ""; position: absolute; left: -4px; right: 30%; top: 0.62em; height: 2px; background: var(--blue);
  transform: rotate(-1.5deg); opacity: 0.0;
}
.sl-item .thumb { width: 54px; padding: 4px 4px 7px; background: #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); transform: rotate(4deg); }
.sl-item .thumb img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.sl-item.missing { cursor: default; }
.sl-item.missing .t { color: rgba(29, 27, 23, 0.32); font-size: 20px; }
.sl-item.missing .thumb { box-shadow: none; background: transparent; border: 1.5px dashed rgba(29, 27, 23, 0.25); height: 54px; }
.sl-item.found:hover .t { color: var(--blue); }
.sl-foot { margin-top: 28px; display: flex; gap: 10px; flex-wrap: wrap; }
.sl-foot .rect-btn { padding: 10px 14px; font-size: 13px; }

/* end card */
.end-card { width: min(520px, calc(100vw - 32px)); padding: 44px 34px 34px; text-align: center; position: relative; transform: rotate(-1deg); }
.end-card .tape { top: -13px; left: 50%; margin-left: -48px; }
.end-card h2 { font-family: var(--hand); font-weight: 400; font-size: 44px; margin: 6px 0 12px; }
.end-card p { margin: 0 auto 24px; max-width: 360px; }
.end-card .row { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ------------------------------------------------------------ transitions */

.wipe {
  position: fixed; inset: -10vh -10vw; z-index: 60; pointer-events: none;
  background-color: var(--paper); background-image: var(--noise); background-blend-mode: multiply;
  transform: translateY(110%) rotate(-3deg);
}
.wipe.in { transition: transform 0.7s cubic-bezier(0.7, 0, 0.3, 1); transform: translateY(0) rotate(0deg); }
.wipe.out { transition: transform 0.8s cubic-bezier(0.7, 0, 0.3, 1); transform: translateY(-115%) rotate(3deg); }

.grain {
  position: fixed; inset: -50%; z-index: 70; pointer-events: none; opacity: 0.09;
  background-image: var(--noise); animation: grain 0.9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* ------------------------------------------------------------ small screens */

@media (max-width: 820px) {
  .ch-list { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; padding: 24px 15vw 40px; gap: 28px; align-items: flex-start; }
  .ch { width: 70vw; flex: none; scroll-snap-align: center; }
  .ov-body, .ov-body.photo { grid-template-columns: minmax(0, 1fr); padding-top: 76px; align-items: start; }
  .credits { transform: rotate(0.8deg); }
  .vf-ui .c1 { top: 30px; left: 22px; } .vf-ui .c2 { top: 30px; right: 22px; }
  .vf-ui .c3 { bottom: 30px; left: 22px; } .vf-ui .c4 { bottom: 30px; right: 22px; }
  .vf-ui .rec, .vf-ui .tr { top: 10px; } .vf-ui .tc, .vf-ui .brr, .vf-ui .ph { bottom: 10px; }
  .vf-ui .rec, .vf-ui .tc { left: 12px; } .vf-ui .tr, .vf-ui .brr { right: 12px; }
  .vf-ui .ph { display: none; }
  .media.square { width: 100%; }
  .vf-sound { bottom: 30px; }
  .stills { gap: 12px; flex-wrap: nowrap; }
  .still { width: calc(25% - 9px); padding: 5px 5px 7px; }
  .scene-title { top: max(74px, calc(env(safe-area-inset-top) + 58px)); }
  .sl-sheet { top: auto; height: 88vh; width: 100vw; border-radius: 0; padding-left: 60px; animation-name: sheetUp; }
  .shotlist.closing .sl-sheet { animation-name: sheetDown; }
  .sl-sheet { background-image: var(--noise), linear-gradient(90deg, transparent 44px, rgba(216, 52, 60, 0.35) 44px, rgba(216, 52, 60, 0.35) 45.5px, transparent 45.5px), repeating-linear-gradient(180deg, transparent 0 33px, var(--line) 33px 34px); }
  @keyframes sheetUp { from { transform: translateY(100%); } }
  @keyframes sheetDown { to { transform: translateY(100%); } }
}

@media (prefers-reduced-motion: reduce) {
  .hs .ring, .hs .ring.b, .grain, .vf-screen img { animation: none !important; }
  .w, .intro-sub, .intro .rect-btn { animation-duration: 0.01s; animation-delay: 0s; }
}

.ch-list::-webkit-scrollbar { display: none; }
