:root {
  --bg-deep: #0f0a1a;
  --bg-mid: #1a1028;
  --rose: #f0b8c8;
  --rose-light: #ffd6e3;
  --gold: #e8c090;
  --gold-soft: rgba(232, 192, 144, 0.5);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.94);
  --glass: rgba(18, 10, 32, 0.88);
  --glass-border: rgba(255, 200, 220, 0.22);
  --glass-hover: rgba(255, 255, 255, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Outfit", sans-serif;
  font-weight: 300;
  background: var(--bg-deep);
  color: var(--text);
  text-align: center;
  overflow-x: hidden;
  min-height: 100vh;
}

#canvas-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 50% 50%, rgba(10, 6, 20, 0.55) 0%, transparent 70%),
    radial-gradient(ellipse 90% 70% at 50% 40%, transparent 0%, rgba(15, 10, 26, 0.65) 100%),
    radial-gradient(circle at 50% 100%, rgba(232, 164, 184, 0.06) 0%, transparent 50%);
}

.readability-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 55% at 50% 50%, rgba(8, 4, 18, 0.72) 0%, transparent 75%);
}

.section {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 20px;
  display: none;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.section.active {
  display: flex;
  perspective: 1200px;
  animation: sectionIn 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes sectionIn {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.98);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.card {
  max-width: 620px;
  width: 100%;
  background: linear-gradient(160deg, rgba(28, 16, 48, 0.95) 0%, rgba(14, 8, 28, 0.92) 100%);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  padding: 48px 36px;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: box-shadow 0.3s ease;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 45%, rgba(232, 164, 184, 0.04) 100%);
  pointer-events: none;
}

.card-inner {
  position: relative;
  z-index: 1;
  transform: translateZ(30px);
}

.section.active .card-inner > * {
  opacity: 0;
  animation: contentIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.section.active .card-inner > *:nth-child(1) { animation-delay: 0.1s; }
.section.active .card-inner > *:nth-child(2) { animation-delay: 0.2s; }
.section.active .card-inner > *:nth-child(3) { animation-delay: 0.3s; }
.section.active .card-inner > *:nth-child(4) { animation-delay: 0.4s; }
.section.active .card-inner > *:nth-child(5) { animation-delay: 0.5s; }
.section.active .card-inner > *:nth-child(6) { animation-delay: 0.6s; }
.section.active .card-inner > *:nth-child(7) { animation-delay: 0.7s; }
.section.active .letter-text p {
  opacity: 0;
  animation: contentIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.section.active .letter-text p:nth-child(1) { animation-delay: 0.35s; }
.section.active .letter-text p:nth-child(2) { animation-delay: 0.5s; }
.section.active .letter-text p:nth-child(3) { animation-delay: 0.65s; }
.section.active .letter-text p:nth-child(4) { animation-delay: 0.8s; }

@keyframes contentIn {
  from {
    opacity: 0;
    transform: translateY(18px) translateZ(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateZ(0);
  }
}

.section.active .card-inner > .letter-text {
  animation: none;
  opacity: 1;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}

.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
  font-weight: 500;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

h1 {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 20px;
  color: #ffffff;
  text-shadow:
    0 2px 20px rgba(232, 164, 184, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.6);
}

p {
  font-size: clamp(1.05rem, 2.5vw, 1.15rem);
  line-height: 1.85;
  color: var(--text-muted);
  font-weight: 400;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

p em {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.15em;
  color: var(--rose-light);
  text-shadow: 0 0 20px rgba(255, 214, 227, 0.3);
}

.divider {
  margin: 24px auto;
  letter-spacing: 12px;
  color: var(--gold);
  opacity: 0.85;
  font-size: 0.85rem;
  text-shadow: 0 0 12px rgba(232, 192, 144, 0.4);
}

.btn {
  margin-top: 32px;
  padding: 14px 36px;
  font-family: "Outfit", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255, 200, 220, 0.45);
  border-radius: 100px;
  background: linear-gradient(135deg, rgba(240, 184, 200, 0.28), rgba(232, 192, 144, 0.2));
  color: #ffffff;
  cursor: pointer;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s ease,
              background 0.3s ease,
              border-color 0.3s ease;
}

.btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 40px rgba(232, 164, 184, 0.35);
  background: linear-gradient(135deg, rgba(240, 184, 200, 0.4), rgba(232, 192, 144, 0.28));
  border-color: rgba(255, 214, 227, 0.7);
}

.btn:active {
  transform: translateY(0);
}

.counter {
  margin-top: 28px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.4rem;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 200, 220, 0.25);
  padding: 16px 24px;
  border-radius: 20px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.counter b {
  font-weight: 600;
  color: var(--gold);
  font-size: 1.25em;
  text-shadow: 0 0 16px rgba(232, 192, 144, 0.5);
}

.letter-text {
  text-align: left;
  max-width: 480px;
  margin: 0 auto;
}

.letter-text p + p {
  margin-top: 1.2em;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.gallery img {
  width: 100%;
  height: 170px;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid rgba(255, 200, 220, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: scale(0.92) translateY(12px);
  animation: photoIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.gallery img:hover {
  transform: scale(1.02);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.gallery img:nth-child(1) { animation-delay: 0.3s; }
.gallery img:nth-child(2) { animation-delay: 0.55s; }
.gallery img:nth-child(3) { animation-delay: 0.8s; }
.gallery img:nth-child(4) { animation-delay: 1.05s; }

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

.final-icon {
  font-size: 3.5rem;
  margin: 28px 0 16px;
  display: inline-block;
  animation: pulse 4s ease-in-out infinite;
  filter: drop-shadow(0 0 24px rgba(232, 164, 184, 0.4));
}

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

.signature {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 1.4rem;
  color: var(--rose-light);
  margin-top: 8px;
  text-shadow: 0 0 24px rgba(255, 214, 227, 0.4);
}

.progress-dots {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.4s ease, transform 0.4s ease, width 0.4s ease;
}

.dot.active {
  background: var(--rose-light);
  width: 20px;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(255, 214, 227, 0.5);
}

.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: transparent;
  pointer-events: none;
}

.gate-overlay .gate-card {
  pointer-events: auto;
}

.gate-card {
  max-width: 420px;
  width: 100%;
}

.gate-card h1 {
  margin-bottom: 12px;
}

.gate-card p {
  margin-bottom: 24px;
}

.gate-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(255, 200, 220, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-family: "Outfit", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.gate-input:focus {
  outline: none;
  border-color: rgba(255, 214, 227, 0.7);
  box-shadow: 0 0 0 3px rgba(240, 184, 200, 0.15);
}

.gate-error {
  color: #ffb4c4;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .card { padding: 36px 24px; border-radius: 24px; }
  .gallery { grid-template-columns: 1fr; }
  .gallery img { height: 200px; }
  .progress-dots { bottom: 20px; }
}
