:root {
  --bg-deep: #071221;
  --bg-mid: #0f1c2f;
  --bg-soft: #15253d;
  --paper: rgba(245, 239, 228, 0.92);
  --paper-soft: rgba(255, 252, 246, 0.64);
  --ink: #122033;
  --ink-soft: #4d5d74;
  --line: rgba(12, 23, 41, 0.1);
  --accent: #cab48d;
  --accent-deep: #8f7350;
  --white: #fbfaf7;
  --shadow: 0 24px 58px rgba(4, 13, 26, 0.26);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--white);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(circle at 12% 12%, rgba(202, 180, 141, 0.18), transparent 28%),
    radial-gradient(circle at 88% 14%, rgba(132, 152, 190, 0.16), transparent 24%),
    linear-gradient(160deg, var(--bg-deep) 0%, var(--bg-mid) 42%, var(--bg-soft) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  filter: blur(10px);
  transition:
    width 320ms ease,
    height 320ms ease,
    top 320ms ease,
    right 320ms ease,
    bottom 320ms ease,
    left 320ms ease,
    background 320ms ease,
    filter 320ms ease;
}

body::before {
  width: 12rem;
  height: 12rem;
  top: 10%;
  left: -3rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(228, 212, 182, 0.16), transparent 72%);
}

body::after {
  width: 16rem;
  height: 16rem;
  right: -5rem;
  bottom: 10%;
  border-radius: 45%;
  background: radial-gradient(circle, rgba(163, 180, 210, 0.14), transparent 70%);
}

.page {
  position: relative;
  z-index: 1;
  width: min(100%, 72rem);
  margin: 0 auto;
  padding:
    calc(1.15rem + env(safe-area-inset-top, 0px))
    clamp(1rem, 4vw, 2rem)
    calc(2rem + env(safe-area-inset-bottom, 0px));
}

.page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  background: rgba(7, 18, 33, 0);
  transition: opacity 280ms ease, background-color 280ms ease;
}

.hero,
.lock-panel,
.letter > .panel,
.footer-note {
  transition:
    opacity 300ms ease,
    transform 300ms ease,
    box-shadow 300ms ease;
}

.music-panel {
  z-index: 4;
}

body.music-immersed .page::after {
  opacity: 1;
  background:
    linear-gradient(180deg, rgba(6, 10, 18, 0.22), rgba(7, 12, 20, 0.42)),
    radial-gradient(circle at 50% 34%, rgba(244, 194, 110, 0.16), transparent 34%),
    radial-gradient(circle at 18% 26%, rgba(226, 147, 57, 0.12), transparent 26%),
    radial-gradient(circle at 82% 72%, rgba(178, 103, 28, 0.1), transparent 24%);
}

body.music-immersed .hero,
body.music-immersed .lock-panel,
body.music-immersed .letter > .panel:not(.music-panel),
body.music-immersed .footer-note {
  opacity: 0.64;
}

body.music-immersed .music-panel {
  transform: translateY(-2px);
  box-shadow:
    0 32px 78px rgba(6, 15, 28, 0.36),
    0 0 0 1px rgba(244, 197, 123, 0.14),
    0 0 80px rgba(214, 145, 54, 0.22);
}

body.music-immersed::before {
  width: 22rem;
  height: 22rem;
  top: 4%;
  left: -1rem;
  background: radial-gradient(circle, rgba(255, 203, 120, 0.4), rgba(220, 133, 42, 0.14) 36%, transparent 70%);
  filter: blur(24px);
  animation: candle-float 6.8s ease-in-out infinite;
}

body.music-immersed::after {
  width: 18rem;
  height: 18rem;
  right: -2rem;
  bottom: 8%;
  background: radial-gradient(circle, rgba(244, 184, 95, 0.3), rgba(190, 112, 35, 0.1) 38%, transparent 72%);
  filter: blur(24px);
  animation: candle-float 8.2s ease-in-out infinite reverse;
}

.hero {
  padding: 1.2rem 0 1rem;
}

.eyebrow,
.lock-kicker,
.quiz-step {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  color: rgba(244, 239, 230, 0.72);
}

.hero h1,
.section-heading h2,
.quiz-question,
.time-box span {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.hero h1 {
  margin: 0.45rem 0 0.9rem;
  max-width: 14ch;
  font-size: clamp(2.45rem, 8vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lead {
  margin: 0;
  max-width: 34rem;
  color: rgba(244, 239, 230, 0.76);
  line-height: 1.72;
}

.panel {
  position: relative;
  overflow: hidden;
  margin-top: 1.2rem;
  padding: 1.3rem;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(250, 246, 239, 0.96), rgba(238, 230, 216, 0.9)),
    linear-gradient(120deg, rgba(255, 255, 255, 0.22), transparent 60%);
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.18), transparent 28%);
}

