/* ============================================================================
   SAVE THE DATE — Premium Wedding Website Stylesheet
   ============================================================================
   A stunning, Apple-inspired smooth-scrolling experience.
   Design System: Romantic & Warm palette with modern glassmorphism,
   scroll-driven animations, and luxurious typography.
   ============================================================================ */


/* ----------------------------------------------------------------------------
   §1. DESIGN TOKENS (Custom Properties)
   ---------------------------------------------------------------------------- */

:root {
  /* Color Palette — Blush, Sage & Cream */
  --color-cream: hsl(10, 40%, 96%);
  --color-blush: hsl(10, 40%, 90%);
  --color-rose: hsl(10, 35%, 60%);
  --color-rose-light: hsl(10, 35%, 85%);
  --color-sage: hsl(145, 25%, 55%);
  --color-sage-light: hsl(145, 20%, 85%);
  --color-text: hsl(20, 15%, 20%);
  --color-text-light: hsl(20, 10%, 45%);
  --color-bg: hsl(30, 30%, 97%);
  --color-white: #ffffff;
  --color-overlay: rgba(20, 15, 10, 0.55);

  /* Typography Scale — fluid, responsive */
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --font-script: 'Playfair Display', Georgia, serif;

  /* Fluid type sizes using clamp() for smooth scaling */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.925rem + 0.4vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.75rem);
  --text-2xl: clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);
  --text-3xl: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
  --text-4xl: clamp(2.5rem, 1.75rem + 3.75vw, 5rem);
  --text-hero: clamp(3rem, 2rem + 5vw, 7rem);

  /* Spacing scale */
  --space-xs: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
  --space-sm: clamp(0.75rem, 0.6rem + 0.75vw, 1.25rem);
  --space-md: clamp(1rem, 0.75rem + 1.25vw, 2rem);
  --space-lg: clamp(1.5rem, 1rem + 2.5vw, 3rem);
  --space-xl: clamp(2rem, 1.25rem + 3.75vw, 5rem);
  --space-2xl: clamp(3rem, 2rem + 5vw, 7rem);
  --space-3xl: clamp(4rem, 2.5rem + 7.5vw, 10rem);

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: 0.2s var(--ease-out-expo);
  --transition-base: 0.4s var(--ease-out-expo);
  --transition-slow: 0.6s var(--ease-out-expo);
  --transition-luxe: 0.8s var(--ease-out-quart);

  /* Shadows — layered for realistic depth */
  --shadow-sm:
    0 1px 2px rgba(20, 15, 10, 0.04),
    0 2px 4px rgba(20, 15, 10, 0.03);
  --shadow-md:
    0 2px 4px rgba(20, 15, 10, 0.04),
    0 4px 12px rgba(20, 15, 10, 0.06),
    0 8px 24px rgba(20, 15, 10, 0.04);
  --shadow-lg:
    0 4px 8px rgba(20, 15, 10, 0.03),
    0 8px 24px rgba(20, 15, 10, 0.06),
    0 16px 48px rgba(20, 15, 10, 0.06);
  --shadow-xl:
    0 8px 16px rgba(20, 15, 10, 0.04),
    0 16px 48px rgba(20, 15, 10, 0.08),
    0 32px 96px rgba(20, 15, 10, 0.08);
  --shadow-sage:
    0 4px 16px hsla(145, 25%, 55%, 0.25),
    0 8px 32px hsla(145, 25%, 55%, 0.18);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-blur: 20px;

  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Layout */
  --container-max: 1200px;
  --container-padding: clamp(1.25rem, 1rem + 2vw, 3rem);

  /* Gradient color interpolation variable for fallback */
  --in-oklch: ;
}

/* Enable oklch gradient interpolation where supported */
@supports (background: linear-gradient(in oklch, white, black)) {
  :root {
    --in-oklch: in oklch;
  }
}


/* ----------------------------------------------------------------------------
   §2. GLOBAL RESET & BASE STYLES
   ---------------------------------------------------------------------------- */

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

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: transparent;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Selection styling */
::selection {
  background-color: var(--color-rose-light);
  color: var(--color-text);
}

::-moz-selection {
  background-color: var(--color-rose-light);
  color: var(--color-text);
}

/* Sensible media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Remove default list styles */
ul,
ol {
  list-style: none;
}

/* Typography baseline */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
  max-width: 65ch;
}

a {
  color: var(--color-sage);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-rose);
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Focus-visible for accessibility */
:focus-visible {
  outline: 2px solid var(--color-sage);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Utility container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}


