:root {
  --ink: #211e1c;
  --ink-soft: #514a45;
  --paper: #f3eee4;
  --paper-deep: #e8dece;
  --red: #96372f;
  --red-dark: #6f2824;
  --green: #627366;
  --gold: #c39a4c;
  --line: rgba(33, 30, 28, 0.2);
  --shadow: 0 22px 64px rgba(29, 22, 17, 0.2);
  --serif: Georgia, "Songti SC", "STSong", serif;
  --sans: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--ink);
  font-family: var(--sans);
}

body {
  min-width: 320px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.14;
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(255, 255, 255, 0.08) 4px),
    repeating-linear-gradient(90deg, transparent 0, transparent 5px, rgba(0, 0, 0, 0.06) 6px);
  mix-blend-mode: soft-light;
}

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: auto;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 420ms ease, transform 520ms cubic-bezier(0.22, 0.82, 0.28, 1), visibility 0s 520ms;
}

.scene.is-active {
  z-index: 10;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.scene.is-exiting {
  visibility: visible;
  opacity: 0;
  transform: translateY(-16px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--red);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.eyebrow.light {
  color: #f0c56e;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-width: 184px;
  min-height: 50px;
  padding: 0 16px 0 20px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  background: var(--red);
  border-color: var(--red);
}

.primary-button:active {
  transform: translateY(0);
}

.button-arrow {
  width: 25px;
  height: 25px;
  margin-left: 20px;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  line-height: 1;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 50%;
  background: rgba(32, 29, 27, 0.78);
  color: white;
  cursor: pointer;
}

.sound-toggle {
  position: fixed;
  z-index: 90;
  top: 22px;
  right: 24px;
  font-family: var(--serif);
  font-size: 21px;
  backdrop-filter: blur(8px);
}

.sound-toggle.is-playing span {
  display: inline-block;
  animation: soundPulse 1.4s ease-in-out infinite;
}

/* Password */
.lock-scene {
  display: grid;
  place-items: center;
  min-height: 100%;
  background: #1d1a18;
}

.lock-photo {
  position: absolute;
  inset: -4%;
  background: url("assets/photos/01.jpg") center 38% / cover no-repeat;
  filter: saturate(0.72) contrast(1.08);
  opacity: 0.28;
  transform: scale(1.05);
}

.lock-vignette {
  position: absolute;
  inset: 0;
  background: rgba(20, 17, 15, 0.58);
  box-shadow: inset 0 0 180px rgba(0, 0, 0, 0.7);
}

.lock-panel {
  position: relative;
  z-index: 2;
  width: min(430px, calc(100% - 36px));
  padding: 50px 44px 30px;
  border: 1px solid rgba(244, 239, 230, 0.38);
  border-top: 3px solid var(--red);
  border-radius: 3px;
  background: rgba(31, 28, 26, 0.9);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.45);
  color: var(--paper);
  backdrop-filter: blur(10px);
}

.lock-panel h1 {
  margin: 0 0 34px;
  font-family: var(--serif);
  font-size: clamp(30px, 7vw, 44px);
  font-weight: 500;
  letter-spacing: 0;
}

.archive-mark {
  position: absolute;
  top: 28px;
  right: 32px;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(195, 154, 76, 0.75);
  border-radius: 50%;
  color: #dbb76e;
  display: grid;
  place-content: center;
  text-align: center;
  transform: rotate(8deg);
}

.archive-mark span {
  font-size: 7px;
  letter-spacing: 1px;
}

.archive-mark strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
}

.pin-inputs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 11px;
  margin-bottom: 18px;
}

.pin {
  width: 100%;
  height: 70px;
  border: 1px solid rgba(244, 239, 230, 0.35);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--paper);
  caret-color: var(--gold);
  font-family: var(--serif);
  font-size: 32px;
  text-align: center;
}

.pin:focus {
  border-color: var(--gold);
  background: rgba(195, 154, 76, 0.1);
}

.password-form.is-wrong .pin {
  border-color: #cf5c50;
  animation: pinShake 320ms ease;
}

.unlock-button {
  width: 100%;
  border-color: var(--paper);
  background: var(--paper);
  color: var(--ink);
}

.unlock-button:hover {
  color: var(--paper);
}

.lock-error {
  height: 18px;
  margin: 10px 0 0;
  color: #e17a6f;
  font-size: 12px;
  text-align: center;
}

.serial-line {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid rgba(244, 239, 230, 0.18);
  color: rgba(244, 239, 230, 0.46);
  font-size: 8px;
  letter-spacing: 1.5px;
}

