@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400;1,500&family=Jost:wght@300;400;500;600&display=swap');

:root {
  --primary: #1a3d34;
  --secondary: #d4a843;
  --background: #f4f1eb;
  --text-dark: #212529;
  --text-light: #f8f9fa;
  --border-light: #dcd3c4;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Jost', sans-serif;
  background-color: var(--background);
  color: var(--text-dark);
  overflow-x: hidden;
  width: 100%;
}

/* =================================
   MUSIC BUTTON
   ================================= */
.music-btn {
  position: fixed;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1100;
  background: rgba(244, 241, 235, 0.88);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.3s;
}
.music-btn:hover { background: var(--border-light); }
.music-btn svg { color: var(--primary); width: 20px; height: 20px; }

/* =================================
   MANDALA BACKGROUND
   ================================= */
.mandala-bg {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 90vh);
  height: min(90vw, 90vh);
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

/* =================================
   NAVIGATION
   ================================= */
#navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 0;
  transition: all 0.4s ease;
  background: transparent;
}

#navbar.scrolled {
  background: rgba(244, 241, 235, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-light);
}

.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0 1rem;
}

.nav-inner a {
  text-decoration: none;
  color: var(--primary);
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: clamp(0.65rem, 2vw, 0.82rem);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: color 0.3s;
  position: relative;
  white-space: nowrap;
}

.nav-inner a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 1.5px;
  background: var(--secondary);
  transition: width 0.35s ease;
}

.nav-inner a:hover::after { width: 100%; }
.nav-inner a:hover { color: var(--secondary); }

/* =================================
   HERO SECTION
   ================================= */
.hero {
  min-height: 100svh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: clamp(5rem, 14vw, 7rem) 1rem clamp(4rem, 10vw, 5rem);
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, rgba(212, 168, 67, 0.11) 0%, transparent 65%),
    var(--background);
  overflow: hidden;
}

/* =================================
   GANESHA
   ================================= */
.ganpati-container {
  position: relative;
  z-index: 100; /* Increased to establish a clear stacking context above other elements */
  margin-bottom: 0.25rem;
  animation: ganpatiFloat 5s ease-in-out infinite;
  mix-blend-mode: multiply;
  /* Adjust Ganesha's position to make space for Mushika */
  margin-top: 50px; /* Example adjustment */
}

.ganesh-img {
  width: min(280px, 72vw);
  height: auto;
  display: block;
}

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

/* =================================
   MUSHIKA
   ================================= */
.mushika-container {
  position: absolute;
  bottom: 0px; /* Adjusted to move Mushika slightly upwards */
  left: 10%; /* Adjusted to move Mushika a little more towards Ganesha */
  transform: translateX(-50%); /* Keep for fine-tuning horizontal position */
  width: 80px;
  height: auto;
  z-index: 5;
}

.mushika-img {
  width: 80px;
  height: auto;
  display: block;
  position: relative;
  z-index: 2;
  animation: mushikaScurry 4s ease-out 1 forwards; /* Animation: 4s duration, ease-out, play once, stay at end */
}

@keyframes mushikaScurry {
  0% {
    transform: translateX(-100vw); /* Start completely off-screen left (viewport) */
  }
  100% {
    transform: translateX(0); /* Stop at the position defined by .mushika-container */
  }
}

/* =================================
   LET'S BEGIN BUTTON
   ================================= */
.lets-begin-btn { display: none; }

/* =================================
   HERO NAMES
   ================================= */
.hero-names {
  z-index: 2;
  position: relative;
  opacity: 0; /* Hidden initially */
  visibility: hidden; /* Hidden initially */
  transition: opacity 1s ease-in, visibility 1s ease-in; /* Fade-in transition */
}

.hero-names h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.4rem, 10vw, 5.5rem);
  font-weight: 400;
  color: var(--primary);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.name-amp {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(1.6rem, 6vw, 3.2rem);
  color: var(--secondary);
  margin: 0 0.25em;
}

.hero-date {
  font-family: 'Jost', sans-serif;
  font-size: clamp(0.68rem, 2.5vw, 0.95rem);
  color: var(--primary);
  letter-spacing: 3px;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  opacity: 0; /* Hidden initially */
  visibility: hidden; /* Hidden initially */
  transition: opacity 1s ease-in 0.5s, visibility 1s ease-in 0.5s; /* Fade-in transition with delay */
}

