/* ====================================================================
   KERALA WEDDING INVITATION — STYLES
   Edit the variables below to re-theme colors, fonts and spacing.
==================================================================== */

:root {
  /* -- Palette -------------------------------------------------- */
  --ivory:        #FBF3E1;   /* page background, warm kasavu cream */
  --paper:        #FFFDF8;   /* card surfaces, slightly lighter    */
  --gold:         #AD8339;   /* muted temple gold                  */
  --gold-light:   #E4C77E;   /* highlight gold, borders            */
  --gold-deep:    #8C6A24;   /* pressed / darker gold              */
  --maroon:       #7C2128;   /* kumkum red accent, used sparingly  */
  --green-deep:   #3F5942;   /* banana-leaf green, rare accent     */
  --ink:          #3A2C1D;   /* primary text, warm brown-black     */
  --ink-soft:     #6B5C48;   /* secondary text                     */
  --line:         rgba(173, 131, 57, 0.28);

  /* -- Type ------------------------------------------------------ */
  --font-display: 'Cormorant Garamond', serif;
  --font-script:  'Petit Formal Script', cursive;
  --font-body:    'Jost', sans-serif;
  --font-mal:     'Noto Sans Malayalam', sans-serif;

  /* -- Layout ------------------------------------------------------ */
  --max-w: 720px;
  --section-pad: clamp(64px, 10vw, 120px);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ====================== ENVELOPE OVERLAY ====================== */

#envelope-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background:
    radial-gradient(circle at 50% 35%, #fffaf0 0%, var(--ivory) 70%);
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

#envelope-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.envelope {
  position: relative;
  width: min(320px, 78vw);
  height: 210px;
  cursor: pointer;
  filter: drop-shadow(0 18px 30px rgba(60, 40, 10, 0.18));
}

.envelope__back {
  position: absolute;
  inset: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.envelope__card {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 10%;
  bottom: 10%;
  background: var(--paper);
  border: 1px solid var(--gold-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  transition: transform 0.8s cubic-bezier(.22,.9,.32,1) 0.25s;
  z-index: 1;
}

.envelope__eyebrow {
  font-family: var(--font-mal);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--gold-deep);
  margin: 0 0 6px;
}

.envelope__names {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 0 0 4px;
  color: var(--ink);
}
.envelope__names span { color: var(--gold-deep); padding: 0 4px; }

.envelope__hint {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}

.envelope__flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  clip-path: polygon(0 0, 100% 0, 50% 85%);
  transform-origin: top center;
  transition: transform 0.7s cubic-bezier(.6,-0.1,.3,1.3);
  z-index: 3;
  border-radius: 4px 4px 0 0;
}

.envelope__seal {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: #fff8e8;
  z-index: 4;
  box-shadow: 0 4px 10px rgba(90, 60, 10, 0.35);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.envelope.is-open .envelope__flap {
  transform: rotateX(180deg);
}
.envelope.is-open .envelope__seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
}
.envelope.is-open .envelope__card {
  transform: translateY(-18px) scale(1.03);
}

.envelope__tap {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* ====================== MUSIC TOGGLE ====================== */

.music-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  box-shadow: 0 6px 16px rgba(60,40,10,0.08);
  transition: color 0.3s ease, border-color 0.3s ease;
}
.music-toggle:hover { color: var(--gold-deep); border-color: var(--gold-light); }

.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i {
  width: 2.5px;
  background: currentColor;
  display: inline-block;
  height: 4px;
  border-radius: 1px;
}
.music-toggle[aria-pressed="true"] .bars i { animation: bar 0.9s ease-in-out infinite; }
.bars i:nth-child(1) { animation-delay: 0s; }
.bars i:nth-child(2) { animation-delay: 0.2s; }
.bars i:nth-child(3) { animation-delay: 0.4s; }

@keyframes bar {
  0%, 100% { height: 4px; }
  50% { height: 12px; }
}

/* ====================== SCROLL PROGRESS ====================== */

#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--maroon));
  z-index: 95;
  transition: width 0.1s linear;
}

/* ====================== SHARED SECTION STYLES ====================== */

.invite { position: relative; }

section, header.hero, footer.footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--section-pad) 24px;
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

.eyebrow, .section-eyebrow {
  font-family: var(--font-mal);
  color: var(--gold-deep);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
}

.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 28px;
}

.divider {
  width: 64px;
  height: 1px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0 0 40px;
  color: var(--ink);
}

/* ====================== HERO ====================== */

.hero { padding-top: clamp(56px, 12vw, 96px); position: relative; }

.border-frame {
  height: 34px;
  margin: 0 auto 18px;
  width: min(360px, 90%);
  background-repeat: repeat-x;
  background-position: center;
  background-size: 34px 34px;
  opacity: 0.85;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cpath d='M17 3 C 22 3 26 8 26 14 C 26 20 22 25 17 25 C 12 25 8 20 8 14 C 8 8 12 3 17 3 Z' fill='none' stroke='%23AD8339' stroke-width='1'/%3E%3Ccircle cx='17' cy='14' r='2' fill='%23AD8339'/%3E%3C/svg%3E");
}
.border-frame--bottom { margin: 40px auto 0; }

