/* =============================================================================
   Brown Flower — Floral cokelat paling bersih — ornamen tipis, countdown tanpa kotak (garis saja), bingkai ganda.
   Palet: aksen #6b4a2f di atas #fbf8f3; tinta #2c2118. Tipografi: Cormorant Garamond +
   Figtree + Great Vibes (script judul/nama).
   CSS ini SUMBER KEBENARAN; `scripts/build-theme-css.mjs` menyalinnya ke
   `public/themes/brown-flower.{hash}.css`. JANGAN di-import dari index.tsx
   (DECISIONS #31) — ia dikirim lewat <ThemeStyles slug="brown-flower" />.
============================================================================= */

.bf {
  --bf-acc: #6b4a2f;
  --bf-acc-text: #5a3d26;
  --bf-on-acc: #ffffff;
  --bf-paper: #fbf8f3;
  --bf-paper-2: #f3ede2;
  --bf-card: #fffdf9;
  --bf-ink: #2c2118;
  --bf-muted: rgba(44, 33, 24, 0.72);
  --bf-hairline: rgba(107, 74, 47, 0.22);
  --bf-disp-stack: var(--bf-disp), Georgia, "Times New Roman", serif;
  --bf-body-stack: var(--bf-body), system-ui, sans-serif;
  --bf-script-stack: var(--bf-script), "Great Vibes", cursive;
  background: var(--bf-paper);
  color: var(--bf-ink);
  font-family: var(--bf-body-stack);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
.bf *,
.bf *::before,
.bf *::after {
  box-sizing: border-box;
}
.bf ::selection {
  background: var(--bf-acc);
  color: var(--bf-on-acc);
}

.bf-stage {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  border-inline: 1px solid var(--bf-hairline);
  background-color: var(--bf-paper);
}

.bf-section {
  position: relative;
  padding: 56px 24px;
  border-top: 1px solid var(--bf-hairline);
}
.bf-section:first-child {
  border-top: 0;
}

.bf-eyebrow {
  font-family: var(--bf-disp-stack);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--bf-acc-text);
  text-align: center;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.bf-eyebrow::before,
.bf-eyebrow::after {
  content: "❀";
  font-size: 14px;
  color: var(--bf-acc);
  letter-spacing: 0;
}

.bf-title {
  font-family: var(--bf-script-stack);
  font-size: 34px;
  line-height: 1.2;
  text-align: center;
  margin: 8px 0 0;
  color: var(--bf-ink);
}

/* Kartu entri (mempelai / acara / kisah / amplop) — satu kartu per entri. */
.bf-section > div:has(> .bf-title) {
  background: var(--bf-card);
  border: 1px solid var(--bf-hairline);
  border-radius: 14px;
  padding: 28px 20px;
  margin-top: 16px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(107, 74, 47, 0.06);
}
.bf-section > div:has(> .bf-title):first-of-type {
  margin-top: 0;
}

.bf-foto {
  width: min(62%, 240px);
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  overflow: hidden;
  background: color-mix(in srgb, var(--bf-acc) 18%, transparent);
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--bf-acc);
  outline: 1px solid var(--bf-acc);
  outline-offset: 4px;
}
.bf-foto span {
  font-family: var(--bf-disp-stack);
  font-size: 56px;
  color: var(--bf-acc-text);
}

/* Countdown */
.bf .countdown {
  display: flex;
  gap: 0;
  margin-top: 28px;
}
.bf .count-box {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 16px 4px 14px;
  background: transparent;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--bf-hairline);
  padding: 18px 4px 16px;
}
.bf .count-num {
  font-family: var(--bf-disp-stack);
  font-size: clamp(26px, 8vw, 36px);
  font-variant-numeric: tabular-nums;
  display: block;
  color: var(--bf-ink);
}
.bf .count-label {
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--bf-muted);
  margin-top: 6px;
  display: block;
}
.bf .countdown-done {
  font-family: var(--bf-disp-stack);
  font-size: 22px;
  text-align: center;
  margin-top: 28px;
  color: var(--bf-ink);
}

