/* Mothers Day love letter — Kelly */
:root {
  --bg-deep: #0c0a12;
  --bg-mid: #1a1228;
  --accent: #e8a598;
  --accent2: #c9a227;
  --text: #f4f0ea;
  --muted: rgba(244, 240, 234, 0.72);
  --line: rgba(232, 165, 152, 0.35);
  --card: rgba(26, 18, 40, 0.85);
  --glow: rgba(232, 165, 152, 0.15);
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-sans: "Outfit", system-ui, sans-serif;
  --radius: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@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;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--text);
  background: radial-gradient(120% 80% at 50% -10%, #2d1f44 0%, var(--bg-deep) 55%, #050308 100%);
  line-height: 1.65;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

/* Security gate */
.site-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(120% 80% at 50% -10%, #2d1f44 0%, var(--bg-deep) 55%, #050308 100%);
}

.site-gate[hidden] {
  display: none;
}

.site-gate__panel {
  width: min(100%, 24rem);
  padding: 2rem 1.75rem 1.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(12px);
}

.site-gate__eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.85rem;
}

.site-gate__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 8vw, 2.75rem);
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 0.75rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 45%, var(--accent2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-gate__lead {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-gate__form {
  display: grid;
  gap: 0.85rem;
  text-align: left;
}

.site-gate__question {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--text);
}

.site-gate__input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(12, 10, 18, 0.55);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.site-gate__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow);
}

.site-gate__submit {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(232, 165, 152, 0.12);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.site-gate__submit:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px var(--glow);
}

.site-gate__error {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  color: #f0a8a0;
}

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero,
.letter,
.timeline-section,
.gems,
.album-jukebox-section,
.footer {
  position: relative;
  z-index: 2;
}

/* Hero */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem 6rem;
}

.hero__eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 10vw, 5.5rem);
  font-weight: 400;
  line-height: 1.05;
  margin: 0 0 1rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 45%, var(--accent2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__name {
  font-style: italic;
}

.hero__subtitle {
  max-width: 28rem;
  color: var(--muted);
  font-size: 1.15rem;
  margin: 0 0 2.5rem;
}

.hero__scroll-hint {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(12, 10, 18, 0.5);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  backdrop-filter: blur(8px);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.hero__scroll-hint:hover,
.hero__scroll-hint:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 32px var(--glow);
  outline: none;
}

.hero__scroll-hint:active {
  transform: scale(0.98);
}

.hero__chev {
  font-size: 1rem;
  animation: bob 2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .hero__chev {
    animation: none;
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal--delay-1 {
  transition-delay: 0.08s;
}
.reveal--delay-2 {
  transition-delay: 0.16s;
}
.reveal--delay-3 {
  transition-delay: 0.24s;
}

/* Letter */
.letter {
  padding: 2rem 1.25rem 4rem;
  display: flex;
  justify-content: center;
}

.letter__paper {
  max-width: 38rem;
  background: linear-gradient(160deg, rgba(36, 28, 52, 0.92), rgba(18, 14, 28, 0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 5vw, 3rem);
  box-shadow: var(--shadow);
  font-size: 1.05rem;
}

.letter__salutation {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-top: 0;
}

.letter__closing {
  margin-top: 2rem;
  margin-bottom: 0.25rem;
  font-style: italic;
  color: var(--accent);
}

.letter__signature {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  margin: 0;
}

.letter__ps {
  margin-top: 1.75rem;
}

/* Section heads */
.section-head {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

.section-head h2 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 400;
  margin: 0 0 0.75rem;
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.section-head code {
  font-size: 0.82em;
  font-family: ui-monospace, monospace;
  background: rgba(232, 165, 152, 0.12);
  padding: 0.12em 0.45em;
  border-radius: 6px;
  color: var(--text);
}

/* Timeline */
.timeline-section {
  padding: clamp(2.5rem, 10vh, 6rem) 1.25rem clamp(4rem, 12vh, 7rem);
}

.timeline-section .section-head {
  scroll-margin-top: 1rem;
}

.timeline-section__frame {
  max-width: 72rem;
  margin: 0 auto;
}

.timeline-nav {
  position: fixed;
  top: calc(50vh - 48px);
  right: max(1rem, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  z-index: 6;
}

.timeline-nav__btn {
  appearance: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(12, 10, 18, 0.72);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.timeline-nav__btn:hover:not(:disabled),
.timeline-nav__btn:focus-visible:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 0 28px var(--glow);
  outline: none;
}

.timeline-nav__btn:active:not(:disabled) {
  transform: scale(0.96);
}

.timeline-nav__btn:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 72rem;
  width: 100%;
  min-width: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    var(--accent),
    rgba(201, 162, 39, 0.35) 42%,
    rgba(232, 165, 152, 0.12)
  );
  transform: translateX(-50%);
  border-radius: 2px;
  z-index: 0;
}

.timeline__item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
  margin-bottom: clamp(2.25rem, 5vw, 3.25rem);
  scroll-margin-top: 1rem;
  scroll-margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.timeline__step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem 0.85rem;
  width: 100%;
  margin: 0 auto 0.35rem;
  padding: 0 1rem;
  position: relative;
}

.timeline__dot {
  grid-column: 2;
  grid-row: 1;
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--accent2);
  box-shadow: 0 0 0 3px rgba(12, 10, 18, 0.95), 0 0 14px rgba(232, 165, 152, 0.35);
}

.timeline__year {
  grid-row: 1;
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2.8vw, 1.4rem);
  font-weight: 400;
  color: var(--accent2);
  letter-spacing: 0.02em;
  display: block;
  margin: 0;
  padding: 0;
  line-height: 1.25;
  min-width: 0;
}

.timeline__item:nth-child(odd) .timeline__year {
  grid-column: 1;
  justify-self: end;
  text-align: right;
}

.timeline__item:nth-child(even) .timeline__year {
  grid-column: 3;
  justify-self: start;
  text-align: left;
}

.timeline__main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(1rem, 2.5vw, 2rem);
  width: 100%;
  min-width: 0;
}