.shutter {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: var(--ink);
  clip-path: circle(0 at 50% 50%);
}

.shutter.is-closing {
  animation: shutterOpen 980ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

/* Portrait */
.portrait-scene {
  min-height: 100%;
  background: var(--red-dark);
}

.portrait-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 37%;
}

.portrait-shade {
  position: absolute;
  inset: 0;
  background: rgba(25, 19, 16, 0.22);
  box-shadow: inset 0 -260px 170px -90px rgba(22, 17, 15, 0.82);
}

.portrait-copy {
  position: absolute;
  z-index: 2;
  left: clamp(26px, 8vw, 118px);
  bottom: clamp(42px, 9vh, 90px);
  max-width: 560px;
  color: white;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.32);
}

.portrait-copy h2 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: clamp(54px, 8vw, 104px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

.identity-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 28px;
  font-size: 13px;
}

.identity-lines span {
  display: inline-flex;
  align-items: center;
}

.identity-lines span:not(:last-child)::after {
  content: "";
  width: 18px;
  height: 1px;
  margin: 0 10px;
  background: rgba(255, 255, 255, 0.65);
}

.light-button {
  border-color: white;
  background: white;
  color: var(--ink);
  text-shadow: none;
}

.light-button:hover {
  color: white;
}

.portrait-index {
  position: absolute;
  right: 26px;
  bottom: 20px;
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 2px;
}

/* Shared page header */
.scene-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto 38px;
  padding-top: 52px;
}

.scene-header.compact {
  margin-bottom: 30px;
}

.scene-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 4.5vw, 54px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0;
}

.progress-count {
  display: flex;
  align-items: baseline;
  color: var(--red);
  font-family: var(--serif);
}

.progress-count strong {
  font-size: 46px;
  font-weight: 500;
}

.progress-count span {
  font-size: 18px;
}