/* Cover — gerbang "Buka Undangan" (mekanika CoverGate: .is-js + .is-open). */
.bf-cover {
  display: none;
}
.bf.is-js .bf-cover {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--bf-ink);
  background: linear-gradient(180deg, #fbf8f3, #f7f1e6);
  transition: transform 1s cubic-bezier(0.7, 0, 0.3, 1);
}
.bf.is-js.is-open .bf-cover {
  transform: translateY(-100%);
}
.bf-cover__inner {
  position: relative;
  text-align: center;
  padding: 24px;
  max-width: 430px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--bf-acc);
  outline: 1px solid var(--bf-acc);
  outline-offset: 6px;
  border-radius: 4px;
  padding: 40px 20px 30px;
}
.bf-cover__deco::before {
  content: "\2740";
  font-size: 26px;
  color: var(--bf-acc);
  opacity: 0.7;
}
.bf-cover__kicker {
  font-family: var(--bf-disp-stack);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bf-acc-text);
  margin: 0 0 14px;
}
.bf-cover__name {
  font-family: var(--bf-script-stack);
  font-size: 46px;
  line-height: 1.15;
  color: var(--bf-acc-text);
  margin: 0;
}

.bf-guest {
  margin-top: 22px;
  font-size: 13px;
  color: var(--bf-muted);
}
.bf-guest small {
  display: block;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 11px;
  margin-bottom: 4px;
}
.bf-guest strong {
  display: block;
  font-size: 15px;
}
.bf-open {
  margin-top: 26px;
  font-family: var(--bf-disp-stack);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--bf-acc-text);
  background: transparent;
  border: 1px solid var(--bf-acc);
  border-radius: 999px;
  padding: 14px 30px;
}
.bf-open:hover {
  opacity: 0.88;
}

/* Tombol musik */
.bf-music {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 55;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--bf-acc);
  background: var(--bf-paper);
  color: var(--bf-acc-text);
  display: none;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.bf.is-open .bf-music {
  display: grid;
}

/* Hormati prefers-reduced-motion: konten tetap lengkap tanpa animasi. */
@media (prefers-reduced-motion: reduce) {
  .bf * {
    animation: none !important;
    transition: none !important;
  }
  .bf.is-js .bf-cover {
    transition: none;
  }
}

/* Elemen melayang 3D: Bunga blush pucat + daun eucalyptus jatuh pelan — jatuh + bergoyang (SVG, CSS-only).
   `.bf-drift` = di dalam sampul (absolute, ikut wipe); `--page` = lapisan
   tipis fixed di seluruh undangan (z-40, di bawah sampul z-50, svg lebih
   redup). Hanya transform/opacity yang dianimasikan. `--dz` per item =
   translateZ (-80px s.d. 80px) di dalam container ber-perspective. */