/* ----------------------------------------------------------------------------
   §3. SHARED SECTION STYLING
   ---------------------------------------------------------------------------- */

.section {
  padding-block: var(--space-3xl);
  position: relative;
}

.section-title {
  font-family: var(--font-script);
  font-size: var(--text-3xl);
  font-weight: 400;
  color: var(--color-text);
  text-align: center;
  margin-bottom: var(--space-xl);
}

.section-subtitle {
  font-family: var(--font-heading);
  font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.85rem);
  font-style: italic;
  font-weight: 400;
  color: var(--color-sage);
  text-transform: none;
  letter-spacing: 0.02em;
  text-align: center;
  margin-bottom: var(--space-lg);
}

.countdown .section-subtitle {
  font-size: clamp(1.65rem, 1.35rem + 1.2vw, 2.5rem);
  font-weight: 500;
  color: hsl(10, 52%, 38%);
}

/* Decorative separator — thin sage line with floral/heart SVG */
.separator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-block: var(--space-xl);
}

.separator::before,
.separator::after {
  content: "";
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(
    to right var(--in-oklch),
    transparent,
    var(--color-sage),
    transparent
  );
}

.separator-icon {
  color: var(--color-rose);
  font-size: var(--text-lg);
  line-height: 1;
  opacity: 0.8;
}


/* ----------------------------------------------------------------------------
   §3. FIXED AMBIENT BACKGROUND SYSTEM
   ---------------------------------------------------------------------------- */

.fixed-bg-container {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background-color: var(--color-bg);
  pointer-events: none;
}

.fixed-bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1.6s cubic-bezier(0.25, 1, 0.5, 1), transform 1.6s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: opacity, transform;
}

.fixed-bg-slide.active {
  opacity: 1;
  transform: scale(1.02);
}

.fixed-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: opacity;
  pointer-events: none;
}

.fixed-bg-overlay.dark {
  background: var(--color-overlay);
  opacity: 1;
}



.fixed-bg-overlay.light {
  background: linear-gradient(
    135deg,
    rgba(254, 237, 233, 0.75) 0%,
    rgba(253, 251, 247, 0.75) 50%,
    rgba(235, 245, 239, 0.75) 100%
  );
  opacity: 0;
}


/* ----------------------------------------------------------------------------
   §4. HERO SECTION
   ---------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* left align elements */
  justify-content: flex-end; /* bottom align elements */
  text-align: left; /* left align text content */
  overflow: hidden;
  background-color: transparent;
  padding-left: clamp(2rem, 5vw + 1rem, 6rem);
  padding-right: clamp(2rem, 5vw + 1rem, 6rem);
  padding-bottom: clamp(5rem, 8vh + 2rem, 10rem);
  padding-top: var(--space-3xl);
}

/* Hero content container */
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 750px;
  width: 100%;
  animation: hero-fade-in 1.6s var(--ease-out-expo) both;
}

/* Couple names — large, serif, breathtaking */
.hero-names {
  font-family: var(--font-script);
  font-size: var(--text-hero);
  font-weight: 400;
  color: var(--color-white);
  line-height: 1.1;
  margin-bottom: var(--space-sm);
  text-shadow:
    0 2px 20px rgba(0, 0, 0, 0.25),
    0 4px 40px rgba(0, 0, 0, 0.15);
  white-space: nowrap; /* Keep names on the same line */
}

@media (max-width: 600px) {
  .hero-names {
    font-size: clamp(2rem, 8.5vw, 3rem); /* Scale down on mobile to prevent overflow */
  }
}

/* Ampersand styling */
.hero-ampersand {
  display: inline-block;
  font-family: var(--font-script);
  font-size: 0.75em;
  color: var(--color-rose-light);
  margin-inline: 0.1em;
  opacity: 0.95;
}

/* "We are getting married" pre-title */
.hero-subtitle {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 1rem + 2.25vw, 3.1rem); /* Reduced by half */
  font-weight: 500;
  color: var(--color-cream);
  letter-spacing: 0.12em; /* Restored slight spacing for mid-size uppercase */
  line-height: 1.05;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
  opacity: 0.95;
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
  white-space: nowrap; /* Keep it on a single line */
}

@media (max-width: 600px) {
  .hero-subtitle {
    font-size: clamp(1.1rem, 4.5vw, 1.5rem); /* Proportional mobile scale down */
  }
}

