:root {
  --ivory: #FBF7EC;
  --ivory-deep: #F3ECDC;
  --green: #1E4B3B;
  --green-soft: #3B6656;
  --green-dark: #123025;
  --gold: #B8923F;
  --gold-light: #D8BB74;
  --gold-pale: #F0E2C3;
  --ink: #2C332E;
  --white: #FFFDF7;
  --shadow-soft: 0 10px 35px rgba(30, 75, 59, 0.05);
  --shadow-medium: 0 15px 45px rgba(30, 75, 59, 0.1);
  --shadow-gold: 0 10px 25px rgba(184, 146, 63, 0.12);
}

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

/* Fix horizontal overflow at root level */
html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Jost', sans-serif;
  background-color: var(--ivory);
  color: var(--ink);
  line-height: 1.6;
}

/* ---------- Decorative Floating Motifs ---------- */
/* These are position:absolute so they need a positioned ancestor to not cause overflow */
.floating-motif {
  position: fixed; /* fixed keeps them decorative without affecting layout flow */
  pointer-events: none;
  opacity: 0.1;
  z-index: 0;
  background-repeat: no-repeat;
  background-size: contain;
  overflow: hidden;
}

.motif-1 {
  top: 5vh;
  left: -80px;
  width: 200px;
  height: 200px;
  background-image: radial-gradient(circle, transparent 65%, var(--gold-light) 66%, transparent 70%);
}

.motif-2 {
  top: 95vh;
  right: -100px;
  width: 240px;
  height: 240px;
  background-image: radial-gradient(circle, transparent 65%, var(--green-soft) 66%, transparent 70%);
}

.motif-3 {
  top: 175vh;
  left: -90px;
  width: 220px;
  height: 220px;
  background-image: radial-gradient(circle, transparent 65%, var(--gold) 66%, transparent 70%);
}

/* ---------- Floating Flower Petals ---------- */
.floating-flowers {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}

.flower-petal {
  position: absolute;
  top: -8%;
  opacity: 0;
  will-change: transform, opacity;
  animation-name: petal-fall;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.flower-petal svg {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes petal-fall {
  0% {
    transform: translate3d(0, -10vh, 0) rotate(0deg);
    opacity: 0;
  }
  8% {
    opacity: 0.8;
  }
  25% {
    transform: translate3d(18px, 25vh, 0) rotate(90deg);
  }
  50% {
    transform: translate3d(-16px, 50vh, 0) rotate(180deg);
  }
  75% {
    transform: translate3d(16px, 75vh, 0) rotate(270deg);
  }
  92% {
    opacity: 0.6;
  }
  100% {
    transform: translate3d(-12px, 112vh, 0) rotate(360deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-flowers {
    display: none;
  }
  .floating-motif {
    display: none;
  }
}

/* ---------- Hero Section ---------- */
.hero-section {
  position: relative;
  min-height: 100svh; /* svh = small viewport height, avoids mobile browser chrome issues */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  background: url('background.jpg.jpeg') no-repeat center center;
  background-size: cover;
  overflow: hidden;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(251, 247, 236, 0.45);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  width: 100%;
  animation: fadeIn 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bismillah {
  font-family: 'Amiri', serif;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  color: var(--green);
  margin-bottom: 24px;
  letter-spacing: 0.05em;
  opacity: 0.95;
}

.hero-eyebrow {
  font-size: clamp(0.75rem, 1.6vw, 0.95rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-soft);
  margin-bottom: 40px;
  font-weight: 500;
  padding: 0 10px;
}

/* Monogram */
.monogram-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.monogram {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-color: var(--white);
  box-shadow: var(--shadow-gold);
}

.monogram::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px dashed rgba(184, 146, 63, 0.45);
  border-radius: 50%;
}

.monogram-letters {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: -0.05em;
  margin-top: 1px;
}

/* Names */
.names {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(2.1rem, 6.5vw, 3.8rem);
  line-height: 1.2;
  color: var(--green);
  margin-bottom: 60px;
}

.names .name {
  display: block;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.names .ampersand {
  display: block;
  font-style: italic;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: var(--gold);
  margin: 12px 0;
}

/* Scroll indicator */
.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
  gap: 8px;
  opacity: 0.75;
}

.scroll-text {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--green-soft);
  font-weight: 500;
}

.scroll-arrow {
  width: 24px;
  height: 24px;
  fill: var(--gold);
  animation: bounce 2s infinite;
}

.scroll-arrow svg {
  width: 100%;
  height: 100%;
}

/* ---------- Couple & Details Section ---------- */
.couple-section {
  padding: 80px 20px;
  background-color: var(--white);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.section-header {
  text-align: center;
  margin-bottom: 55px;
}

.section-subtitle {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.1rem, 4.5vw, 2.9rem);
  color: var(--green);
  font-weight: 600;
}

.star-divider {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.star-divider svg {
  width: 22px;
  height: 22px;
  fill: var(--gold);
}

/* Couple Cards */
.couple-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 70px;
}

@media (max-width: 640px) {
  .couple-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.couple-card {
  position: relative;
  background: var(--ivory);
  border-radius: 120px 120px 18px 18px;
  padding: 55px 30px 45px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(184, 146, 63, 0.22);
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.couple-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-medium);
}

.card-border {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(184, 146, 63, 0.35);
  border-radius: 106px 106px 8px 8px;
  pointer-events: none;
}

.role-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  display: block;
  margin-bottom: 14px;
  font-weight: 600;
}

.couple-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  color: var(--green);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 14px;
}

.couple-lineage {
  font-size: 0.84rem;
  color: var(--green-soft);
  line-height: 1.55;
  padding: 0 8px;
}

/* Event Details Container */
.details-container {
  max-width: 720px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid rgba(184, 146, 63, 0.3);
  border-radius: 160px 160px 18px 18px;
  padding: 55px 30px 45px;
  text-align: center;
  box-shadow: 0 18px 50px -15px rgba(30, 75, 59, 0.12);
  position: relative;
  overflow: hidden;
}

.details-container::before {
  content: '';
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(184, 146, 63, 0.45);
  border-radius: 146px 146px 8px 8px;
  pointer-events: none;
}

.details-arch-header h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  color: var(--green);
  margin-bottom: 35px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Details Grid */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
  padding: 0 10px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.venue-item {
  grid-column: span 2;
  margin-top: 10px;
}

@media (max-width: 500px) {
  .details-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .venue-item {
    grid-column: span 1;
  }
}

.detail-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--ivory);
  border-radius: 50%;
  margin-bottom: 10px;
  border: 1px solid rgba(184, 146, 63, 0.15);
}

