:root {
  --background: 34 42% 97%;
  --foreground: 342 22% 18%;
  --primary: 344 52% 63%;
  --secondary: 35 50% 92%;
  --accent: 41 56% 73%;
  --muted: 24 20% 90%;
  --destructive: 0 72% 58%;
  --border: 26 24% 83%;
  --card: 0 0% 100%;
  --shadow-sm: 0 10px 30px rgba(122, 87, 95, 0.08);
  --shadow-md: 0 18px 45px rgba(122, 87, 95, 0.14);
  --shadow-lg: 0 24px 80px rgba(191, 129, 149, 0.22);
  --transition-fast: 180ms ease;
  --transition-smooth: 360ms cubic-bezier(0.22, 1, 0.36, 1);
  --radius-sm: 0.75rem;
  --radius-md: 1.25rem;
  --radius-lg: 2rem;
}

.dark {
  --background: 340 22% 10%;
  --foreground: 34 35% 94%;
  --primary: 343 58% 71%;
  --secondary: 340 20% 18%;
  --accent: 41 58% 68%;
  --muted: 340 12% 22%;
  --destructive: 0 80% 66%;
  --border: 338 14% 28%;
  --card: 340 18% 14%;
  --shadow-sm: 0 12px 30px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 30px 90px rgba(255, 167, 192, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
}

body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

::selection {
  background: hsl(var(--primary) / 0.2);
}

.hero-gradient {
  background:
    radial-gradient(circle at 18% 20%, hsl(var(--primary) / 0.22), transparent 24%),
    radial-gradient(circle at 78% 18%, hsl(var(--accent) / 0.22), transparent 22%),
    linear-gradient(180deg, hsl(var(--secondary) / 0.92), hsl(var(--background)) 56%, hsl(var(--background)) 100%);
}

.hero-reveal-shell {
  position: relative;
  min-height: calc(100vh - 5rem);
}

.hero-content {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition: opacity 1100ms ease, transform 1400ms cubic-bezier(0.19, 1, 0.22, 1);
  transition-delay: 420ms;
}

.hero-content-center {
  min-height: calc(100vh - 5rem);
  padding: 5rem 1.5rem;
}

.hero-reveal-shell.is-open .hero-content {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hero-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-reveal-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 248, 246, 0.98), rgba(246, 227, 220, 0.99)),
    linear-gradient(135deg, rgba(212, 159, 175, 0.25), rgba(232, 194, 139, 0.22));
  transition: transform 2400ms cubic-bezier(0.22, 1, 0.36, 1), opacity 1400ms ease;
}

.dark .hero-reveal-panel {
  background:
    linear-gradient(180deg, rgba(45, 30, 36, 0.98), rgba(34, 24, 29, 0.99)),
    linear-gradient(135deg, rgba(212, 159, 175, 0.15), rgba(232, 194, 139, 0.15));
}

.hero-reveal-panel::before {
  content: "";
  position: absolute;
  inset: 1.5rem;
  border-radius: 2rem;
  border: 1px solid hsl(var(--primary) / 0.15);
}

.panel-left {
  left: 0;
  width: 50%;
  z-index: 102;
}

.panel-right {
  right: 0;
  width: 50%;
  z-index: 101;
}

.hero-reveal-divider {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, 
    transparent, 
    hsl(var(--primary) / 0.3), 
    hsl(var(--accent) / 0.5), 
    hsl(var(--primary) / 0.3), 
    transparent
  );
  z-index: 105;
  transform: translateX(-50%);
  transition: opacity 800ms ease, transform 2400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-panel-ornament {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 35% 30%, hsl(var(--primary) / 0.12) 0 22px, transparent 23px),
    radial-gradient(circle at 65% 68%, hsl(var(--accent) / 0.12) 0 26px, transparent 27px),
    radial-gradient(circle at 60% 38%, rgba(255,255,255,0.45) 0 10px, transparent 11px);
  opacity: 0.6;
}

