:root {
  --bg-1: #20040f;
  --bg-2: #4f0f2e;
  --bg-3: #8a1f43;
  --card: rgba(255, 248, 244, 0.15);
  --text-main: #fff8f2;
  --text-soft: #ffe8d9;
  --accent: #ffd3a5;
  --accent-strong: #ffb6c7;
  --shadow: rgba(22, 4, 12, 0.45);
}

body.page-intro {
  --bg-1: #101522;
  --bg-2: #212d45;
  --bg-3: #4b3552;
  --text-soft: #e3e8fb;
  --accent: #f2d5af;
  --accent-strong: #ebc8b4;
  --shadow: rgba(7, 10, 18, 0.5);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text-main);
  background: linear-gradient(125deg, var(--bg-1), var(--bg-2), var(--bg-3));
  background-size: 180% 180%;
  animation: drift 14s ease infinite;
  overflow-x: hidden;
  position: relative;
}

.ambient-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 214, 177, 0.16), transparent 32%),
    radial-gradient(circle at 80% 25%, rgba(255, 168, 196, 0.18), transparent 30%),
    radial-gradient(circle at 50% 85%, rgba(255, 230, 197, 0.14), transparent 35%);
}

.page-intro .ambient-glow {
  background:
    radial-gradient(circle at 22% 22%, rgba(184, 198, 242, 0.18), transparent 36%),
    radial-gradient(circle at 78% 24%, rgba(241, 213, 175, 0.13), transparent 32%),
    radial-gradient(circle at 52% 82%, rgba(219, 195, 233, 0.12), transparent 38%);
}

.invite-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
  z-index: 2;
}

.invite-card {
  width: min(720px, 100%);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 240, 228, 0.2), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  box-shadow:
    0 20px 55px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  padding: clamp(1.6rem, 3vw, 2.8rem);
  text-align: center;
  animation: enter 900ms cubic-bezier(0.2, 0.9, 0.25, 1) both;
  transition: transform 420ms ease, opacity 420ms ease;
}

.page-intro .invite-card {
  background: linear-gradient(160deg, rgba(244, 239, 232, 0.18), rgba(208, 220, 250, 0.08));
  border: 1px solid rgba(227, 231, 249, 0.26);
}

.label {
  margin: 0;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--text-soft);
  opacity: 0.92;
  animation: fade-up 800ms ease both;
  animation-delay: 150ms;
}

.title {
  margin: 0.55rem 0 0.8rem;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.08;
  color: #ffe3d4;
  text-shadow: 0 5px 18px rgba(54, 3, 21, 0.45);
  animation: fade-up 850ms ease both;
  animation-delay: 220ms;
}

.line {
  margin: 0.5rem 0;
  font-size: clamp(1.3rem, 2.4vw, 1.65rem);
  line-height: 1.45;
  font-weight: 500;
  animation: fade-up 900ms ease both;
}

#line-intro {
  animation-delay: 320ms;
}

.line-event {
  animation-delay: 420ms;
}

.line-event a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 211, 165, 0.7);
  transition: color 180ms ease, border-color 180ms ease;
}

.line-event a:hover {
  color: #ffe0bc;
  border-color: #ffe0bc;
}

.signature {
  margin: 1.3rem 0 1.5rem;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent-strong);
  animation: fade-up 950ms ease both;
  animation-delay: 500ms;
}

.actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fade-up 1s ease both;
  animation-delay: 620ms;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.72rem 1.25rem;
  font-family: "Manrope", sans-serif;
  font-weight: 600;
  font-size: 1.08rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 220ms ease, background 220ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #361222;
  background: linear-gradient(135deg, #ffd8ac, #ffc6d0);
  box-shadow: 0 8px 20px rgba(255, 189, 165, 0.35);
}

.page-intro .btn-primary {
  color: #22273b;
  background: linear-gradient(135deg, #f2dfc6, #decae8);
  box-shadow: 0 8px 22px rgba(26, 32, 53, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 12px 26px rgba(255, 189, 165, 0.5);
}

.btn-secondary {
  color: #ffe8dc;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.btn-tertiary {
  color: #ffe8dc;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-tertiary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.note {
  margin: 1.1rem auto 0;
  max-width: 28ch;
  font-size: 1.15rem;
  color: #ffe8d6;
  animation: fade-up 650ms ease both;
}

.hearts-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.heart {
  position: absolute;
  bottom: -12%;
  left: var(--left);
  font-size: var(--size);
  color: rgba(255, 227, 221, 0.44);
  filter: drop-shadow(0 4px 8px rgba(31, 4, 15, 0.35));
  animation: float var(--duration) linear infinite;
  animation-delay: var(--delay);
}

.page-intro .heart {
  color: rgba(225, 230, 247, 0.24);
  filter: drop-shadow(0 4px 8px rgba(10, 13, 25, 0.35));
}

.page-transition-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.04);
  background: radial-gradient(circle at center, rgba(35, 23, 34, 0.35), rgba(5, 6, 12, 0.94));
  transition: opacity 520ms ease, transform 520ms ease;
  z-index: 6;
}

body.is-transitioning .page-transition-layer {
  opacity: 1;
  transform: scale(1);
}

body.is-transitioning .invite-card {
  opacity: 0;
  transform: translateY(-8px) scale(0.986);
}

@keyframes drift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  from {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 0.55;
  }
  85% {
    opacity: 0.3;
  }
  to {
    transform: translateY(-125vh) rotate(16deg);
    opacity: 0;
  }
}

@media (max-width: 640px) {
  .invite-card {
    border-radius: 22px;
    padding: 1.45rem 1.2rem 1.65rem;
  }

  .line {
    font-size: 1.2rem;
  }

  .btn {
    width: 100%;
  }

  .actions {
    gap: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }

  .page-transition-layer {
    display: none;
  }
}