.detail-icon svg {
  width: 22px;
  height: 22px;
  fill: var(--gold);
}

.detail-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
  font-weight: 600;
}

.detail-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  color: var(--ink);
  line-height: 1.45;
  font-weight: 500;
}

/* Map Link Button */
.map-action {
  margin-top: 15px;
}

.map-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--green);
  color: var(--white);
  padding: 13px 28px;
  border-radius: 30px;
  text-decoration: none;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 6px 18px rgba(30, 75, 59, 0.18);
  border: 1px solid transparent;
  white-space: nowrap;
}

.map-link-btn:hover {
  background-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(184, 146, 63, 0.28);
}

.map-link-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

/* ---------- Countdown Section ---------- */
.countdown-section {
  position: relative;
  padding: 90px 20px;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
  color: var(--white);
  text-align: center;
  overflow: hidden;
  z-index: 2;
}

.countdown-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image:
    radial-gradient(var(--gold) 1.5px, transparent 1.5px),
    radial-gradient(var(--gold) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}

.countdown-header {
  position: relative;
  z-index: 2;
  margin-bottom: 55px;
}

.countdown-header .section-title {
  color: var(--gold-light);
}

.countdown-header .section-subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-pale);
  opacity: 0.85;
  margin-top: 6px;
  font-weight: 500;
}

/* Countdown Clock */
.countdown {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
}

.count-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.count-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 1.5px solid rgba(216, 187, 116, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 15px rgba(216, 187, 116, 0.08);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.count-circle:hover {
  transform: scale(1.06);
  border-color: var(--gold-light);
  background-color: rgba(255, 255, 255, 0.08);
}

.count-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  font-weight: 600;
  color: var(--gold-light);
}

.count-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold-pale);
  font-weight: 500;
}

/* ---------- Footer Section ---------- */
.footer-section {
  position: relative;
  padding: 80px 20px 60px;
  background-color: var(--ivory);
  text-align: center;
  border-top: 1px solid rgba(184, 146, 63, 0.18);
  z-index: 2;
}

.compliments {
  margin: 35px auto 45px;
  max-width: 450px;
}

.compliments-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 10px;
  font-weight: 600;
}

.compliments-names {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem;
  color: var(--green);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.compliments-place {
  font-size: 0.88rem;
  color: var(--green-soft);
  margin-top: 4px;
  letter-spacing: 0.08em;
}

.footer-closing {
  margin-top: 45px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--green-soft);
  border-top: 1px solid rgba(30, 75, 59, 0.1);
  padding-top: 25px;
  display: inline-block;
  font-weight: 500;
}

/* ---------- Keyframes ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation-delay: 0s !important;
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}

/* ---------- Body Scroll Lock ---------- */
body.no-scroll {
  overflow: hidden;
  height: 100vh;
}

