:root {
  --ivory: #FBF3EF;
  --blush: #F3D9DD;
  --rose: #D98CA0;
  --rose-deep: #B15C74;
  --wine: #6E3B4C;
  --gold: #C9A66B;
  --ink: #4A3538;
  --white: #FFFDFC;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Cormorant Garamond', serif;

  background-image: url('images/background.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  color: var(--ink);
  margin: 0;
  padding: 0;
}

/* Guaranteed bottom spacing above the floating nav (single source of truth) */
.page-bottom-spacer {
  height: 140px;
  width: 100%;
  display: block;
  clear: both;
}

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

/* ---------- Scroll Reveal Animations ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Typography & Base ---------- */
.eyebrow {
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--rose-deep);
  font-weight: 600;
}

.script {
  font-family: 'Alex Brush', cursive;
  color: var(--wine);
  line-height: 1;
}

/* ---------- Readable Section Wrapper ---------- */
.content-box {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(217, 140, 160, 0.3);
  border-radius: 16px;

  width: 95%;
  max-width: 1000px;
  box-sizing: border-box;
  padding: 50px 40px;
  margin: 0 auto 50px;

  box-shadow: 0 10px 30px rgba(139, 61, 86, 0.08);
}

/* ---------- Floating Navigation ---------- */
.floating-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 253, 252, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(217, 140, 160, 0.3);
  padding: 10px 20px;
  border-radius: 50px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 92vw;
  gap: 10px 15px;
  z-index: 50;
  box-shadow: 0 10px 25px rgba(110, 59, 76, 0.15);
  transition: opacity 0.5s ease, visibility 0.5s ease, transform 0.5s ease;
}
.floating-nav.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 20px);
}
.floating-nav a {
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--rose-deep);
  padding: 8px 12px;
  border-radius: 20px;
  transition: background 0.3s, color 0.3s;
  white-space: nowrap;
}
.floating-nav a:hover, .floating-nav a.active {
  background: var(--rose-deep);
  color: var(--white);
}
@media (max-width: 600px) {
  .floating-nav {
    width: 92%;
    max-width: 380px;
    bottom: 14px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 20px;
    overflow-x: visible;
  }
  .floating-nav a {
    font-size: 0.6rem;
    padding: 7px 10px;
    letter-spacing: 0.08em;
  }
}

@media (max-width: 600px) {
  .page-bottom-spacer { height: 170px; }
}

@media (max-width: 480px) {
  .content-box {
    padding: 34px 20px;
  }
  .godparents-wrap {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1200px) {
  .content-box {
    max-width: 1100px;
    padding: 60px 70px;
  }
  section {
    max-width: 860px;
  }
  .section-title {
    font-size: 3.4rem;
  }
  .detail-card p {
    font-size: 1.45rem;
  }
  .godparent-group p {
    font-size: 1.15rem;
  }
  .baby-name {
    font-size: 7.5rem;
  }
  .hero-sub {
    font-size: 1.5rem;
  }
}

/* ---------- Ambient Floating Decor (site-wide) ---------- */
.ambient-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.amb-item { position: absolute; }
.amb-sparkle { color: var(--gold); opacity: 0.5; animation: twinkle 3s ease-in-out infinite; }
.amb-heart { color: var(--rose); opacity: 0.4; animation: ambFloat 6s ease-in-out infinite; }
.amb-bow { opacity: 0.5; animation: ambFloat 7s ease-in-out infinite; }

@keyframes ambFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(4deg); }
}

@media (max-width: 600px) {
  .amb-bow { width: 22px !important; }
  .amb-item { opacity: 0.35; }
}

/* Ensure real content always paints above the ambient layer */
.hero, .content-box, footer {
  position: relative;
  z-index: 2;
}

/* ---------- Box-bow: signature ribbon accent on every content box ---------- */
.box-bow {
  position: absolute;
  top: -24px;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  width: 56px;
  z-index: 3;
  filter: drop-shadow(0 4px 6px rgba(110,59,76,0.18));
  animation: float 4s ease-in-out infinite;
}
@media (max-width: 480px) {
  .box-bow { width: 40px; top: -18px; }
}

