@import url('https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,300..700;1,300..700&family=Pinyon+Script&display=swap');

:root {
  /* Derived Palette */
  --primary-beige: #b4a078;
  --secondary-beige: #a08c64;
  --soft-cream: #F5F2EA;
  /* Slightly clearer version of extracted lighter tones */
  --deep-black: #1C1C1C;
  --charcoal: #2D2D2D;
  --white: #FFFFFF;
  --overlay-dark: rgba(28, 28, 28, 0.4);
  --overlay-light: rgba(245, 242, 234, 0.85);

  /* Fonts */
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Lato', sans-serif;
  --font-script: 'Pinyon Script', cursive;
  --font-display: 'Cormorant', serif;
  /* New variable */

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 8rem;

  /* Transitions */
  --transition-fast: 0.3s ease;
  --transition-slow: 0.8s ease;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  /* Offset for fixed navbar */
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--soft-cream);
  color: var(--deep-black);
  line-height: 1.6;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  margin-bottom: var(--spacing-sm);
  letter-spacing: 0.05em;
}

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

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

section {
  padding: var(--spacing-xl) var(--spacing-md);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-animate {
  opacity: 0;
  animation: fadeInUp 1s ease-out forwards;
}

.delay-1 {
  animation-delay: 0.2s;
}

.delay-2 {
  animation-delay: 0.5s;
}

.delay-3 {
  animation-delay: 0.8s;
}

.delay-4 {
  animation-delay: 1.1s;
}

.delay-5 {
  animation-delay: 1.4s;
}

.delay-6 {
  animation-delay: 1.7s;
}

/* Scroll Animations */
.fade-in,
.reveal-up,
.reveal-left,
.reveal-right {
  opacity: 0;
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-up {
  transform: translateY(30px);
}

.reveal-left {
  transform: translateX(-60px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible {
  opacity: 1;
  transform: translate(0);
}

.reveal-delay-1 {
  transition-delay: 0.1s;
}

.reveal-delay-2 {
  transition-delay: 0.2s;
}

.reveal-delay-3 {
  transition-delay: 0.3s;
}

.reveal-delay-4 {
  transition-delay: 0.4s;
}

.reveal-delay-4 {
  transition-delay: 0.4s;
}

/* Typography */
.text-center {
  text-align: center;
}

.text-uppercase {
  text-transform: uppercase;
}

.section-title {
  font-family: var(--font-display);
  font-size: 3.5rem;
  margin-bottom: var(--spacing-lg);
  color: var(--deep-black);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background-color: var(--primary-beige);
  margin: var(--spacing-sm) auto 0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background-color: var(--deep-black);
  color: var(--white);
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--deep-black);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn:hover {
  background-color: transparent;
  color: var(--deep-black);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--deep-black);
  color: var(--deep-black);
}

.btn-outline:hover {
  background-color: var(--deep-black);
  color: var(--white);
}


/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 9999;
  background: transparent;
  /* Initial transparent state */
  padding: 1.5rem 0;
  /* Larger padding initially */
  transition: all 0.4s ease;
}

.navbar.scrolled,
.navbar.mobile-open {
  background: var(--deep-black);
  /* Solid black on scroll OR when menu open */
  padding: 1rem 0;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  color: var(--white);
  font-weight: 700;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--white);
  font-family: var(--font-body);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  opacity: 0.8;
  transition: opacity 0.3s;
}

.nav-link:hover {
  opacity: 1;
  color: var(--primary-beige);
}

.hamburger {
  display: none;
  cursor: pointer;
}

.bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  transition: all 0.3s ease-in-out;
  background-color: var(--white);
}

.hamburger.active .bar:nth-child(2) {
  opacity: 0;
}

.hamburger.active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-menu {
    position: fixed;
    right: -100%;
    left: auto;
    top: 60px;
    /* Below navbar */
    flex-direction: column;
    background-color: var(--deep-black);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    padding: 1rem 0;
    height: calc(100vh - 60px);
    overflow-y: auto;
  }

  .nav-menu.active {
    right: 0;
    left: auto;
  }

  .nav-item {
    margin: 1rem 0;
  }
}