/* Wedding date in hero */
.hero-date {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-rose-light);
  letter-spacing: 0.15em;
  margin-top: var(--space-md);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* Scroll indicator — animated bouncing chevron */
.scroll-indicator {
  position: absolute;
  bottom: var(--space-lg);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-white);
  opacity: 0.7;
  transition: opacity var(--transition-base);
  animation: bounce 2s ease-in-out infinite;
}

.scroll-indicator:hover {
  opacity: 1;
}

.scroll-indicator-text {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.scroll-indicator-chevron {
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--color-white);
  border-bottom: 2px solid var(--color-white);
  transform: rotate(45deg);
  opacity: 0.8;
}

/* Hero fade-in on load */
@keyframes hero-fade-in {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ----------------------------------------------------------------------------
   §5. COUNTDOWN SECTION
   ---------------------------------------------------------------------------- */

.countdown {
  padding-block: var(--space-3xl);
  background-color: #FAF7F5 !important;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 10;
  border-top: 1px solid rgba(145, 60, 75, 0.12);
}

.countdown .section-title {
  font-family: var(--font-script);
  font-size: var(--text-3xl);
  color: var(--color-text);
  margin-bottom: var(--space-xl);
}

/* Celebration Events Grid (3 Cards) */
.events-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: 900px;
  margin-inline: auto;
  margin-bottom: var(--space-xl);
  padding-inline: var(--space-xs);
}

@media (min-width: 650px) {
  .events-grid {
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
  }
}

.event-card {
  flex: 1 1 220px;
  background: #ffffff;
  border: 1.5px solid rgba(145, 60, 75, 0.18);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-sm);
  box-shadow: 0 8px 24px rgba(20, 15, 10, 0.08);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

.event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(20, 15, 10, 0.14);
  border-color: var(--color-rose-light);
}

.event-card-featured {
  background: #ffffff;
  border-color: var(--color-rose);
  box-shadow: 0 10px 32px rgba(196, 139, 159, 0.22);
}

.event-tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-sage);
  background: rgba(122, 139, 123, 0.12);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: var(--space-xs);
}

.event-tag-featured {
  color: var(--color-rose);
  background: rgba(196, 139, 159, 0.15);
}

.event-title {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.55rem);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.event-date {
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 0.95rem + 0.35vw, 1.25rem);
  font-weight: 500;
  color: var(--color-rose);
  margin-bottom: 0.2rem;
}

.event-day {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Solid Opaque Countdown Card Wrapper */
.countdown-wrapper {
  background: #ffffff;
  border: 1.5px solid rgba(145, 60, 75, 0.25);
  border-radius: var(--radius-xl);
  padding: var(--space-md) var(--space-md);
  max-width: 620px;
  margin-inline: auto;
  margin-top: var(--space-md);
  box-shadow: 0 12px 35px rgba(20, 15, 10, 0.14);
  opacity: 1;
}

.countdown-label-heading {
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 0.75rem + 0.3vw, 1rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: hsl(10, 52%, 38%);
  margin-bottom: var(--space-sm);
  opacity: 1;
}

/* Countdown grid: compact layout */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.4rem, 0.3rem + 0.5vw, 1rem);
  max-width: 540px;
  margin-inline: auto;
}

/* Each countdown box — 100% solid white inner card */
.countdown-box {
  background: #ffffff;
  border: 1.5px solid rgba(145, 60, 75, 0.22);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.5rem;
  box-shadow: 0 4px 14px rgba(20, 15, 10, 0.08);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
  opacity: 1;
}

.countdown-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(20, 15, 10, 0.18);
  border-color: rgba(145, 60, 75, 0.4);
}

/* Countdown number */
.countdown-number {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.8rem);
  font-weight: 800;
  color: hsl(10, 52%, 38%);
  line-height: 1;
  margin-bottom: 0.2rem;
  letter-spacing: -0.02em;
}

/* Countdown label */
.countdown-label {
  display: block;
  font-family: var(--font-body);
  font-size: clamp(0.7rem, 0.65rem + 0.25vw, 0.85rem);
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}


/* ----------------------------------------------------------------------------
   §6. OUR STORY SECTION
   ---------------------------------------------------------------------------- */

.story {
  padding-block: var(--space-3xl);
  background-color: transparent;
}

/* Story chapter: image + text side by side */
.story-chapter {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
  margin-bottom: var(--space-2xl);
}

/* Alternate layout: reverse every even chapter */
.story-chapter:nth-child(even) {
  flex-direction: row-reverse;
}

