/* =============================================================================
   Cypress & Linen — tier Premium (Wedding26).
   Konsep: Krem linen + hijau zaitun gelap; ilustrasi cat air vila Tuscany + pohon cemara; foto oval; section hijau gelap untuk detail acara; pastoral tenang.
   Palet: aksen #4a5240, kertas #f3efe2, tinta #33382c.
   Tipografi: Cormorant Garamond + Figtree.
   CSS ini SUMBER KEBENARAN; `scripts/build-theme-css.mjs` menyalinnya ke
   `public/themes/cypress-linen.{hash}.css`. JANGAN di-import dari index.tsx
   (DECISIONS #31) — ia dikirim lewat <ThemeStyles slug="cypress-linen" />.
============================================================================= */

.cl {
  --cl-acc: #4a5240;
  --cl-acc-text: #39402f;
  --cl-on-acc: #ffffff;
  --cl-paper: #f3efe2;
  --cl-ink: #33382c;
  --cl-muted: rgba(51, 56, 44, 0.68);
  --cl-line: rgba(74, 82, 64, 0.35);
  --cl-card: #fbf8ee;
  --cl-dark: #39402f;
  --cl-dark-ink: #efe9d6;
  --cl-dark-muted: rgba(239, 233, 214, 0.75);
  --cl-dark-line: rgba(239, 233, 214, 0.3);
  --cl-disp-stack: var(--cl-disp), Georgia, "Times New Roman", serif;
  --cl-body-stack: var(--cl-body), system-ui, sans-serif;

  background: var(--cl-paper);
  color: var(--cl-ink);
  font-family: var(--cl-body-stack);
  overflow-x: clip;
}
.cl *,
.cl *::before,
.cl *::after {
  box-sizing: border-box;
}
.cl ::selection {
  background: var(--cl-acc);
  color: var(--cl-on-acc);
}

.cl-stage {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

.cl-section {
  position: relative;
  padding: 56px 24px;
}

.cl-eyebrow {
  font-family: var(--cl-body-stack);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cl-acc-text);
  text-align: center;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

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

.cl-foto {
  width: min(62%, 240px);
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid #8a7f5c;
  background: color-mix(in srgb, var(--cl-acc) 18%, transparent);
  display: grid;
  place-items: center;
}
.cl-foto span {
  font-family: var(--cl-disp-stack);
  font-size: 56px;
  color: var(--cl-acc-text);
}
.cl-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Countdown bersama (kelas generik dari `@/themes/_shared/motion`). */
.cl .countdown {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  justify-content: center;
}
.cl .count-box {
  flex: 1;
  min-width: 0;
  text-align: center;
  padding: 16px 4px 14px;
  background: var(--cl-card);
  border: 1px solid var(--cl-line);
  border-radius: 14px;
}
.cl .count-num {
  font-family: var(--cl-disp-stack);
  font-size: clamp(26px, 8vw, 36px);
  font-variant-numeric: tabular-nums;
  display: block;
  color: var(--cl-ink);
}
.cl .count-label {
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--cl-muted);
  margin-top: 6px;
  display: block;
}
.cl .countdown-done {
  font-family: var(--cl-disp-stack);
  font-size: 22px;
  text-align: center;
  margin-top: 28px;
}

/* Galeri: gambar langsung anak section → grid 2 kolom. */
.cl-section > img {
  width: calc(50% - 6px);
  margin: 3px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  vertical-align: top;
}

/* Tombol salin (amplop): satu-satunya <button> anak langsung kartu bank. */
.cl-section > div > button {
  margin-top: 12px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--cl-acc);
  background: var(--cl-acc);
  color: var(--cl-on-acc);
  font-family: var(--cl-body-stack);
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

