/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  color: #3a3a3a;
  line-height: 1.7;
  background: #fdfbf9;
}

/* === Typography === */
h1, h2, h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
}

h2 {
  font-size: 2.5rem;
  letter-spacing: 0.05em;
  color: #2c2c2c;
}

/* === Hero === */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5e6d3 0%, #edddd0 15%, #e8d5c4 30%, #deccbd 45%, #d4c5b5 60%, #cebfaf 80%, #c9b8a8 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255,255,255,0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.2) 0%, transparent 40%);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  /* When you add a hero photo, uncomment:
  background: url('images/hero.jpg') center/cover no-repeat;
  */
}

/* Ornamental flourishes */
.hero-ornament {
  position: absolute;
  width: 200px;
  height: 200px;
  border: 1px solid rgba(44, 44, 44, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.hero-ornament--top {
  top: -60px;
  right: -60px;
  animation: ornamentSpin 30s linear infinite, fadeInScale 2s ease-out 0.5s both;
}

.hero-ornament--bottom {
  bottom: -80px;
  left: -80px;
  width: 260px;
  height: 260px;
  animation: ornamentSpin 35s linear infinite reverse, fadeInScale 2s ease-out 0.8s both;
}

.hero-ornament--center-left {
  top: 20%;
  left: 8%;
  width: 120px;
  height: 120px;
  border-style: dashed;
  border-color: rgba(44, 44, 44, 0.06);
  animation: ornamentSpin 25s linear infinite, ornamentDrift 6s ease-in-out infinite alternate, fadeInScale 2s ease-out 1s both;
}

.hero-ornament--center-right {
  bottom: 20%;
  right: 8%;
  width: 100px;
  height: 100px;
  border-style: dashed;
  border-color: rgba(44, 44, 44, 0.06);
  animation: ornamentSpin 20s linear infinite reverse, ornamentDrift 7s ease-in-out infinite alternate-reverse, fadeInScale 2s ease-out 1.2s both;
}

@keyframes ornamentSpin {
  to { transform: rotate(360deg); }
}

@keyframes ornamentDrift {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(10px, -15px) rotate(180deg); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* Twinkling stars canvas */
.hero-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: twinkle ease-in-out infinite;
}

.star::after {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent);
  border-radius: 50%;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fadeInUp 1.5s ease-out 5.5s both;
  cursor: pointer;
}

.scroll-indicator span {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(44, 44, 44, 0.65);
}

.scroll-arrow {
  width: 22px;
  height: 22px;
  border-right: 1.5px solid rgba(44, 44, 44, 0.5);
  border-bottom: 1.5px solid rgba(44, 44, 44, 0.5);
  transform: rotate(45deg);
}

/* Decorative line flourishes around title */
.hero-content::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  border: 1px solid rgba(44, 44, 44, 0.05);
  border-radius: 50%;
  animation: ringPulse 5s ease-in-out infinite, fadeInScale 1.5s ease-out 1s both;
  pointer-events: none;
}

@keyframes ringPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.4; }
  50% { transform: translate(-50%, -50%) scale(1.08); opacity: 0.15; }
}

.hero-content {
  position: relative;
  text-align: center;
  color: #2c2c2c;
  padding: 2rem;
}

.hero-date {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: 1rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.04em;
}

.magic-letter-amp {
  font-style: italic;
  font-weight: 300;
  margin: 0 0.3em;
  opacity: 0.6;
}

.hero-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-style: italic;
  font-weight: 300;
  margin-top: 0.5rem;
  letter-spacing: 0.1em;
  opacity: 0;
}

/* === Dividers === */
.divider {
  width: 60px;
  height: 1px;
  background: #2c2c2c;
  margin: 1.5rem auto;
  opacity: 0.4;
}

.divider-small {
  width: 40px;
  height: 1px;
  background: #b8a898;
  margin: 1rem auto 2rem;
}

/* === Countdown === */
.countdown {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3.5rem;
  font-weight: 300;
  line-height: 1;
  color: #2c2c2c;
}

.countdown-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #888;
  margin-top: 0.5rem;
}