/* Details Cards */
.details-container {
  display: flex;
  justify-content: center;
  gap: 4rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  flex-wrap: wrap;
}

.detail-card {
  background-color: #E6DCCD;
  /* Beige card color matches reference */
  border-radius: 20px;
  padding: 3rem 2rem;
  flex: 1;
  min-width: 300px;
  max-width: 500px;
  text-align: center;
  color: var(--charcoal);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
}

.detail-card:hover {
  transform: translateY(-5px);
}

.card-icon svg {
  width: 60px;
  height: 60px;
  margin-bottom: 1rem;
  stroke: var(--charcoal);
  stroke-width: 1.2;
  overflow: visible;
}

.card-title {
  font-family: var(--font-script);
  font-size: 3.5rem;
  color: #5D4037;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.card-location {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #444;
}

.card-address {
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin-bottom: 3rem;
  color: #666;
  max-width: 90%;
}

.card-time {
  font-weight: 700;
  font-size: 1.4rem;
  color: #444;
  margin-top: 2.0rem;
  /* Pushes time to bottom if height varies */
}

.card-map {
  width: 100%;
  height: 250px;
  border: 0;
  border-radius: 12px;
  margin-top: 0.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
  .details-container {
    flex-direction: column;
    align-items: center;
  }

  .detail-card {
    width: 100%;
    margin-bottom: 1rem;
    min-width: 0;
    /* Prevents overflow on very small screens */
    padding: 2rem 1.5rem;
    /* Slightly reduced padding for mobile */
  }
}

/* Hero Section */
.hero {
  min-height: 120vh;
  height: auto;
  padding: 4rem 0;
  /* Add top/bottom padding for safety */
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-image: url('/black-beige-sample/assets/images/gallery/1 (1).JPG');
  /* Placeholder main image */
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  /* Parallax */
  color: var(--white);
  text-align: center;
  padding: 0;
  opacity: 1;
  /* Hero always visible initially */
  transform: none;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-dark);
}

.hero-logo {
  max-width: 300px;
  height: auto;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

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

.hero h1 {
  font-size: 4rem;
  margin-bottom: var(--spacing-md);
}

.hero-date {
  font-family: var(--font-heading);
  font-size: 2rem;
  margin: 1.5rem 0;
  color: var(--white);
  letter-spacing: 2px;
}

.countdown {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: var(--spacing-md);
  font-family: var(--font-body);
  flex-wrap: wrap;
}

.countdown-item {
  background: rgba(0, 0, 0, 0.6);
  /* Semi-transparent box */
  border: 1px solid var(--primary-beige);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  min-width: 100px;
  text-align: center;
  backdrop-filter: blur(5px);
}

.countdown-item span {
  display: block;
  font-size: 2.5rem;
  font-family: var(--font-heading);
  color: var(--white);
  line-height: 1;
  margin-bottom: 0.2rem;
}

/* Date & Venue */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-lg);
  max-width: 1200px;
  margin: 0 auto;
}

.map-placeholder {
  width: 100%;
  height: 400px;
  background-color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

/* Entourage */
.entourage-section {
  background-color: var(--soft-cream);
  padding-bottom: var(--spacing-xl);
}

.entourage-group {
  margin-bottom: var(--spacing-lg);
}

.entourage-group h3 {
  font-size: 2rem;
  color: var(--primary-beige);
  margin-bottom: 0.5rem;
}

.role-subtitle {
  font-family: 'Playfair Display', serif;
  /* Use serif for elegant feel */
  font-style: italic;
  color: var(--charcoal);
  margin-bottom: var(--spacing-md);
  font-size: 1.1rem;
}

.names-row p,
.secondary-group p,
.flower-girls p {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.sponsors-grid {
  display: flex;
  justify-content: center;
  gap: 4rem;
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
  /* Or center if preferred, but list usually looks better left aligned in columns */
}

.sponsor-col:first-child {
  text-align: right;
}

.sponsor-col p {
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.entourage-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3rem auto 2rem;
  max-width: 800px;
  width: 90%;
}

.entourage-divider::before,
.entourage-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-beige), transparent);
  margin: 0 1.5rem;
  opacity: 0.7;
}

