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

:root {
  --cream: #efe6dc;
  --pearl: #d4c4c8;
  --ink: #3a2e32;
  --gold: #d4b07a;
  --dusk: #3d1014;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-script: "Great Vibes", cursive;
  --font-sans: "Outfit", system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html,
body {
  min-height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  font-family: var(--font-sans);
  background:
    radial-gradient(ellipse at 50% 0%, #5c1c22 0%, #3d1014 55%, #2a0b0e 100%);
  color: #f3ead8;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.wash {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(61, 16, 20, 0.2) 0%,
      rgba(61, 16, 20, 0.62) 48%,
      #3d1014 86%
    ),
    url("../assets/invite-mood.jpg") center 22% / cover no-repeat,
    #3d1014;
}

.petals {
  position: fixed;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.petals span {
  position: absolute;
  top: -10%;
  color: #d4b07a;
  animation: fall linear infinite;
}

@keyframes fall {
  to {
    transform: translateY(120vh) rotate(40deg);
  }
}

#stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

body.stars-on #stars {
  opacity: 1;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
  50% {
    opacity: 0.9;
  }
  0%,
  100% {
    opacity: 0.2;
  }
}

.scene {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.65s ease, visibility 0.65s;
}

.scene.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.scene--scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  justify-content: flex-start;
  padding-top: 3.5rem;
  padding-bottom: 3rem;
}

.pearl {
  background: #f6f0e4;
}

.wax {
  position: relative;
  z-index: 2;
  width: min(340px, 86vw);
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  animation: seal-breathe 2.8s ease-in-out infinite;
}

.wax-logo {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.wax.opening {
  animation: seal-lift 0.7s ease forwards;
}

@keyframes seal-lift {
  to {
    transform: scale(1.08) translateY(-10px);
    opacity: 0;
  }
}

@keyframes seal-breathe {
  50% {
    transform: scale(1.03);
  }
}

.hint {
  position: relative;
  z-index: 2;
  margin-top: 1.75rem;
  font-family: var(--font-serif);
  color: #5c4448;
  font-size: 1.05rem;
}

.hint.dark {
  color: #5c4448;
}

.silk {
  background: linear-gradient(180deg, #f3ebe4, #e4d4d0);
  color: #5c2d35;
}

.silk-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.35rem, 5vw, 1.85rem);
  text-align: center;
  margin-bottom: 1.5rem;
  z-index: 1;
}

