/* =============================================================================
   Basic Palembang — Adat Palembang — songket emas di atas mauve, foto oktagon, basmalah Arab, countdown panel ungu.
   Palet: aksen #c9a227 di atas #f6eff4; tinta #3a2436. Tipografi: Cinzel +
   Plus Jakarta Sans + Great Vibes (script judul/nama) + Amiri Arabic (basmalah).
   CSS ini SUMBER KEBENARAN; `scripts/build-theme-css.mjs` menyalinnya ke
   `public/themes/basic-palembang.{hash}.css`. JANGAN di-import dari index.tsx
   (DECISIONS #31) — ia dikirim lewat <ThemeStyles slug="basic-palembang" />.
============================================================================= */

.bp {
  --bp-acc: #c9a227;
  --bp-acc-text: #8a6d1a;
  --bp-on-acc: #ffffff;
  --bp-paper: #f6eff4;
  --bp-paper-2: #eadfe9;
  --bp-card: #fff9fd;
  --bp-ink: #3a2436;
  --bp-muted: rgba(58, 36, 54, 0.72);
  --bp-hairline: rgba(142, 107, 138, 0.35);
  --bp-disp-stack: var(--bp-disp), "Times New Roman", serif;
  --bp-body-stack: var(--bp-body), system-ui, sans-serif;
  --bp-script-stack: var(--bp-script), "Great Vibes", cursive;
  --bp-arab-stack: var(--bp-arab), serif;
  background: var(--bp-paper);
  color: var(--bp-ink);
  font-family: var(--bp-body-stack);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
.bp *,
.bp *::before,
.bp *::after {
  box-sizing: border-box;
}
.bp ::selection {
  background: var(--bp-acc);
  color: var(--bp-on-acc);
}

.bp-stage {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  border-inline: 1px solid var(--bp-hairline);
  background-color: var(--bp-paper);
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32'><path d='M16 4 L28 16 L16 28 L4 16 Z' fill='none' stroke='%23c9a227' stroke-opacity='0.10'/><circle cx='16' cy='16' r='1.6' fill='%23c9a227' fill-opacity='0.10'/></svg>");
  background-size: 32px 32px;
}

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

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

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

/* Kartu entri (mempelai / acara / kisah / amplop) — satu kartu per entri. */
.bp-section > div:has(> .bp-title) {
  background: var(--bp-card);
  border: 1px solid var(--bp-hairline);
  border-radius: 14px;
  padding: 28px 20px;
  margin-top: 16px;
  text-align: center;
  border-top: 3px solid var(--bp-acc);
}
.bp-section > div:has(> .bp-title):first-of-type {
  margin-top: 0;
}

.bp-foto {
  width: min(62%, 240px);
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  overflow: hidden;
  background: color-mix(in srgb, var(--bp-acc) 18%, transparent);
  display: grid;
  place-items: center;
  border-radius: 0;
  clip-path: polygon(
    30% 0,
    70% 0,
    100% 30%,
    100% 70%,
    70% 100%,
    30% 100%,
    0 70%,
    0 30%
  );
}
.bp-foto span {
  font-family: var(--bp-disp-stack);
  font-size: 56px;
  color: var(--bp-acc-text);
}

/* Countdown */
.bp .countdown {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}
.bp .count-box {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 16px 4px 14px;
  background: #8e6b8a;
  border: 1px solid #8e6b8a;
  border-radius: 14px;
}
.bp .count-num {
  font-family: var(--bp-disp-stack);
  font-size: clamp(26px, 8vw, 36px);
  font-variant-numeric: tabular-nums;
  display: block;
  color: #f6eff4;
}
.bp .count-label {
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(246, 239, 244, 0.75);
  margin-top: 6px;
  display: block;
}
.bp .countdown-done {
  font-family: var(--bp-disp-stack);
  font-size: 22px;
  text-align: center;
  margin-top: 28px;
  color: var(--bp-ink);
}

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

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

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

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

/* Elemen melayang 3D: Wajik songket emas + kelopak mawar naik berkilau — naik + berkilau (SVG, CSS-only).
   `.bp-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. */
.bp-drift {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  perspective: 800px;
}
.bp-drift--page {
  position: fixed;
  z-index: 40;
}
.bp-drift__item {
  position: absolute;
  top: 0;
  display: block;
  animation: bp-drift-fall linear infinite;
  will-change: transform, opacity;
}
.bp-drift__item svg {
  display: block;
  animation: bp-drift-sway 2.2s ease-in-out infinite alternate;
  filter: drop-shadow(0 2px 3px rgb(120 90 60 / 0.35));
}
.bp-drift__item:nth-child(even) svg {
  animation-duration: 2.8s;
}
.bp-drift--page .bp-drift__item svg {
  opacity: 0.55;
}
@keyframes bp-drift-fall {
  0% {
    transform: translate3d(0, 112vh, var(--dz, 0px)) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.9;
  }
  85% {
    opacity: 0.78;
  }
  100% {
    transform: translate3d(0, -12vh, var(--dz, 0px)) rotate(-300deg);
    opacity: 0;
  }
}
@keyframes bp-drift-sway {
  0% {
    transform: translateX(-10px) rotate(-8deg) scale(0.85);
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(10px) rotate(8deg) scale(1.08);
    opacity: 0.9;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bp-drift {
    display: none;
  }
}
/* Kedalaman 3D sampul: container ber-perspective, isi preserve-3d, tiap
   lapisan teks/tombol di translateZ berbeda — nama paling dekat. */
.bp.is-js .bp-cover {
  perspective: 900px;
}
.bp-cover-inner {
  transform-style: preserve-3d;
}
.bp-cover__name {
  transform: translateZ(28px);
}
.bp-cover__kicker {
  transform: translateZ(14px);
}
.bp-guest {
  transform: translateZ(20px);
}
.bp-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. */
.bp.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;
}
.bp.is-js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Foto & kartu di dalam section: muncul menyusul (stagger) setelah section. */
.bp.is-js .reveal img,
.bp.is-js .reveal .bp-card,
.bp.is-js .reveal .bp-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;
}
.bp.is-js .reveal.is-visible img,
.bp.is-js .reveal.is-visible .bp-card,
.bp.is-js .reveal.is-visible .bp-foto {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .bp.is-js .reveal,
  .bp.is-js .reveal img,
  .bp.is-js .reveal .bp-card,
  .bp.is-js .reveal .bp-foto {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
/* Latar berlapis tiap section: semburat aksen di atas + gradien kertas ke aksen. */
.bp-section {
  background:
    radial-gradient(
      120% 55% at 50% 0%,
      color-mix(in srgb, var(--bp-acc) 12%, transparent),
      transparent 62%
    ),
    linear-gradient(
      180deg,
      var(--bp-paper),
      color-mix(in srgb, var(--bp-paper) 84%, var(--bp-acc))
    );
  padding: clamp(84px, 14vw, 128px) 20px;
}
/* Preview lebih panjang: foto mempelai & galeri lebih besar. */
.bp-foto {
  width: min(82%, 320px);
}
.bp-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) .bp-section {
  background:
    radial-gradient(
      110% 50% at 50% 0%,
      color-mix(in srgb, var(--bp-acc) 30%, transparent),
      transparent 65%
    ),
    repeating-linear-gradient(
      45deg,
      color-mix(in srgb, var(--bp-acc) 4%, transparent) 0 2px,
      transparent 2px 26px
    ),
    repeating-linear-gradient(
      -45deg,
      color-mix(in srgb, var(--bp-acc) 4%, transparent) 0 2px,
      transparent 2px 26px
    ),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--bp-acc) 28%, var(--bp-paper)),
      color-mix(in srgb, var(--bp-acc) 20%, var(--bp-paper))
    );
}
/* Bingkai ornamen ganda di tiap section (kartu berbingkai emas/aksen). */
.bp-section {
  border: 2px solid color-mix(in srgb, var(--bp-acc) 60%, transparent);
  outline: 1px solid color-mix(in srgb, var(--bp-acc) 40%, transparent);
  outline-offset: 6px;
  border-radius: 24px;
  margin: 20px 14px;
}
/* Foto mempelai bentuk arch (lengkung atas) + bingkai emas + bayangan. */
.bp-foto {
  border-radius: 999px 999px 18px 18px;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--bp-acc) 45%, transparent);
}
/* Drift lebih kentara: opacity naik (page variant). */
.bp-drift--page .bp-drift__item svg {
  opacity: 0.4;
}

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