/* Memory archive */
.memory-scene {
  min-height: 100%;
  padding-bottom: 70px;
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(33, 30, 28, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(33, 30, 28, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

.memory-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.72fr);
  gap: 44px;
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
}

.timeline {
  position: relative;
  display: grid;
  gap: 10px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 12px;
  width: 1px;
  background: var(--red);
  opacity: 0.6;
}

.memory-slot {
  position: relative;
  display: grid;
  grid-template-columns: 34px 106px minmax(0, 1fr) 116px;
  align-items: center;
  min-height: 80px;
  padding: 8px 8px 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.memory-slot::before {
  content: "";
  position: relative;
  z-index: 2;
  width: 9px;
  height: 9px;
  margin-left: 8px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 1px var(--red);
}

.memory-slot .slot-date {
  color: var(--red);
  font-family: var(--serif);
  font-size: 13px;
}

.memory-slot .slot-title {
  padding-right: 16px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.4;
}

.memory-slot .slot-icon {
  color: var(--ink-soft);
  font-size: 12px;
  text-align: right;
}

.memory-slot .slot-thumb {
  position: absolute;
  right: 8px;
  width: 96px;
  height: 62px;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: 0 4px 14px rgba(33, 30, 28, 0.18);
  transform: rotate(1deg);
}

.memory-slot.is-filled {
  cursor: default;
}

.memory-slot.is-filled::before {
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.memory-slot.is-wrong {
  animation: slotNudge 300ms ease;
}

.evidence-tray {
  position: sticky;
  top: 26px;
  align-self: start;
  padding: 18px 0 0;
  border-top: 2px solid var(--ink);
}

.tray-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  font-size: 11px;
  font-weight: 700;
}

.tray-rule {
  height: 1px;
  flex: 1;
  background: var(--line);
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.evidence-card {
  position: relative;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 5px solid white;
  border-radius: 1px;
  background: white;
  box-shadow: 0 5px 16px rgba(33, 30, 28, 0.15);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 250ms ease;
}

.evidence-card:nth-child(3n + 1) {
  transform: rotate(-1deg);
}

.evidence-card:nth-child(3n + 2) {
  transform: rotate(1.2deg);
}

.evidence-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.evidence-card:hover,
.evidence-card.is-selected {
  z-index: 2;
  transform: translateY(-4px) rotate(0deg);
  box-shadow: 0 10px 24px rgba(33, 30, 28, 0.26);
}

.evidence-card.is-selected {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.evidence-card.is-filed {
  pointer-events: none;
  opacity: 0.34;
  filter: grayscale(0.55);
  transform: scale(0.95) rotate(0deg);
}

.evidence-card.is-filed::after {
  content: "已归档";
  position: absolute;
  inset: 50% auto auto 50%;
  padding: 4px 7px;
  border: 2px solid var(--red);
  color: var(--red);
  background: rgba(243, 238, 228, 0.88);
  font-size: 9px;
  font-weight: 700;
  transform: translate(-50%, -50%) rotate(-7deg);
}

.memory-complete {
  width: min(440px, calc(100% - 40px));
  margin: 46px auto 0;
  text-align: center;
}

.memory-complete p {
  margin: 12px 0 20px;
  font-family: var(--serif);
  font-size: 22px;
}

.aperture-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto;
  border: 1px solid var(--red);
  border-radius: 50%;
  display: grid;
  place-items: center;
  animation: apertureSpin 4s linear infinite;
}

.aperture-mark span {
  width: 22px;
  height: 22px;
  border: 6px double var(--red);
  border-radius: 50%;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 28px;
  min-width: 180px;
  padding: 11px 16px;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Puzzle */
.puzzle-scene {
  min-height: 100%;
  padding-bottom: 54px;
  background: #e5dccd;
}

.chapter-number {
  color: rgba(33, 30, 28, 0.22);
  font-family: var(--serif);
  font-size: 48px;
}

.puzzle-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(210px, 1fr);
  gap: 48px;
  align-items: center;
  width: min(1120px, calc(100% - 64px));
  margin: 0 auto;
}

.puzzle-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  padding: 12px;
  background: #d3c4af;
  box-shadow: var(--shadow);
}

.puzzle-board {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
}

.puzzle-piece {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-image: url("assets/photos/11.jpg");
  background-repeat: no-repeat;
  background-size: 300% 300%;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: transform 160ms ease, filter 160ms ease;
}

.puzzle-piece:hover {
  z-index: 2;
  filter: brightness(1.08);
}

.puzzle-piece.is-selected {
  z-index: 3;
  transform: scale(0.94);
  box-shadow: inset 0 0 0 4px var(--gold);
}

.puzzle-board.is-complete {
  gap: 0;
}

.puzzle-board.is-complete .puzzle-piece {
  pointer-events: none;
  box-shadow: none;
  animation: pieceSettle 620ms ease both;
}

.puzzle-frame {
  position: absolute;
  inset: -9px;
  border: 1px solid rgba(33, 30, 28, 0.42);
  pointer-events: none;
}

.puzzle-note {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 4px;
}

.puzzle-note > p:nth-child(2) {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(19px, 2.2vw, 27px);
  line-height: 1.75;
}

.note-kicker,
.note-date {
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
}

.note-rule {
  width: 64px;
  height: 2px;
  margin: 30px 0 16px;
  background: var(--red);
}

.puzzle-success {
  width: min(500px, calc(100% - 40px));
  margin: 24px auto 0;
  text-align: center;
}

.puzzle-success p {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
}

/* Letter */
.letter-scene {
  min-height: 100%;
  padding: 54px 30px 70px;
  background: #25211f;
}

.letter-paper {
  position: relative;
  z-index: 2;
  width: min(720px, calc(100% - 24px));
  min-height: 680px;
  margin: 0 auto;
  padding: 44px 58px 50px;
  border-radius: 2px;
  background-color: var(--paper);
  background-image: linear-gradient(transparent 35px, rgba(99, 115, 102, 0.18) 36px);
  background-size: 100% 36px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  transform: rotate(-0.3deg);
}

.letter-paper::before {
  content: "0722";
  position: absolute;
  top: 34px;
  right: 42px;
  color: rgba(150, 55, 47, 0.12);
  font-family: var(--serif);
  font-size: 74px;
}

.letter-head {
  position: relative;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
}

.letter-head span {
  font-family: var(--serif);
  font-size: 11px;
}

.letter-paper h2 {
  position: relative;
  margin: 44px 0 28px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}

.letter-body {
  position: relative;
  min-height: 396px;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 2.12;
}

.letter-body p {
  min-height: 36px;
  margin: 0;
}

.letter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 1.5px;
}

.signature-line {
  width: 130px;
  border-bottom: 1px solid var(--ink-soft);
}

.letter-photo-strip {
  position: absolute;
  left: calc(50% + 300px);
  top: 110px;
  z-index: 3;
  display: grid;
  gap: 18px;
}

.letter-photo-strip img {
  width: 150px;
  height: 110px;
  object-fit: cover;
  border: 8px solid white;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.letter-photo-strip img:nth-child(1) {
  transform: rotate(4deg);
}

.letter-photo-strip img:nth-child(2) {
  transform: translateX(20px) rotate(-3deg);
}

.letter-photo-strip img:nth-child(3) {
  transform: translateX(-10px) rotate(2deg);
}

.wish-open-button {
  position: relative;
  z-index: 4;
  display: flex;
  margin: 34px auto 0;
  border-color: var(--paper);
}

/* Wish */
.wish-scene {
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 38px 20px;
  overflow: hidden;
  background: #181716;
  color: var(--paper);
}

.wish-orbit {
  position: absolute;
  width: min(70vw, 720px);
  aspect-ratio: 1;
  border: 1px solid rgba(195, 154, 76, 0.22);
  border-radius: 50%;
}

.wish-orbit::before,
.wish-orbit::after {
  content: "";
  position: absolute;
  inset: 16%;
  border: 1px solid rgba(244, 239, 230, 0.12);
  border-radius: 50%;
}

.wish-orbit::after {
  inset: 35%;
  background: var(--gold);
  border: 0;
  box-shadow: 0 0 40px rgba(195, 154, 76, 0.5);
}

.wish-panel {
  position: relative;
  z-index: 2;
  width: min(620px, 100%);
}

.wish-panel h2 {
  margin: 0 0 34px;
  font-family: var(--serif);
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 500;
  line-height: 1.22;
}

.wish-form textarea {
  width: 100%;
  height: 150px;
  resize: none;
  border: 0;
  border-bottom: 1px solid rgba(244, 239, 230, 0.54);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.7;
}

.wish-form-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}

.wish-form-bottom > span {
  color: rgba(244, 239, 230, 0.5);
  font-family: var(--serif);
  font-size: 11px;
}

.gold-button {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
}

.gold-button:hover {
  color: white;
}

/* Blackout and finale */
.blackout {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  visibility: hidden;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

.blackout.is-on {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 140ms linear;
}

.sealed-note {
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  opacity: 0;
}

.blackout.show-note .sealed-note {
  opacity: 1;
  transition: opacity 300ms ease;
}

.sealed-note p {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 2px;
}

.sealed-dot {
  display: block;
  width: 8px;
  height: 8px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px var(--gold);
}

.finale-scene {
  min-height: 100%;
  overflow: hidden;
  background: #171513;
  color: white;
}

#confettiCanvas {
  position: absolute;
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.film-reel {
  position: absolute;
  z-index: 1;
  left: -4vw;
  bottom: -30px;
  display: flex;
  gap: 14px;
  width: max-content;
  padding: 30px 24px;
  border-top: 10px dotted rgba(244, 239, 230, 0.68);
  border-bottom: 10px dotted rgba(244, 239, 230, 0.68);
  background: #27221f;
  transform: rotate(-3deg) translateY(110%);
}

.finale-scene.is-active .film-reel {
  animation: reelEnter 1100ms 180ms cubic-bezier(0.2, 0.85, 0.2, 1) forwards;
}

.film-photo {
  width: clamp(170px, 23vw, 320px);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 4px solid var(--paper);
  filter: saturate(0.92) contrast(1.04);
}

.finale-copy {
  position: relative;
  z-index: 3;
  width: min(920px, calc(100% - 42px));
  margin: 0 auto;
  padding-top: clamp(72px, 13vh, 128px);
  text-align: center;
}

.finale-copy h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(45px, 8vw, 94px);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: 0;
}

.finale-copy h2 span {
  white-space: nowrap;
}

.finale-copy > p:not(.eyebrow) {
  margin: 20px auto 0;
  color: rgba(255, 255, 255, 0.76);
  font-family: var(--serif);
  font-size: clamp(14px, 2vw, 19px);
}

.finale-date {
  width: max-content;
  margin: 28px auto 0;
  padding: 9px 18px;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 5px;
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-5px); }
  65% { transform: translateX(5px); }
}