/* Story image container */
.story-image-wrapper {
  flex: 0 0 auto;
  width: min(100%, 500px);
}

.story-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  object-fit: cover;
  object-position: top;
  aspect-ratio: 4 / 5;
  background-color: var(--color-white);
  transition: box-shadow var(--transition-slow), transform 1s var(--ease-out-expo), opacity 1s var(--ease-out-expo);
}

/* Scroll-driven animations for story images */
@media (min-width: 600px) and (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .story-chapter:nth-child(odd) .story-image-wrapper {
      animation: story-image-entry-left auto linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 50%;
    }

    .story-chapter:nth-child(even) .story-image-wrapper {
      animation: story-image-entry-right auto linear both;
      animation-timeline: view();
      animation-range: entry 10% cover 50%;
    }
  }
}

@keyframes story-image-entry-left {
  from {
    opacity: 0;
    transform: translate3d(-100px, 20px, 0) rotate(-6deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
}

@keyframes story-image-entry-right {
  from {
    opacity: 0;
    transform: translate3d(100px, 20px, 0) rotate(6deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
}

.story-image:hover {
  box-shadow: var(--shadow-xl);
}

/* Story text content */
.story-text {
  flex: 1;
  min-width: 0;
}

/* Chapter number/label in elegant italic serif */
.story-label {
  font-family: var(--font-script);
  font-style: italic;
  font-size: var(--text-lg);
  color: var(--color-sage);
  margin-bottom: var(--space-xs);
  display: block;
}

.story-heading {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.story-paragraph {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-light);
  line-height: 1.8;
  max-width: 50ch;
}

.story-date {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-rose);
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-top: var(--space-sm);
  display: inline-block;
}


/* ----------------------------------------------------------------------------
   §7. PHOTO GALLERY SECTION (Polaroid Stacking)
   ---------------------------------------------------------------------------- */

.gallery-section {
  position: relative;
  background-color: transparent;
  color: var(--color-text);
}

/* Stacking Scroll Track — defines the scrolling distance (650vh for 15 photos) */
.gallery-stack-track {
  height: 650vh;
  position: relative;
}

/* Sticky viewport that stays locked in center during scroll progress */
.gallery-stack-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gallery-stack-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: var(--space-md);
  position: relative;
}

/* Polaroid Card Deck styling */
.polaroid-deck {
  position: relative;
  width: min(85vw, 320px);
  height: min(115vw, 400px);
  perspective: 1000px;
  margin-top: var(--space-md);
}

/* Base polaroid card element */
.polaroid-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  opacity: 0;
  transition: none;
  pointer-events: none;
}

/* Card 0 (base card) starts visible and slightly rotated */
.polaroid-card[data-index="0"] {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1) rotate(-4deg);
}

/* Frame design mimicking real paper polaroid card */
.polaroid-frame {
  width: 100%;
  height: 100%;
  background-color: var(--color-white);
  padding: 16px 16px 64px 16px; /* wider bottom border */
  border-radius: 2px;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.08),
    0 16px 40px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Polaroid square photo container */
.polaroid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  background-color: var(--color-cream);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Elegant italic title font on Polaroid */
.polaroid-caption {
  position: absolute;
  bottom: 14px;
  left: 16px;
  right: 16px;
  text-align: center;
  font-family: var(--font-script);
  font-style: italic;
  font-size: clamp(1.2rem, 1rem + 0.75vw, 1.6rem);
  color: #2b2520;
  line-height: 1.1;
  letter-spacing: normal;
  text-transform: none;
  font-weight: 500;
}

/* Keyframes for Stacking Cards (Scroll progression mapping) */
@keyframes stack-card-0 {
  0% { transform: translate3d(0, 0, 0) rotate(-4deg); opacity: 1; }
  100% { transform: translate3d(-5px, 2px, -15px) rotate(-6deg); opacity: 0.95; }
}

@keyframes stack-card-1 {
  0%, 4% { transform: translate3d(120vw, 50vh, 100px) rotate(25deg); opacity: 0; }
  10%, 100% { transform: translate3d(0, 0, 0) rotate(3deg); opacity: 1; z-index: 2; }
}

@keyframes stack-card-2 {
  0%, 10% { transform: translate3d(-120vw, -30vh, 100px) rotate(-35deg); opacity: 0; }
  16%, 100% { transform: translate3d(0, 0, 0) rotate(-5deg); opacity: 1; z-index: 3; }
}

