/* =========================================================
   WEDDING INVITATION — TEMPLATE STYLESHEET
   Theme: South Indian traditional — "Kumkum & Turmeric" (light)
                                     "Temple Lamp at Dusk" (dark)
   Edit the CSS variables below to re-theme the whole page.
   ========================================================= */

:root {
  /* ---- Light theme: Kumkum & Turmeric ---- */
  --bg: #FBF3E7;
  --bg-alt: #F4E6CD;
  --surface: #FFFFFF;
  --surface-soft: #FDF8EF;
  --maroon: #7A1E33;
  --maroon-deep: #591323;
  --gold: #B8873B;
  --gold-bright: #D9AF56;
  --turmeric: #DE8F2B;
  --leaf: #3C5D4F;
  --text: #2B1810;
  --text-soft: #6B5544;
  --line: rgba(122, 30, 51, 0.16);
  --shadow: rgba(89, 19, 35, 0.14);

  --font-display: 'Yeseva One', 'Cormorant Garamond', serif;
  --font-body: 'EB Garamond', 'Georgia', serif;

  --radius: 4px;
  --container: 880px;
  --nav-h: 76px;

  color-scheme: light;
}

html[data-theme="dark"] {
  /* ---- Dark theme: Temple Lamp at Dusk ---- */
  --bg: #1B120F;
  --bg-alt: #241A15;
  --surface: #2A1E18;
  --surface-soft: #241A15;
  --maroon: #C4415C;
  --maroon-deep: #8C2B40;
  --gold: #D4AF6A;
  --gold-bright: #EAD08E;
  --turmeric: #E3A24D;
  --leaf: #6E9A87;
  --text: #F3E6D8;
  --text-soft: #C9B39E;
  --line: rgba(212, 175, 106, 0.2);
  --shadow: rgba(0, 0, 0, 0.45);

  color-scheme: dark;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 400;
  color: var(--maroon);
  text-align: center;
  letter-spacing: 0.01em;
}

.section-subtitle {
  text-align: center;
  color: var(--text-soft);
  font-style: italic;
  margin-top: 0.4rem;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.2rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.nav-monogram {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--maroon);
  letter-spacing: 0.03em;
}
.nav-monogram .amp { color: var(--gold); margin: 0 0.15em; }

.nav-links {
  display: flex;
  gap: clamp(1rem, 2vw, 2.2rem);
}
.nav-link {
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
  position: relative;
  padding-bottom: 4px;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link:focus-visible::after { width: 100%; }
.nav-link:hover { color: var(--maroon); }

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--maroon);
  transition: background 0.25s ease, color 0.25s ease;
}
.icon-btn:hover { background: var(--bg-alt); }
.icon-btn svg { width: 21px; height: 21px; }

.icon-disc { transition: transform 0.6s linear; }
#musicToggle[aria-pressed="true"] .icon-disc {
  animation: spin 3.2s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.diya-flame { transform-origin: 12px 8px; }
#themeToggle[aria-pressed="true"] .diya-flame {
  animation: flicker 1.6s ease-in-out infinite;
}
@keyframes flicker {
  0%, 100% { transform: scaleY(1) scaleX(1); opacity: 1; }
  50% { transform: scaleY(1.12) scaleX(0.94); opacity: 0.85; }
}

.hamburger {
  display: none;
  width: 40px; height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.hamburger span {
  width: 22px; height: 2px;
  background: var(--maroon);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 2rem) 1.5rem 3rem;
  gap: 1.1rem;
  overflow: hidden;
}

.kolam-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 0;
}
.kolam {
  width: min(92vw, 620px);
  height: min(92vw, 620px);
  overflow: visible;
}
.kolam-ring circle {
  fill: none;
  stroke: var(--gold);
  opacity: 0.5;
}
.kolam-ring--outer circle {
  stroke-width: 1;
  stroke-dasharray: 4 10;
  animation: rotate-cw 120s linear infinite;
  transform-origin: 200px 200px;
}
.kolam-ring--inner circle {
  stroke-width: 1.2;
  stroke-dasharray: 1 9;
  animation: rotate-ccw 90s linear infinite;
  transform-origin: 200px 200px;
}
@keyframes rotate-cw { to { transform: rotate(360deg); } }
@keyframes rotate-ccw { to { transform: rotate(-360deg); } }

.eyebrow {
  position: relative; z-index: 1;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--turmeric);
  max-width: 30em;
}

.hero-names {
  position: relative; z-index: 1;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 9vw, 5.2rem);
  color: var(--maroon);
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 2vw, 1rem);
  line-height: 1;
}
.amp-big {
  font-size: 0.55em;
  color: var(--gold);
  font-style: italic;
}

.hero-date {
  position: relative; z-index: 1;
  color: var(--text-soft);
  font-style: italic;
  font-size: 1.05rem;
}

.countdown {
  position: relative; z-index: 1;
  display: flex;
  gap: clamp(0.8rem, 3vw, 1.8rem);
  margin-top: 0.6rem;
}
.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 58px;
}
.countdown-num {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  color: var(--maroon);
}
.countdown-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-top: 0.2rem;
}

.btn-scroll {
  position: relative; z-index: 1;
  margin-top: 0.8rem;
  padding: 0.75em 1.8em;
  border: 1px solid var(--gold);
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--maroon);
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.btn-scroll:hover {
  background: var(--maroon);
  border-color: var(--maroon);
  color: var(--surface);
  transform: translateY(-2px);
}