.hero__names {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.6rem, 9vw, 4.6rem);
  margin: 8px 0 22px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.hero__names .amp {
  font-family: var(--font-script);
  color: var(--gold-deep);
  font-size: 0.6em;
}

.hero__request {
  font-size: 1rem;
  color: var(--ink-soft);
  max-width: 380px;
  margin: 0 auto 20px;
}

.hero__date {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--maroon);
  margin: 0;
}

.scroll-cue {
  display: inline-block;
  margin-top: 56px;
  width: 22px;
  height: 34px;
  border: 1px solid var(--gold);
  border-radius: 12px;
  position: relative;
}
.scroll-cue span {
  position: absolute;
  top: 6px; left: 50%;
  width: 4px; height: 4px;
  background: var(--gold);
  border-radius: 50%;
  transform: translateX(-50%);
  animation: scrolldown 1.6s ease-in-out infinite;
}
@keyframes scrolldown {
  0% { top: 6px; opacity: 1; }
  70% { top: 20px; opacity: 0; }
  100% { top: 20px; opacity: 0; }
}

/* ====================== BLESSING ====================== */

.blessing__text {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  color: var(--ink);
  max-width: 560px;
  margin: 26px auto;
}

/* ====================== COUPLE ====================== */

.couple {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 5vw, 56px);
  flex-wrap: wrap;
}
.couple__card { flex: 1 1 200px; max-width: 240px; }
.couple__label {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 8px;
}
.couple__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 2rem;
  margin: 0 0 10px;
}
.couple__parents {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.couple__ornament {
  font-family: var(--font-script);
  font-size: 2.4rem;
  color: var(--gold);
  flex: 0 0 auto;
}

/* ====================== EVENTS ====================== */

.events__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 44px;
}

.event-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 36px 24px;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(60,40,10,0.10);
  border-color: var(--gold-light);
}
.event-card__icon svg {
  width: 40px; height: 40px;
  fill: none;
  stroke: var(--gold-deep);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 14px;
}
.event-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  margin: 0 0 10px;
}
.event-card__time { font-size: 0.9rem; color: var(--ink); margin: 0 0 8px; }
.event-card__venue { font-size: 0.84rem; color: var(--ink-soft); margin: 0; }

/* Countdown */
.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 4vw, 28px);
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.countdown__unit {
  min-width: 64px;
}
.countdown__unit span {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 2rem;
  color: var(--maroon);
}
.countdown__unit small {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ====================== BUTTONS ====================== */

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 13px 30px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
}
.btn:active { transform: scale(0.97); }

.btn--gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #3a2a10;
  box-shadow: 0 8px 18px rgba(140, 106, 36, 0.28);
}
.btn--gold:hover { box-shadow: 0 12px 24px rgba(140, 106, 36, 0.36); }

.btn--ghost {
  background: transparent;
  border-color: var(--gold);
  color: var(--gold-deep);
}
.btn--ghost:hover { background: var(--gold-light); color: #3a2a10; }

.btn--full { width: 100%; }

/* ====================== VENUE ====================== */

.venue__name { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 6px; }
.venue__address { color: var(--ink-soft); margin: 0 0 24px; }

/* ====================== RSVP ====================== */

.rsvp__note { color: var(--ink-soft); max-width: 440px; margin: 0 auto 32px; }

.rsvp-form {
  max-width: 420px;
  margin: 0 auto;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field label, .field legend {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
  padding: 0;
}

.field input[type="text"],
.field input[type="number"],
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 11px 12px;
  transition: border-color 0.25s ease;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.field--radio { border: none; padding: 0; margin: 0; }
.field--radio label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.9rem;
  color: var(--ink);
  margin-right: 20px;
}

.rsvp-confirmation {
  max-width: 420px;
  margin: 0 auto;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--gold-light);
  border-radius: 6px;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--maroon);
}

.rsvp__contact { margin-top: 28px; font-size: 0.85rem; color: var(--ink-soft); }

/* ====================== FOOTER ====================== */

.footer__names {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 20px 0 10px;
}
.footer__names span { color: var(--gold-deep); padding: 0 6px; }
.footer__thanks { color: var(--ink-soft); font-size: 0.9rem; }

.scroll-top {
  margin-top: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--paper);
  color: var(--gold-deep);
  cursor: pointer;
  font-size: 1rem;
}

/* ====================== FOCUS VISIBILITY ====================== */

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--maroon);
  outline-offset: 2px;
}

/* ====================== RESPONSIVE ====================== */

@media (max-width: 480px) {
  .music-toggle .music-toggle__label { display: none; }
  .couple { gap: 20px; }
  .couple__ornament { order: 3; width: 100%; }
}