.timeline__item:nth-child(even) .timeline__main {
  direction: rtl;
}

.timeline__item:nth-child(even) .timeline__main > * {
  direction: ltr;
}

.timeline__card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  min-height: 0;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.125rem 1.35rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.timeline__photo {
  margin: 0;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.timeline__img {
  flex: 1 1 0;
  width: 100%;
  min-height: clamp(200px, 30vw, 320px);
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center 20%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  background: var(--card);
}

.timeline__cap {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
  padding: 0 0.15rem;
  max-width: min(52ch, 100%);
}

.timeline__card h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin: 0 0 0.5rem;
  color: var(--accent);
}

.timeline__card p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--muted);
}

.timeline__card strong {
  color: var(--text);
  font-weight: 500;
}

.egg-fireballs,
.egg-honey {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.egg-fireballs:hover,
.egg-honey:hover,
.egg-fireballs:focus-visible,
.egg-honey:focus-visible {
  color: var(--accent2);
  outline: none;
}

.egg-fireballs.is-pulse,
.egg-honey.is-pulse {
  animation: pulse 0.6s ease;
}

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

@media (max-width: 768px) {
  html {
    scroll-padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  }

  .toast {
    bottom: calc(7rem + env(safe-area-inset-bottom, 0px));
  }

  .timeline-nav {
    top: auto;
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    flex-direction: row;
    border-radius: 14px;
    padding: 0.35rem;
    background: rgba(12, 10, 18, 0.82);
    border: 1px solid var(--line);
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  }

  .timeline-nav__btn {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    border: none;
    box-shadow: none;
    background: transparent;
  }

  .timeline-nav__btn:hover:not(:disabled),
  .timeline-nav__btn:focus-visible:not(:disabled) {
    background: rgba(232, 165, 152, 0.12);
  }

  .timeline-section {
    padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
  }

  .timeline {
    padding-left: 0;
  }

  .timeline::before {
    left: 15px;
    transform: none;
  }

  .timeline__item {
    padding-left: 0;
    margin-bottom: 2.5rem;
    gap: 0.75rem;
  }

  .timeline__step {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.7rem;
    margin: 0 0 0.15rem;
    padding: 0 0.75rem 0 2.35rem;
  }

  .timeline__dot {
    position: absolute;
    left: 15px;
    margin-top: 0.12rem;
    width: 12px;
    height: 12px;
    transform: translateX(-50%);
    grid-column: unset;
    grid-row: unset;
    box-shadow: 0 0 0 3px rgba(12, 10, 18, 0.95), 0 0 12px rgba(232, 165, 152, 0.28);
  }

  .timeline__year {
    flex: 1 1 auto;
    grid-column: unset;
    grid-row: unset;
    justify-self: unset;
    min-width: 0;
    width: 100%;
    padding: 0;
    position: relative;
    z-index: 1;
    font-size: 1.2rem;
  }

  .timeline__item:nth-child(odd) .timeline__year {
    text-align: left;
  }

  .timeline__item:nth-child(even) .timeline__year {
    text-align: right;
  }

  .timeline__item:nth-child(even) .timeline__main {
    direction: ltr;
  }

  .timeline__main {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .timeline__item:nth-child(even) .timeline__card {
    order: 2;
  }

  .timeline__item:nth-child(even) .timeline__photo {
    order: 1;
  }

  .timeline__photo {
    height: auto;
  }

  .timeline__img {
    min-height: min(52vw, 280px);
    max-height: min(62vw, 400px);
    flex: 0 0 auto;
  }
}

/* Gem cards */
.gems {
  padding: 2rem 1.25rem 5rem;
}

.gems__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 0.5rem;
  perspective: 1200px;
}

.gem-card {
  position: relative;
  min-height: 160px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: transparent;
  border-radius: var(--radius);
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  text-align: left;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: rgba(232, 165, 152, 0.12);
}

.gem-card.is-flipped {
  transform: rotateY(180deg);
}

.gem-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.gem-card__front,
.gem-card__back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
}