@keyframes stack-card-3 {
  0%, 16% { transform: translate3d(100vw, -80vh, 100px) rotate(30deg); opacity: 0; }
  22%, 100% { transform: translate3d(0, 0, 0) rotate(4deg); opacity: 1; z-index: 4; }
}

@keyframes stack-card-4 {
  0%, 22% { transform: translate3d(-100vw, 80vh, 100px) rotate(-28deg); opacity: 0; }
  28%, 100% { transform: translate3d(0, 0, 0) rotate(-2deg); opacity: 1; z-index: 5; }
}

@keyframes stack-card-5 {
  0%, 28% { transform: translate3d(-80vw, -100vh, 100px) rotate(-38deg); opacity: 0; }
  34%, 100% { transform: translate3d(0, 0, 0) rotate(6deg); opacity: 1; z-index: 6; }
}

@keyframes stack-card-6 {
  0%, 34% { transform: translate3d(110vw, 70vh, 100px) rotate(22deg); opacity: 0; }
  40%, 100% { transform: translate3d(0, 0, 0) rotate(-4deg); opacity: 1; z-index: 7; }
}

@keyframes stack-card-7 {
  0%, 40% { transform: translate3d(0, -120vh, 100px) rotate(-20deg); opacity: 0; }
  46%, 100% { transform: translate3d(0, 0, 0) rotate(2deg); opacity: 1; z-index: 8; }
}

@keyframes stack-card-8 {
  0%, 46% { transform: translate3d(120vw, -40vh, 100px) rotate(32deg); opacity: 0; }
  52%, 100% { transform: translate3d(0, 0, 0) rotate(-6deg); opacity: 1; z-index: 9; }
}

@keyframes stack-card-9 {
  0%, 52% { transform: translate3d(0, 120vh, 100px) rotate(-25deg); opacity: 0; }
  58%, 100% { transform: translate3d(0, 0, 0) rotate(5deg); opacity: 1; z-index: 10; }
}

@keyframes stack-card-10 {
  0%, 58% { transform: translate3d(-120vw, 50vh, 100px) rotate(28deg); opacity: 0; }
  64%, 100% { transform: translate3d(0, 0, 0) rotate(-3deg); opacity: 1; z-index: 11; }
}

@keyframes stack-card-11 {
  0%, 64% { transform: translate3d(110vw, -70vh, 100px) rotate(-30deg); opacity: 0; }
  70%, 100% { transform: translate3d(0, 0, 0) rotate(4deg); opacity: 1; z-index: 12; }
}

@keyframes stack-card-12 {
  0%, 70% { transform: translate3d(-110vw, 80vh, 100px) rotate(25deg); opacity: 0; }
  76%, 100% { transform: translate3d(0, 0, 0) rotate(-5deg); opacity: 1; z-index: 13; }
}

@keyframes stack-card-13 {
  0%, 76% { transform: translate3d(-90vw, -110vh, 100px) rotate(-36deg); opacity: 0; }
  82%, 100% { transform: translate3d(0, 0, 0) rotate(3deg); opacity: 1; z-index: 14; }
}

@keyframes stack-card-14 {
  0%, 82% { transform: translate3d(100vw, 90vh, 100px) rotate(24deg); opacity: 0; }
  90%, 100% { transform: translate3d(0, 0, 0) rotate(-2deg); opacity: 1; z-index: 15; }
}


/* ----------------------------------------------------------------------------
   §8. WEDDING DETAILS SECTION
   ---------------------------------------------------------------------------- */

.details {
  padding-block: var(--space-3xl);
  background-color: transparent;
  text-align: center;
}

/* Detail cards row */
.details-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-lg);
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* Individual detail card — glassmorphism with sage accent */
.detail-card {
  flex: 1 1 280px;
  max-width: 360px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-top: 3px solid var(--color-sage);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-lg);
  box-shadow: var(--shadow-md);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

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

/* Card icon */
.detail-icon {
  font-size: var(--text-3xl);
  color: var(--color-sage);
  margin-bottom: var(--space-md);
  line-height: 1;
}

.detail-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.detail-card-text {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-light);
  line-height: 1.7;
  margin-inline: auto;
}

.detail-card-accent {
  font-family: var(--font-script);
  font-size: var(--text-lg);
  color: var(--color-sage);
  margin-top: var(--space-sm);
  display: block;
}

.details-action {
  margin-top: var(--space-xl);
  text-align: center;
  position: relative;
  z-index: 10;
}