.section-heading {
  position: relative;
  z-index: 1;
  margin-bottom: 1rem;
}

.section-heading .eyebrow,
.lock-kicker,
.quiz-step {
  color: var(--accent-deep);
}

.section-heading h2 {
  margin: 0.35rem 0 0.55rem;
  font-size: clamp(1.9rem, 6vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.section-copy,
.unlock-date,
.memory-body p,
.quiz-feedback,
.footer-note,
.noscript-banner {
  color: var(--ink-soft);
  line-height: 1.72;
}

.lock-panel {
  padding: 1.45rem;
}

.lock-copy {
  position: relative;
  z-index: 1;
}

.lock-panel h2 {
  margin: 0.45rem 0 0.7rem;
  max-width: 16ch;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(2rem, 7vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.countdown {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.4rem;
}

.time-box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 0.95rem;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(10, 21, 38, 0.96), rgba(18, 35, 59, 0.94));
  color: var(--white);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.time-box span {
  font-size: clamp(2.15rem, 9vw, 3.15rem);
  line-height: 1;
}

.time-box small {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(244, 239, 230, 0.7);
}

.unlock-date {
  position: relative;
  z-index: 1;
  margin: 1rem 0 0;
}

.letter {
  display: grid;
  gap: 1.4rem;
  margin-top: 1.35rem;
}

.letter > .panel {
  margin-top: 0;
}

.letter[hidden] {
  display: none !important;
}

.intro-card p,
.final-panel p {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.92;
}

.drop-cap::first-letter {
  float: left;
  margin-right: 0.35rem;
  font-size: 3.4rem;
  line-height: 0.88;
  color: var(--accent-deep);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.legacy-memories {
  display: none !important;
}

.memory-gallery {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
}

.memory-feature-shell {
  display: grid;
  gap: 1rem;
  align-items: start;
  transition: opacity 220ms ease, transform 220ms ease;
}

.memory-feature-shell.is-swapping {
  opacity: 0.52;
  transform: translateY(8px);
}

.memory-feature-media {
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.memory-photo-surface,
.memory-lightbox-media {
  position: relative;
  display: block;
  width: min(100%, 24rem);
  aspect-ratio: 4 / 5;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(10, 20, 36, 0.16);
}

.memory-photo-surface {
  margin: 0 auto;
}

.memory-lightbox-media {
  margin: 0 auto;
}

.memory-photo,
.memory-thumb-image,
.memory-lightbox-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 280ms ease, transform 280ms ease;
}

.memory-photo.is-ready,
.memory-thumb-image.is-ready,
.memory-lightbox-image.is-ready {
  opacity: 1;
  transform: scale(1);
}

.memory-photo-placeholder,
.memory-thumb-placeholder,
.memory-lightbox-placeholder {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  overflow: hidden;
  isolation: isolate;
}

.memory-photo-placeholder::before,
.memory-thumb-placeholder::before,
.memory-lightbox-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.2), transparent 22%),
    linear-gradient(150deg, transparent 16%, rgba(255, 255, 255, 0.08) 100%);
  z-index: 0;
}

.memory-photo-placeholder[data-tone="bench"],
.memory-thumb-placeholder[data-tone="bench"],
.memory-lightbox-placeholder[data-tone="bench"] {
  background: linear-gradient(165deg, #1a2840 0%, #566885 100%);
}

.memory-photo-placeholder[data-tone="iftar"],
.memory-thumb-placeholder[data-tone="iftar"],
.memory-lightbox-placeholder[data-tone="iftar"] {
  background: linear-gradient(165deg, #2f3f56 0%, #8f7456 100%);
}

.memory-photo-placeholder[data-tone="ride"],
.memory-thumb-placeholder[data-tone="ride"],
.memory-lightbox-placeholder[data-tone="ride"] {
  background: linear-gradient(165deg, #213349 0%, #53707f 100%);
}

.memory-photo-placeholder[data-tone="distance"],
.memory-thumb-placeholder[data-tone="distance"],
.memory-lightbox-placeholder[data-tone="distance"] {
  background: linear-gradient(165deg, #111f34 0%, #55627c 100%);
}

.memory-photo-placeholder {
  align-content: end;
  padding: 1.15rem;
}

.memory-thumb-placeholder {
  place-items: end start;
  padding: 0.8rem;
}

.memory-lightbox-placeholder {
  align-content: end;
  padding: 1.25rem;
}

.memory-placeholder-index,
.memory-thumb-placeholder span {
  position: relative;
  z-index: 1;
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: rgba(244, 239, 230, 0.16);
  color: var(--white);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.memory-placeholder-name {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 0.9rem;
  max-width: 10ch;
  color: var(--white);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(1.7rem, 5vw, 2.25rem);
  line-height: 1.02;
}

.memory-zoom-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0.85rem auto 0;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: rgba(18, 32, 51, 0.08);
  color: var(--ink-soft);
  font-size: 0.88rem;
  box-shadow: inset 0 0 0 1px rgba(12, 23, 41, 0.08);
}

.memory-feature-media:hover .memory-photo-surface {
  box-shadow: 0 28px 56px rgba(10, 20, 36, 0.2);
}

.memory-feature-copy {
  display: grid;
  gap: 0.7rem;
  align-self: center;
}

.memory-tag {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  color: var(--accent-deep);
}

.memory-feature-title,
.memory-lightbox-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(1.8rem, 5.6vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: black;
}

.memory-feature-text,
.memory-lightbox-text,
.memory-feature-note {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.78;
}

.memory-feature-note {
  font-size: 0.95rem;
}

.memory-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.memory-thumb {
  display: grid;
  gap: 0.72rem;
  padding: 0.7rem;
  border: 1px solid rgba(12, 23, 41, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.5);
  text-align: left;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 200ms ease,
    box-shadow 200ms ease,
    border-color 200ms ease,
    background-color 200ms ease;
}

.memory-thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(12, 23, 41, 0.1);
}

.memory-thumb.is-active {
  border-color: rgba(18, 32, 51, 0.22);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 16px 36px rgba(10, 20, 36, 0.12);
}

.memory-thumb-media {
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  overflow: hidden;
}

.memory-thumb-copy {
  display: grid;
  gap: 0.25rem;
  color: black;
}

.memory-thumb-copy strong {
  font-size: 1rem;
  font-weight: 600;
  color: black;
}

.memory-thumb-copy small {
  color: var(--ink-soft);
  line-height: 1.5;
  color: black;
}

.memory-lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
}

.memory-lightbox[hidden] {
  display: none !important;
}

.memory-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 18, 33, 0.74);
  opacity: 0;
  transition: opacity 220ms ease;
}

.memory-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 1.5rem), 58rem);
  max-height: calc(100svh - 1.5rem);
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-radius: 28px;
  background: rgba(247, 241, 232, 0.96);
  box-shadow: 0 30px 70px rgba(4, 13, 26, 0.34);
  overflow: auto;
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
}

