/* =====================================================
   LUXURY WEDDING INVITATION — MASTER STYLESHEET
   ===================================================== */

/* ─── CSS Variables ─── */
:root {
  --black: #000000;
  --charcoal: #0e0e0e;
  --dark: #111111;
  --dark-mid: #1a1a1a;
  --grey: #3a3a3a;
  --grey-light: #888888;
  --ivory: #f7f4ee;
  --ivory-warm: #faf8f5;
  --ivory-deep: #ede8df;
  --pearl: #f0ece4;
  --white: #ffffff;
  --white-80: rgba(255,255,255,0.8);
  --white-60: rgba(255,255,255,0.6);
  --white-30: rgba(255,255,255,0.3);
  --white-10: rgba(255,255,255,0.1);
  --lace: rgba(255,255,255,0.85);
  --transition-slow: 1.55s cubic-bezier(0.19, 1, 0.22, 1);
  --transition-med: 1s cubic-bezier(0.19, 1, 0.22, 1);
  --transition-fast: 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
  --font-script: 'Great Vibes', cursive;
  --font-couple: 'Alex Brush', 'Allura', 'Parisienne', cursive;
  --font-serif: 'Cormorant Garamond', 'Libre Baskerville', Georgia, serif;
  --font-display: 'Playfair Display', 'Cormorant Upright', Georgia, serif;
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--black);
}

body {
  font-family: var(--font-serif);
  color: var(--white);
  cursor: default;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Film Grain ─── */
.film-grain {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  animation: grainShift 0.15s steps(1) infinite;
}

@keyframes grainShift {
  0%   { background-position: 0px 0px; }
  10%  { background-position: -50px -30px; }
  20%  { background-position: 30px -70px; }
  30%  { background-position: -90px 40px; }
  40%  { background-position: 60px -20px; }
  50%  { background-position: -10px 80px; }
  60%  { background-position: 70px -50px; }
  70%  { background-position: -60px 20px; }
  80%  { background-position: 40px 60px; }
  90%  { background-position: -30px -10px; }
  100% { background-position: 0px 0px; }
}

/* ─── Particle Canvas ─── */
#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ─── Invitation Wrapper ─── */
.invitation-wrapper {
  position: fixed;
  inset: 0;
  z-index: 10;
}

/* ─── Pages ─── */
.page {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.035);
  filter: blur(14px);
  transition:
    opacity var(--transition-slow),
    transform var(--transition-slow),
    filter var(--transition-slow);
  will-change: opacity, transform, filter;
}

.page.active {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
  filter: blur(0);
}

.page.exit-up {
  opacity: 0;
  transform: scale(0.985);
  filter: blur(16px);
  pointer-events: none;
}

.page.exit-down {
  opacity: 0;
  transform: scale(1.02);
  filter: blur(16px);
  pointer-events: none;
}

/* ─── Background Photo Layers ─── */
.bg-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  transform: scale(1.05);
  transition: transform 8s ease-out;
}

.page.active .bg-photo {
  transform: scale(1);
}

.bg-photo--dark {
  background-image: url('https://images.unsplash.com/photo-1508193638397-1c4234db14d8?auto=format&fit=crop&w=1920&q=80');
  background-color: #050505;
}

.bg-photo--light {
  background-image: url('https://images.unsplash.com/photo-1519741497674-611481863552?auto=format&fit=crop&w=1920&q=80');
  background-color: #0a0a0a;
}

.bg-photo--ivory {
  background: var(--ivory-warm);
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.55) 0%,
    rgba(0,0,0,0.35) 40%,
    rgba(0,0,0,0.55) 100%
  );
}

.bg-overlay-light {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.7) 0%,
    rgba(0,0,0,0.5) 50%,
    rgba(0,0,0,0.7) 100%
  );
}

.bg-overlay-ivory {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(247,244,238,0.15) 0%,
    rgba(247,244,238,0) 100%
  );
}

/* ─── Page Content ─── */
.page-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  max-width: 520px;
  padding: 40px 24px;
  height: 100%;
}