/* === Navigation === */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 2rem;
  background: rgba(253, 251, 249, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.nav a {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: #5a5a5a;
  transition: color 0.3s;
}

.nav a:hover {
  color: #2c2c2c;
}

.lang-toggle {
  position: fixed;
  bottom: 25px;
  right: 80px;
  z-index: 200;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(184, 168, 152, 0.4);
  border-radius: 50%;
  background: rgba(253, 251, 249, 0.9);
  backdrop-filter: blur(8px);
  color: #b8a898;
  cursor: pointer;
  transition: all 0.3s;
}

.lang-toggle:hover {
  border-color: #b8a898;
  color: #8a7a6a;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* === Sections === */
.section {
  padding: 5rem 2rem;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.section-alt {
  max-width: 100%;
  background: #f7f3ef;
}

.section-alt > * {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.section-text {
  font-size: 1.05rem;
  line-height: 1.9;
  color: #555;
  max-width: 600px;
  margin: 0 auto;
}

/* === Details === */
.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.detail-card {
  padding: 2rem 1.5rem;
  background: #fdfbf9;
  border-radius: 4px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.04);
}

.detail-icon {
  margin-bottom: 1rem;
  color: #b8a898;
}

.detail-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.detail-card p {
  font-size: 0.95rem;
  color: #666;
}

/* === Location === */
.location-address {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #888;
  letter-spacing: 0.05em;
}

.location-link {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.9rem;
  color: #888;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.3s;
}

.location-link:hover {
  color: #3a3a3a;
}

.map-container {
  margin-top: 2rem;
}

/* === Gallery === */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.gallery-img:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
}

/* === Photo Upload === */
.photos-description {
  margin-bottom: 1rem;
}

.qr-container {
  margin: 2rem auto;
  display: flex;
  justify-content: center;
}

.qr-link {
  display: inline-block;
  padding: 1rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.qr-link:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.qr-code {
  display: block;
  border-radius: 4px;
}

.photos-upload-link {
  display: inline-block;
  margin-top: 1rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #888;
  text-decoration: none;
  padding: 0.6rem 1.5rem;
  border: 1px solid rgba(184, 168, 152, 0.4);
  border-radius: 4px;
  transition: all 0.3s;
}

.photos-upload-link:hover {
  border-color: #b8a898;
  color: #3a3a3a;
  background: rgba(184, 168, 152, 0.08);
}

/* === Gallery Modal === */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(8px);
}

.modal-img {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal.active .modal-img {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 25px;
  z-index: 1001;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2.5rem;
  cursor: pointer;
  transition: color 0.3s;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-prev,
.modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 3rem;
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.3s;
  line-height: 1;
}

.modal-prev { left: 20px; }
.modal-next { right: 20px; }

.modal-prev:hover,
.modal-next:hover {
  color: #fff;
}

/* === RSVP Form === */
.rsvp-form {
  max-width: 500px;
  margin: 2rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rsvp-form input,
.rsvp-form select,
.rsvp-form textarea {
  font-family: 'Montserrat', sans-serif;
  font-weight: 300;
  font-size: 0.95rem;
  padding: 0.9rem 1.2rem;
  border: 1px solid #ddd5cc;
  border-radius: 4px;
  background: #fff;
  color: #3a3a3a;
  transition: border-color 0.3s;
}

.rsvp-form input:focus,
.rsvp-form select:focus,
.rsvp-form textarea:focus {
  outline: none;
  border-color: #b8a898;
}

.rsvp-form button {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 1rem 2rem;
  border: 1px solid #3a3a3a;
  background: #3a3a3a;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.rsvp-form button:hover {
  background: transparent;
  color: #3a3a3a;
}

/* === Music Toggle === */
.music-toggle {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(184, 168, 152, 0.4);
  background: rgba(253, 251, 249, 0.9);
  backdrop-filter: blur(8px);
  color: #b8a898;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s, color 0.3s, box-shadow 0.3s;
}

.music-toggle:hover {
  border-color: #b8a898;
  color: #8a7a6a;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.music-bars { display: none; }

.music-toggle.playing .music-icon-on { display: none; }
.music-toggle.playing .music-bars { display: flex; gap: 3px; align-items: flex-end; height: 16px; }

.music-toggle.playing {
  border-color: #b8a898;
  background: rgba(184, 168, 152, 0.15);
  color: #6a5d50;
}

.music-bar {
  display: block;
  width: 3px;
  background: #b8a898;
  border-radius: 1px;
  animation: barBounce 1s ease-in-out infinite;
}

.music-bar:nth-child(1) { height: 6px; animation-delay: 0s; }
.music-bar:nth-child(2) { height: 12px; animation-delay: 0.15s; }
.music-bar:nth-child(3) { height: 8px; animation-delay: 0.3s; }
.music-bar:nth-child(4) { height: 14px; animation-delay: 0.45s; }

@keyframes barBounce {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1); }
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 4rem 2rem;
  background: #2c2c2c;
  color: #d4c5b5;
}

.footer-names {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 300;
  letter-spacing: 0.05em;
}

.footer-date {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  margin-top: 0.5rem;
  opacity: 0.6;
}

/* === Animations === */

/* Scroll-reveal fade-in */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section {
  animation: fadeInUp 0.8s ease-out both;
}

/* Staggered reveal via scroll-driven classes */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.15s; }
.reveal-delay-2 { transition-delay: 0.3s; }
.reveal-delay-3 { transition-delay: 0.45s; }

/* Hero entrance — slow, magical stagger */
.hero-content {
  animation: heroReveal 2.5s cubic-bezier(0.22, 1, 0.36, 1) 0.5s both;
}

@keyframes heroReveal {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.hero-date {
  animation: letterReveal 2s cubic-bezier(0.22, 1, 0.36, 1) 1s both;
}

@keyframes letterReveal {
  from {
    opacity: 0;
    letter-spacing: 1.2em;
    filter: blur(3px);
  }
  to {
    opacity: 0.7;
    letter-spacing: 0.4em;
    filter: blur(0);
  }
}


/* Title: hidden by default, revealed letter-by-letter via JS */
.hero h1 {
  opacity: 0;
}

.hero h1.magic-ready {
  opacity: 1;
}

/* Per-letter magical appearance */
.magic-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(15px) scale(0.7);
  filter: blur(8px);
  animation: magicLetterIn 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.magic-letter.space {
  width: 0.25em;
}

.magic-letter-amp {
  animation-name: magicAmpIn;
}

@keyframes magicAmpIn {
  0% {
    opacity: 0;
    transform: translateY(15px) scale(0.7);
    filter: blur(8px);
    text-shadow: 0 0 0 transparent;
  }
  50% {
    opacity: 0.5;
    text-shadow: 0 0 25px rgba(212, 197, 181, 0.7), 0 0 50px rgba(212, 197, 181, 0.4);
  }
  100% {
    opacity: 0.6;
    transform: translateY(0) scale(1);
    filter: blur(0);
    text-shadow: 0 0 0 transparent;
  }
}

@keyframes magicLetterIn {
  0% {
    opacity: 0;
    transform: translateY(15px) scale(0.7);
    filter: blur(8px);
    text-shadow: 0 0 0 transparent;
  }
  50% {
    opacity: 0.8;
    text-shadow: 0 0 20px rgba(212, 197, 181, 0.6), 0 0 40px rgba(212, 197, 181, 0.3);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    text-shadow: 0 0 0 transparent;
  }
}


/* Subtitle: also letter-by-letter */
.hero-subtitle {
  opacity: 0;
}

.hero-subtitle.magic-ready {
  opacity: 0.8;
}

.magic-subtitle-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(10px);
  filter: blur(6px);
  animation: magicSubtitleIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.magic-subtitle-letter.space {
  width: 0.2em;
}

@keyframes magicSubtitleIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(6px);
    text-shadow: 0 0 0 transparent;
  }
  50% {
    text-shadow: 0 0 15px rgba(212, 197, 181, 0.5);
  }
  100% {
    opacity: 0.8;
    transform: translateY(0);
    filter: blur(0);
    text-shadow: 0 0 0 transparent;
  }
}

.divider {
  animation: growLine 1.8s ease-out 3.6s both;
}

@keyframes growLine {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 60px;
    opacity: 0.4;
  }
}