.memory-lightbox.is-open .memory-lightbox-backdrop {
  opacity: 1;
}

.memory-lightbox.is-open .memory-lightbox-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.memory-lightbox-close {
  justify-self: end;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 0.95rem;
  background: rgba(18, 32, 51, 0.08);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: inset 0 0 0 1px rgba(12, 23, 41, 0.1);
}

.memory-feature-media:focus-visible,
.memory-thumb:focus-visible,
.memory-lightbox-close:focus-visible {
  outline: 2px solid rgba(18, 32, 51, 0.4);
  outline-offset: 4px;
}

.memory-lightbox-copy {
  display: grid;
  gap: 0.7rem;
}

body.is-lightbox-open {
  overflow: hidden;
}

.memory-list {
  display: grid;
  gap: 0.9rem;
}

.music-panel {
  overflow: visible;
  position: relative;
  background:
    linear-gradient(180deg, rgba(246, 241, 233, 0.97), rgba(234, 228, 220, 0.92)),
    linear-gradient(135deg, rgba(150, 170, 197, 0.1), transparent 58%);
}

.music-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 20% 22%, rgba(255, 228, 176, 0.36), transparent 24%),
    radial-gradient(circle at 74% 30%, rgba(244, 193, 115, 0.24), transparent 32%),
    radial-gradient(circle at 52% 68%, rgba(181, 99, 28, 0.12), transparent 34%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 245, 228, 0.03) 0,
      rgba(255, 245, 228, 0.03) 1px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: screen;
  transition: opacity 320ms ease;
}