/* ---------- Inline sparkle / heart accents ---------- */
.inline-sparkle {
  display: inline-block;
  color: var(--gold);
  vertical-align: middle;
  animation: twinkle 2.4s ease-in-out infinite;
}
.inline-heart {
  display: block;
  margin: 0 auto 10px;
  color: var(--rose);
  animation: ambFloat 4s ease-in-out infinite;
}

/* ---------- Godparents divider (tablet/desktop) ---------- */
@media (min-width: 640px) {
  .godparent-group:first-child {
    border-right: 1px dashed var(--rose);
  }
}

/* ---------- Ribbon signature ---------- */
.ribbon-corner {
  position: absolute;
  top: 0; left: 0;
  width: 180px; height: auto;
  z-index: 3;
  filter: drop-shadow(0 6px 10px rgba(110,59,76,0.15));
  animation: sway 6s ease-in-out infinite;
  transform-origin: top center;
}
.ribbon-corner.right {
  left: auto; right: 0;
  transform: scaleX(-1);
  animation-delay: 0.4s;
  animation-name: swayR;
}
@keyframes sway { 0%,100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
@keyframes swayR { 0%,100% { transform: scaleX(-1) rotate(-1.5deg); } 50% { transform: scaleX(-1) rotate(1.5deg); } }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(255, 253, 252, 0.85) 0%, rgba(255, 253, 252, 0) 65%);
}
.hero-bow {
  width: 86px;
  margin-bottom: 18px;
  animation: float 4s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero .eyebrow {
  margin-bottom: 14px;
  font-weight: 800;
  color: var(--wine);
}
.baby-name {
  font-family: 'Alex Brush', cursive;
  font-size: clamp(3.2rem, 9vw, 6.5rem);
  margin: 6px 0 18px;
  text-shadow: 0 0 1px var(--wine), 2px 2px 4px rgba(255,255,255,0.9);
}
.hero-sub {
  font-size: 1.35rem;
  font-style: italic;
  color: var(--ink);
  font-weight: 600;
  max-width: 480px;
  margin-bottom: 10px;
}
.hero-date {
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
  color: var(--wine);
  font-weight: 700;
  margin-top: 22px;
  padding: 12px 30px;
  border-top: 2px solid var(--rose);
  border-bottom: 2px solid var(--rose);
}
.scroll-cue { margin-top: 56px; font-family: 'Montserrat', sans-serif; font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--rose-deep); opacity: 0.75; }

/* ---------- Ribbon divider ---------- */
.ribbon-divider { display: flex; justify-content: center; padding: 16px 0 44px; background: transparent; }
.ribbon-divider svg { width: 120px; height: auto; }

/* ---------- Section Shared ---------- */
section { padding: 40px 24px; max-width: 760px; margin: 0 auto; text-align: center; scroll-margin-top: clamp(90px, 14vh, 160px); }
.section-title { font-size: clamp(2.2rem, 5vw, 3rem); color: var(--wine); margin-bottom: 8px; }
.section-lead { font-family: 'Montserrat', sans-serif; font-size: 0.75rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--rose-deep); margin-bottom: 15px; }

/* ---------- Details cards ---------- */
.details-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}
.detail-card {
  flex: 1 1 180px;
  background: var(--white);
  border: 1px solid var(--blush);
  border-radius: 4px;
  padding: 34px 20px;
  position: relative;
  box-sizing: border-box;
}
.detail-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 12px;
  background: var(--rose);
  clip-path: polygon(0 0, 100% 0, 85% 100%, 50% 70%, 15% 100%);
}
.detail-card h3 {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--rose-deep);
  margin-bottom: 12px;
}
.detail-card p {
  font-size: 1.3rem;
  color: var(--ink);
  margin: 0;
}
.detail-card span {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  color: var(--wine);
  margin-top: 6px;
}

