@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Lora:wght@400;500;600&family=Great+Vibes&display=swap');

:root {
  --primary: #576B53; /* sage green */
  --primary-light: #dbe6d7;
  --text-dark: #3e513a;
  --text-light: #697c64;
  --bg-color: #faf8f5;
  --white: #ffffff;
  --nav-height: 65px;
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Lora', serif;
  --font-script: 'Great Vibes', cursive;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%; height: 100dvh;
  overflow: hidden; /* No global scroll */
  background: var(--bg-color);
  color: var(--text-dark);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Background Decorations */
.bg-decoration {
  position: fixed; inset: 0; z-index: 2000;
  pointer-events: none; overflow: hidden;
  background: transparent;
  opacity: 1; /* Adjust opacity if needed */
}
.bg-decoration .blob { display: none; } /* Hide old blobs */

/* Butterfly Animation */
.butterfly {
  position: absolute;
  width: 40px; height: 40px;
  animation: flutter 6s ease-in-out infinite;
  opacity: 0.8;
}
.butterfly svg { width: 100%; height: 100%; fill: var(--primary); }
.butterfly-1 { top: 15%; right: 10%; }
.butterfly-2 { bottom: 25%; left: 5%; animation-duration: 8s; transform: scale(0.7) scaleX(-1); }

/* Flower Animation */
.flower-corner {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
  max-width: 50%;
  max-height: 50vh;
  object-fit: contain;
}
.flower-tl { top: -10px; left: -10px; transform-origin: top left; animation: sway 5s ease-in-out infinite alternate; }
.flower-tr { top: -10px; right: -10px; transform-origin: top right; animation: sway 6s ease-in-out infinite alternate-reverse; }
.flower-left { top: 35vh; left: -20px; height: 50vh; max-width: 35%; transform-origin: left center; animation: sway 7s ease-in-out infinite alternate; }
.flower-right { top: 35vh; right: -20px; height: 50vh; max-width: 35%; transform-origin: right center; animation: sway 8s ease-in-out infinite alternate-reverse; }
.flower-bottom { bottom: -10px; left: -15%; width: 130%; max-width: none; height: auto; animation: wave-bottom 7s ease-in-out infinite alternate; z-index: 2; transform-origin: bottom center; }

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(20px, 30px) scale(1.1); }
}
@keyframes flutter {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-10px, -15px) rotate(-10deg); }
  50% { transform: translate(5px, -20px) rotate(5deg); }
  75% { transform: translate(15px, -10px) rotate(15deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes sway {
  0% { transform: rotate(-5deg); }
  100% { transform: rotate(5deg); }
}
@keyframes wave-bottom {
  0% { transform: translateX(-1%) rotate(-1deg); }
  100% { transform: translateX(1%) rotate(1deg); }
}

/* App Container */
.app-container {
  position: relative;
  width: 100%; height: 100%;
  max-width: 480px; /* Mobile constraint */
  margin: 0 auto;
  background: url('img/bg-floral.webp') center center no-repeat;
  background-size: cover;
  box-shadow: 0 0 30px rgba(0,0,0,0.05);
  overflow: hidden;
  z-index: 1;
}

/* Pages / Sections */
.page-section {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: var(--nav-height);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 30px 20px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 1;
}
.page-section.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  z-index: 10;
}

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-heading); margin: 0 0 15px; color: var(--text-dark); line-height: 1.2; }
p { margin: 0 0 15px; line-height: 1.6; color: var(--text-light); }
.text-center { text-align: center; }

/* Bottom Navbar */
.bottom-nav {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 9999;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  transition: all 0.3s ease;
  width: 20%;
  height: 100%;
  cursor: pointer;
}
.nav-item svg {
  width: 20px; height: 20px;
  margin-bottom: 4px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all 0.3s ease;
}
.nav-item.active {
  color: var(--primary);
}
.nav-item.active svg {
  transform: translateY(-3px);
  stroke-width: 2.5;
}

