:root {
  --maroon: #6d1b2b;
  --maroon-dark: #4a1220;
  --gold: #c9a227;
  --gold-light: #e6c76b;
  --ivory: #fbf3e4;
  --ivory-alt: #f4e6c8;
  --ink: #2b1a12;
  --ink-soft: #6b5849;
  --display: 'Cormorant Garamond', serif;
  --body: 'Poppins', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--ink);
  background: var(--ivory);
  overflow-x: hidden;
}

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

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-item.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Ornament helpers ===== */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  max-width: 220px;
  margin: 0 auto 1.6rem;
  color: var(--gold);
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold) 40%, var(--gold-light) 50%, var(--gold) 60%, transparent);
  background-size: 200% 100%;
  animation: shimmer 5s ease-in-out infinite;
}

.divider::after {
  background: linear-gradient(to left, transparent, var(--gold) 40%, var(--gold-light) 50%, var(--gold) 60%, transparent);
  background-size: 200% 100%;
  animation: shimmer 5s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 200% 0; }
  50% { background-position: 0 0; }
}

.divider-flower {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  animation: spin-slow 18s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== Floating petals (hero) ===== */
.petals {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.petal {
  position: absolute;
  top: -5%;
  width: var(--size);
  height: var(--size);
  background: var(--gold-light);
  border-radius: 0 60% 0 60%;
  opacity: 0;
  animation-name: petal-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes petal-fall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  8% { opacity: 0.75; }
  92% { opacity: 0.5; }
  100% { transform: translate(var(--drift), 115vh) rotate(360deg); opacity: 0; }
}

/* ===== Invitation cover ===== */
body.locked { overflow: hidden; height: 100vh; }

.invite-cover {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.invite-cover.closing {
  opacity: 0;
  transform: scale(1.06);
  pointer-events: none;
}

.invite-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.invite-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(43,10,18,0.88) 0%, rgba(74,18,32,0.9) 55%, rgba(43,10,18,0.95) 100%);
  z-index: 1;
}

.invite-corner { z-index: 2; opacity: 0.6; }

.invite-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  animation: invite-fade-in 1.1s ease both;
}

@keyframes invite-fade-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.invite-monogram {
  width: 52px;
  height: 52px;
  color: var(--gold-light);
  margin-bottom: 1.4rem;
  animation: spin-slow 22s linear infinite;
}

.hero-ganpati {
  width: 74px;
  height: auto;
  margin: 0 auto 0.6rem;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.5));
}

.ganpati-mantra {
  font-family: 'Noto Serif Devanagari', serif;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--gold-light);
  margin-bottom: 0.9rem;
}

.hero .divider { margin-bottom: 1rem; }

.invite-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  color: var(--ivory-alt);
  margin-bottom: 1rem;
}

.invite-names {
  font-family: var(--display);
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 600;
  color: var(--ivory);
}

.invite-names .amp { color: var(--gold-light); font-style: italic; margin: 0 0.2em; }

.invite-cover .divider { color: var(--gold-light); }
.invite-cover .divider::before { background: linear-gradient(to right, transparent, var(--gold-light) 40%, var(--gold-light) 60%, transparent); }
.invite-cover .divider::after { background: linear-gradient(to left, transparent, var(--gold-light) 40%, var(--gold-light) 60%, transparent); }

.invite-date {
  color: var(--ivory-alt);
  font-size: 1rem;
  letter-spacing: 0.04em;
  margin-bottom: 2.6rem;
}

.open-invite-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 2.2rem;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--ivory);
  font-family: var(--body);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  animation: invite-pulse 2.6s ease-in-out infinite;
}

.open-invite-btn:hover {
  background: rgba(201,162,39,0.18);
  transform: translateY(-2px);
}

.envelope-icon { width: 20px; height: 20px; }

@keyframes invite-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,162,39,0.35); }
  50% { box-shadow: 0 0 0 10px rgba(201,162,39,0); }
}

/* ===== Navbar ===== */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(251, 243, 228, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(201, 162, 39, 0.3);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  color: var(--maroon);
  text-decoration: none;
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-right: 1rem;
}