/* Siluet vila Tuscany + pohon cemara di bawah cover (SVG scene). */
.cl-cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 110px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='110' viewBox='0 0 480 110'%3E%3Cg fill='%234a5240' fill-opacity='0.85'%3E%3Cellipse cx='52' cy='62' rx='9' ry='48'/%3E%3Cellipse cx='80' cy='70' rx='7' ry='38'/%3E%3Cellipse cx='408' cy='62' rx='9' ry='48'/%3E%3Cellipse cx='436' cy='70' rx='7' ry='38'/%3E%3Crect x='180' y='66' width='120' height='44'/%3E%3Cpath d='M168 68 L240 34 L312 68 Z'/%3E%3Crect x='232' y='80' width='16' height='30'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 480px 110px;
  opacity: 0.9;
}
/* Tekstur linen halus di stage (garis silang sangat tipis). */
.cl-stage {
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(74, 82, 64, 0.03) 0 1px,
      transparent 1px 5px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(74, 82, 64, 0.03) 0 1px,
      transparent 1px 5px
    );
}
/* Section acara HIJAU GELAP ("Villa Lembah Hijau"). */
.cl-stage > div[data-section-id="schedule"] > .cl-section {
  background: var(--cl-dark);
  color: var(--cl-darkInk);
}
.cl-stage > div[data-section-id="schedule"] .cl-eyebrow,
.cl-stage > div[data-section-id="schedule"] .cl-title {
  color: var(--cl-darkInk);
}
/* Judul serif italic yang tenang. */
.cl-title {
  font-style: italic;
  font-weight: 500;
}
/* Foto oval berbingkai linen: cincin ganda zaitun. */
.cl-foto {
  outline: 1px solid rgba(74, 82, 64, 0.5);
  outline-offset: 5px;
}
/* Countdown: kotak krem berbingkai zaitun. */
.cl .count-box {
  border-color: var(--cl-acc);
  background: var(--cl-card);
}
.cl .count-num {
  color: var(--cl-acc-text);
}