/* =================================
   COUNTDOWN
   ================================= */
.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.4rem, 2vw, 1rem);
  margin-top: 1.25rem;
  opacity: 0; /* Hidden initially */
  visibility: hidden; /* Hidden initially */
  transition: opacity 1s ease-in 1s, visibility 1s ease-in 1s; /* Fade-in transition with delay */
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(44px, 12vw, 80px);
}

.countdown-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.5rem, 5.5vw, 2.4rem);
  color: var(--primary);
  line-height: 1;
  font-weight: 400;
}

.countdown-label {
  font-family: 'Jost', sans-serif;
  font-size: clamp(0.5rem, 1.6vw, 0.65rem);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
  opacity: 0.7;
  margin-top: 5px;
}

.countdown-sep {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  color: var(--secondary);
  margin-top: -12px;
  opacity: 0.7;
}

/* =================================
   SCROLL INDICATOR
   ================================= */
.scroll-indicator {
  position: absolute;
  bottom: clamp(1.2rem, 4vw, 2rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  cursor: pointer;
  animation: bounce 2.5s ease-in-out infinite;
}

.scroll-indicator svg {
  width: 26px;
  height: 26px;
  stroke: var(--secondary);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
  40%  { transform: translate(-50%, -16px); }
  60%  { transform: translate(-50%, -8px); }
}

/* =================================
   GENERAL SECTIONS
   ================================= */
section {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(4rem, 10vw, 7rem) clamp(1rem, 5vw, 2rem);
  overflow: hidden;
}

.section-title {
  text-align: center;
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
}

.section-title h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 6vw, 2.8rem);
  color: var(--primary);
  font-weight: 400;
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.section-title .subtitle {
  font-family: 'Jost', sans-serif;
  font-size: clamp(0.65rem, 2vw, 0.82rem);
  color: var(--secondary);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.title-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.title-ornament .line {
  width: 40px;
  height: 1px;
  background: var(--border-light);
}

.title-ornament .dot {
  width: 5px;
  height: 5px;
  background: var(--secondary);
  border-radius: 50%;
}

/* =================================
   EVENTS
   ================================= */
#events {
  background-color: var(--background);
}

.events-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: clamp(1.25rem, 4vw, 2.5rem);
}

.event-icon {
  width: 90px;
  height: 90px;
  margin: 0 auto 1.25rem;
  mix-blend-mode: multiply;
}

.event-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.event-card {
  background: var(--background);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--secondary);
  border-radius: 6px;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  text-align: center;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.event-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(26, 61, 52, 0.09);
}

.event-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  color: var(--primary);
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.event-card .event-date {
  font-family: 'Jost', sans-serif;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  color: var(--secondary);
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.event-card .event-time {
  font-size: clamp(0.82rem, 2vw, 0.95rem);
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.event-card .event-desc {
  font-size: clamp(0.82rem, 2vw, 0.92rem);
  color: #666;
  line-height: 1.75;
}

/* =================================
   FAMILIES
   ================================= */
#families {
  background-color: #eae5db;
}

.families-content {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.families-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  width: 100%;
  max-width: 700px;
}

.family {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(220, 211, 196, 0.7);
  border-radius: 8px;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 3vw, 2rem);
  text-align: center;
  backdrop-filter: blur(4px);
}

.family-label {
  font-family: 'Jost', sans-serif;
  font-size: 0.66rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.family-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.family-ornament-line {
  width: 24px;
  height: 1px;
  background: var(--secondary);
  opacity: 0.5;
}

.family-ornament-dot {
  width: 4px;
  height: 4px;
  background: var(--secondary);
  border-radius: 50%;
}

.family-names {
  list-style: none;
  padding: 0;
  margin: 0;
}

.family-names li {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(1.05rem, 3vw, 1.2rem);
  color: var(--primary);
  line-height: 2.3;
  letter-spacing: 0.01em;
}

/* families divider (not used in new layout) */
.families-divider { display: none; }
.fam-line { display: none; }
.fam-diamond { display: none; }

@media (max-width: 600px) {
  .families-row {
    grid-template-columns: 1fr;
    max-width: 340px;
  }
}

/* =================================
   VENUE
   ================================= */
#venue {
  background-image: url('venue.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
}

#venue::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(15, 32, 26, 0.62);
  z-index: 0;
}