/* ─── Typography Globals ─── */
.script-title {
  font-family: var(--font-script);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 400;
  line-height: 1.1;
  margin: 8px 0 20px;
  letter-spacing: -0.01em;
}

.script-white { color: var(--white); text-shadow: 0 2px 30px rgba(0,0,0,0.5); }
.script-dark  { color: var(--dark-mid); }

.couple-name {
  font-family: var(--font-couple);
  white-space: nowrap;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.label-small {
  font-family: var(--font-serif);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.35em;
  text-transform: uppercase;
}

.label-white { color: var(--white-60); }
.label-dark  { color: var(--grey); }

.tracking-widest { letter-spacing: 0.38em; }

/* ─── Navigation Dots ─── */
.page-dots {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.4s ease;
}

.dot.active {
  background: var(--white);
  border-color: var(--white);
  transform: scale(1.3);
}

.dot.dark-dot {
  border-color: rgba(0,0,0,0.3);
}

.dot.dark-dot.active {
  background: var(--dark-mid);
  border-color: var(--dark-mid);
}

/* ─── Music Player ─── */
.music-player {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 10px;
}

.music-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--white-30);
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  color: var(--white-80);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.music-btn:hover {
  border-color: var(--white-60);
  color: var(--white);
}

.music-btn.playing {
  animation: musicPulse 2s ease infinite;
}

.music-btn.unavailable {
  opacity: 0.42;
  cursor: not-allowed;
}

@keyframes musicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.15); }
  50% { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
}

.music-volume {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  border: 1px solid var(--white-30);
  border-radius: 20px;
  padding: 6px 12px;
  opacity: 0;
  transform: translateX(-6px);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.music-volume.visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

#volumeSlider {
  width: 70px;
  height: 2px;
  accent-color: var(--white);
  cursor: pointer;
  background: var(--white-30);
  outline: none;
  border: none;
}

/* ─── Swipe Hint ─── */
.swipe-hint {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  color: var(--white-30);
  font-size: 0.85rem;
  animation: bounceDown 2s ease infinite;
  pointer-events: none;
}

@keyframes bounceDown {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.3; }
  50% { transform: translateX(-50%) translateY(6px); opacity: 0.7; }
}

/* ============================================
   PAGE 0 — ENVELOPE
   ============================================ */
.envelope-content {
  gap: 0;
  justify-content: center;
}

.envelope-content .script-title {
  margin: 4px 0 28px;
}

/* ─── Envelope Scene ─── */
.envelope-scene {
  perspective: 1400px;
  width: 320px;
  height: 220px;
  position: relative;
  margin: 0 auto;
  cursor: pointer;
  transform-style: preserve-3d;
  will-change: transform, filter;
  filter: drop-shadow(0 34px 42px rgba(0,0,0,0.5));
  touch-action: manipulation;
}

.envelope-scene:hover {
  transform: translateY(-4px);
}

.envelope-wrapper {
  position: relative;
  width: 320px;
  height: 220px;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 1.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.envelope-wrapper.opening {
  transform: translateZ(42px) translateY(-8px) scale(1.045);
}

/* ─── Envelope Back ─── */
.envelope-back {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.env-back-body {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 18%, rgba(255,255,248,0.78), transparent 28%),
    linear-gradient(155deg, #f7f3eb 0%, #eae3d5 42%, #f5f0e8 100%);
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.88),
    inset 0 -16px 28px rgba(90,75,58,0.06),
    0 24px 80px rgba(0,0,0,0.68),
    0 7px 22px rgba(0,0,0,0.42);
  position: relative;
  overflow: hidden;
}

.env-back-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.06'/%3E%3C/svg%3E");
  opacity: 0.5;
}

.env-back-body::after,
.env-front-body::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(28deg, transparent 49.4%, rgba(90,75,58,0.10) 50%, transparent 50.7%),
    linear-gradient(152deg, transparent 49.4%, rgba(255,255,255,0.5) 50%, transparent 50.7%),
    linear-gradient(180deg, transparent 68%, rgba(0,0,0,0.035) 100%);
  mix-blend-mode: multiply;
}