.gem-card__front {
  background: linear-gradient(145deg, rgba(45, 35, 68, 0.95), rgba(20, 16, 32, 0.98));
}

.gem-card__back {
  background: linear-gradient(145deg, rgba(60, 42, 38, 0.95), rgba(26, 18, 40, 0.98));
  transform: rotateY(180deg);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

.gem-card__icon {
  font-size: 1.5rem;
  opacity: 0.85;
}

.gem-card__teaser {
  font-family: var(--font-serif);
  font-size: 1.2rem;
}

/* Album jukebox (replaces vinyl) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.album-jukebox-section {
  padding: 3rem 1rem 5rem;
  display: flex;
  justify-content: center;
}

.album-jukebox-section__inner {
  text-align: center;
  max-width: 26rem;
  width: 100%;
}

.album-jukebox__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
}

.album-jukebox {
  width: min(240px, 72vw);
  aspect-ratio: 1;
  border-radius: 6px;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
  margin: 0;
  display: block;
  background: linear-gradient(145deg, rgba(36, 28, 52, 0.95), rgba(14, 12, 22, 0.98));
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: visible;
  transition: box-shadow 0.25s, transform 0.2s;
}

.album-jukebox:hover,
.album-jukebox:focus-visible {
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(232, 165, 152, 0.35),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  outline: none;
}

.album-jukebox:active:not(:disabled) {
  transform: scale(0.985);
}

.album-jukebox__play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 165, 152, 0.45);
  background: linear-gradient(165deg, rgba(36, 28, 52, 0.95), rgba(20, 16, 32, 0.98));
  color: var(--accent);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: box-shadow 0.2s, transform 0.15s, border-color 0.2s, opacity 0.2s;
}

.album-jukebox__play:hover:not(:disabled),
.album-jukebox__play:focus-visible:not(:disabled) {
  border-color: rgba(232, 165, 152, 0.75);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(232, 165, 152, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  outline: none;
}

.album-jukebox__play:active:not(:disabled) {
  transform: scale(0.96);
}

.album-jukebox__play:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.album-jukebox.is-dealing {
  cursor: wait;
  pointer-events: none;
}

.album-jukebox__shine {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.14) 0%,
    transparent 38%,
    transparent 62%,
    rgba(255, 255, 255, 0.04) 100%
  );
  opacity: 0.85;
}

.album-jukebox__art {
  position: absolute;
  inset: 10px;
  z-index: 1;
  border-radius: 3px;
  overflow: visible;
  perspective: 920px;
  transform-style: preserve-3d;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.album-jukebox__stack {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.album-jukebox__layer {
  position: absolute;
  inset: 0;
  border-radius: 3px;
  overflow: hidden;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition:
    transform 0.62s cubic-bezier(0.34, 1.06, 0.36, 1),
    opacity 0.5s ease,
    filter 0.5s ease;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}

.album-jukebox__layer--front {
  z-index: 3;
  transform: translate3d(0, 0, 0) scale(1);
}

.album-jukebox__layer--mid {
  z-index: 2;
  transform: translate3d(clamp(10px, 3.4vw, 16px), 12px, -48px) scale(0.9);
  opacity: 0.94;
  filter: brightness(0.94);
}

/* Deepest slot: holds queue lookahead but stays invisible (only front + mid peek are shown). */
.album-jukebox__layer--back {
  z-index: 1;
  transform: translate3d(0, 22px, -96px) scale(0.82);
  opacity: 0;
  pointer-events: none;
  filter: brightness(0.88);
}

.album-jukebox__layer--front.album-jukebox__layer--exit-slide {
  transform-origin: 50% 50%;
  transform: translate3d(-118%, 0, 0) rotateZ(-1.5deg) scale(0.94);
  opacity: 1;
  z-index: 4;
  filter: brightness(1);
}

/* Outgoing sleeve eases from off-screen left into the deep slot (mid stays risen on top). */
.album-jukebox__layer--front.album-jukebox__layer--dock-back {
  transform-origin: 50% 50%;
  transform: translate3d(0, 22px, -96px) scale(0.82);
  opacity: 1;
  z-index: 1;
  filter: brightness(0.88);
}

.album-jukebox__layer--mid.album-jukebox__layer--rise {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
  z-index: 5;
  filter: brightness(1);
}

.album-jukebox__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.album-jukebox__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1rem;
  text-align: center;
  background: radial-gradient(120% 100% at 50% 0%, rgba(232, 165, 152, 0.18), rgba(26, 18, 40, 0.92));
  border: 1px solid rgba(232, 165, 152, 0.2);
}