.hero-open-button {
  position: relative;
  z-index: 110;
  display: flex;
  width: 9.5rem;
  height: 9.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--accent)));
  color: white;
  
  /* Bevel effect */
  box-shadow: 
    0 20px 50px rgba(191, 129, 149, 0.4),
    inset 6px 6px 12px rgba(255, 255, 255, 0.35),
    inset -6px -6px 12px rgba(0, 0, 0, 0.25);
  border: 4px solid rgba(255, 255, 255, 0.15);
  
  transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 800ms ease, box-shadow 400ms ease;
}

.hero-open-button:hover {
  transform: scale(1.08);
  box-shadow: 
    0 25px 60px rgba(191, 129, 149, 0.45),
    inset 8px 8px 16px rgba(255, 255, 255, 0.4),
    inset -8px -8px 16px rgba(0, 0, 0, 0.3);
}

.hero-open-button:active {
  transform: scale(0.96);
  box-shadow: 
    0 10px 25px rgba(191, 129, 149, 0.3),
    inset 2px 2px 6px rgba(0, 0, 0, 0.3),
    inset -2px -2px 6px rgba(255, 255, 255, 0.2);
}

.hero-open-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: "Playfair Display", serif;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-shadow: 0 8px 20px rgba(138, 63, 84, 0.25);
}

.hero-open-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-open-heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  transform-origin: center;
  animation: heartBeat 1700ms ease-in-out infinite;
}

.hero-reveal-overlay.open .panel-left {
  transform: translateX(-100%);
  opacity: 0;
}

.hero-reveal-overlay.open .panel-right {
  transform: translateX(100%);
  opacity: 0;
}

.hero-reveal-overlay.open .hero-reveal-divider {
  opacity: 0;
  transform: translateX(-50%) scaleY(0);
}

.hero-reveal-overlay.open .hero-open-button {
  opacity: 0;
  transform: scale(0.8);
  pointer-events: none;
}

.hero-couple-name-wrap {
  overflow: visible;
  padding: 0.35rem 0.5rem 0.7rem;
}

.hero-couple-name {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  line-height: 1.18;
  text-shadow: 0 14px 40px rgba(191, 129, 149, 0.16);
}

.hero-couple-name-stack {
  display: inline-flex;
  width: min(100%, 14ch);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1em;
  text-align: center;
  line-height: 1.05;
}

.hero-name-line,
.hero-heart-line {
  display: block;
  width: 100%;
  text-align: center;
}

.hero-name-part,
.hero-heart-loop,
.hero-tagline,
.hero-meta,
.hero-actions {
  opacity: 0;
}

.hero-reveal-shell.is-open .hero-name-part {
  animation: nameRise 1200ms cubic-bezier(0.2, 1, 0.22, 1) forwards;
}

.hero-reveal-shell.is-open .hero-name-delay {
  animation-delay: 220ms;
}

.hero-heart-loop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0.12em 0.08em 0.18em;
  transform-origin: center;
  filter: drop-shadow(0 10px 18px rgba(205, 90, 124, 0.25));
  will-change: transform;
}

.hero-heart-line {
  font-size: 0.68em;
}

.hero-reveal-shell.is-open .hero-heart-loop {
  animation:
    heartReveal 900ms ease forwards 420ms,
    heartBeat 1700ms ease-in-out infinite 1400ms;
}

.hero-reveal-shell.is-open .hero-tagline {
  animation: fadeLift 1000ms ease forwards 1500ms;
}

.hero-reveal-shell.is-open .hero-meta {
  animation: fadeLift 1000ms ease forwards 1900ms;
}

.hero-reveal-shell.is-open .hero-actions {
  animation: fadeLift 1000ms ease forwards 2200ms;
}

.hero-sparkles {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: hidden;
}

.hero-sparkle {
  position: absolute;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0 28%, rgba(255,235,192,0.9) 29% 56%, transparent 57%);
  box-shadow: 0 0 18px rgba(255, 219, 150, 0.7);
  opacity: 0;
  animation: sparkleBurst 1200ms ease-out forwards;
}