.nav-logo span { color: var(--gold); margin: 0 0.15em; }

.nav-links {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  margin-left: 1.6rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.nav-links a:first-child { margin-left: 0; }

.nav-links a:hover { color: var(--maroon); }

.nav-links a.active {
  color: var(--maroon);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 2px;
}

/* ===== Music toggle ===== */
#music-toggle {
  position: fixed;
  left: calc(1.4rem + 48px + 0.8rem); /* just right of #back-to-top */
  bottom: 1.4rem;
  z-index: 60;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--maroon);
  color: var(--gold-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(74,18,32,0.35);
  transition: transform 0.2s ease;
}

#music-toggle:hover { transform: scale(1.06); }

#music-toggle .icon { width: 22px; height: 22px; }
#music-toggle .icon-off { display: none; }
#music-toggle.playing .icon-on { display: none; }
#music-toggle.playing .icon-off { display: block; }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5.5rem 1.5rem 1.6rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(74,18,32,0.72) 0%, rgba(74,18,32,0.82) 60%, rgba(43,10,18,0.92) 100%);
  z-index: 1;
}

.hero-content { position: relative; z-index: 2; }

.corner {
  position: absolute;
  width: 64px;
  height: 60px;
  color: var(--gold-light);
  opacity: 0.55;
  z-index: 2;
}