.special-roles {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3rem;
  margin-bottom: var(--spacing-lg);
}

.role-item h4,
.bearer-item h4 {
  color: var(--primary-beige);
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.party-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  max-width: 800px;
  margin: 0 auto var(--spacing-lg);
}

.parents-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  max-width: 900px;
  margin: 0 auto 2rem;
}

.parents-col h4 {
  color: var(--primary-beige);
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  letter-spacing: 0.1em;
  font-size: 1.1rem;
}

.party-col h4 {
  color: var(--primary-beige);
  text-transform: uppercase;
  margin-bottom: 1rem;
  letter-spacing: 0.1em;
}

.party-col p {
  margin-bottom: 0.5rem;
}

.secondary-group {
  margin-bottom: 1.5rem;
}

.bearers-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3rem;
  margin-bottom: var(--spacing-lg);
}

.offertory-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3rem;
}

.offertory-item .off-type {
  display: block;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: var(--primary-beige);
  margin-bottom: 0.5rem;
  font-size: 1.0rem;
}

@media (max-width: 768px) {

  .sponsors-grid,
  .parents-grid {
    flex-direction: row;
    /* Keep side-by-side */
    gap: 2rem;
    text-align: center;
    justify-content: center;
  }

  .sponsor-col:last-child {
    text-align: left;
  }

  /* Parents grid specific for mobile */
  .parents-grid {
    display: flex;
    /* Override grid */
    width: 100%;
  }

  .parents-col {
    flex: 1;
  }

  .party-grid {
    grid-template-columns: 1fr 1fr;
    /* Keep 2 columns */
    gap: 1rem;
  }

  .special-roles,
  .bearers-grid,
  .offertory-grid {
    flex-direction: row;
    /* Keep horizontal alignment */
    flex-wrap: wrap;
    /* Allow wrapping if needed but keep grouped */
    gap: 1.5rem;
    row-gap: 2rem;
  }

  /* Adjust font sizes for mobile to fit side-by-side */
  .sponsors-grid p,
  .party-grid p,
  .bearers-grid p {
    font-size: 0.85rem;
  }

  .entourage-group h3 {
    font-size: 1.5rem;
  }
}

/* Events */
.timeline {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.event-card {
  background: var(--white);
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--primary-beige);
}

/* Attire */
/* Attire */
.attire-guide {
  background-color: var(--white);
  /* Changed to white as per concept image look which seems clean */
  color: var(--charcoal);
  text-align: center;
}

.attire-intro {
  max-width: 700px;
  margin: 0 auto var(--spacing-md);
  font-size: 1.1rem;
}

.attire-palette {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--spacing-lg);
}

.petal {
  width: 40px;
  height: 40px;
  border-radius: 50% 50% 0 50%;
  transform: rotate(45deg);
  margin: 0 5px;
}

.attire-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  max-width: 1000px;
  margin: 0 auto var(--spacing-lg);
  text-align: left;
}

.attire-block.reverse {
  flex-direction: row-reverse;
  text-align: right;
}

.attire-visual {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Removed bg and height constraints for actual images */
}