/* Floating sparkles in hero */
.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, rgba(212, 197, 181, 0.9), transparent);
  border-radius: 50%;
  pointer-events: none;
  animation: sparkleFloat linear infinite;
}

@keyframes sparkleFloat {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0);
  }
  10% {
    opacity: 1;
    transform: translateY(-20px) scale(1);
  }
  90% {
    opacity: 0.6;
    transform: translateY(-300px) scale(0.8);
  }
  100% {
    opacity: 0;
    transform: translateY(-350px) scale(0);
  }
}

/* Gentle glow pulse behind hero title */
.hero-content::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  animation: gentleGlow 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes gentleGlow {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
  50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}


/* Detail card hover */
.detail-card {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.detail-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.detail-icon {
  transition: transform 0.4s ease;
}

.detail-card:hover .detail-icon {
  transform: scale(1.15);
}


/* Nav link underline animation */
.nav a {
  position: relative;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 1px;
  background: #b8a898;
  transition: width 0.3s ease, left 0.3s ease;
}

.nav a:hover::after {
  width: 100%;
  left: 0;
}

/* Footer gentle fade-in */
.footer {
  animation: fadeInUp 0.8s ease-out both;
}

/* === Responsive === */
@media (max-width: 600px) {
  .nav {
    gap: 1rem;
    padding: 0.8rem 1rem;
    flex-wrap: wrap;
  }

  .nav a {
    font-size: 0.65rem;
  }

  .section {
    padding: 3.5rem 1.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}