.corner-tl { top: 1.4rem; left: 1.4rem; }
.corner-tr { top: 1.4rem; right: 1.4rem; transform: scaleX(-1); }
.corner-bl { bottom: 1.4rem; left: 1.4rem; transform: scaleY(-1); }
.corner-br { bottom: 1.4rem; right: 1.4rem; transform: scale(-1, -1); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.72rem;
  color: var(--gold-light);
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.hero .divider { color: var(--gold-light); }
.hero .divider::before { background: linear-gradient(to right, transparent, var(--gold-light)); }
.hero .divider::after { background: linear-gradient(to left, transparent, var(--gold-light)); }

.hero-names {
  font-family: var(--display);
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  color: var(--ivory);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hero-names .amp {
  color: var(--gold-light);
  font-style: italic;
  margin: 0 0.2em;
}

.hero-date {
  margin-top: 0.3rem;
  font-size: 1.05rem;
  color: var(--ivory-alt);
  letter-spacing: 0.05em;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.count-box {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.count-box span {
  display: block;
  font-family: var(--display);
  font-size: 1.4rem;
  color: var(--gold-light);
  font-weight: 700;
  line-height: 1;
}

.count-box small {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.58rem;
  color: var(--ivory-alt);
  margin-top: 0.2rem;
}

.scroll-cue {
  display: inline-block;
  margin-top: 1.4rem;
  color: var(--ivory-alt);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(230,199,107,0.5);
  padding-bottom: 0.3rem;
}

/* ===== Sections ===== */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 6rem 1.5rem;
  text-align: center;
}

.section.alt { max-width: 100%; background: var(--ivory-alt); }
.section.alt > * { max-width: 1100px; margin-left: auto; margin-right: auto; }

.section-tag {
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 0.72rem;
  color: var(--maroon);
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 1.3rem;
  color: var(--ink);
  font-weight: 600;
}

/* ===== Save the date (scratch cards) ===== */
.scratch-row {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.scratch-card {
  position: relative;
  width: 130px;
  height: 150px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(201,162,39,0.4);
  box-shadow: 0 10px 26px rgba(74,18,32,0.1);
  background: #fff;
}

.scratch-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.scratch-reveal span {
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.1rem;
  color: var(--maroon);
  line-height: 1.1;
}

.scratch-reveal small {
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.65rem;
  color: var(--ink-soft);
}

.scratch-card.revealed .scratch-reveal span {
  animation: reveal-pop 0.6s ease;
}

@keyframes reveal-pop {
  0% { transform: scale(0.85); opacity: 0.5; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: none;
  transition: opacity 0.6s ease;
}

.scratch-canvas.cleared {
  opacity: 0;
  pointer-events: none;
}

.scratch-hint {
  text-align: center;
  margin-top: 1.6rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
  transition: opacity 0.4s ease;
}

.scratch-hint.hidden { opacity: 0; }

/* ===== Schedule (Celebration) ===== */
.schedule {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.schedule-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 1.5rem;
  background: #fff;
  border: 1px solid rgba(201,162,39,0.3);
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
  align-items: center;
  text-align: left;
  box-shadow: 0 10px 26px rgba(74,18,32,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.schedule-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(74,18,32,0.12);
}

.schedule-date {
  text-align: center;
  color: var(--maroon);
  border-right: 1px solid rgba(201,162,39,0.3);
}

.schedule-date .day {
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 700;
  display: block;
}

.schedule-date .mon {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.schedule-body h3 {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.schedule-time { font-size: 0.86rem; color: var(--maroon); margin-bottom: 0.3rem; font-weight: 500; }
.schedule-venue { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 0.4rem; }

.schedule-map {
  font-size: 0.8rem;
  color: var(--maroon);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
}

/* ===== Bios (Couple) ===== */
.bios {
  display: flex;
  justify-content: center;
  gap: 3.5rem;
  flex-wrap: wrap;
  text-align: center;
}

.bio-card { max-width: 260px; }

.bio-frame {
  width: 156px;
  height: 156px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  padding: 6px;
  margin: 0 auto 1.2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bio-frame:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 24px rgba(201,162,39,0.35);
}

.bio-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
}

.bio-card h3 {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--maroon);
  margin-bottom: 0.5rem;
}

.bio-card p { color: var(--ink-soft); font-size: 0.9rem; }

/* ===== Card deck (Collection slideshow, fanned) ===== */
.card-deck {
  position: relative;
  width: 220px;
  height: 300px;
  margin: 0 auto 3.2rem;
  touch-action: pan-y;
}

.deck-card {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 5px solid #fff;
  box-shadow: 0 14px 32px rgba(74,18,32,0.2);
  transform-origin: center center;
  transform: translate(var(--tx, 0px), var(--ty, 0px))
             rotate(var(--rot, 0deg))
             scale(var(--scale, 1));
  z-index: var(--z, 1);
  opacity: var(--op, 1);
  transition: transform 0.7s cubic-bezier(0.34, 1.2, 0.4, 1), opacity 0.5s ease;
  cursor: pointer;
}

.deck-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.deck-card.leaving {
  transform: translate(var(--tx, 0px), 130px) rotate(calc(var(--rot, 0deg) - 12deg)) scale(0.85);
  opacity: 0;
  transition: transform 0.7s ease-in, opacity 0.7s ease-in;
}

.deck-card.no-transition { transition: none; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 3.6rem 1.5rem 2.6rem;
  background: var(--maroon-dark);
  color: var(--ivory-alt);
}

.footer-flower {
  width: 30px;
  height: 30px;
  color: var(--gold);
  margin-bottom: 0.8rem;
}

.footer-mark {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--ivory);
}

.footer-mark span { color: var(--gold-light); margin: 0 0.15em; }

/* ===== Back to top ===== */
#back-to-top {
  position: fixed;
  left: 1.4rem;
  bottom: 1.4rem;
  z-index: 60;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: var(--ivory);
  color: var(--maroon);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(74,18,32,0.15);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#back-to-top svg { width: 20px; height: 20px; }

/* ====================================================================
   Responsive breakpoints
   Small mobile  : <= 380px
   Mobile        : <= 640px
   Tablet        : 641px – 1024px
   Laptop        : 1025px – 1440px  (base styles above target this)
   Big screen    : >= 1441px
   ==================================================================== */

/* ----- Tablet (portrait phones through tablets) ----- */
@media (max-width: 1024px) {
  .section { padding: 4.5rem 1.5rem; }
  .bios { gap: 2.4rem; }
  .corner { width: 48px; height: 48px; }

  .hero { padding: 5rem 1.5rem 1.4rem; }
  .hero-names { font-size: clamp(2.4rem, 6.5vw, 4.4rem); }
  .hero-ganpati { width: 68px; margin: 0 auto 0.7rem; }
  .ganpati-mantra { font-size: 0.85rem; margin-bottom: 0.8rem; }
  .countdown { margin-top: 1.2rem; }
  .scroll-cue { margin-top: 1.2rem; }
}

/* ----- Mobile ----- */
@media (max-width: 640px) {
  .nav-inner { padding: 0.8rem 1.1rem; }
  .nav-logo { font-size: 1.05rem; }
  .nav-links a { margin-left: 0.9rem; font-size: 0.76rem; }

  .hero { padding: 4.5rem 1.2rem 1.3rem; min-height: 100svh; }
  .corner { width: 36px; height: 36px; opacity: 0.4; }
  .eyebrow { margin-bottom: 0.6rem; }
  .hero .divider { margin-bottom: 0.7rem; }
  .countdown { gap: 0.5rem; margin-top: 1.1rem; }
  .count-box { width: 60px; height: 60px; }
  .count-box span { font-size: 1.2rem; }
  .scroll-cue { margin-top: 1.1rem; }

  .section { padding: 3.6rem 1.2rem; }
  .section-title { margin-bottom: 1rem; }

  .schedule-item { grid-template-columns: 62px 1fr; gap: 1rem; padding: 1.1rem 1.2rem; }
  .schedule-date .day { font-size: 1.4rem; }

  .scratch-row { gap: 0.9rem; }
  .scratch-card { width: 96px; height: 112px; }
  .scratch-reveal span { font-size: 1.5rem; }

  .bios { gap: 2rem; flex-direction: column; align-items: center; }

  .card-deck { width: 170px; height: 230px; margin-bottom: 2.4rem; }

  #music-toggle { width: 46px; height: 46px; left: calc(1rem + 42px + 0.6rem); bottom: 1rem; }
  #back-to-top { width: 42px; height: 42px; left: 1rem; bottom: 1rem; }

  .invite-monogram { width: 42px; height: 42px; margin-bottom: 1rem; }
  .hero-ganpati { width: 64px; margin: 0 auto 0.8rem; }
  .ganpati-mantra { font-size: 0.8rem; margin-bottom: 1.2rem; }
  .invite-corner { width: 36px; height: 36px; }
  .open-invite-btn { padding: 0.85rem 1.8rem; font-size: 0.88rem; }
}

/* ----- Small mobile ----- */
@media (max-width: 380px) {
  .nav-links a { margin-left: 0.6rem; font-size: 0.7rem; }
  .hero { padding: 4rem 1rem 1.1rem; }
  .hero-ganpati { width: 54px; margin: 0 auto 0.5rem; }
  .ganpati-mantra { font-size: 0.72rem; line-height: 1.35; margin-bottom: 0.7rem; }
  .eyebrow { margin-bottom: 0.5rem; }
  .hero .divider { margin-bottom: 0.6rem; }
  .countdown { gap: 0.35rem; margin-top: 0.9rem; }
  .count-box { width: 52px; height: 52px; }
  .count-box span { font-size: 1.1rem; }
  .count-box small { font-size: 0.5rem; }
  .scroll-cue { margin-top: 0.9rem; }
  .corner { display: none; }
  .scratch-row { gap: 0.5rem; }
  .scratch-card { width: 82px; height: 98px; }
  .scratch-reveal span { font-size: 1.25rem; }
  .schedule-item { grid-template-columns: 1fr; text-align: center; }
  .schedule-date { border-right: none; border-bottom: 1px solid rgba(201,162,39,0.3); padding-bottom: 0.6rem; margin-bottom: 0.6rem; }
}

/* ----- Big screens ----- */
@media (min-width: 1441px) {
  .nav-inner, .section, .section.alt > * { max-width: 1320px; }
  .hero-names { font-size: clamp(4.2rem, 6vw, 6.8rem); }
  .section-title { font-size: clamp(2.2rem, 2.6vw, 3.1rem); }
}