.silk-card {
  position: relative;
  width: min(260px, 78vw);
  height: min(340px, 48vh);
  border-radius: 18px 18px 12px 12px;
  background: linear-gradient(180deg, #f7eef1, #e8d6d8);
  box-shadow: 0 24px 50px rgba(80, 40, 50, 0.18);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.emboss {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(120, 80, 90, 0.18);
  border-radius: 40% 40% 12px 12px / 18% 18% 12px 12px;
  box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.4);
}

.silk-bow {
  position: relative;
  width: 160px;
  height: 110px;
  border: 0;
  background: none;
  cursor: pointer;
  z-index: 2;
}

.loop {
  position: absolute;
  top: 18px;
  width: 70px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f3e0e4, #c9a0a8 70%);
  box-shadow: 0 8px 16px rgba(90, 50, 60, 0.2);
}

.loop.left {
  left: 8px;
  transform: rotate(-18deg);
}

.loop.right {
  right: 8px;
  transform: rotate(18deg);
}

.knot {
  position: absolute;
  left: 50%;
  top: 28px;
  width: 28px;
  height: 34px;
  margin-left: -14px;
  border-radius: 8px;
  background: linear-gradient(180deg, #e8c4ca, #b87884);
  z-index: 2;
}

.tail {
  position: absolute;
  top: 56px;
  width: 22px;
  height: 54px;
  background: linear-gradient(180deg, #d9aeb4, #c4929c);
  clip-path: polygon(0 0, 100% 0, 85% 100%, 15% 100%);
}

.tail.left {
  left: 52px;
  transform: rotate(12deg);
}

.tail.right {
  right: 52px;
  transform: rotate(-12deg);
}

.silk-bow.untied .loop.left {
  transform: translate(-40px, -10px) rotate(-40deg);
  opacity: 0.2;
  transition: 0.7s ease;
}

.silk-bow.untied .loop.right {
  transform: translate(40px, -10px) rotate(40deg);
  opacity: 0.2;
  transition: 0.7s ease;
}

.silk-bow.untied .knot,
.silk-bow.untied .tail {
  opacity: 0;
  transition: 0.5s ease;
}

.dusk {
  background: transparent;
}

.kicker {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.8rem;
}

.soft {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  opacity: 0.8;
}

.names {
  font-family: var(--font-script);
  font-size: clamp(2.6rem, 12vw, 4.2rem);
  font-weight: 400;
  text-align: center;
  line-height: 1.05;
  margin: 0.6rem 0 1rem;
  color: var(--gold);
}

.names em {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-style: italic;
  color: #f6efe8;
  opacity: 0.7;
}

.venue {
  text-align: center;
  opacity: 0.65;
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
  line-height: 1.5;
}

.btn-gold {
  font-family: var(--font-sans);
  border: 0;
  cursor: pointer;
  color: #2a1810;
  background: linear-gradient(135deg, #f0d189, #d4a24a);
  padding: 0.9rem 1.8rem;
  border-radius: 999px;
  min-height: 48px;
  font-size: 0.95rem;
}

.btn-gold.hidden,
.hidden {
  display: none !important;
}

.serif-line {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.progress-wrap {
  width: min(280px, 80vw);
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #e8c4ca, var(--gold));
}

.loading-text {
  font-size: 0.85rem;
  opacity: 0.6;
}

.scene-title {
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 5vw, 2rem);
  text-align: center;
  margin-bottom: 0.4rem;
}

.sub {
  text-align: center;
  opacity: 0.65;
  font-size: 0.88rem;
  margin-bottom: 1.4rem;
  max-width: 20rem;
}

.vow-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-bottom: 1.3rem;
}

.heart-btn {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  background: radial-gradient(circle at 30% 30%, #f4b4c4, #c45a72);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 1.1rem;
}

.heart-btn.popped {
  animation: pop 0.35s ease forwards;
  pointer-events: none;
}

@keyframes pop {
  to {
    transform: scale(1.4);
    opacity: 0;
  }
}

.reason-list {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.4rem;
}

.reason-card {
  padding: 1rem 1.15rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 181, 106, 0.35);
  background: rgba(255, 255, 255, 0.05);
  animation: slide-up 0.4s ease;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.reason-badge {
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin-bottom: 0.3rem;
}

.polaroid-track-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
  margin-bottom: 1rem;
}

.clothesline {
  position: absolute;
  top: 12px;
  left: 5%;
  right: 5%;
  height: 2px;
  background: rgba(255, 255, 255, 0.22);
}

.polaroid-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 2rem 1rem 1rem;
  scrollbar-width: none;
}

.polaroid-track::-webkit-scrollbar {
  display: none;
}

.polaroid {
  flex: 0 0 82%;
  scroll-snap-align: center;
  background: #faf8f5;
  padding: 0.65rem 0.65rem 2.4rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  transform: rotate(-2deg);
}

.polaroid img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
}

.polaroid figcaption {
  font-family: var(--font-script);
  font-size: 1.15rem;
  color: #444;
  text-align: center;
  margin-top: 0.6rem;
}

.dots {
  display: flex;
  gap: 6px;
  margin-bottom: 1.25rem;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.dot.active {
  background: var(--gold);
}

.envelope-btn {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 1rem;
}

.envelope {
  position: relative;
  width: 168px;
  height: 114px;
}

.env-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #f0d189, #d4a24a);
  border-radius: 4px;
}

.env-letter {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 18%;
  height: 55%;
  background: #fff;
  display: grid;
  place-items: center;
  transition: transform 0.5s ease;
}

.envelope.open .env-letter {
  transform: translateY(-45px);
}

.env-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 55%;
  background: linear-gradient(180deg, #f5dc9c, #c99640);
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transition: transform 0.5s ease;
}

.envelope.open .env-flap {
  transform: rotateX(180deg);
}

.tap-letter {
  font-size: 0.75rem;
  opacity: 0.45;
  margin-top: 0.5rem;
}

.paper {
  background: #faf6f0;
  color: #3a3028;
  padding: 2rem 1.7rem;
  border-radius: 4px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  margin-bottom: 1.5rem;
}

.paper-dear {
  font-family: var(--font-script);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.paper-head {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.paper-body {
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.paper-sign {
  font-family: var(--font-script);
  font-size: 1.35rem;
  margin-top: 1.2rem;
  text-align: right;
}

.timeline {
  list-style: none;
  width: min(340px, 100%);
  border-left: 1px solid rgba(212, 181, 106, 0.4);
  padding-left: 1.2rem;
  margin: 0.5rem 0 1.5rem;
}

.timeline li {
  margin-bottom: 1.15rem;
}

.timeline time {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

.timeline strong {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.15rem;
}

.timeline span {
  display: block;
  font-size: 0.85rem;
  opacity: 0.65;
  margin-top: 0.15rem;
}

.dress {
  max-width: 22rem;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.55;
  opacity: 0.8;
  margin-bottom: 1.2rem;
}

.maps {
  color: var(--gold);
  margin-bottom: 1.4rem;
  font-size: 0.9rem;
}

.finale {
  text-align: center;
}

.finale-name {
  font-family: var(--font-script);
  font-size: clamp(3rem, 14vw, 5rem);
  color: var(--gold);
}

.finale-heart {
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  opacity: 0.8;
}

#confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  animation: confetti-fall 2.5s ease-out forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.home-link {
  position: fixed;
  top: calc(0.75rem + var(--safe-top));
  left: 0.75rem;
  z-index: 50;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.mute-btn {
  position: fixed;
  top: calc(0.65rem + var(--safe-top));
  right: 0.65rem;
  z-index: 50;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
}