.hero-sparkle::before,
.hero-sparkle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255, 245, 225, 0.95);
  transform: translate(-50%, -50%);
  border-radius: 999px;
}

.hero-sparkle::before {
  width: 2px;
  height: 1.2rem;
}

.hero-sparkle::after {
  width: 1.2rem;
  height: 2px;
}

.hero-sparkle:nth-child(1) { left: 15%; top: 22%; animation-delay: 0ms; }
.hero-sparkle:nth-child(2) { left: 26%; top: 14%; animation-delay: 80ms; }
.hero-sparkle:nth-child(3) { left: 38%; top: 26%; animation-delay: 160ms; }
.hero-sparkle:nth-child(4) { left: 50%; top: 16%; animation-delay: 120ms; }
.hero-sparkle:nth-child(5) { left: 62%; top: 24%; animation-delay: 200ms; }
.hero-sparkle:nth-child(6) { left: 74%; top: 18%; animation-delay: 260ms; }
.hero-sparkle:nth-child(7) { left: 84%; top: 30%; animation-delay: 320ms; }
.hero-sparkle:nth-child(8) { left: 20%; top: 44%; animation-delay: 180ms; }
.hero-sparkle:nth-child(9) { left: 34%; top: 54%; animation-delay: 280ms; }
.hero-sparkle:nth-child(10) { left: 48%; top: 42%; animation-delay: 240ms; }
.hero-sparkle:nth-child(11) { left: 60%; top: 56%; animation-delay: 340ms; }
.hero-sparkle:nth-child(12) { left: 76%; top: 48%; animation-delay: 420ms; }
.hero-sparkle:nth-child(13) { left: 12%; top: 66%; animation-delay: 220ms; }
.hero-sparkle:nth-child(14) { left: 28%; top: 74%; animation-delay: 360ms; }
.hero-sparkle:nth-child(15) { left: 44%; top: 82%; animation-delay: 460ms; }
.hero-sparkle:nth-child(16) { left: 58%; top: 72%; animation-delay: 520ms; }
.hero-sparkle:nth-child(17) { left: 72%; top: 84%; animation-delay: 600ms; }
.hero-sparkle:nth-child(18) { left: 86%; top: 68%; animation-delay: 540ms; }

.save-date-shell {
  position: relative;
  overflow: hidden;
}

.save-date-shell::before {
  content: "";
  position: absolute;
  inset: auto -6rem -6rem auto;
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  background: radial-gradient(circle, hsl(var(--primary) / 0.14), transparent 62%);
  pointer-events: none;
}

.save-date-message {
  font-family: "Playfair Display", serif;
  font-style: italic;
}

.scratch-card {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border-radius: 1.9rem;
  border: 1px solid hsl(var(--border) / 0.76);
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.65), transparent 28%),
    linear-gradient(145deg, rgba(255, 248, 244, 0.98), rgba(245, 228, 216, 0.96));
  box-shadow: var(--shadow-md);
}

.dark .scratch-card {
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.08), transparent 28%),
    linear-gradient(145deg, rgba(76, 52, 59, 0.98), rgba(54, 37, 43, 0.98));
}

.scratch-card-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background:
    radial-gradient(circle at 50% 18%, hsl(var(--accent) / 0.22), transparent 24%),
    radial-gradient(circle at 18% 85%, hsl(var(--primary) / 0.12), transparent 22%),
    radial-gradient(circle at 82% 85%, hsl(var(--primary) / 0.12), transparent 20%);
}

.scratch-card-kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: hsl(var(--primary));
}

.scratch-card-date {
  margin-top: 1rem;
  max-width: 11ch;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 0.96;
  color: hsl(var(--foreground));
}

.scratch-card-time {
  margin-top: 1rem;
  font-size: 1rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: hsl(var(--foreground) / 0.72);
}