.attire-visual img {
  max-width: 100%;
  height: 350px;
  /* Fixed height for uniformity */
  width: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

@media (max-width: 768px) {

  .attire-block,
  .attire-block.reverse {
    flex-direction: column;
    text-align: center;
  }

  .attire-visual img {
    height: auto;
    max-height: 250px;
  }
}

.attire-details {
  flex: 1;
}

.attire-details h3 {
  font-family: var(--font-heading);
  color: #5D4037;
  /* Chocolate brown */
  font-size: 1.8rem;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.attire-details h4 {
  font-size: 1.2rem;
  color: var(--charcoal);
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.attire-details p {
  margin-bottom: 1.5rem;
  color: #666;
}

.attire-note {
  background-color: #F9F7F2;
  padding: 2rem;
  margin-top: var(--spacing-lg);
  border-radius: 8px;
  font-style: italic;
  color: #5D4037;
}

@media (max-width: 768px) {

  .attire-block,
  .attire-block.reverse {
    flex-direction: column;
    text-align: center;
  }
}



/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.gallery-item {
  cursor: pointer;
  height: 300px;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.3s;
}

.gallery-item:hover img {
  filter: brightness(0.8);
}

/* RSVP */
.rsvp-form-container {
  max-width: 600px;
  margin: 0 auto;
  background: var(--white);
  padding: var(--spacing-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

input,
select,
textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid #ddd;
  font-family: var(--font-body);
  font-size: 1rem;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-beige);
}

/* Accordion */
/* Accordion */
.accordion-item {
  border-bottom: 1px solid #ddd;
  max-width: 800px;
  margin: 0 auto;
  transition: all 0.3s ease;
  border-radius: 8px;
  /* Smooth corners when active */
}

.accordion-header {
  padding: 1.5rem 1rem;
  /* Added side padding for consistency */
  cursor: pointer;
  position: relative;
  font-weight: bold;
}

.accordion-header::after {
  content: '+';
  position: absolute;
  right: 1rem;
  /* Adjust right position with padding */
  color: var(--primary-beige);
}

.accordion-item.active {
  background-color: var(--deep-black);
  border-bottom-color: transparent;
  margin: 1rem auto;
  /* Add vertical space when active */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.accordion-item.active .accordion-header::after {
  content: '-';
  color: var(--primary-beige);
  /* Keep beige on black */
}

.accordion-item.active .accordion-header {
  color: var(--primary-beige);
  /* Beige title on black bg */
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 1rem;
  /* Match header padding */
}

.accordion-item.active .accordion-content {
  max-height: 300px;
  /* Increased max-height for longer text */
  margin-bottom: 1rem;
  color: var(--white);
  /* White text for content */
}

/* Mobile */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 2rem;
  }
}

/* Intro Overlay */
#intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--soft-cream);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  /* Changed to column to stack envelope and text */
  justify-content: center;
  align-items: center;
  transition: opacity 1s ease-out;
}

.intro-text {
  font-family: var(--font-script);
  color: #310c0c;
  font-size: 1.8rem;
  margin-top: 3rem;
  opacity: 0;
  z-index: 55;
  /* Above white overlay (50), below flower (60) */
  animation: fadeInUp 1s ease-out forwards 0.5s;
  letter-spacing: 2px;
}

#intro-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}


/* White Transition Overlay */
.white-transition-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--white);
  opacity: 0;
  z-index: 50;
  /* Above everything in the intro container */
  pointer-events: none;
  transition: opacity 1.5s ease;
}

.white-transition-overlay.visible {
  opacity: 1;
}

/* Corner Flowers / Vines */
.corner-flower {
  position: absolute;
  width: 25vw;
  /* Responsive size */
  max-width: 300px;
  height: 25vw;
  max-height: 300px;
  z-index: 60;
  /* Above white overlay (50) */
  pointer-events: none;
  overflow: visible;
  opacity: 0;
  transition: opacity 1s ease;
}

.corner-flower.top-left {
  top: 0;
  left: 0;
}

.corner-flower.top-right {
  top: 0;
  right: 0;
}

.corner-flower.bottom-left {
  bottom: 0;
  left: 0;
}

.corner-flower.bottom-right {
  bottom: 0;
  right: 0;
}