/* ─── Envelope Card (hidden inside) ─── */
.env-card {
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translate3d(-50%, 48px, -10px) rotateX(1deg) scale(0.985);
  width: 240px;
  height: 160px;
  z-index: 4;
  opacity: 0;
  will-change: transform, opacity, filter;
  transform-style: preserve-3d;
  transition:
    transform 1.8s cubic-bezier(0.19, 1, 0.22, 1),
    opacity 1s ease,
    filter 1.3s ease;
}

.env-card.sliding {
  transform: translate3d(-50%, -178px, 36px) rotateX(0deg) scale(1.035);
  opacity: 1;
  filter: blur(0);
}

.env-card-inner {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 22% 12%, rgba(255,255,255,0.92), transparent 24%),
    linear-gradient(145deg, #fbf9f5 0%, #f0ece4 100%);
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 8px rgba(255,255,255,0.14),
    inset 0 0 0 1px rgba(30,30,30,0.08),
    0 18px 48px rgba(0,0,0,0.44);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.6);
  position: relative;
  overflow: hidden;
}

.env-card-inner::before {
  content: '';
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(30,30,30,0.1);
  pointer-events: none;
}

.env-card-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paper)' opacity='0.055'/%3E%3C/svg%3E"),
    repeating-linear-gradient(90deg, rgba(30,30,30,0.018) 0 1px, transparent 1px 9px);
  pointer-events: none;
}

.env-card-monogram {
  font-family: var(--font-couple);
  font-size: 2.2rem;
  color: var(--dark-mid);
  line-height: 1;
}

.env-card-line {
  width: 60px;
  height: 1px;
  background: rgba(30,30,30,0.2);
  margin: 4px 0;
}

.env-card-label {
  font-family: var(--font-serif);
  font-size: 0.45rem;
  letter-spacing: 0.3em;
  color: var(--grey-light);
  text-transform: uppercase;
}

.env-card-names {
  font-family: var(--font-couple);
  font-size: 1.3rem;
  color: var(--dark-mid);
  line-height: 1;
  white-space: nowrap;
}

.env-card-date {
  font-family: var(--font-serif);
  font-size: 0.5rem;
  letter-spacing: 0.25em;
  color: var(--grey);
  text-transform: uppercase;
}

/* ─── Envelope Front ─── */
.envelope-front {
  position: absolute;
  inset: 0;
  z-index: 6;
  transform: translateZ(22px);
  pointer-events: none;
}

.env-front-body {
  width: 100%;
  height: 72%;
  bottom: 0;
  position: absolute;
  background:
    radial-gradient(circle at 22% 18%, rgba(255,255,248,0.85), transparent 28%),
    linear-gradient(145deg, #faf8f4 0%, #f2ede4 48%, #e8e0d2 100%);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.8),
    inset 0 -22px 28px rgba(88,70,50,0.06),
    0 -3px 12px rgba(255,255,255,0.08);
  clip-path: polygon(0 4%, 50% 36%, 100% 4%, 100% 100%, 0 100%);
}

.env-front-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.4;
}

/* ─── Lace Border on Front ─── */
.env-lace-border {
  position: absolute;
  inset: 8px 8px 7px;
  border: none;
  border-radius: 2px;
  background: transparent;
  pointer-events: none;
}

.env-lace-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 2px;
  box-shadow: 
    inset 0 0 0 3px rgba(255,255,255,0.3),
    0 0 0 1px rgba(230,220,210,0.5);
}

/* Lace dots pattern */
.env-lace-border::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 3px dashed rgba(255,255,255,0.5);
  border-radius: 4px;
}

/* ─── Monogram on Envelope ─── */
.env-front-monogram {
  font-family: var(--font-couple);
  font-size: 2.8rem;
  color: var(--dark-mid);
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transform: translateY(12px);
  letter-spacing: 0.08em;
}