/* ---------- Cover Overlay ---------- */
.cover-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: var(--ivory);
  background-image:
    radial-gradient(circle at 50% 50%, rgba(184, 146, 63, 0.15), transparent 70%),
    radial-gradient(circle at 10% 10%, rgba(30, 75, 59, 0.1), transparent 45%);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Allow scroll if content taller than screen */
  overflow-y: auto;
  padding: 24px 20px;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.8s;
}

.cover-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Card */
.cover-card {
  width: 100%;
  max-width: 420px;
  background-color: rgba(255, 253, 247, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(184, 146, 63, 0.35);
  border-radius: 18px;
  padding: 48px 30px;
  text-align: center;
  box-shadow: 0 18px 50px -15px rgba(30, 75, 59, 0.15);
  position: relative;
  animation: fadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  /* Prevent card from being cut off on very small screens */
  my-flex-shrink: 0;
}

.cover-card::before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(184, 146, 63, 0.45);
  border-radius: 10px;
  pointer-events: none;
}

.cover-star {
  color: var(--gold);
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.cover-names {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: clamp(1.7rem, 5vw, 2.2rem);
  line-height: 1.3;
  color: var(--green);
  margin: 24px 0;
}

.cover-names .cover-name {
  display: block;
}

.cover-names .cover-ampersand {
  display: block;
  font-style: italic;
  font-weight: 500;
  font-size: 1.4rem;
  color: var(--gold);
  margin: 8px 0;
}

.cover-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--green-soft);
  margin-bottom: 36px;
  font-weight: 500;
}

/* Open Button */
.open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--green);
  color: var(--white);
  border: none;
  padding: 14px 32px;
  border-radius: 30px;
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(30, 75, 59, 0.18);
  transition: all 0.3s ease;
}

.open-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(184, 146, 63, 0.28);
  background-color: var(--gold);
  color: var(--white);
}

.envelope-icon {
  width: 18px;
  height: 18px;
  fill: var(--white);
  transition: fill 0.3s ease;
}

/* ---------- Music Toggle Floating Button ---------- */
.music-toggle-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--green);
  border: 1px solid var(--gold);
  fill: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.music-toggle-btn:hover {
  background-color: var(--gold);
  fill: var(--white);
  transform: scale(1.08);
}

.music-toggle-btn svg {
  width: 22px;
  height: 22px;
}

.music-toggle-btn.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

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

/* Tablet and below (768px) */
@media (max-width: 768px) {
  .hero-section {
    padding: 60px 16px;
    min-height: 100svh;
  }

  .names {
    margin-bottom: 40px;
  }

  .couple-section {
    padding: 60px 16px;
  }

  .countdown-section {
    padding: 70px 16px;
  }

  .footer-section {
    padding: 60px 16px 50px;
  }
}

/* Mobile (480px) */
@media (max-width: 480px) {
  .cover-overlay {
    padding: 16px 14px;
    align-items: flex-start;
  }

  .cover-card {
    padding: 36px 20px 30px;
    margin: auto; /* center vertically when overlay scrolls */
  }

  .hero-section {
    padding: 50px 14px;
  }

  .hero-eyebrow {
    margin-bottom: 28px;
  }

  .names {
    margin-bottom: 32px;
  }

  .monogram-wrapper {
    margin-bottom: 28px;
  }

  .couple-section {
    padding: 50px 14px;
  }

  .section-header {
    margin-bottom: 40px;
  }

  .couple-card {
    padding: 48px 20px 36px;
  }

  .couple-grid {
    margin-bottom: 50px;
  }

  .details-container {
    padding: 48px 16px 36px;
    border-radius: 100px 100px 14px 14px;
  }

  .details-container::before {
    border-radius: 88px 88px 6px 6px;
  }

  .countdown-section {
    padding: 60px 14px;
  }

  .countdown {
    gap: 16px;
  }

  .count-circle {
    width: 72px;
    height: 72px;
  }

  .count-num {
    font-size: 1.6rem;
  }

  .footer-section {
    padding: 50px 14px 40px;
  }

  .map-link-btn {
    padding: 12px 20px;
    font-size: 0.8rem;
    white-space: normal;
    text-align: center;
  }
}

/* Extra small (360px and below) */
@media (max-width: 360px) {
  .cover-card {
    padding: 28px 14px 24px;
  }

  .bismillah {
    font-size: 1.4rem;
  }

  .cover-names {
    font-size: 1.5rem;
    margin: 16px 0;
  }

  .count-circle {
    width: 62px;
    height: 62px;
  }

  .count-num {
    font-size: 1.4rem;
  }

  .couple-card {
    padding: 40px 14px 28px;
  }

  .details-container {
    padding: 40px 12px 28px;
  }
}