/* ---------- Masonry / Scattered Polaroid Gallery ---------- */
.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 25px;
  padding: 15px 10px;
  margin-top: 20px;
}
.gallery-item {
  width: 200px;
  height: 240px;
  object-fit: cover;
  background: var(--white);
  padding: 10px 10px 28px 10px;
  border-radius: 4px;
  box-shadow: 0 10px 22px rgba(110, 59, 76, 0.15);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              box-shadow 0.3s ease,
              z-index 0.2s ease;
  position: relative;
  cursor: pointer;
}
.gallery-item:nth-child(1) { transform: rotate(-5deg) translateY(4px); }
.gallery-item:nth-child(2) { transform: rotate(3deg) translateY(-8px); }
.gallery-item:nth-child(3) { transform: rotate(-3deg) translateY(10px); }
.gallery-item:nth-child(4n) { transform: rotate(4deg) translateY(-4px); }
.gallery-item:hover {
  transform: rotate(0deg) scale(1.1) translateY(-10px) !important;
  z-index: 15;
  box-shadow: 0 20px 35px rgba(110, 59, 76, 0.28);
}
@media (max-width: 600px) {
  .gallery-grid { gap: 30px; }
  .gallery-item { width: 220px; height: 260px; }
}

/* ---------- Dress Code Color Palette ---------- */
.color-palette {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}
.color-swatch {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid var(--rose);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* ---------- Gift Ideas Section ---------- */
.gift-placeholder {
  margin-top: 20px;
  padding: 40px;
  border: 2px dashed var(--rose);
  border-radius: 8px;
  color: var(--rose-deep);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

/* ---------- Godparents ---------- */
.godparents-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px; margin-top: 30px; text-align: left; }
.godparent-group { background: var(--white); border: 1px solid var(--blush); border-radius: 4px; padding: 28px 26px; }
.godparent-group h3 { font-family: 'Alex Brush', cursive; font-size: 1.7rem; color: var(--rose-deep); margin-bottom: 10px; text-align: center; }
.godparent-group p { font-size: 1.05rem; line-height: 1.7; color: var(--ink); text-align: center; }

/* ---------- Footer ---------- */
footer { text-align: center; padding: 70px 24px 40px; }
.footer-bow { width: 52px; margin-bottom: 18px; opacity: 0.9; }
footer .script { font-size: 2rem; margin-bottom: 6px; }
footer p { font-family: 'Montserrat', sans-serif; font-size: 0.8rem; letter-spacing: 0.05em; color: var(--wine); font-weight: 600; }

@media (max-width: 520px) {
  .ribbon-corner { width: 120px; }
}

/* ================= ENVELOPE GATE ================= */
body.gate-active { overflow: hidden; height: 100vh; }

.envelope-gate {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 20% 20%, var(--blush) 0%, transparent 55%),
              radial-gradient(ellipse at 80% 75%, var(--blush) 0%, transparent 55%),
              var(--ivory);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.envelope-gate.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }

.gate-cloud {
  position: absolute;
  width: 160px;
  height: 50px;
  background: #ffffff;
  border-radius: 50px;
  filter: blur(12px);
  opacity: 0.65;
  z-index: 1;
}
.gate-cloud::before, .gate-cloud::after {
  content: ''; position: absolute; background: #ffffff; border-radius: 50%;
}
.gate-cloud::before { width: 70px; height: 70px; top: -30px; left: 20px; }
.gate-cloud::after { width: 90px; height: 90px; top: -45px; right: 25px; }

.gate-eyebrow {
  font-family: 'Mrs Saint Delafield', cursive;
  font-size: clamp(3.2rem, 9vw, 5rem);
  font-weight: 700;
  margin-bottom: 0px;
  position: relative;
  z-index: 3;
  color: var(--wine);
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.9), 2px 2px 4px rgba(139, 61, 86, 0.15);
}

@keyframes float-scene {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.envelope-scene {
  position: relative; width: 300px; height: 210px; z-index: 2;
  animation: float-scene 5s ease-in-out infinite;
}
.envelope-scene::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 160%; height: 160%;
  background: radial-gradient(circle, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 65%);
  z-index: -1;
  pointer-events: none;
  animation: pulse-glow 4s infinite alternate ease-in-out;
}
@keyframes pulse-glow {
  0% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.9); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.balloon-string { stroke: var(--rose-deep); stroke-width: 1.5; fill: none; opacity: 0.7; }
