:root {
  --bg-0: #0a0602;
  --bg-1: #17100a;
  --bg-2: #2e2110;
  --gold: #ffd93d;
  --cream: #fdf3dc;
  --edge: 15vw;
  --photo-h: 48vh;
  --photo-w: calc(var(--photo-h) * 0.8);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--cream);
  background: radial-gradient(120% 80% at 72% 8%, var(--bg-2) 0%, var(--bg-1) 45%, var(--bg-0) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.scroll-track {
  position: relative;
  height: 900vh;
}

.stage {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.bouquet {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 70vh;
  z-index: 4;
  will-change: transform;
}

.bouquet::before {
  content: "";
  position: absolute;
  inset: -22% -28%;
  background: radial-gradient(circle at 50% 45%, rgba(255, 205, 40, 0.16), rgba(255, 205, 40, 0) 62%);
  pointer-events: none;
}

.bouquet__img {
  position: relative;
  height: 100%;
  width: auto;
  filter: drop-shadow(0 24px 45px rgba(0, 0, 0, 0.55));
}

.intro {
  position: absolute;
  left: 7vw;
  top: 30vh;
  width: 30vw;
  max-width: 520px;
  z-index: 5;
  will-change: transform, opacity;
}

.intro__title {
  margin: 0 0 1rem;
  font-family: "Playfair Display", serif;
  font-weight: 500;
  font-size: clamp(2.4rem, 4.6vw, 4.2rem);
  line-height: 1.02;
}

.intro__word {
  display: inline-block;
  white-space: nowrap;
}

.intro__letter {
  display: inline-block;
}

.intro__lede {
  margin: 0 0 1.6rem;
  max-width: 36ch;
  font-size: 0.98rem;
  line-height: 1.65;
  color: rgba(253, 243, 220, 0.68);
}

.intro__hint {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(253, 243, 220, 0.45);
}

.panels {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.panel {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ph {
  position: absolute;
  top: 26vh;
  height: var(--photo-h);
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 217, 61, 0.28);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.04) 0 10px, rgba(255, 255, 255, 0) 10px 20px),
    linear-gradient(160deg, #4a3a1d 0%, #2b2010 55%, #5b4823 100%);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5), inset 0 0 60px rgba(0, 0, 0, 0.35);
  will-change: transform, opacity;
}

.panel--right .ph {
  right: var(--edge);
}

.panel--left .ph {
  left: var(--edge);
}

.ph__icon {
  width: 24%;
  color: rgba(255, 217, 61, 0.5);
}

.ph__num {
  position: absolute;
  bottom: 7%;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.38em;
  color: rgba(255, 217, 61, 0.75);
}

.ph__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ph--panel.ph--has-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0) 45%);
  pointer-events: none;
}

.ph--panel.ph--has-img .ph__num {
  z-index: 1;
}

.caption {
  position: absolute;
  top: calc(50% + 27vh);
  width: var(--photo-w);
  will-change: transform, opacity;
}

.panel--right .caption {
  right: var(--edge);
}

.panel--left .caption {
  left: var(--edge);
}

.caption__index {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 217, 61, 0.72);
}

.caption__title {
  margin: 0 0 0.5rem;
  font-family: "Playfair Display", serif;
  font-weight: 500;
  font-size: clamp(1.15rem, 1.5vw, 1.6rem);
}

.caption__body {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(253, 243, 220, 0.62);
}

.burst {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.burst__ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  border: 2px solid rgba(255, 217, 61, 0.85);
  box-shadow: 0 0 70px 12px rgba(255, 217, 61, 0.28);
  opacity: 0;
}

.petal {
  position: absolute;
  left: 0;
  top: 0;
  width: 16px;
  height: 24px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: linear-gradient(160deg, #fff6c4 0%, #ffd93d 45%, #e29b00 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  will-change: transform, opacity;
}

.footer-scene {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}

.big-title {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: "Playfair Display", serif;
  text-transform: lowercase;
  line-height: 0.92;
  color: rgba(255, 217, 61, 0.14);
  -webkit-text-stroke: 1.5px rgba(255, 217, 61, 0.42);
  text-shadow: 0 0 90px rgba(255, 190, 0, 0.25);
  will-change: transform, opacity;
}

.big-title__sm {
  font-size: clamp(2.6rem, 6.5vw, 7rem);
  font-style: italic;
}

.big-title__lg {
  font-size: clamp(3.4rem, 12vw, 14rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.fallen {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.ph--card {
  height: auto;
  border-radius: 12px;
  will-change: transform, opacity;
}

.sound {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 30;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 217, 61, 0.32);
  background: rgba(23, 16, 10, 0.68);
  color: var(--gold);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: border-color 0.25s, transform 0.25s;
}

.sound[hidden] {
  display: none;
}

.sound:hover {
  border-color: rgba(255, 217, 61, 0.72);
  transform: scale(1.06);
}

.sound svg {
  width: 20px;
  height: 20px;
}

.sound__on,
.sound__off {
  transition: opacity 0.25s;
}

.sound__off {
  opacity: 0;
}

.sound.is-muted .sound__on {
  opacity: 0;
}

.sound.is-muted .sound__off {
  opacity: 1;
}

@media (max-width: 820px), (max-width: 1100px) and (orientation: portrait) {
  .scroll-track {
    height: 660vh;
  }

  .bouquet {
    top: 66%;
    height: 52vh;
    z-index: 2;
  }

  .intro {
    left: 8vw;
    top: 9vh;
    width: 84vw;
    max-width: none;
    text-align: center;
  }

  .intro__title {
    font-size: clamp(1.95rem, 9vw, 3.4rem);
    margin-bottom: 1rem;
  }

  .intro__lede {
    font-size: 0.88rem;
    line-height: 1.58;
    margin-bottom: 1rem;
  }

  .intro__hint {
    font-size: 0.68rem;
    letter-spacing: 0.24em;
  }

  .panel--right .ph,
  .panel--left .ph {
    left: calc((100% - min(64vw, 32vh)) / 2);
    right: auto;
    top: 33vh;
    bottom: auto;
    width: min(64vw, 32vh);
    height: auto;
  }

  .panel--right .caption,
  .panel--left .caption {
    left: 8vw;
    right: auto;
    top: 9vh;
    width: 84vw;
    text-align: center;
  }

  .caption__index {
    margin-bottom: 0.55rem;
  }

  .caption__title {
    font-size: clamp(1.25rem, 5.2vw, 1.8rem);
  }

  .caption__body {
    font-size: 0.9rem;
    line-height: 1.58;
    margin-left: auto;
    margin-right: auto;
    max-width: 44ch;
  }

  .big-title__sm {
    font-size: clamp(1.9rem, 8.5vw, 4rem);
  }

  .big-title__lg {
    font-size: clamp(2.5rem, 12vw, 7rem);
    white-space: normal;
  }
}

@media (orientation: landscape) and (min-width: 821px) and (max-height: 620px) {
  .intro {
    top: 15vh;
    width: 34vw;
  }

  .intro__title {
    font-size: clamp(1.5rem, 3.2vw, 2.4rem);
    margin-bottom: 0.8rem;
  }

  .intro__lede {
    font-size: 0.82rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
  }

  .caption {
    top: calc(50% + 24vh);
    width: 30vw;
  }

  .caption__title {
    font-size: 1.05rem;
  }

  .caption__body {
    font-size: 0.82rem;
    line-height: 1.5;
  }
}