/* ----------------------------------------------------------------------------
   §9. SAVE THE DATE CTA SECTION
   ---------------------------------------------------------------------------- */

/* Add to Calendar button — pill, sage, luxurious */
.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-white);
  background-color: var(--color-sage);
  padding: 1em 2.5em;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-sage);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-fast);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.cta-button:hover {
  transform: translateY(-3px);
  box-shadow:
    0 6px 24px hsla(145, 25%, 55%, 0.3),
    0 12px 48px hsla(145, 25%, 55%, 0.2);
  background-color: hsl(145, 25%, 45%);
}

.cta-button:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* CTA venue/location teaser */
.cta-venue {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-light);
  margin-top: var(--space-lg);
  letter-spacing: 0.05em;
}


/* ----------------------------------------------------------------------------
   §10. ENDING SIGNATURE
   ---------------------------------------------------------------------------- */

.ending-signature {
  padding-block: var(--space-2xl) var(--space-3xl);
  position: relative;
  z-index: 10;
  background-color: #FAF7F5 !important;
  text-align: center;
}

.ending-initials-wrapper,
.ending-date-wrapper {
  display: block;
  text-align: center;
  width: 100%;
}

.ending-initials {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 1.5rem + 2.5vw, 4rem);
  font-weight: 400;
  letter-spacing: 0.15em;
  padding-left: 0.15em; /* Offset trailing letter-spacing to center text perfectly */
  color: var(--color-rose);
  margin-bottom: var(--space-xs);
  display: inline-block;
  line-height: 1.1;
  text-transform: uppercase;
}

.ending-ampersand {
  font-family: var(--font-script);
  font-style: italic;
  color: var(--color-sage);
  margin-inline: 0.3em;
  font-size: 0.85em;
}

.ending-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-top: 0;
  margin-bottom: var(--space-lg);
  color: var(--color-sage);
  opacity: 0.7;
}

.ending-divider::before,
.ending-divider::after {
  content: "";
  width: 60px;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    var(--color-sage),
    transparent
  );
}

.ending-date {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-light);
  letter-spacing: 0.2em;
  padding-left: 0.2em; /* Offset trailing letter-spacing to center text perfectly */
  text-transform: uppercase;
  margin-top: var(--space-xs);
  display: inline-block;
}


/* ----------------------------------------------------------------------------
   §11. MUSIC TOGGLE BUTTON
   ---------------------------------------------------------------------------- */

.music-toggle {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  z-index: 1000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

.music-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
  background: rgba(255, 255, 255, 0.7);
}

.music-toggle:active {
  transform: scale(0.95);
}

/* Music icon styling */
.music-icon {
  color: var(--color-sage);
  transition:
    transform var(--transition-fast),
    color var(--transition-fast);
}

/* Gently sway and pulse the music icon when playing */
.music-toggle.playing .music-icon {
  animation: music-sway 2s ease-in-out infinite alternate;
  color: var(--color-rose);
}


/* ----------------------------------------------------------------------------
   §12. KEYFRAME ANIMATIONS
   ---------------------------------------------------------------------------- */

/* Scroll-driven: fade + slide up */
@keyframes fade-slide-in {
  from {
    opacity: 0;
    transform: translateY(60px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Simple fade-in */
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Scale in — for gallery and cards */
@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Float — gentle up-down for decorative elements */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Bounce — for scroll indicator chevron */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-12px);
  }
  60% {
    transform: translateX(-50%) translateY(-6px);
  }
}

/* Pulse — for music bars and heart icon */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.8;
  }
}

/* Music icon sway & pulse */
@keyframes music-sway {
  0% {
    transform: rotate(-10deg) scale(0.95);
  }
  100% {
    transform: rotate(10deg) scale(1.1);
  }
}

/* Parallax — for gallery layers */
@keyframes parallax-shift {
  from {
    transform: translateY(40px);
  }
  to {
    transform: translateY(-40px);
  }
}


/* ----------------------------------------------------------------------------
   §13. SCROLL-DRIVEN ANIMATIONS (with Feature Detection)
   ---------------------------------------------------------------------------- */

/*
 * Modern scroll-driven animations using animation-timeline: view().
 * Wrapped in @supports for browsers that support them (Chrome 115+,
 * Edge 115+, Safari 26+). Firefox does not yet support these.
 *
 * Per best practices:
 * - Feature detection uses BOTH animation-timeline and animation-range: entry
 * - Wrapped in prefers-reduced-motion: no-preference
 * - Only animate compositor-friendly properties (opacity, transform)
 * - animation-timeline declared AFTER animation shorthand
 */