.envelope-btn {
  position: absolute; left: 50%; top: 36px; transform: translateX(-50%);
  width: 260px; height: 170px; background: none; border: none; padding: 0;
  cursor: pointer; perspective: 900px;
  transition: transform 0.3s ease;
}
.envelope-btn:hover {
  transform: translateX(-50%) scale(1.02);
}

.envelope { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.env-back {
  position: absolute; inset: 0; background: var(--rose); border-radius: 6px;
  box-shadow: 0 25px 45px rgba(110, 59, 76, 0.35);
}
.env-pocket-left { position: absolute; inset: 0; clip-path: polygon(0 0, 52% 48%, 0 100%); background: var(--rose-deep); opacity: 0.55; border-radius: 6px; }
.env-pocket-right { position: absolute; inset: 0; clip-path: polygon(100% 0, 48% 48%, 100% 100%); background: var(--rose-deep); opacity: 0.55; border-radius: 6px; }

.env-card {
  position: absolute; left: 8%; right: 8%; top: 6%; height: 80%; background: var(--white);
  border: 1px solid var(--blush); border-radius: 4px; transform: translateY(18%); opacity: 0;
  transition: transform 0.8s ease 0.5s, opacity 0.6s ease 0.5s;
  display: flex; align-items:center; justify-content:center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.env-card span { font-family: 'Alex Brush', cursive; font-size: 1.8rem; color: var(--wine); font-weight: 600; }
.envelope.open .env-card { transform: translateY(-34%); opacity: 1; }

.env-flap {
  position: absolute; top: 0; left: 0; right: 0; height: 52%;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(160deg, var(--rose) 0%, var(--rose-deep) 100%);
  transform-origin: top center; transition: transform 0.9s cubic-bezier(.4, 0, .2, 1);
  backface-visibility: hidden; z-index: 3; border-radius: 6px 6px 0 0;
  filter: drop-shadow(0px 3px 4px rgba(0,0,0,0.15));
}
.envelope.open .env-flap { transform: rotateX(180deg); z-index: 1; filter: none; }

.env-seal {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--rose-deep), var(--wine));
  box-shadow: 0 5px 10px rgba(0,0,0,0.3), inset 0 2px 4px rgba(255,255,255,0.4);
  border: 1px solid #4a1024;
  display: flex; align-items: center; justify-content: center; z-index: 4;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.env-seal svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5)); }
.envelope.open .env-seal { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }

@keyframes sway {
  0% { transform: rotate(-3deg); }
  100% { transform: rotate(4deg); }
}
.gate-ribbon {
  position: absolute;
  right: -100px;
  bottom: -50px;
  width: 115px;
  animation: float-scene 4s ease-in-out infinite;
}
.gate-balloons {
  position: absolute;
  left: -90px;
  top: -70px;
  width: 135px;
  transform-origin: bottom right;
  animation: sway 4s ease-in-out infinite alternate;
  z-index: 1;
}
.gate-pompoms {
  position: absolute;
  left: -65px;
  bottom: -45px;
  width: 100px;
  opacity: 0.9;
}

.gate-sparkle { position: absolute; color: var(--gold); z-index: 2; animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: 0.25; transform: scale(0.8); } 55% { opacity: 1; transform: scale(1.15); } }

@keyframes pulse-opacity {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; text-shadow: 0 0 8px rgba(139, 61, 86, 0.2); }
}
.gate-caption {
  font-family: 'Montserrat', sans-serif; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--rose-deep);
  margin-top: 26px; text-decoration: underline; text-underline-offset: 5px;
  position: relative; z-index: 2;
  animation: pulse-opacity 2.5s infinite ease-in-out;
}

.main-content.hidden { display: none; }

/* ---------- Fluffy Background Clouds ---------- */
.css-cloud {
  position: absolute;
  width: 160px;
  height: 50px;
  background: #ffffff;
  border-radius: 50px;
  filter: blur(12px);
  opacity: 0.7;
  z-index: 1;
}
.css-cloud::before, .css-cloud::after {
  content: '';
  position: absolute;
  background: #ffffff;
  border-radius: 50%;
}
.css-cloud::before {
  width: 70px; height: 70px;
  top: -30px; left: 20px;
}
.css-cloud::after {
  width: 90px; height: 90px;
  top: -45px; right: 25px;
}