.scratch-card-love {
  margin-top: 1.2rem;
  font-family: "Playfair Display", serif;
  font-size: 1.45rem;
  color: hsl(var(--primary));
}

.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  transition: opacity 0.7s ease;
}

.scratch-canvas:active {
  cursor: grabbing;
}

.scratch-card.is-revealed .scratch-card-content {
  animation: revealGlow 900ms ease forwards;
}

.floral {
  position: absolute;
  width: 260px;
  height: 260px;
  opacity: 0.6;
}

.floral::before,
.floral::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 20%, hsl(var(--primary) / 0.18) 0 18px, transparent 19px),
    radial-gradient(circle at 20% 50%, hsl(var(--accent) / 0.18) 0 18px, transparent 19px),
    radial-gradient(circle at 80% 50%, hsl(var(--accent) / 0.18) 0 18px, transparent 19px),
    radial-gradient(circle at 50% 80%, hsl(var(--primary) / 0.18) 0 18px, transparent 19px);
}

.floral-top {
  top: 2rem;
  right: 1rem;
  transform: rotate(18deg);
}

.floral-bottom {
  bottom: 1rem;
  left: 1rem;
  transform: rotate(-12deg);
}

.gallery-sunset {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 247, 236, 0.5), transparent 24%),
    linear-gradient(180deg, rgba(255, 199, 183, 0.9), rgba(214, 129, 145, 0.9));
}

.gallery-sunset::before,
.gallery-rose::before,
.gallery-cream::before,
.gallery-floral::before,
.gallery-monogram::before,
.gallery-candle::before,
.gallery-arch::before,
.gallery-garden::before {
  content: "";
  position: absolute;
  inset: 0;
}

.gallery-rose {
  background:
    radial-gradient(circle at 65% 22%, rgba(255,255,255,0.45), transparent 16%),
    linear-gradient(140deg, rgba(255, 235, 240, 0.98), rgba(225, 150, 174, 0.92));
}

.gallery-cream {
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.55), transparent 20%),
    linear-gradient(145deg, rgba(251, 244, 234, 0.98), rgba(233, 208, 180, 0.9));
}

.gallery-floral {
  background:
    linear-gradient(145deg, rgba(250, 234, 238, 0.98), rgba(245, 225, 206, 0.95));
}

.gallery-floral::before {
  background:
    radial-gradient(circle at 26% 30%, rgba(213, 112, 138, 0.45) 0 22px, transparent 23px),
    radial-gradient(circle at 32% 34%, rgba(255,255,255,0.8) 0 9px, transparent 10px),
    radial-gradient(circle at 55% 56%, rgba(232, 171, 94, 0.35) 0 25px, transparent 26px),
    radial-gradient(circle at 62% 60%, rgba(255,255,255,0.8) 0 9px, transparent 10px),
    radial-gradient(circle at 76% 30%, rgba(202, 122, 150, 0.42) 0 20px, transparent 21px),
    radial-gradient(circle at 80% 34%, rgba(255,255,255,0.8) 0 8px, transparent 9px);
}

.gallery-monogram {
  background: linear-gradient(145deg, rgba(245, 231, 222, 0.98), rgba(214, 176, 127, 0.9));
}

.gallery-monogram::before {
  content: "M  ❤  M";
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(118, 72, 83, 0.88);
  font-family: "Playfair Display", serif;
  font-size: 2.2rem;
  letter-spacing: 0.2em;
}

.gallery-candle {
  background: linear-gradient(180deg, rgba(45, 27, 32, 0.92), rgba(145, 90, 88, 0.85));
}

.gallery-candle::before {
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 218, 143, 0.98) 0 12px, transparent 13px),
    linear-gradient(180deg, transparent 0 28%, rgba(255, 245, 228, 0.9) 29% 64%, transparent 65%),
    radial-gradient(circle at 50% 26%, rgba(255, 166, 72, 0.62), transparent 30px);
}

.gallery-arch {
  background: linear-gradient(145deg, rgba(251, 233, 238, 0.98), rgba(244, 219, 196, 0.94));
}