.corner-flower .vine {
  fill: none;
  stroke: #d4af37;
  /* Gold */
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 400;
  /* Enough to cover the path length */
  stroke-dashoffset: 400;
  transition: stroke-dashoffset 3s ease-out;
}

.corner-flower.bloom {
  opacity: 1;
}

.corner-flower.bloom .vine {
  stroke-dashoffset: 0;
}

.intro-container {
  perspective: 1500px;
  /* For 3D rotation */
  transition: filter 1.5s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.intro-container.blurred {
  filter: blur(8px);
}

/* Envelope */
.envelope {
  width: 300px;
  height: 200px;
  background-color: #2b221b;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  /* No overflow hidden, so letter can rise out */
}

.envelope::before {
  /* Shadow inside */
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.05), transparent);
  z-index: 2;
  pointer-events: none;
}

.flap {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 3;
}

/* Flap Triangles */
.flap.bottom {
  bottom: 0;
  left: 0;
  border-left: 150px solid transparent;
  border-right: 150px solid transparent;
  border-bottom: 110px solid #48392e;
  /* Bottom flap color */
}

.flap.left {
  top: 0;
  left: 0;
  border-top: 100px solid transparent;
  border-bottom: 100px solid transparent;
  border-left: 160px solid #403229;
  /* Left flap color */
}

.flap.right {
  top: 0;
  right: 0;
  border-top: 100px solid transparent;
  border-bottom: 100px solid transparent;
  border-right: 160px solid #403229;
  /* Right flap color */
}

.flap.top {
  top: 0;
  left: 0;
  border-left: 150px solid transparent;
  border-right: 150px solid transparent;
  border-top: 120px solid #504033;
  /* Top flap color */
  transform-origin: top;
  transition: transform 0.6s ease-in-out, z-index 0.6s ease-in-out;
  z-index: 4;
  /* Top flap must be above others initially */
}

.envelope.open .flap.top {
  transform: rotateX(180deg);
  z-index: 1;
  /* Move behind letter after opening */
}

/* Wax Seal */
.wax-seal {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background-color: #fff6ea;
  /* Deep Red Seal */
  border-radius: 50%;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3), 0 4px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 6;
  cursor: pointer;
  transition: transform 0.3s ease, opacity 0.5s ease;
}

.wax-seal img {
  width: 80%;
  height: auto;
  object-fit: contain;
}