/* ─── Envelope Flap ─── */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 62%;
  z-index: 7;
  transform-origin: top center;
  transform-style: preserve-3d;
  will-change: transform, z-index, filter;
  transition:
    transform 1.45s cubic-bezier(0.19, 1, 0.22, 1),
    z-index 0s linear 0.9s,
    filter 1.2s ease;
  filter: drop-shadow(0 10px 12px rgba(0,0,0,0.26));
}

.envelope-flap.open {
  z-index: 3;
  transform: translateZ(-16px) rotateX(-174deg);
  filter: drop-shadow(0 -9px 16px rgba(0,0,0,0.18));
}

.env-flap-inner {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: url(#curvedFlap);
  background:
    radial-gradient(circle at 50% 5%, rgba(255,255,255,0.88), transparent 30%),
    linear-gradient(160deg, #f8f5ef 0%, #eee8de 60%, #e5ddd0 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
  backface-visibility: visible;
}

.env-flap-inner::before {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: url(#curvedFlap);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.3;
}

/* ─── Lace Flap Edge ─── */
.env-lace-flap {
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 18px;
  overflow: hidden;
  pointer-events: none;
}

.env-lace-flap::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(
      circle at 50% -2px,
      transparent 58%,
      rgba(255,255,255,0.85) 58%,
      rgba(255,255,255,0.85) 78%,
      transparent 78%
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 5px,
      rgba(255,255,255,0.6) 5px,
      rgba(255,255,255,0.6) 6px
    );
}

/* ─── Bottom Lace ─── */
.env-lace-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 12px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255,255,255,0.1) 0,
    rgba(255,255,255,0.1) 4px,
    transparent 4px,
    transparent 8px
  );
}

/* ─── Tap Hint ─── */
.tap-hint {
  margin-top: 22px;
  animation: fadeInOut 2.5s ease infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

/* ─── Envelope Open State ─── */
.envelope-scene.opening {
  transform: scale(1.055) translateY(-8px);
  filter: drop-shadow(0 42px 54px rgba(0,0,0,0.58));
}

.envelope-scene.opened {
  transform: scale(1);
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.4));
}

/* ============================================
   PAGE 1 — SAVE THE DATE
   ============================================ */
.savedate-content {
  gap: 12px;
  justify-content: center;
}

/* ─── Lace Frame Card ─── */
.lace-frame-card {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto 20px;
}

.lace-border-outer {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Outer lace scallop border */
.lace-border-outer::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid rgba(255,255,255,0.7);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.2),
    inset 0 0 0 1px rgba(255,255,255,0.2),
    0 8px 40px rgba(0,0,0,0.5);
  background: rgba(30,30,30,0.55);
  backdrop-filter: blur(2px);
}

/* Scalloped lace outer edge */
.lace-border-outer::after {
  content: '';
  position: absolute;
  inset: -10px;
  border: none;
  background-image:
    radial-gradient(circle at 50% 0%, transparent 40%, rgba(255,255,255,0.65) 40%, rgba(255,255,255,0.65) 55%, transparent 55%),
    radial-gradient(circle at 50% 100%, transparent 40%, rgba(255,255,255,0.65) 40%, rgba(255,255,255,0.65) 55%, transparent 55%),
    radial-gradient(circle at 0% 50%, transparent 40%, rgba(255,255,255,0.65) 40%, rgba(255,255,255,0.65) 55%, transparent 55%),
    radial-gradient(circle at 100% 50%, transparent 40%, rgba(255,255,255,0.65) 40%, rgba(255,255,255,0.65) 55%, transparent 55%);
  background-size: 18px 18px, 18px 18px, 18px 18px, 18px 18px;
  background-position: top, bottom, left, right;
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
}

.lace-inner-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding: 20px;
}

.savedate-title {
  font-family: var(--font-script);
  font-size: 2.6rem;
  color: var(--white);
  font-weight: 400;
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  transform: rotate(-2deg);
}