/* =========================================================
   INVOCATION / STORY
   ========================================================= */
.invocation {
  padding: 5rem 1.5rem;
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.shloka {
  text-align: center;
  padding: 2.2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px -28px var(--shadow);
}
.shloka-line {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  color: var(--maroon);
  line-height: 1.7;
}
.shloka-translation {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-soft);
}

.story-copy { text-align: center; }
.story-copy .section-title { margin-bottom: 1.2rem; }
.story-copy p { max-width: 58ch; margin: 0 auto; color: var(--text-soft); }
.story-copy strong { color: var(--maroon); font-weight: 600; }

/* =========================================================
   EVENTS / TIMELINE
   ========================================================= */
.events {
  padding: 5rem 1.5rem;
  background: var(--bg-alt);
  transition: background 0.4s ease;
}

.timeline {
  max-width: var(--container);
  margin: 3rem auto 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2.4rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 8px; bottom: 8px;
  width: 1px;
  background: repeating-linear-gradient(to bottom, var(--gold) 0 6px, transparent 6px 12px);
}

.event-card {
  position: relative;
  padding-left: 4.6rem;
  display: grid;
  gap: 0.3rem;
}
.event-card::before {
  content: "";
  position: absolute;
  left: 18px; top: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--gold);
}
.event-card::after {
  content: "";
  position: absolute;
  left: 24px; top: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--turmeric);
}

.event-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--maroon);
}
.event-meta {
  color: var(--text-soft);
  font-size: 0.94rem;
}
.event-meta strong { color: var(--text); font-weight: 600; }

.event-actions { margin-top: 0.4rem; }
.btn-ics {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--leaf);
  border-bottom: 1px dotted var(--leaf);
  padding-bottom: 1px;
}
.btn-ics:hover { color: var(--maroon); border-color: var(--maroon); }

/* =========================================================
   VENUE
   ========================================================= */
.venue {
  padding: 5rem 1.5rem;
  display: flex;
  justify-content: center;
}
.venue-card {
  max-width: 520px;
  text-align: center;
  padding: 2.4rem 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.venue-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--maroon);
  margin-top: 0.8rem;
}
.venue-address {
  color: var(--text-soft);
  margin-top: 0.4rem;
}

.btn-outline {
  display: inline-block;
  margin-top: 1.4rem;
  padding: 0.7em 1.6em;
  border: 1px solid var(--maroon);
  border-radius: 999px;
  color: var(--maroon);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.3s ease, color 0.3s ease;
}
.btn-outline:hover { background: var(--maroon); color: var(--surface); }

/* =========================================================
   GALLERY
   ========================================================= */
.gallery {
  padding: 5rem 1.5rem;
  background: var(--bg-alt);
}
.gallery-grid {
  max-width: var(--container);
  margin: 2.6rem auto 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.gallery-item {
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  border: 1px dashed var(--gold);
  border-radius: var(--radius);
  color: var(--text-soft);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--surface-soft);
  transition: transform 0.25s ease, border-color 0.25s ease;
  transition-delay: calc(var(--i, 0) * 60ms);
}
.gallery-item:hover { transform: translateY(-4px); border-color: var(--maroon); }

/* =========================================================
   RSVP
   ========================================================= */
.rsvp {
  padding: 5rem 1.5rem;
  max-width: 560px;
  margin: 0 auto;
}
.rsvp-form {
  margin-top: 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label, .field legend {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.field input[type="text"],
.field input[type="number"],
.field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.7em 0.9em;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.25s ease;
}
.field input:focus, .field textarea:focus { border-color: var(--gold); }
.field textarea { resize: vertical; }

.field-error {
  font-size: 0.78rem;
  color: var(--maroon);
  min-height: 1em;
}

.field-attending { border: none; padding: 0; }
.pill-group { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.pill-group input { position: absolute; opacity: 0; pointer-events: none; }
.pill {
  padding: 0.55em 1.1em;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-soft);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.pill-group input:checked + .pill {
  background: var(--maroon);
  border-color: var(--maroon);
  color: var(--surface);
}
.pill-group input:focus-visible + .pill { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

.btn-solid {
  margin-top: 0.4rem;
  padding: 0.85em 1.6em;
  background: var(--maroon);
  color: var(--surface);
  border-radius: 999px;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 0.3s ease, transform 0.2s ease;
}
.btn-solid:hover { background: var(--maroon-deep); transform: translateY(-2px); }

.rsvp-thankyou {
  margin-top: 2.4rem;
  text-align: center;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.rsvp-thankyou-title {
  font-family: var(--font-display);
  color: var(--maroon);
  font-size: 1.3rem;
}
#thankYouMessage { color: var(--text-soft); margin-top: 0.5rem; }
.rsvp-thankyou .btn-outline { margin-top: 1.4rem; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  padding: 3.4rem 1.5rem;
  text-align: center;
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
}
.footer-monogram {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--maroon);
}
.footer-monogram .amp { color: var(--gold); margin: 0 0.2em; }
.footer-families {
  margin-top: 0.8rem;
  color: var(--text-soft);
  font-size: 0.9rem;
}
.footer-hashtag {
  margin-top: 0.6rem;
  color: var(--turmeric);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
    padding: 2rem 0 2.4rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .hamburger { display: flex; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  body { font-size: 16.5px; }
  .countdown { gap: 0.7rem; }
  .countdown-unit { min-width: 50px; }
}