@keyframes shutterOpen {
  0% { clip-path: circle(0 at 50% 50%); }
  40% { clip-path: circle(80% at 50% 50%); }
  65% { clip-path: circle(80% at 50% 50%); }
  100% { clip-path: circle(0 at 50% 50%); }
}

@keyframes soundPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}

@keyframes slotNudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(7px); }
}

@keyframes apertureSpin {
  to { transform: rotate(360deg); }
}

@keyframes pieceSettle {
  0% { filter: brightness(1.45); }
  100% { filter: brightness(1); }
}

@keyframes reelEnter {
  to { transform: rotate(-3deg) translateY(0); }
}

@media (max-width: 900px) {
  .memory-workspace {
    grid-template-columns: 1fr;
  }

  .evidence-tray {
    position: static;
    grid-row: 1;
  }

  .evidence-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .puzzle-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .puzzle-note {
    display: grid;
    grid-template-columns: 70px 1fr;
    padding: 14px 0;
  }

  .puzzle-note > p:nth-child(2) {
    font-size: 19px;
  }

  .note-rule,
  .note-date {
    display: none;
  }

  .letter-photo-strip {
    left: auto;
    right: 10px;
    top: 90px;
    opacity: 0.72;
  }

  .letter-photo-strip img {
    width: 105px;
    height: 82px;
  }
}