.bf-drift {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  perspective: 800px;
}
.bf-drift--page {
  position: fixed;
  z-index: 40;
}
.bf-drift__item {
  position: absolute;
  top: 0;
  display: block;
  animation: bf-drift-fall linear infinite;
  will-change: transform, opacity;
}
.bf-drift__item svg {
  display: block;
  animation: bf-drift-sway 2.2s ease-in-out infinite alternate;
  filter: drop-shadow(0 2px 3px rgb(107 74 47 / 0.3));
}
.bf-drift__item:nth-child(even) svg {
  animation-duration: 2.8s;
}
.bf-drift--page .bf-drift__item svg {
  opacity: 0.55;
}
@keyframes bf-drift-fall {
  0% {
    transform: translate3d(0, -12vh, var(--dz, 0px)) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.9;
  }
  85% {
    opacity: 0.78;
  }
  100% {
    transform: translate3d(0, 112vh, var(--dz, 0px)) rotate(300deg);
    opacity: 0;
  }
}
@keyframes bf-drift-sway {
  from {
    transform: translateX(-16px) rotate(-14deg);
  }
  to {
    transform: translateX(16px) rotate(14deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .bf-drift {
    display: none;
  }
}
/* Kedalaman 3D sampul: container ber-perspective, isi preserve-3d, tiap
   lapisan teks/tombol di translateZ berbeda — nama paling dekat. */
.bf.is-js .bf-cover {
  perspective: 900px;
}
.bf-cover-inner {
  transform-style: preserve-3d;
}
.bf-cover__name {
  transform: translateZ(28px);
}
.bf-cover__kicker {
  transform: translateZ(14px);
}
.bf-guest {
  transform: translateZ(20px);
}
.bf-open {
  transform: translateZ(18px);
}

/* === Motion Bali (dedup+motion 12 Nov 2026): reveal-on-scroll, latar, panjang === */
/* Reveal: konten section muncul saat di-scroll (zoom-in halus ala referensi).
   `.is-js` hanya ada setelah JS jalan -> tanpa JS konten tetap terlihat. */
.bf.is-js .reveal {
  opacity: 0;
  transform: translateY(30px) scale(0.965);
  transition:
    opacity 0.9s ease,
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.bf.is-js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Foto & kartu di dalam section: muncul menyusul (stagger) setelah section. */
.bf.is-js .reveal img,
.bf.is-js .reveal .bf-card,
.bf.is-js .reveal .bf-foto {
  opacity: 0;
  transform: translateY(18px) scale(0.97);
  transition:
    opacity 0.9s ease 0.18s,
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.18s;
}
.bf.is-js .reveal.is-visible img,
.bf.is-js .reveal.is-visible .bf-card,
.bf.is-js .reveal.is-visible .bf-foto {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .bf.is-js .reveal,
  .bf.is-js .reveal img,
  .bf.is-js .reveal .bf-card,
  .bf.is-js .reveal .bf-foto {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
/* Latar berlapis tiap section: semburat aksen di atas + gradien kertas ke aksen. */
.bf-section {
  background:
    radial-gradient(
      120% 55% at 50% 0%,
      color-mix(in srgb, var(--bf-acc) 12%, transparent),
      transparent 62%
    ),
    linear-gradient(
      180deg,
      var(--bf-paper),
      color-mix(in srgb, var(--bf-paper) 84%, var(--bf-acc))
    );
  padding: clamp(84px, 14vw, 128px) 20px;
}
/* Preview lebih panjang: foto mempelai & galeri lebih besar. */
.bf-foto {
  width: min(82%, 320px);
}
.bf-section > img {
  border-radius: 16px;
  margin-bottom: 18px;
}

/* === Motion Bali v2 (12 Nov 2026): ritme latar selang-seling + bingkai === */
/* Section genap: latar aksen pekat + pola wajik samar (ritme terang-gelap). */
div[data-section-id]:nth-child(even) .bf-section {
  background:
    radial-gradient(
      110% 50% at 50% 0%,
      color-mix(in srgb, var(--bf-acc) 30%, transparent),
      transparent 65%
    ),
    repeating-linear-gradient(
      45deg,
      color-mix(in srgb, var(--bf-acc) 4%, transparent) 0 2px,
      transparent 2px 26px
    ),
    repeating-linear-gradient(
      -45deg,
      color-mix(in srgb, var(--bf-acc) 4%, transparent) 0 2px,
      transparent 2px 26px
    ),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bf-acc) 28%, var(--bf-paper)),
      color-mix(in srgb, var(--bf-acc) 20%, var(--bf-paper))
    );
}
/* Bingkai ornamen ganda di tiap section (kartu berbingkai emas/aksen). */
.bf-section {
  border: 2px solid color-mix(in srgb, var(--bf-acc) 60%, transparent);
  outline: 1px solid color-mix(in srgb, var(--bf-acc) 40%, transparent);
  outline-offset: 6px;
  border-radius: 24px;
  margin: 20px 14px;
}
/* Foto mempelai bentuk arch (lengkung atas) + bingkai emas + bayangan. */
.bf-foto {
  border-radius: 999px 999px 18px 18px;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--bf-acc) 45%, transparent);
}
/* Drift lebih kentara: opacity naik (page variant). */
.bf-drift--page .bf-drift__item svg {
  opacity: 0.4;
}

/* === Tombol Lihat Lokasi (12 Nov 2026): lengkapi data preview === */
.bf-maps {
  display: inline-block;
  margin-top: 10px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--bf-acc);
  color: var(--bf-on-acc, #fff);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}