.savedate-divider {
  width: 50px;
  height: 1px;
  background: rgba(255,255,255,0.4);
  margin: 4px 0;
}

.savedate-names {
  font-family: var(--font-serif);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: var(--white-80);
  text-transform: uppercase;
}

.savedate-date {
  font-family: var(--font-serif);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: var(--white-80);
  text-transform: uppercase;
}

.formal-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--white-80);
  letter-spacing: 0.02em;
}

.venue-label {
  font-family: var(--font-serif);
  font-size: 0.6rem;
  letter-spacing: 0.32em;
  color: var(--white-60);
  text-transform: uppercase;
}

.venue-date {
  font-family: var(--font-serif);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--white-60);
  margin-bottom: 4px;
}

/* ─── Buttons ─── */
.btn-outline {
  display: inline-block;
  padding: 10px 28px;
  border: 1px solid rgba(255,255,255,0.5);
  background: transparent;
  color: var(--white-80);
  font-family: var(--font-serif);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.4s ease;
  margin-top: 4px;
}

.btn-outline:hover {
  border-color: var(--white);
  color: var(--white);
  background: rgba(255,255,255,0.06);
}

.btn-outline--white {
  color: var(--white-80);
  border-color: rgba(255,255,255,0.45);
}

/* ============================================
   PAGE 2 — FORMAL INVITATION
   ============================================ */
.invitation-content {
  justify-content: center;
}

.invitation-card {
  background: linear-gradient(145deg, #faf8f4 0%, #f2ede4 60%, #e8e2d6 100%);
  border-radius: 3px;
  padding: 44px 36px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.7), 0 5px 20px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}

.invitation-card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(30,30,30,0.12);
  border-radius: 2px;
  pointer-events: none;
}

.invitation-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
}

.inv-monogram {
  font-family: var(--font-couple);
  font-size: 3.5rem;
  color: var(--dark-mid);
  line-height: 1;
  position: relative;
  z-index: 1;
  letter-spacing: 0.06em;
}

.inv-small-label {
  font-family: var(--font-serif);
  font-size: 0.55rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--grey);
  position: relative;
  z-index: 1;
}

.inv-couple-name {
  font-family: var(--font-couple);
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  color: var(--dark-mid);
  font-weight: 400;
  line-height: 1.1;
  position: relative;
  z-index: 1;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.inv-ornament {
  font-size: 0.4rem;
  letter-spacing: 0.5em;
  color: var(--grey-light);
  position: relative;
  z-index: 1;
}

.inv-body-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.78rem;
  line-height: 1.8;
  color: var(--grey);
  position: relative;
  z-index: 1;
  text-align: center;
}

.inv-line {
  width: 60px;
  height: 1px;
  background: rgba(30,30,30,0.15);
  position: relative;
  z-index: 1;
  margin: 4px 0;
}

.inv-tiny {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.6rem;
  color: var(--grey-light);
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1.6;
}

/* ============================================
   PAGE 3 — DETAILS
   ============================================ */
.details-content {
  gap: 16px;
  justify-content: center;
}

.details-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  margin: 10px 0;
}

@media (min-width: 480px) {
  .details-grid {
    flex-direction: row;
    gap: 12px;
    justify-content: center;
  }
}

.detail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  border: 1px solid var(--white-10);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(6px);
  min-width: 120px;
  flex: 1;
  max-width: 150px;
}

.detail-icon {
  font-size: 0.9rem;
  color: var(--white-30);
  margin-bottom: 4px;
}

.detail-label {
  font-family: var(--font-serif);
  font-size: 0.48rem;
  letter-spacing: 0.3em;
  color: var(--white-30);
  text-transform: uppercase;
}

.detail-value {
  font-family: var(--font-serif);
  font-size: 0.75rem;
  color: var(--white-80);
  line-height: 1.5;
  text-align: center;
}

/* ============================================
   PAGE 4 — GALLERY
   ============================================ */
.gallery-content {
  gap: 16px;
  justify-content: center;
}

.gallery-carousel {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: 280px;
  overflow: hidden;
  border-radius: 2px;
}