/* Cover — layar penuh saat JS jalan; wipe ke atas saat dibuka. */
.cl-cover {
  display: none;
}
.cl.is-js .cl-cover {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(180deg, #f3efe2 0%, #e9e2cc 100%);
  color: #33382c;
  transition: transform 1s cubic-bezier(0.7, 0, 0.3, 1);
}
.cl.is-js.is-open .cl-cover {
  transform: translateY(-100%);
}
.cl-cover-inner {
  position: relative;
  text-align: center;
  max-width: 420px;
  width: calc(100% - 48px);
  padding: 40px 24px;
  margin: 0 auto;
}
.cl-open {
  margin-top: 28px;
  padding: 13px 34px;
  border-radius: 999px;
  border: 1px solid var(--cl-acc);
  background: var(--cl-acc);
  color: var(--cl-on-acc);
  font-family: var(--cl-body-stack);
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

/* Tombol musik mengambang (muncul setelah cover dibuka). */
.cl-music {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 55;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--cl-acc);
  background: var(--cl-paper);
  color: var(--cl-acc-text);
  display: none;
  place-items: center;
  cursor: pointer;
}
.cl.is-open .cl-music {
  display: grid;
}

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

/* Elemen melayang 3D (drift.tsx): container pakai perspective, tiap item
   translateZ berbeda (-70px s.d. +75px) untuk kedalaman/parallax; hanya
   transform/opacity yang dianimasikan. Sampul juga berlapis 3D halus:
   judul/eyebrow/tombol di translateZ berbeda di atas perspective sampul. */
.cl-drift {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  perspective: 700px;
}
.cl-drift--page {
  position: fixed;
  z-index: 40;
}
.cl-drift__item {
  position: absolute;
  top: 0;
  display: block;
  transform-style: preserve-3d;
}
.cl-drift__move {
  display: block;
  animation: cl-drift-fall linear infinite;
  will-change: transform, opacity;
  transform-style: preserve-3d;
}
.cl-drift__item svg {
  display: block;
  animation: cl-drift-sway 2.4s ease-in-out infinite alternate;
  filter: drop-shadow(0 2px 3px rgb(0 0 0 / 0.25));
}
.cl-drift__item:nth-child(even) svg {
  animation-duration: 3s;
}
.cl-drift--page .cl-drift__item svg {
  opacity: 0.55;
}
@keyframes cl-drift-fall {
  0% {
    transform: translate3d(0, -12vh, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.9;
  }
  85% {
    opacity: 0.78;
  }
  100% {
    transform: translate3d(0, 112vh, 0) rotate(300deg);
    opacity: 0;
  }
}
@keyframes cl-drift-sway {
  from {
    transform: translateX(-16px) rotate(-12deg) rotateY(-10deg);
  }
  to {
    transform: translateX(16px) rotate(12deg) rotateY(10deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .cl-drift {
    display: none;
  }
}

/* Lapisan sampul 3D halus: judul paling depan, eyebrow & tombol di belakangnya. */
.cl-cover {
  perspective: 1100px;
}
.cl-cover-inner,
.cl-cover-inner > div {
  transform-style: preserve-3d;
}
.cl-cover-inner .cl-eyebrow {
  transform: translateZ(14px);
}
.cl-cover-inner .cl-title {
  transform: translateZ(30px);
}
.cl-cover-inner .cl-open {
  transform: translateZ(20px);
}

/* === 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. */
.cl.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;
}
.cl.is-js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Foto & kartu di dalam section: muncul menyusul (stagger) setelah section. */
.cl.is-js .reveal img,
.cl.is-js .reveal .cl-card,
.cl.is-js .reveal .cl-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;
}
.cl.is-js .reveal.is-visible img,
.cl.is-js .reveal.is-visible .cl-card,
.cl.is-js .reveal.is-visible .cl-foto {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .cl.is-js .reveal,
  .cl.is-js .reveal img,
  .cl.is-js .reveal .cl-card,
  .cl.is-js .reveal .cl-foto {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
/* Latar berlapis tiap section: semburat aksen di atas + gradien kertas ke aksen. */
.cl-section {
  background:
    radial-gradient(
      120% 55% at 50% 0%,
      color-mix(in srgb, var(--cl-acc) 12%, transparent),
      transparent 62%
    ),
    linear-gradient(
      180deg,
      var(--cl-paper),
      color-mix(in srgb, var(--cl-paper) 84%, var(--cl-acc))
    );
  padding: clamp(84px, 14vw, 128px) 20px;
}
/* Preview lebih panjang: foto mempelai & galeri lebih besar. */
.cl-foto {
  width: min(82%, 320px);
}
.cl-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) .cl-section {
  background:
    radial-gradient(
      110% 50% at 50% 0%,
      color-mix(in srgb, var(--cl-acc) 30%, transparent),
      transparent 65%
    ),
    repeating-linear-gradient(
      45deg,
      color-mix(in srgb, var(--cl-acc) 4%, transparent) 0 2px,
      transparent 2px 26px
    ),
    repeating-linear-gradient(
      -45deg,
      color-mix(in srgb, var(--cl-acc) 4%, transparent) 0 2px,
      transparent 2px 26px
    ),
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--cl-acc) 28%, var(--cl-paper)),
      color-mix(in srgb, var(--cl-acc) 20%, var(--cl-paper))
    );
}
/* Bingkai ornamen ganda di tiap section (kartu berbingkai emas/aksen). */
.cl-section {
  border: 2px solid color-mix(in srgb, var(--cl-acc) 60%, transparent);
  outline: 1px solid color-mix(in srgb, var(--cl-acc) 40%, transparent);
  outline-offset: 6px;
  border-radius: 24px;
  margin: 20px 14px;
}
/* Foto mempelai bentuk arch (lengkung atas) + bingkai emas + bayangan. */
.cl-foto {
  border-radius: 999px 999px 18px 18px;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--cl-acc) 45%, transparent);
}
/* Drift lebih kentara: opacity naik (page variant). */
.cl-drift--page .cl-drift__item svg {
  opacity: 0.4;
}

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