.album-jukebox__placeholder-title {
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  font-weight: 400;
  color: var(--text);
  line-height: 1.2;
}

.album-jukebox__placeholder-sub {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.album-jukebox__title {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 4vw, 1.45rem);
  font-weight: 400;
  color: var(--accent);
  margin: 1.35rem 0 0.25rem;
  line-height: 1.25;
}

.album-jukebox__subtitle {
  margin: 0;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.album-jukebox__caption {
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  padding: 0 0.25rem;
}

.album-jukebox__pick-hint {
  color: var(--accent2);
  font-weight: 500;
}

/* Footer */
.footer {
  padding: 3rem 1.25rem 5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer__link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.footer__link:hover {
  border-color: var(--accent);
}

.footer__ghost {
  position: fixed;
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  right: max(1rem, env(safe-area-inset-right, 0px));
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(12, 10, 18, 0.75);
  cursor: pointer;
  font-size: 1.25rem;
  z-index: 5;
  opacity: 0.35;
  transition: opacity 0.25s, transform 0.25s, box-shadow 0.25s;
}

.footer__ghost:hover,
.footer__ghost:focus-visible {
  opacity: 1;
  transform: scale(1.05);
  box-shadow: 0 0 24px var(--glow);
  outline: none;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 20;
  background: rgba(36, 28, 52, 0.95);
  border: 1px solid var(--line);
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  transition: opacity 0.35s, transform 0.35s;
  opacity: 0;
  pointer-events: none;
  max-width: min(90vw, 24rem);
  text-align: center;
}

.toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  padding: max(1.25rem, env(safe-area-inset-top, 0px))
    max(1.25rem, env(safe-area-inset-right, 0px))
    max(1.25rem, env(safe-area-inset-bottom, 0px))
    max(1.25rem, env(safe-area-inset-left, 0px));
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 10, 0.72);
  backdrop-filter: blur(6px);
}

.modal__panel {
  position: relative;
  z-index: 1;
  max-width: 26rem;
  width: 100%;
  max-height: calc(100vh - 3rem);
  max-height: calc(100dvh - 3rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(165deg, #2a2238, #14101c);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: var(--shadow);
}

.modal__panel--burst {
  text-align: center;
  max-width: 28rem;
}

.modal__panel h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  margin-top: 0;
}

.modal__big {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 1.35;
  color: var(--accent);
  margin-bottom: 0;
}

.modal__x {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal__x:hover {
  color: var(--text);
}

/* Confetti particles */
.confetti-piece {
  position: fixed;
  width: 8px;
  height: 8px;
  pointer-events: none;
  z-index: 25;
  border-radius: 2px;
  animation: confetti-fall 2.2s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) rotate(720deg);
    opacity: 0;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 3rem 1rem 4.5rem;
  }

  .hero__eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.22em;
  }

  .letter {
    padding: 1.5rem 1rem 3rem;
  }

  .gems {
    padding: 1.5rem 1rem 4rem;
  }

  .gems__grid {
    padding: 0 0.15rem;
  }

  .footer {
    padding: 2.5rem 1rem 4.5rem;
  }

  .timeline__cap {
    line-height: 1.55;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