.gallery-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.gallery-slide.active {
  opacity: 1;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--white-10);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--white-30);
}

.gallery-placeholder-inner i {
  font-size: 2rem;
}

.gallery-placeholder-inner p {
  font-family: var(--font-serif);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.gallery-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.gallery-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--white-30);
  background: transparent;
  color: var(--white-60);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-btn:hover {
  border-color: var(--white);
  color: var(--white);
}

.gallery-dots {
  display: flex;
  gap: 6px;
}

.gallery-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--white-30);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.gallery-dot.active {
  background: var(--white);
  transform: scale(1.3);
}

.gallery-caption {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.7rem;
  color: var(--white-30);
  letter-spacing: 0.05em;
}

/* ============================================
   PAGE 5 — COUNTDOWN
   ============================================ */
.countdown-content {
  gap: 8px;
  justify-content: center;
}

.countdown-monogram {
  font-family: var(--font-couple);
  font-size: 4.5rem;
  color: var(--dark-mid);
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: 0.06em;
}

.countdown-with {
  font-family: var(--font-serif);
  font-size: 0.55rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--grey);
  margin-top: 8px;
}

.countdown-content .inv-couple-name {
  font-family: var(--font-couple);
  font-size: clamp(2.8rem, 9vw, 4.2rem);
  color: var(--dark-mid);
  white-space: nowrap;
}

.countdown-content .inv-small-label {
  color: var(--grey);
  margin-bottom: 16px;
}

.countdown-content .inv-tiny {
  color: var(--grey-light);
  margin-bottom: 4px;
}

/* ─── Timer ─── */
.countdown-timer {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  margin-top: 4px;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.countdown-num {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3rem);
  font-weight: 400;
  color: var(--dark-mid);
  line-height: 1;
  letter-spacing: -0.02em;
}

.countdown-lbl {
  font-family: var(--font-serif);
  font-size: 0.38rem;
  letter-spacing: 0.3em;
  color: var(--grey-light);
  text-transform: uppercase;
}

.countdown-sep {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: var(--grey);
  line-height: 1;
  margin-bottom: 12px;
  padding: 0 2px;
}

/* ============================================
   PAGE 6 — RSVP
   ============================================ */
.rsvp-content {
  gap: 10px;
  justify-content: center;
  padding-top: 40px;
  padding-bottom: 40px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.rsvp-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--white-10);
  backdrop-filter: blur(10px);
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
  border-radius: 2px;
}

/* ─── Form ─── */
.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-family: var(--font-serif);
  font-size: 0.55rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--white-60);
}

.optional {
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.55rem;
  color: var(--white-30);
}

.form-input,
.form-textarea {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--white-10);
  border-radius: 1px;
  color: var(--white-80);
  font-family: var(--font-serif);
  font-size: 0.85rem;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.3s ease;
  width: 100%;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--white-30);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--white-30);
  font-style: italic;
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

/* ─── Attendance Buttons ─── */
.attendance-btns {
  display: flex;
  gap: 10px;
}

.attendance-btn {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--white-10);
  background: transparent;
  color: var(--white-60);
  font-family: var(--font-serif);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.attendance-btn:hover {
  border-color: var(--white-30);
  color: var(--white);
}

.attendance-btn.selected-yes {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.5);
  color: var(--white);
}

.attendance-btn.selected-no {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.2);
  color: var(--white-60);
}

/* ─── Submit Button ─── */
.btn-submit {
  padding: 13px 28px;
  border: 1px solid rgba(255,255,255,0.45);
  background: transparent;
  color: var(--white-80);
  font-family: var(--font-serif);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.4s ease;
  margin-top: 4px;
}

.btn-submit:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--white);
  color: var(--white);
}

.btn-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Thank You State ─── */
.rsvp-thankyou {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  animation: fadeInUp 1s ease forwards;
}