/* Pulse Animation for Seal */
@keyframes pulse-gold {
  0% {
    box-shadow: 0 0 0 0 rgba(158, 42, 43, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(158, 42, 43, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(158, 42, 43, 0);
  }
}

.wax-seal.pulse {
  animation: pulse-gold 2s infinite;
}

/* Seal Disappear */
.wax-seal.popped {
  transform: translate(-50%, -50%) scale(1.5);
  opacity: 0;
  pointer-events: none;
}

/* Letter (The Image) */
.letter {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 280px;
  height: 180px;
  background: #fff;
  overflow: hidden;
  /* Initially hidden inside envelope */
  z-index: 2;
  transition: transform 1s cubic-bezier(0.19, 1, 0.22, 1);
  /* Initial state inside envelope */
  transform: translateY(0);
}

.letter .intro-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  /* Initially fill the small card area */
  display: block;
  transform: scale(1.5);
  /* Zoom in initially to focus on center details */
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.letter.zoomed .intro-image {
  transform: scale(1);
  /* Reset scale to show full cropped image on full screen */
}

/* Letter Rising Animation (Disabled to keep in place) */
.envelope.open .letter {
  z-index: 5;
  /* Above flaps */
  transform: translateY(-120px);
  transition-delay: 0.4s;
}

/* Zoom Transition */
.letter.zoomed-transition {
  transition: all 1.2s cubic-bezier(0.25, 1, 0.5, 1) !important;
  transition-delay: 0s !important;
}

/* 
   .letter.zoomed styles are now handled via JS FLIP to prevent layout jumping.
   We keep the class selector for the child image transform reset.
*/

/* Writing / Handwritten Animation */
.writing-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  /* border-right: 3px solid var(--white); Removed cursor */
  width: 0;
  /* Start with 0 width */
  vertical-align: bottom;
  /* Align properly */
  box-sizing: border-box;
}

@keyframes typing {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

/* Specific Delays and Durations */
.delay-write-1 {
  /* Anthony & Jazee */
  animation: typing 3s ease-out forwards;
  /* Smooth easing for handwriting */
  animation-delay: 2.2s;
}

.delay-write-2 {
  /* Are getting married */
  animation: typing 2.5s ease-out forwards;
  animation-delay: 5.3s;
  /* Adjusted delay for longer first animation */
}

.delay-write-3 {
  /* Date */
  animation: typing 2s ease-out forwards;
  animation-delay: 7.8s;
}

/* Countdown Spin Animation */
.countdown-item {
  /* Ensure basic styling if not already present or override */
  display: inline-block;
  /* or flex depending on layout */
  transition: transform 0.3s ease;
  perspective: 1000px;
  cursor: pointer;
}

@keyframes rotate-flip {
  0% {
    transform: rotateY(0);
  }

  100% {
    transform: rotateY(360deg);
  }
}

.countdown-item:hover,
.countdown-item:active {
  animation: rotate-flip 0.8s ease-in-out;
}


/* 3D Carousel */
#gallery {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

.carousel-container {
  width: 100%;
  max-width: 1000px;
  height: 500px;
  margin: 0 auto;
  position: relative;
  perspective: 1000px;
  /* Key for 3D effect */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  /* Hide items flying too far out */
  contain: layout style paint;
}

.carousel-track {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  display: flex;
  justify-content: center;
  align-items: center;
}

.carousel-item {
  position: absolute;
  width: 300px;
  height: 450px;
  background-color: #fff;
  border-radius: 10px;
  overflow: hidden;
  /* No transition on hidden items — only visible ones pay the cost */
  transition: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  /* Default state (hidden) */
  opacity: 0;
  visibility: hidden;
  transform: translateZ(-500px);
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  /* Let click pass to item */
}

/* Positions */
.carousel-item.center {
  opacity: 1;
  visibility: visible;
  z-index: 10;
  transform: translateX(0) translateZ(0) scale(1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--primary-beige);
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
    opacity 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.carousel-item.left-1 {
  opacity: 0.7;
  visibility: visible;
  z-index: 5;
  transform: translateX(-60%) translateZ(-150px) rotateY(15deg);
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
    opacity 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.carousel-item.left-2 {
  opacity: 0.5;
  visibility: visible;
  z-index: 2;
  transform: translateX(-100%) translateZ(-300px) rotateY(25deg);
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
    opacity 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.carousel-item.right-1 {
  opacity: 0.7;
  visibility: visible;
  z-index: 5;
  transform: translateX(60%) translateZ(-150px) rotateY(-15deg);
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
    opacity 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.carousel-item.right-2 {
  opacity: 0.5;
  visibility: visible;
  z-index: 2;
  transform: translateX(100%) translateZ(-300px) rotateY(-25deg);
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
    opacity 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Navigation Buttons */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--deep-black);
  color: var(--white);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 20;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s;
}

.carousel-nav:hover {
  background-color: var(--primary-beige);
}

.carousel-nav.prev {
  left: 20px;
}

.carousel-nav.next {
  right: 20px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 99999;
  /* Must be above navbar (9999), music toggle (10000), and intro overlay (10000) */
  display: none;
  /* Hidden by default */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  width: 90%;
  height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lightbox-img {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  margin-bottom: 2rem;
  border: 1px solid var(--charcoal);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Slide-out animations */
.lightbox-img.slide-out-left {
  transform: translateX(-100%);
  opacity: 0;
}

.lightbox-img.slide-out-right {
  transform: translateX(100%);
  opacity: 0;
}

/* Slide-in starting positions (no transition, instant placement) */
.lightbox-img.slide-in-left {
  transform: translateX(-100%);
  opacity: 0;
  transition: none;
}

.lightbox-img.slide-in-right {
  transform: translateX(100%);
  opacity: 0;
  transition: none;
}

/* Final position (animates from slide-in to here) */
.lightbox-img.slide-in-active {
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.lightbox-thumbnails {
  display: flex;
  gap: 10px;
  width: 80%;
  overflow-x: auto;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  scrollbar-width: thin;
  /* Firefox */
}

/* Custom Scrollbar for thumbnails */
.lightbox-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.lightbox-thumbnails::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.5);
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
  background: var(--primary-beige);
  border-radius: 3px;
}

.lightbox-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  cursor: pointer;
  border-radius: 4px;
  opacity: 0.6;
  transition: all 0.2s;
  flex-shrink: 0;
}

.lightbox-thumb:hover,
.lightbox-thumb.active {
  opacity: 1;
  border: 2px solid var(--primary-beige);
  transform: scale(1.1);
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: var(--white);
  font-size: 3rem;
  cursor: pointer;
  z-index: 100001;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: transparent;
  color: var(--white);
  border: none;
  font-size: 3rem;
  cursor: pointer;
  z-index: 100002;
  padding: 1rem;
  transition: all 0.3s;
  opacity: 0.7;
}

.lightbox-nav:hover {
  opacity: 1;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
  left: 20px;
}

.lightbox-nav.next {
  right: 20px;
}

@media (max-width: 768px) {
  .carousel-container {
    height: 350px;
    perspective: 600px;
  }

  .carousel-item {
    width: 200px;
    height: 300px;
  }

  .carousel-item.left-1 {
    transform: translateX(-40%) translateZ(-80px) rotateY(10deg);
  }

  .carousel-item.left-2 {
    transform: translateX(-70%) translateZ(-150px) rotateY(15deg);
  }

  .carousel-item.right-1 {
    transform: translateX(40%) translateZ(-80px) rotateY(-10deg);
  }

  .carousel-item.right-2 {
    transform: translateX(70%) translateZ(-150px) rotateY(-15deg);
  }

  .lightbox-thumbnails {
    width: 100%;
  }

  /* Hide nav buttons on mobile if using swipe, or keep small */
  .carousel-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

/* --- Aesthetic Vertical Timeline --- */
.timeline-container {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 0;
}

/* Central Line */
.timeline-container::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background-color: var(--primary-beige);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: 100%;
  margin-bottom: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

/* Marker (The Dot) */
.timeline-marker {
  position: absolute;
  left: 50%;
  top: 0;
  /* Align with top of content roughly */
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background-color: var(--soft-cream);
  border: 2px solid var(--primary-beige);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 0 4px #fff;
  /* White halo to separate from line */
}

/* Content Box */
.timeline-content {
  width: 42%;
  /* Leave space in middle */
  padding: 20px;
  background-color: var(--deep-black);
  /* Black box */
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  position: relative;
  border: 1px solid var(--primary-beige);
}

.timeline-content h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  /* Smaller font */
  margin-bottom: 5px;
  color: var(--primary-beige);
  /* Beige text */
}

.timeline-content .time {
  font-family: var(--font-body);
  font-size: 1.2rem;
  /* Smaller font */
  color: var(--white);
  display: block;
  margin-bottom: 10px;
}

.timeline-content p {
  font-size: 0.85rem;
  /* Smaller font */
  color: #ccc;
  /* Light grey text */
  font-weight: 300;
}

/* Alternating Layout */
.timeline-item:nth-child(odd) {
  flex-direction: row;
}

.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
}

.timeline-item:nth-child(odd) .timeline-content {
  text-align: right;
  margin-right: auto;
  /* Push to left */
  padding-right: 40px;
  /* Space from line */
}

.timeline-item:nth-child(even) .timeline-content {
  text-align: left;
  margin-left: auto;
  /* Push to right */
  padding-left: 40px;
  /* Space from line */
}

/* Mobile Adjustments (Keep Alternating per User Request) */
@media (max-width: 768px) {
  .timeline-container::before {
    left: 50%;
  }

  .timeline-content {
    width: 40%;
    /* Narrow enough to fit side-by-side */
    padding: 10px;
  }

  .timeline-item:nth-child(odd) .timeline-content {
    padding-right: 15px;
    /* Closer to line */
  }

  .timeline-item:nth-child(even) .timeline-content {
    padding-left: 15px;
    /* Closer to line */
  }

  .timeline-content h3 {
    font-size: 1.1rem;
  }

  .timeline-content .time {
    font-size: 1.2rem;
  }

  .timeline-content p {
    font-size: 0.8rem;
    line-height: 1.2;
  }
}

/* --- Note on Gifts Section --- */
#gifts {
  position: relative;
  /* min-height: 100vh; Removed to fit flow better */
  padding: var(--spacing-xl) var(--spacing-md);
  background-color: var(--soft-cream);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gift-card-overlay {
  background-color: var(--white);
  border-radius: 4px;
  /* Sharper, more elegant corners */
  padding: 4rem 3rem;
  width: 100%;
  max-width: 600px;
  /* Generous width */
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(180, 160, 120, 0.3);
  /* Subtle beige border */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  position: relative;
}

/* Inner decorative border */
.gift-card-overlay::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 1px solid rgba(180, 160, 120, 0.2);
  pointer-events: none;
}

.gift-icon {
  width: 50px;
  height: 50px;
  color: #5D4037;
  /* Brown */
  margin-bottom: 10px;
}

.gift-icon svg {
  width: 100%;
  height: 100%;
  vector-effect: non-scaling-stroke;
}

.gift-card-overlay h2 {
  font-family: var(--font-script);
  font-size: 2.5rem;
  color: #5D4037;
  /* Brown title */
  margin: 0;
  line-height: 1.1;
}

.gift-card-overlay p {
  font-family: var(--font-body);
  /* Sans-serif */
  font-size: 1rem;
  color: #5D4037;
  /* Brown text */
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 768px) {
  #gifts {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .gift-card-overlay {
    padding: 3rem 1.5rem;
  }

  .gift-card-overlay h2 {
    font-size: 2rem;
  }
}

/* Music Toggle */
.music-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: var(--deep-black);
  color: var(--primary-beige);
  border: 2px solid var(--primary-beige);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10000;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.music-toggle:hover {
  transform: scale(1.1);
  background-color: var(--primary-beige);
  color: var(--deep-black);
}

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

/* RSVP Google Form */
.rsvp-iframe-container {
  width: 100%;
  max-width: 640px;
  margin: 3rem auto 0;
  /* Added 3rem top margin */
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  background: var(--white);
}

.rsvp-iframe-container iframe {
  width: 100%;
  border: 0;
  display: block;
}

@media (max-width: 768px) {
  .rsvp-iframe-container iframe {
    height: 850px;
    /* Adjusted height for mobile */
  }
}

/* Intro Instruction */
.seal-instruction {
  position: absolute;
  top: 120%;
  /* Below the envelope */
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--primary-beige);
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0;
  animation: fadeInFloat 3s ease-in-out infinite;
  animation-delay: 1.5s;
  /* Wait for envelope to appear */
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.5s ease;
  z-index: 10;
}

.seal-instruction.hidden {
  opacity: 0;
}

@keyframes fadeInFloat {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(5px);
  }

  20% {
    opacity: 0.8;
    transform: translateX(-50%) translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
  }

  80% {
    opacity: 0.8;
    transform: translateX(-50%) translateY(0);
  }

  100% {
    opacity: 0;
    /* Fade out slightly at end of loop before restarting */
    transform: translateX(-50%) translateY(5px);
  }
}