body.music-immersed .music-panel::before {
  opacity: 0.88;
  animation: candle-panel-glow 4.8s ease-in-out infinite;
}

.memories {
  background:
    linear-gradient(180deg, rgba(249, 244, 236, 0.97), rgba(239, 229, 216, 0.92)),
    linear-gradient(130deg, rgba(205, 182, 139, 0.09), transparent 60%);
}

.quiz-panel {
  background:
    linear-gradient(180deg, rgba(247, 242, 234, 0.96), rgba(235, 230, 223, 0.91)),
    linear-gradient(135deg, rgba(144, 164, 191, 0.08), transparent 58%);
}

.final-panel {
  background:
    linear-gradient(180deg, rgba(248, 243, 235, 0.97), rgba(238, 231, 220, 0.92)),
    linear-gradient(135deg, rgba(201, 179, 140, 0.08), transparent 62%);
}

.record-player {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1.25rem;
  align-items: center;
  overflow: visible;
}

.record-player::before,
.record-player::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  border-radius: 50%;
  filter: blur(18px);
  transition: opacity 320ms ease, transform 320ms ease;
}

.record-player::before {
  width: 14rem;
  height: 14rem;
  left: -1.2rem;
  top: 1.2rem;
  background: radial-gradient(circle, rgba(255, 205, 128, 0.32), rgba(214, 130, 48, 0.08) 48%, transparent 74%);
}

.record-player::after {
  width: 11rem;
  height: 11rem;
  right: 3%;
  bottom: -0.4rem;
  background: radial-gradient(circle, rgba(255, 187, 96, 0.24), rgba(181, 99, 28, 0.06) 44%, transparent 72%);
}

body.music-immersed .record-player::before {
  opacity: 0.9;
  animation: candle-ambient-drift 12.5s ease-in-out infinite;
}

body.music-immersed .record-player::after {
  opacity: 0.82;
  animation: candle-ambient-drift 15.5s ease-in-out infinite reverse;
}

.record-stage,
.audio-copy {
  position: relative;
  z-index: 1;
}

.record-stage {
  position: relative;
  width: min(100%, 19rem);
  aspect-ratio: 1;
  margin: 1.1rem auto 0;
  display: grid;
  place-items: center;
}

.record-stage::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(19, 34, 55, 0.16), transparent 72%);
  filter: blur(8px);
}

body.music-immersed .record-stage::before {
  background: radial-gradient(circle, rgba(251, 203, 122, 0.4), rgba(214, 130, 48, 0.12) 42%, transparent 74%);
  filter: blur(22px);
  animation: candle-record-glow 3.8s ease-in-out infinite;
}

.record-disc {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  touch-action: manipulation;
  background:
    radial-gradient(circle at center, #e7d8bb 0 10%, #16253d 10% 14%, #0f1828 14% 32%, #1a2840 32% 33.5%, #0f1828 33.5% 47%, #1c2f4a 47% 48.5%, #0f1828 48.5% 61%, #16253d 61% 62.5%, #09111e 62.5% 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 22px 44px rgba(8, 15, 28, 0.24);
  transition: transform 220ms ease, box-shadow 220ms ease, opacity 220ms ease;
}

.record-disc::before,
.record-disc::after,
.record-disc-inner::before,
.record-disc-inner::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
}

.record-disc::before {
  inset: 6%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.2), transparent 18%),
    radial-gradient(circle at center, transparent 48%, rgba(255, 255, 255, 0.06) 48% 49%, transparent 49% 56%, rgba(255, 255, 255, 0.04) 56% 57%, transparent 57% 64%, rgba(255, 255, 255, 0.03) 64% 65%, transparent 65%);
}

.record-disc::after {
  inset: 41%;
  background: radial-gradient(circle, #f5efe4 0 34%, #d2b98d 34% 72%, #f5efe4 72% 100%);
  box-shadow: inset 0 0 0 1px rgba(12, 23, 41, 0.12);
}

.record-disc-inner {
  position: absolute;
  inset: 0;
}

.record-disc-inner::before {
  inset: 47%;
  background: #132136;
}

.record-disc-inner::after {
  inset: 28%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.record-disc:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 28px 50px rgba(8, 15, 28, 0.3);
}

.record-disc:disabled {
  cursor: default;
  opacity: 0.75;
}

.tonearm {
  position: absolute;
  top: 11%;
  right: 8%;
  width: 38%;
  height: 0.7rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #e8dece, #8b98ac 58%, #5c6678 100%);
  transform-origin: 92% 50%;
  transform: rotate(38deg);
  transition: transform 380ms ease;
  box-shadow: 0 8px 16px rgba(12, 23, 41, 0.14);
}

.tonearm::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -0.55rem;
  width: 1.1rem;
  height: 1.1rem;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #f3eadb;
  box-shadow: inset 0 0 0 1px rgba(12, 23, 41, 0.12);
}

