/*
    Traditional Bali - Pulau Dewata Edition
    A vibrant and spiritual design system inspired by Balinese culture.
*/

:root {
    --primary: #5c2a9d; /* Deep Spiritual Purple */
    --secondary: #fff9e6; /* Sand Beige */
    --accent: #ffcc00; /* Balinese Gold */
    --text: #2d3436;
    --muted: #636e72;
    --white: #ffffff;
    --font-heading: 'Kalam', cursive; /* Whimsical yet traditional */
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Outfit', sans-serif;
    --transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-sans); background-color: var(--secondary); color: var(--text); line-height: 1.7; overflow-x: hidden; }
body.no-scroll { overflow: hidden; height: 100vh; }

/* --- Pattern Background --- */
.bali-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80"><path d="M40 0 L80 40 L40 80 L0 40 Z" fill="none" stroke="%23ffcc00" stroke-width="0.5" opacity="0.1"/></svg>');
    opacity: 0.1;
}

/* --- Kamboja Decorations --- */
.kamboja {
    position: fixed; width: 100px; height: 100px; z-index: 500; pointer-events: none; opacity: 0.3;
}
.k-tl { top: 20px; left: 20px; }
.k-tr { top: 20px; right: 20px; transform: rotate(90deg); }
.k-bl { bottom: 20px; left: 20px; transform: rotate(-90deg); }
.k-br { bottom: 20px; right: 20px; transform: rotate(180deg); }

/* --- Intro Screen --- */
.intro-bali {
    position: fixed; top: 0; left: 0; width: 100%; height: 100dvh;
    background: linear-gradient(135deg, var(--primary) 0%, #431f75 100%); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    transition: transform 1.5s cubic-bezier(0.8, 0, 0.2, 1);
}
.intro-bali.opened { transform: scale(1.5); opacity: 0; pointer-events: none; }
.intro-content { text-align: center; color: white; padding: 2rem; }
.intro-names { font-family: var(--font-heading); font-size: clamp(3.5rem, 12vw, 6rem); color: var(--accent); margin-bottom: 3rem; text-shadow: 0 10px 20px rgba(0,0,0,0.3); }

/* --- Navigation --- */
nav {
    position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px);
    z-index: 1000; transition: var(--transition);
}
nav.visible { transform: translateX(-50%) translateY(0); }
.nav-inner {
    background: white; padding: 0.8rem 1.5rem; border-radius: 50px; display: flex; gap: 1.5rem; box-shadow: 0 10px 30px rgba(92, 42, 157, 0.2);
}
nav a { color: rgba(92, 42, 157, 0.2); font-size: 1.2rem; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
nav a.active { color: var(--primary); transform: scale(1.2); }

/* --- Sections --- */
section { padding: 6rem 1.5rem; position: relative; }
@media (min-width: 992px) { section { padding: 10rem 2rem; } }
.container { max-width: 1000px; margin: 0 auto; text-align: center; }
.section-title h2 { font-family: var(--font-heading); font-size: 3.5rem; color: var(--primary); margin-bottom: 1.5rem; }

/* --- Hero --- */
.hero { height: 100vh; display: flex; align-items: center; justify-content: center; }
.hero-box {
    background: white; padding: 5rem 3rem; border-radius: 40% 60% 70% 30% / 40% 50% 60% 70%;
    box-shadow: 30px 30px 0 var(--accent); position: relative; max-width: 500px;
}
.hero-names { font-family: var(--font-heading); font-size: clamp(3rem, 10vw, 5rem); color: var(--primary); line-height: 1.2; }

/* --- Countdown --- */
.countdown-bali { display: flex; justify-content: center; gap: 2rem; margin-bottom: 6rem; }
.time-box span { display: block; font-family: var(--font-heading); font-size: 3.5rem; color: var(--primary); line-height: 1; }
.time-box label { font-size: 0.7rem; text-transform: uppercase; color: var(--muted); letter-spacing: 0.2rem; }

/* --- RSVP --- */
.bali-form { background: white; padding: 4rem; border-radius: 40px; box-shadow: 0 20px 50px rgba(92, 42, 157, 0.1); text-align: left; }
.bali-form label { display: block; font-size: 0.8rem; text-transform: uppercase; color: var(--primary); margin-bottom: 1rem; font-weight: 700; }
.bali-form input, .bali-form textarea {
    width: 100%; padding: 1.2rem; background: var(--secondary); border: none; border-radius: 15px;
    font-family: var(--font-sans); font-size: 1rem; margin-bottom: 2.5rem;
}
.btn-bali {
    width: 100%; padding: 1.5rem; background: var(--primary); color: white; border: none;
    border-radius: 50px; font-family: var(--font-heading); font-size: 1.4rem; cursor: pointer; transition: var(--transition);
}
.btn-bali:hover { background: var(--accent); color: var(--primary); }

/* ── Responsive Fix ── */
@media (max-width: 600px) {
  /* Countdown */
  .countdown-bali {
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 3rem;
  }
  .time-box {
    flex: 1 1 calc(50% - 0.8rem);
    min-width: 60px;
  }
  .time-box span {
    font-size: clamp(1.8rem, 8vw, 3.5rem) !important;
  }

  /* Event grid - inline styles in HTML use auto-fit minmax(320px) */
  /* Override via section targeting */
  #event .container > div[style*="grid"] {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* RSVP form */
  .bali-form {
    padding: 2rem;
    border-radius: 20px;
  }

  /* Footer */
  #rsvp + footer,
  footer {
    padding: 5rem 1.5rem !important;
  }
  footer h2 {
    font-size: clamp(2rem, 8vw, 3.5rem) !important;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  footer p[style*="italic"] {
    font-size: clamp(0.9rem, 3.5vw, 1.1rem) !important;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Section padding */
  section {
    padding: 4rem 1.5rem;
  }

  /* Couple flex */
  #couple .container > div[style*="flex"] {
    gap: 2rem !important;
  }
  #couple .container > div[style*="flex"] > div[style*="min-width"] {
    min-width: unset !important;
    width: 100% !important;
  }
}