#venue .section-title,
#venue .venue-content {
  position: relative;
  z-index: 1;
}

#venue .section-title h2,
#venue .section-title .subtitle {
  color: var(--background);
}

#venue .section-title .subtitle {
  color: var(--secondary);
}

#venue .title-ornament .line {
  background: rgba(244, 241, 235, 0.35);
}

.venue-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.venue-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  color: var(--background);
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.venue-address {
  font-family: 'Jost', sans-serif;
  font-size: clamp(0.9rem, 2.5vw, 1.05rem);
  line-height: 1.9;
  color: rgba(244, 241, 235, 0.82);
  margin-bottom: 1.75rem;
}

.venue-btn {
  display: inline-block;
  padding: 0.8rem 2.5rem;
  background: transparent;
  color: var(--background);
  border: 1.5px solid rgba(212, 168, 67, 0.8);
  text-decoration: none;
  font-family: 'Jost', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 50px;
  transition: all 0.3s ease;
}

.venue-btn:hover {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.22);
}

/* =================================
   RSVP
   ================================= */
#rsvp {
  background-color: #eae5db;
}

.rsvp-message {
  max-width: 520px;
  margin: -2rem auto 2.5rem;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(1rem, 3vw, 1.2rem);
  line-height: 1.85;
  color: #666;
  text-align: center;
}

.rsvp-form {
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.form-group {
  margin-bottom: 1.4rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: #fff;
  font-family: 'Jost', sans-serif;
  font-size: 0.95rem;
  color: var(--text-dark);
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
  -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.18);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.attendance-options {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.attendance-option {
  flex: 1;
  min-width: 130px;
  position: relative;
}

.attendance-option input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.attendance-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: clamp(0.78rem, 2vw, 0.88rem);
  text-transform: none;
  letter-spacing: 0;
  text-align: center;
  font-weight: 400;
}

.attendance-option input[type="checkbox"]:checked + label {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--text-light);
}

.rsvp-submit {
  display: block;
  width: 100%;
  padding: 1rem 2rem;
  margin-top: 1rem;
  background: var(--primary);
  color: var(--text-light);
  border: none;
  font-family: 'Jost', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.35s ease;
}

.rsvp-submit:hover {
  background: var(--secondary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}

.rsvp-success {
  display: none;
  text-align: center;
  padding: 2.5rem 1rem;
}

.rsvp-success.show {
  display: block;
  animation: fadeIn 0.6s ease-out;
}

.rsvp-success h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.6rem, 5vw, 2rem);
  color: var(--primary);
  font-weight: 400;
  margin-bottom: 0.75rem;
}

.rsvp-success p {
  font-size: 1rem;
  color: #666;
}

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

/* =================================
   FOOTER
   ================================= */
footer {
  background: var(--primary);
  text-align: center;
  padding: clamp(2.5rem, 6vw, 3.5rem) 1.5rem;
  color: var(--background);
  position: relative;
  z-index: 1;
}

.footer-names {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.footer-tagline {
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.65;
}

footer .ornament-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem auto;
  width: fit-content;
}

footer .ornament-line .line {
  width: 40px;
  height: 1px;
  background: var(--border-light);
  opacity: 0.4;
}

footer .ornament-line .diamond {
  width: 6px;
  height: 6px;
  background: var(--secondary);
  transform: rotate(45deg);
}

/* =================================
   REVEAL ANIMATION
   ================================= */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: all 0.9s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

/* =================================
   MOBILE — ≤ 600px
   ================================= */
@media (max-width: 768px) {
  /* iOS does not support background-attachment:fixed */
  #venue {
    background-attachment: scroll;
  }
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .attendance-options {
    flex-direction: column;
  }

  .families-content {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .families-divider {
    flex-direction: row;
    min-height: unset;
    padding: 0.5rem 0;
    width: 100%;
  }

  .fam-line {
    width: auto;
    height: 1px;
    flex: 1;
  }

  .fam-diamond {
    margin: 0 0.75rem;
  }

  .family {
    padding: 1.5rem 0.5rem;
  }
}