.tonearm::after {
  content: "";
  position: absolute;
  left: -0.35rem;
  top: 50%;
  width: 0.95rem;
  height: 0.95rem;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #22344f;
  box-shadow: 0 0 0 6px rgba(34, 52, 79, 0.12);
}

.record-player.is-playing .record-disc {
  animation: spin-record 5.5s linear infinite;
}

.record-player.is-playing .tonearm {
  transform: rotate(20deg);
}

.audio-copy {
  display: grid;
  gap: 0.75rem;
}

.audio-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  color: var(--accent-deep);
}

.audio-title {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(1.6rem, 5.8vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.audio-status {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.72;
}

.audio-whisper {
  margin: 0;
  max-width: 28rem;
  color: rgba(18, 32, 51, 0.72);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(1rem, 3.8vw, 1.2rem);
  line-height: 1.5;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 260ms ease, transform 260ms ease;
}

body.music-immersed .audio-whisper {
  opacity: 1;
  transform: translateY(0);
}

.audio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.audio-actions .secondary-button {
  margin-top: 0;
}

.memory-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}

.memory-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(12, 23, 41, 0.1);
  border-color: rgba(12, 23, 41, 0.16);
}

.memory-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 1rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.memory-index {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  background: var(--bg-mid);
  color: var(--white);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
}

.memory-title {
  font-size: 1.04rem;
  font-weight: 600;
  color: black;
}

.memory-action {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.memory-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms ease;
}

.memory-card.is-open .memory-body {
  grid-template-rows: 1fr;
}

.memory-body-inner {
  overflow: hidden;
  padding: 0 1rem;
}

.memory-card.is-open .memory-body-inner {
  padding-bottom: 1rem;
}

.memory-visual {
  position: relative;
  height: 8rem;
  margin-bottom: 0.95rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(12, 23, 41, 0.95), rgba(67, 89, 119, 0.9));
}

.memory-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 26% 22%, rgba(244, 239, 230, 0.24), transparent 26%),
    linear-gradient(135deg, transparent 12%, rgba(205, 182, 139, 0.18) 100%);
}