.rsvp-thankyou.visible {
  display: flex;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.thankyou-icon {
  font-size: 2rem;
  color: var(--white-30);
  animation: heartBeat 2s ease infinite;
}

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

.thankyou-title {
  font-family: var(--font-script);
  font-size: 3rem;
  color: var(--white);
  font-weight: 400;
}

.thankyou-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.82rem;
  color: var(--white-60);
  line-height: 1.7;
  text-align: center;
}

.thankyou-names {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.75rem;
  color: var(--white-40);
  margin-top: 4px;
}

/* ─── Form Errors ─── */
.form-error {
  font-family: var(--font-serif);
  font-size: 0.6rem;
  color: rgba(255,150,150,0.9);
  font-style: italic;
  display: none;
}

.form-error.visible {
  display: block;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
  .envelope-scene,
  .envelope-wrapper {
    width: min(82vw, 292px);
    height: calc(min(82vw, 292px) * 0.6875);
  }

  .env-card {
    width: 72%;
    height: 73%;
  }

  .env-card.sliding {
    transform: translate3d(-50%, -150px, 36px) rotateX(0deg) scale(1.03);
  }

  .invitation-card {
    padding: 32px 24px;
  }

  .page-dots {
    right: 12px;
  }

  .music-player {
    bottom: 18px;
    left: 16px;
  }

  .detail-item {
    max-width: 100%;
  }

  .details-grid {
    flex-direction: column;
    align-items: center;
  }

  .lace-frame-card {
    width: 210px;
    height: 210px;
  }

  .savedate-title {
    font-size: 2.2rem;
  }
}

@media (max-height: 600px) {
  .page-content {
    padding: 20px 24px;
  }

  .script-title {
    font-size: 2.5rem;
  }

  .countdown-monogram {
    font-size: 3rem;
  }

  .env-card.sliding {
    transform: translate3d(-50%, -128px, 36px) rotateX(0deg) scale(1.02);
  }
}

/* ─── Utilities ─── */
.hidden { display: none !important; }

/* ============================================
   OWNER QUICK EDIT PANEL
   ============================================ */
.owner-panel {
  position: fixed;
  bottom: 24px;
  right: 60px;
  z-index: 9990;
  width: 280px;
  background: rgba(14,14,14,0.96);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.owner-panel-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.owner-panel-title {
  font-family: var(--font-serif);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--white-60);
}

.owner-admin-link {
  font-family: var(--font-serif);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--white-30);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
}

.owner-admin-link:hover { color: var(--white-60); }

.owner-close {
  background: transparent;
  border: none;
  color: var(--white-30);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 2px 4px;
  transition: color 0.2s ease;
}

.owner-close:hover { color: var(--white); }

.owner-panel-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}

.owner-form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.owner-label {
  font-family: var(--font-serif);
  font-size: 0.52rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--white-30);
}

.owner-input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--white-80);
  font-family: var(--font-serif);
  font-size: 0.82rem;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.3s ease;
  width: 100%;
}

.owner-input:focus { border-color: rgba(255,255,255,0.25); }
.owner-input::placeholder { color: var(--white-10); font-style: italic; }

.owner-save-msg {
  font-family: var(--font-serif);
  font-size: 0.65rem;
  font-style: italic;
  min-height: 16px;
}

.owner-save-btn {
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: var(--white-60);
  font-family: var(--font-serif);
  font-size: 0.58rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 4px;
}

.owner-save-btn:hover {
  background: rgba(255,255,255,0.08);
  color: var(--white);
  border-color: rgba(255,255,255,0.4);
}

/* ─── Loading overlay ─── */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  transition: opacity 1.5s ease;
}

.loading-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-monogram {
  font-family: var(--font-script);
  font-size: 5rem;
  color: rgba(255,255,255,0.15);
  animation: loadPulse 2s ease infinite;
}

@keyframes loadPulse {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.03); }
}

.loading-line {
  width: 60px;
  height: 1px;
  background: rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}

.loading-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.5);
  animation: loadSlide 1.5s ease infinite;
}

@keyframes loadSlide {
  from { left: -100%; }
  to { left: 100%; }
}