@media (max-width: 640px) {
  .sound-toggle {
    top: 14px;
    right: 14px;
  }

  .lock-panel {
    padding: 42px 24px 26px;
  }

  .archive-mark {
    top: 22px;
    right: 22px;
    width: 58px;
    height: 58px;
  }

  .pin {
    height: 62px;
    font-size: 28px;
  }

  .portrait-image {
    object-position: 39% center;
  }

  .portrait-shade {
    background: rgba(25, 19, 16, 0.12);
    box-shadow: inset 0 -300px 190px -80px rgba(22, 17, 15, 0.92);
  }

  .portrait-copy {
    left: 24px;
    right: 24px;
    bottom: 50px;
  }

  .portrait-copy h2 {
    font-size: 55px;
  }

  .identity-lines {
    font-size: 12px;
  }

  .scene-header {
    width: calc(100% - 36px);
    margin-bottom: 25px;
    padding-top: 30px;
  }

  .progress-count strong {
    font-size: 36px;
  }

  .memory-workspace {
    width: calc(100% - 36px);
    gap: 26px;
  }

  .evidence-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .evidence-card {
    border-width: 3px;
  }

  .memory-slot {
    grid-template-columns: 28px 82px minmax(0, 1fr) 74px;
    min-height: 72px;
  }

  .timeline::before {
    left: 10px;
  }

  .memory-slot::before {
    margin-left: 6px;
  }

  .memory-slot .slot-date {
    font-size: 11px;
  }

  .memory-slot .slot-title {
    padding-right: 8px;
    font-size: 14px;
  }

  .memory-slot .slot-icon {
    display: none;
  }

  .memory-slot .slot-thumb {
    width: 65px;
    height: 48px;
    border-width: 3px;
  }

  .puzzle-scene {
    padding-bottom: 32px;
  }

  .puzzle-layout {
    width: calc(100% - 30px);
  }

  .puzzle-stage {
    padding: 7px;
  }

  .puzzle-board {
    gap: 2px;
  }

  .puzzle-note {
    grid-template-columns: 62px 1fr;
  }

  .puzzle-note > p:nth-child(2) {
    font-size: 16px;
    line-height: 1.55;
  }

  .chapter-number {
    font-size: 35px;
  }

  .letter-scene {
    padding: 28px 4px 46px;
  }

  .letter-paper {
    width: calc(100% - 24px);
    min-height: 620px;
    padding: 35px 28px 38px;
  }

  .letter-paper::before {
    top: 46px;
    right: 22px;
    font-size: 54px;
  }

  .letter-head {
    padding-right: 0;
  }

  .letter-paper h2 {
    margin-top: 38px;
    font-size: 24px;
  }

  .letter-body {
    min-height: 360px;
    font-size: 15px;
  }

  .letter-photo-strip {
    display: none;
  }

  .wish-panel h2 {
    font-size: 39px;
  }

  .wish-form textarea {
    height: 132px;
    font-size: 18px;
  }

  .wish-form-bottom {
    align-items: flex-end;
    gap: 12px;
  }

  .gold-button {
    min-width: 164px;
  }

  .finale-copy {
    padding-top: 90px;
  }

  .finale-copy h2 {
    font-size: 50px;
  }

  .finale-copy h2 span {
    display: block;
  }

  .film-reel {
    bottom: 8vh;
  }

  .film-photo {
    width: 205px;
  }
}

@media (max-height: 700px) and (min-width: 700px) {
  .scene-header {
    padding-top: 28px;
    margin-bottom: 20px;
  }

  .puzzle-layout {
    width: min(1000px, calc(100% - 64px));
  }

  .puzzle-success {
    margin-top: 14px;
  }
}

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