.memory-card:nth-child(2) .memory-visual {
  background: linear-gradient(135deg, #223049, #7a684c);
}

.memory-card:nth-child(3) .memory-visual {
  background: linear-gradient(135deg, #1f3048, #436173);
}

.memory-card:nth-child(4) .memory-visual {
  background: linear-gradient(135deg, #0f1d31, #3f4964);
}

.quiz-shell {
  position: relative;
  z-index: 1;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.46);
}

.quiz-question {
  margin: 0 0 1rem;
  font-size: clamp(1.45rem, 5vw, 2rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.quiz-options {
  display: grid;
  gap: 0.75rem;
}

.quiz-option {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 0.95rem 1rem;
  background: #f7f3eb;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: inset 0 0 0 1px rgba(12, 23, 41, 0.08);
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.quiz-option:hover {
  transform: translateY(-1px);
  background: #fffaf2;
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-option.is-correct {
  background: linear-gradient(180deg, #152845, #0f1d30);
  color: var(--white);
  box-shadow: none;
}

.quiz-option.is-wrong {
  background: #ead9cd;
  color: var(--ink);
}

.quiz-feedback {
  min-height: 1.6em;
  margin: 1rem 0 0;
}

.quiz-reveal {
  margin: 1rem 0 0;
  display: grid;
  gap: 0.7rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.quiz-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.quiz-reveal-image {
  
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
  border-radius: 20px;
  box-shadow: 0 22px 44px rgba(10, 20, 36, 0.18);
}

.quiz-reveal-caption {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.68;
}

.secondary-button {
  margin-top: 1rem;
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  background: var(--bg-mid);
  color: var(--white);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 14px 28px rgba(12, 23, 41, 0.18);
  transition: transform 180ms ease, opacity 180ms ease;
}

.secondary-button:hover {
  transform: translateY(-1px);
}

.secondary-button.is-muted {
  background: rgba(18, 32, 51, 0.08);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(12, 23, 41, 0.1);
}

.quiz-summary {
  display: grid;
  gap: 0.75rem;
  color: var(--ink-soft);
  line-height: 1.72;
}

.quiz-summary p {
  margin: 0;
}

.final-panel {
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.final-panel.is-highlighted {
  transform: translateY(-2px);
  box-shadow: 0 28px 62px rgba(6, 15, 28, 0.3);
}

.final-line {
  position: relative;
  z-index: 1;
  margin: 1.1rem 0 0;
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(1.35rem, 4.8vw, 2rem);
  line-height: 1.22;
  letter-spacing: -0.025em;
}

.signature {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent-deep);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.08rem;
}

.date-stamp {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.2rem;
  margin: 1.2rem 0 0;
  color: rgba(18, 32, 51, 0.62);
  font-size: 0.9rem;
  line-height: 1.55;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.date-stamp span {
  display: block;
}

.footer-note {
  margin: 1.1rem 0 0;
  text-align: center;
  color: rgba(244, 239, 230, 0.62);
  font-size: 0.92rem;
}

.noscript-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 3;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(248, 242, 232, 0.96);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.2);
}

.reveal {
  animation: rise-fade 780ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.letter .reveal:nth-child(2) {
  animation-delay: 90ms;
}

.letter .reveal:nth-child(3) {
  animation-delay: 150ms;
}

.letter .reveal:nth-child(4) {
  animation-delay: 220ms;
}

.special-popup {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.special-popup[hidden] {
  display: none !important;
}

.special-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 20, 35, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.special-popup-content {
  position: relative;
  z-index: 1;
  width: min(92vw, 360px);
  background: #f4efe6;
  padding: 1rem;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  animation: popupFade 0.35s ease;
}

.special-popup-content img {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 0.9rem;
}

.special-popup-content p {
  margin: 0 0 0.9rem;
  color: #122033;
  line-height: 1.6;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.05rem;
}

.special-popup-content button {
  border: none;
  background: #0f1c2f;
  color: #fff;
  padding: 0.72rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}

.special-popup-content button:hover {
  opacity: 0.92;
}

@keyframes popupFade {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes popupFade {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rise-fade {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spin-record {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes candle-panel-glow {
  0%,
  100% {
    opacity: 0.8;
    transform: scale(1);
  }

  35% {
    opacity: 0.92;
    transform: scale(1.015);
  }

  68% {
    opacity: 0.86;
    transform: scale(0.995);
  }
}

@keyframes candle-record-glow {
  0%,
  100% {
    opacity: 0.78;
    transform: scale(1);
  }

  30% {
    opacity: 0.96;
    transform: scale(1.04);
  }

  60% {
    opacity: 0.82;
    transform: scale(0.985);
  }
}

@keyframes candle-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
  }

  35% {
    transform: translate3d(0.7rem, -0.55rem, 0) scale(1.05);
    opacity: 0.94;
  }

  70% {
    transform: translate3d(-0.35rem, 0.4rem, 0) scale(0.98);
    opacity: 0.9;
  }
}

@keyframes candle-ambient-drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.84;
  }

  28% {
    transform: translate3d(0.75rem, -0.45rem, 0) scale(1.08);
    opacity: 0.96;
  }

  58% {
    transform: translate3d(-0.4rem, 0.55rem, 0) scale(0.97);
    opacity: 0.78;
  }

  82% {
    transform: translate3d(0.45rem, 0.15rem, 0) scale(1.03);
    opacity: 0.9;
  }
}

@media (min-width: 46rem) {
  .page {
    padding-top: calc(1.8rem + env(safe-area-inset-top, 0px));
  }

  .letter {
    gap: 1.7rem;
    margin-top: 1.55rem;
  }

  .panel,
  .lock-panel {
    padding: 1.75rem;
  }

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

  .memory-feature-shell {
    grid-template-columns: minmax(17rem, 22rem) minmax(0, 1fr);
    gap: 1.35rem;
  }

  .memory-photo-surface,
  .memory-lightbox-media {
    width: 100%;
  }

  .memory-photo-surface {
    margin: 0;
  }

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

  .memory-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-player {
    grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr);
    gap: 1.75rem;
    align-items: start;
  }

  .memory-lightbox-dialog {
    grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr);
    align-items: start;
    padding: 1.2rem;
  }

  .memory-lightbox-close {
    grid-column: 1 / -1;
  }

  .quiz-shell {
  height: auto !important;
  min-height: unset !important;
}

.quiz-panel {
  display: block !important;
}
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