.gallery-arch::before {
  left: 50%;
  top: 18%;
  width: 56%;
  height: 58%;
  transform: translateX(-50%);
  border: 6px solid rgba(193, 147, 94, 0.75);
  border-bottom: none;
  border-radius: 999px 999px 0 0;
  position: absolute;
}

.gallery-garden {
  background: linear-gradient(180deg, rgba(250, 241, 231, 0.98), rgba(217, 190, 179, 0.94));
}

.gallery-garden::before {
  background:
    radial-gradient(circle at 18% 72%, rgba(170, 128, 97, 0.32) 0 38px, transparent 39px),
    radial-gradient(circle at 28% 64%, rgba(207, 116, 145, 0.5) 0 16px, transparent 17px),
    radial-gradient(circle at 46% 70%, rgba(215, 157, 98, 0.4) 0 20px, transparent 21px),
    radial-gradient(circle at 70% 63%, rgba(205, 124, 156, 0.48) 0 18px, transparent 19px),
    radial-gradient(circle at 84% 74%, rgba(171, 132, 100, 0.3) 0 40px, transparent 41px);
}

.rsvp-art {
  background:
    radial-gradient(circle at 20% 20%, hsl(var(--primary) / 0.16), transparent 20%),
    radial-gradient(circle at 80% 15%, hsl(var(--accent) / 0.16), transparent 18%),
    linear-gradient(180deg, hsl(var(--secondary) / 0.68), hsl(var(--background) / 0.8));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes floatUp {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes nameRise {
  0% {
    opacity: 0;
    transform: translateY(36px) scale(0.94);
    letter-spacing: 0.12em;
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    letter-spacing: 0.02em;
    filter: blur(0);
  }
}

@keyframes heartReveal {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.3) rotate(-12deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes heartBeat {
  0%, 100% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.16);
  }
  28% {
    transform: scale(0.96);
  }
  42% {
    transform: scale(1.12);
  }
  70% {
    transform: scale(1);
  }
}

@keyframes fadeLift {
  0% {
    opacity: 0;
    transform: translateY(22px);
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes revealGlow {
  0% {
    transform: scale(0.98);
    filter: brightness(0.95);
  }
  60% {
    transform: scale(1.015);
    filter: brightness(1.03);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes sparkleBurst {
  0% {
    opacity: 0;
    transform: translateY(16px) scale(0.2) rotate(0deg);
    filter: blur(2px);
  }
  30% {
    opacity: 1;
    transform: translateY(0) scale(1.15) rotate(16deg);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px) scale(0.55) rotate(40deg);
    filter: blur(1px);
  }
}

.animate-float {
  animation: floatUp 5s ease-in-out infinite;
}

.animate-fade-lift {
  animation: fadeLift 1000ms ease forwards;
}

@media (max-width: 640px) {
  .hero-content-center {
    min-height: calc(100vh - 5rem);
    padding: 4rem 1rem;
  }

  .hero-open-button {
    width: 7.5rem;
    height: 7.5rem;
    box-shadow: 
      0 15px 35px rgba(191, 129, 149, 0.4),
      inset 4px 4px 8px rgba(255, 255, 255, 0.35),
      inset -4px -4px 8px rgba(0, 0, 0, 0.25);
  }

  .hero-open-monogram {
    gap: 0.35rem;
    font-size: 1.85rem;
  }

  .hero-open-heart {
    font-size: 1.1rem;
  }

  .hero-couple-name {
    gap: 0.24em;
  }

  .hero-couple-name-stack {
    width: 100%;
    gap: 0.04em;
  }

  .hero-heart-line {
    font-size: 0.62em;
  }

  .hero-tagline {
    letter-spacing: 0.18em;
  }

  .hero-sparkle {
    width: 0.78rem;
    height: 0.78rem;
  }

  .scratch-card {
    min-height: 320px;
  }

  .scratch-card-time {
    letter-spacing: 0.16em;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