/* Card Styles for Content */
.card {
  position: relative;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(92,138,185,0.08);
  text-align: center;
  overflow: hidden;
  opacity: 0; /* For animation */
}
.page-section.active > .card:nth-of-type(odd),
.page-section.active .timeline-item:nth-child(odd) .card {
  animation: slideInLeft 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.2s;
}
.page-section.active > .card:nth-of-type(even),
.page-section.active .timeline-item:nth-child(even) .card {
  animation: slideInRight 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.4s;
}
@keyframes slideInLeft {
  0% { opacity: 0; transform: translateX(-30px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes slideInRight {
  0% { opacity: 0; transform: translateX(30px); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes fadeUpText {
  0% { opacity: 0; transform: translateY(15px); }
  100% { opacity: 1; transform: translateY(0); }
}
.page-section.active h2 {
  opacity: 0;
  animation: fadeUpText 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.3s;
}
.page-section.active p:not(.animate-words) {
  opacity: 0;
  animation: fadeUpText 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.5s;
}
.page-section.active .btn {
  opacity: 0;
  animation: fadeUpText 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: 0.7s;
}
/* Card decorations removed for floral mix as we use screen borders */
.card > * {
  position: relative;
  z-index: 1;
}

.mempelai-img {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--white);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  margin-bottom: 15px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  background: var(--primary); color: var(--white);
  border: none; border-radius: 30px;
  padding: 12px 24px;
  font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: var(--font-body);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(92,138,185,0.3);
}

/* Envelope Button */
.btn-envelope {
  position: relative;
  border-radius: 6px;
  padding: 14px 28px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(92,138,185,0.4);
}
.btn-envelope::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: rgba(255, 255, 255, 0.15);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
  transition: background 0.3s;
}
.btn-envelope:hover::before {
  background: rgba(255, 255, 255, 0.25);
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.gallery-grid img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid var(--white);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 3px;
  background: var(--primary-light);
}

/* Form Styles */
.form-group { margin-bottom: 15px; text-align: left; }
.form-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; }
.form-control {
  width: 100%; padding: 12px 16px;
  border: 1px solid #e1e8f0; border-radius: 12px;
  font-family: var(--font-body); font-size: 14px;
  background: rgba(255,255,255,0.9);
  outline: none; transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--primary); }

/* Open Screen (Front Cover) overlay before entering app */
.intro-overlay {
  position: absolute; inset: 0;
  background: transparent;
  z-index: 1000;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 30px;
  text-align: center;
  transition: opacity 0.8s ease 0.6s, visibility 0.8s ease 0.6s;
}

/* Curtain Panels */
.intro-overlay::before,
.intro-overlay::after {
  content: "";
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: var(--bg-color) url('img/bg-floral.webp') center center no-repeat;
  background-size: 200% 100%;
  z-index: -1;
  transition: transform 1.5s cubic-bezier(0.645, 0.045, 0.355, 1);
}
.intro-overlay::before {
  left: 0;
  background-position: left center;
  border-right: 1px solid rgba(0,0,0,0.05);
}
.intro-overlay::after {
  right: 0;
  background-position: right center;
  border-left: 1px solid rgba(0,0,0,0.05);
}

.intro-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.intro-overlay.hidden::before { transform: translateX(-100%); }
.intro-overlay.hidden::after { transform: translateX(100%); }

.intro-overlay .card {
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.intro-overlay.hidden .card {
  opacity: 0;
  transform: scale(1.1) translateY(-20px);
}
.intro-names { font-size: 3rem; color: var(--primary); margin: 20px 0; }
.intro-to { font-size: 14px; margin-bottom: 30px; }

/* Custom Scrollbar for inner sections */
.page-section::-webkit-scrollbar { width: 4px; }
.page-section::-webkit-scrollbar-track { background: transparent; }
.page-section::-webkit-scrollbar-thumb { background: rgba(92,138,185,0.3); border-radius: 4px; }

@keyframes fall {
    0% { transform: translateY(-50px) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(110vh) translateX(80px); opacity: 0; }
}
@keyframes spin {
    0% { transform: rotate3d(1, 1, 0.5, 0deg) rotateZ(-30deg); }
    100% { transform: rotate3d(1, 1, 0.5, 180deg) rotateZ(30deg); }
}
.falling-petal {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.vintage-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 40px auto 20px;
  width: 80%;
  max-width: 250px;
}
.vintage-divider::before,
.vintage-divider::after {
  content: "";
  flex-grow: 1;
  height: 1px;
  background: var(--primary);
  opacity: 0.5;
}
.vintage-divider svg {
  width: 14px;
  height: 14px;
  fill: var(--primary);
  margin: 0 15px;
  opacity: 0.8;
}

.gold-text {
  background: linear-gradient(135deg, #a67c00 0%, #bf953f 25%, #fcf6ba 50%, #b38728 75%, #fdffcc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
  display: inline-block;
}

/* Paper Texture Overlay */