@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {

    /* Story chapters: fade + slide in on scroll entry */
    .story-chapter {
      animation: fade-slide-in auto linear backwards;
      animation-timeline: view();
      animation-range: entry 10% cover 40%;
    }

    /* Detail cards: fade + slide in on scroll entry */
    .detail-card {
      animation: fade-slide-in auto linear backwards;
      animation-timeline: view();
      animation-range: entry 10% cover 35%;
    }



    /* Event cards: fade + slide in on scroll entry */
    .event-card {
      animation: fade-slide-in auto linear backwards;
      animation-timeline: view();
      animation-range: entry 10% cover 35%;
    }

    /* Countdown wrapper: fade + slide in */
    .countdown-wrapper {
      animation: fade-slide-in auto linear backwards;
      animation-timeline: view();
      animation-range: entry 10% cover 40%;
    }

    /* Countdown boxes: fade + slide in */
    .countdown-box {
      animation: fade-slide-in auto linear backwards;
      animation-timeline: view();
      animation-range: entry 15% cover 40%;
    }

    /* Details action button */
    .details-action {
      animation: fade-slide-in auto linear backwards;
      animation-timeline: view();
      animation-range: entry 10% cover 40%;
    }

    /* Section titles */
    .section-title {
      animation: fade-in auto linear backwards;
      animation-timeline: view();
      animation-range: entry 10% cover 30%;
    }

    /* Gallery parallax wrapper — different speeds */
    .gallery-parallax {
      animation: parallax-shift auto linear both;
      animation-timeline: view();
      animation-range: entry exit;
    }

    .gallery-parallax:nth-child(odd) {
      animation: parallax-shift auto linear both;
      animation-timeline: view();
      animation-range: entry 10% exit 90%;
    }
  }
}

/*
 * Fallback for browsers without scroll-driven animation support.
 * Elements start invisible; a JS IntersectionObserver adds the
 * .animate-fallback-visible class to trigger a CSS transition.
 */

/* Initial hidden state for JS fallback — only when scroll-driven not supported */
@supports not ((animation-timeline: view()) and (animation-range: entry)) {
  .story-chapter,
  .detail-card,
  .event-card,
  .countdown-wrapper,
  .countdown-box {
    opacity: 0;
    transform: translateY(40px);
    transition:
      opacity 0.8s var(--ease-out-expo),
      transform 0.8s var(--ease-out-expo);
  }

  /* Visible state triggered by IntersectionObserver */
  .story-chapter.animate-fallback-visible,
  .detail-card.animate-fallback-visible,
  .event-card.animate-fallback-visible,
  .countdown-wrapper.animate-fallback-visible,
  .countdown-box.animate-fallback-visible {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ----------------------------------------------------------------------------
   §14. PREFERS-REDUCED-MOTION
   ---------------------------------------------------------------------------- */

/*
 * Per accessibility best practices, disable heavy motion for users
 * who prefer reduced motion. Applied on a per-element basis rather
 * than a global blanket override.
 */

@media (prefers-reduced-motion: reduce) {
  /* Remove scroll indicator bounce */
  .scroll-indicator {
    animation: none;
  }

  /* Remove floating animation on countdown boxes */
  .countdown-box {
    animation: none;
  }

  /* Remove gallery hover zoom */
  .gallery-card:hover .gallery-card-img {
    transform: none;
  }

  /* Remove music icon animation */
  .music-toggle.playing .music-icon {
    animation: none;
  }

  /* Reduce hero fade-in to simple appearance */
  .hero-content {
    animation-duration: 0.01s;
  }



  /* Ensure all elements are visible (no scroll-triggered hiding) */
  .story-chapter,
  .detail-card,
  .gallery-card,
  .countdown-box {
    opacity: 1;
    transform: none;
  }
}


/* ----------------------------------------------------------------------------
   §15. RESPONSIVE DESIGN (Mobile-First)
   ---------------------------------------------------------------------------- */

/* ---- Small screens (base / mobile) ---- */

/* Story chapters: stack vertically */
.story-chapter,
.story-chapter:nth-child(even) {
  flex-direction: column;
  text-align: center;
  gap: var(--space-lg);
}

.story-image-wrapper {
  width: 100%;
  max-width: 400px;
  margin-inline: auto;
}

.story-paragraph {
  margin-inline: auto;
}



/* Mobile Phone Solid Opaque Cards */
@media (max-width: 600px) {
  .countdown-wrapper {
    background-color: #ffffff !important;
    opacity: 1 !important;
    padding: 1.25rem 0.6rem;
    margin-inline: 0.25rem;
    border: 2px solid rgba(145, 60, 75, 0.28) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
  }

  .countdown-box {
    background-color: #ffffff !important;
    opacity: 1 !important;
    border: 1.5px solid rgba(145, 60, 75, 0.25) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  }

  .event-card {
    background-color: #ffffff !important;
    opacity: 1 !important;
    border: 1.5px solid rgba(145, 60, 75, 0.22) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
  }
}

/* Detail cards: full width stack */
.details-grid {
  flex-direction: column;
  align-items: center;
}

.detail-card {
  max-width: 100%;
  width: 100%;
}

/* ---- Tablets (600px+) ---- */
@media (min-width: 600px) {
  /* Countdown: 4-column layout */
  .countdown-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: 700px;
  }



  /* Detail cards: side by side */
  .details-grid {
    flex-direction: row;
  }

  .detail-card {
    max-width: 360px;
  }
}

/* ---- Desktops (900px+) ---- */
@media (min-width: 900px) {
  /* Story chapters: horizontal layout restored */
  .story-chapter {
    flex-direction: row;
    text-align: left;
  }

  .story-chapter:nth-child(even) {
    flex-direction: row-reverse;
    text-align: left;
  }

  .story-image-wrapper {
    width: min(45%, 500px);
    margin-inline: 0;
  }

  .story-paragraph {
    margin-inline: 0;
  }


}

/* ---- Large desktops (1200px+) ---- */
@media (min-width: 1200px) {

}


/* ----------------------------------------------------------------------------
   §16. PARALLAX-LIKE BACKGROUND FIX FOR MOBILE
   ---------------------------------------------------------------------------- */

/*
 * background-attachment: fixed is notoriously broken on iOS.
 * On mobile, we remove the fixed attachment and rely on a simpler
 * cover approach. The JS can optionally add parallax via transforms.
 */
@media (max-width: 768px) {
  .hero-background {
    background-attachment: scroll;
  }
}


/* ----------------------------------------------------------------------------
   §17. RSVP / FORM STYLES (Bonus)
   ---------------------------------------------------------------------------- */

.rsvp-form {
  max-width: 480px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.form-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  letter-spacing: 0.03em;
}

.form-input,
.form-select,
.form-textarea {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-blush);
  border-radius: var(--radius-md);
  padding: 0.9em 1.2em;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-sage);
  box-shadow: 0 0 0 3px rgba(111, 162, 134, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-light);
  opacity: 0.5;
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-white);
  background-color: var(--color-sage);
  padding: 1em 2.5em;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-sage);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-fast);
  letter-spacing: 0.05em;
  align-self: center;
}

.form-submit:hover {
  transform: translateY(-3px);
  box-shadow:
    0 6px 24px hsla(145, 25%, 55%, 0.3),
    0 12px 48px hsla(145, 25%, 55%, 0.2);
  background-color: hsl(145, 25%, 45%);
}


/* ----------------------------------------------------------------------------
   §18. LOADING / PAGE TRANSITIONS
   ---------------------------------------------------------------------------- */

/* Page load overlay — fades out after content loads */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader-text {
  font-family: var(--font-script);
  font-size: var(--text-2xl);
  color: var(--color-text-light);
  animation: pulse 1.5s ease-in-out infinite;
}


/* ----------------------------------------------------------------------------
   §19. UTILITY CLASSES
   ---------------------------------------------------------------------------- */

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.text-script  { font-family: var(--font-script); }
.text-heading { font-family: var(--font-heading); }
.text-body    { font-family: var(--font-body); }

.text-cream      { color: var(--color-cream); }
.text-blush      { color: var(--color-blush); }
.text-sage       { color: var(--color-sage); }
.text-rose       { color: var(--color-rose); }
.text-muted      { color: var(--color-text-light); }

.bg-cream        { background-color: var(--color-cream); }
.bg-blush        { background-color: var(--color-blush); }
.bg-sage-light   { background-color: var(--color-sage-light); }
.bg-rose-light   { background-color: var(--color-rose-light); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hidden by default, shown by JS */
.hidden {
  display: none;
}

.visible {
  display: block;
}


/* ============================================================================
   END OF STYLESHEET
   ============================================================================ */
