/* Tema Temaram: undangan seperti film pendek dengan video latar per babak.
   Dipakai di atas undangan.css. Warna kaya datang dari video; teks gading, satu aksen sampanye. */

[data-tema='temaram'] {
  --bg: #0c0a09; --surface: #17130f; --raised: #221d18;
  --text: #f3ede4; --text-2: #c9bfb1; --muted: #9c9184;
  --accent: #d9bc8c; --on-accent: #1c150b;
  --garis: rgba(243, 237, 228, .1); --garis-kuat: rgba(243, 237, 228, .2);
  --emas-garis: rgba(217, 188, 140, .28);
  --display: 'Italiana', 'Cormorant Garamond', serif; --w-display: 400; --body: 'Hanken Grotesk', system-ui, sans-serif;
  --positif: #8fc79f; --negatif: #e58a7f;
  color-scheme: dark;
}
[data-tema='temaram'] body { background: var(--bg); }

/* Lapisan video latar: satu video per babak, berganti dengan memudar */
.layar-video { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--bg); --tirai: .45; }
.v-latar {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.05);
  transition: opacity 1400ms var(--ease), transform 9s linear;
}
.v-latar.aktif { opacity: 1; transform: scale(1); }
.tirai { position: absolute; inset: 0; background: rgba(10, 8, 7, var(--tirai)); transition: background-color 1200ms var(--ease); }
.tirai::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .55) 100%); }

/* Tipe */
.t-nama {
  font-family: var(--display); font-weight: 400; line-height: .95; letter-spacing: .01em;
  display: flex; flex-direction: column; align-items: center;
  font-size: clamp(64px, 18vw, 120px); text-shadow: 0 2px 24px rgba(0, 0, 0, .45);
}
.t-dan { font-family: var(--display); color: var(--accent); }
.t-nama .t-dan { font-size: .46em; line-height: 1.3; }
.t-judul { font-family: var(--display); font-weight: 400; font-size: 44px; line-height: 1.12; max-width: 14em; }
.t-teks { font-size: 16px; line-height: 26px; color: var(--text-2); max-width: 32rem; }
.babak-no { display: inline-flex; align-items: center; gap: 12px; font-size: 12px; color: var(--accent); letter-spacing: .04em; }
.babak-no::before, .babak-no::after { content: ''; width: 24px; height: 1px; background: var(--accent); opacity: .6; }

/* Sampul: bilah sinema, judul, tombol putar, lalu urutan judul seperti pembuka film */
.t-sampul { background: transparent; padding: 0; display: grid; place-items: center; grid-template-rows: none; }
.t-sampul::before { display: none; }
.t-sampul.terbuka { transform: none; opacity: 0; transition: opacity 900ms var(--ease), visibility 0s linear 900ms; }
.sinema-bar { position: absolute; left: 0; right: 0; z-index: 2; height: 11vh; background: #000; }
.sinema-bar.atas { top: 0; transform-origin: 50% 0; }
.sinema-bar.bawah { bottom: 0; transform-origin: 50% 100%; }
.t-sampul-isi {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 24px; text-align: center; transition: opacity 600ms var(--ease);
}
.t-sampul-isi > .kecil { color: var(--text-2); letter-spacing: .04em; }
.t-tgl { font-size: 15px; color: var(--text-2); letter-spacing: .04em; }
[data-tema='temaram'] .label-tamu {
  margin-top: 12px; background: rgba(12, 10, 9, .55); border: 1px solid var(--emas-garis);
  transform: none; box-shadow: none;
}
[data-tema='temaram'] .label-tamu p:first-child { border-bottom-color: var(--emas-garis); }
.putar {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 16px; padding: 4px 8px 4px 4px;
  background: none; border: 0; color: var(--text); font-size: 15px; font-weight: 500; cursor: pointer;
}
.putar-lingkar {
  position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 28px;
  border: 1px solid var(--accent); color: var(--accent); transition: background-color 180ms var(--ease);
}
.putar-lingkar .ikon { margin-left: 3px; }
.putar-lingkar::after {
  content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--accent);
  animation: ajak-putar 2.8s var(--ease) 1s infinite;
}
@keyframes ajak-putar { 0% { opacity: .7; transform: scale(1); } 70%, 100% { opacity: 0; transform: scale(1.45); } }
.putar:hover .putar-lingkar { background: rgba(217, 188, 140, .14); }
.t-catatan { font-size: 12px; }
.embed .t-catatan { visibility: hidden; }

.kredit { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; pointer-events: none; }
.k {
  grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 18em; padding: 0 24px;
  font-family: var(--display); font-size: clamp(30px, 6vw, 48px); line-height: 1.2; text-align: center;
  opacity: 0; text-shadow: 0 2px 24px rgba(0, 0, 0, .5);
}
.k .kecil { font-family: var(--body); color: var(--text-2); letter-spacing: .04em; }
.k-tamu { font-size: clamp(40px, 9vw, 72px); line-height: 1.05; }
.t-nama-kredit { font-size: clamp(56px, 14vw, 104px); }
.lewati {
  position: absolute; right: 24px; bottom: calc(11vh + 16px); z-index: 3; padding: 8px 14px;
  border-radius: 18px; border: 1px solid var(--garis-kuat); background: rgba(0, 0, 0, .35);
  color: var(--text-2); font-size: 13px; cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity 300ms var(--ease), background-color 150ms var(--ease);
}
.lewati:hover { background: rgba(0, 0, 0, .55); }
.memutar .t-sampul-isi { opacity: 0; pointer-events: none; }
.memutar .lewati { opacity: 1; pointer-events: auto; transition-delay: 800ms; }
.memutar .k1 { animation: kredit 2000ms var(--ease) 700ms both; }
.memutar .k2 { animation: kredit 1800ms var(--ease) 2800ms both; }
.memutar .k3 { animation: kredit 2000ms var(--ease) 4300ms both; }
.memutar .k4 { animation: kredit-tetap 1600ms var(--ease) 6300ms both; }
.memutar .sinema-bar { animation: tarik 1100ms var(--ease) 7200ms forwards; }
@keyframes kredit {
  0% { opacity: 0; transform: translateY(8px); filter: blur(6px); }
  22%, 76% { opacity: 1; transform: none; filter: blur(0); }
  100% { opacity: 0; filter: blur(6px); }
}
@keyframes kredit-tetap { from { opacity: 0; transform: scale(1.03); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes tarik { to { transform: scaleY(0); } }

/* Penanda babak dan kemajuan */
.rel, .kemajuan, .babak-kini { display: none; }
.kemajuan { position: fixed; top: 40px; left: 0; right: 0; z-index: 6; height: 2px; background: var(--garis); }
.embed .kemajuan { top: 0; }
.kemajuan span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.dibuka .kemajuan { display: block; }
.babak-kini {
  position: fixed; top: 52px; left: 16px; z-index: 6; padding: 4px 10px; border-radius: 12px;
  background: rgba(12, 10, 9, .55); font-size: 12px; color: var(--text-2);
}
.dibuka .babak-kini { display: block; }
.rel { position: fixed; left: 32px; top: 50%; z-index: 5; transform: translateY(-50%); }
.rel ol { display: flex; flex-direction: column; gap: 2px; }
.rel a {
  display: grid; grid-template-columns: 28px auto; align-items: center; gap: 8px; height: 32px;
  font-size: 13px; color: var(--muted); text-decoration: none; transition: color 150ms var(--ease);
}
.rel a span:first-child { font-size: 11px; }
.rel a:hover { color: var(--text-2); }
.rel a[aria-current='true'] { color: var(--text); }
.rel a[aria-current='true'] span:first-child { color: var(--accent); }
@media (min-width: 1100px) {
  .dibuka .rel { display: block; }
  .dibuka .babak-kini { display: none; }
}

/* Babak */
.t-isi { position: relative; z-index: 1; transition: opacity 900ms var(--ease); }
/* Isi baru tampil setelah sampul dibuka, karena sampul transparan di atas video */
.tertutup .t-isi, .tertutup .rel { opacity: 0; visibility: hidden; }
.babak { min-height: 100svh; display: grid; place-items: center; padding: 128px 24px 96px; }
.babak-isi {
  width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 20px;
  text-align: center; text-shadow: 0 1px 16px rgba(0, 0, 0, .5);
}
.babak-lebar { max-width: 880px; }
.t-kutipan { margin-top: 16px; padding: 24px 0; border-top: 1px solid var(--emas-garis); border-bottom: 1px solid var(--emas-garis); }
.t-kutipan p { font-family: var(--display); font-size: 24px; line-height: 1.4; }
.t-kutipan cite { display: block; margin-top: 12px; font-style: normal; font-size: 13px; color: var(--muted); }
.t-gulir { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 32px; font-size: 12px; color: var(--muted); text-decoration: none; letter-spacing: .04em; }
.t-gulir span { position: relative; width: 1px; height: 40px; background: var(--garis-kuat); overflow: hidden; }
.t-gulir span::after { content: ''; position: absolute; left: 0; top: 0; width: 1px; height: 12px; background: var(--accent); animation: gulir 2.2s var(--ease) infinite; }
@keyframes gulir { from { transform: translateY(-12px); } to { transform: translateY(40px); } }

.t-orang { display: flex; flex-direction: column; align-items: center; gap: 4px; }
#mempelai .t-judul { margin-bottom: 16px; }
.t-orang-panggilan { font-family: var(--display); font-size: 76px; line-height: 1; }
.t-orang-nama { font-size: 16px; font-weight: 500; margin-top: 12px; }
.t-orang-ortu { font-size: 14px; color: var(--text-2); max-width: 22rem; }
.t-dan-besar { font-size: 48px; line-height: 1; margin: 12px 0; }

.t-hitung { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; margin: 8px 0 16px; }
.t-hitung div { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; border-left: 1px solid var(--emas-garis); }
.t-hitung div:first-child { border-left: 0; }
.t-hitung span { font-family: var(--display); font-size: 52px; line-height: 1; }
.t-hitung small { font-size: 12px; color: var(--muted); }

.t-panel {
  width: 100%; padding: 24px; text-align: left; text-shadow: none;
  background: rgba(14, 11, 9, .7); border: 1px solid rgba(217, 188, 140, .18); border-radius: 16px;
}
.t-daftar-acara { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.t-acara h3 { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.15; }
.t-acara .acara-rinci { margin: 16px 0 20px; }

.t-cerita { width: 100%; text-align: left; }
.t-cerita-butir { display: grid; grid-template-columns: 72px 1fr; gap: 16px; padding: 20px 0; border-top: 1px solid rgba(243, 237, 228, .14); }
.t-cerita-butir:last-child { border-bottom: 1px solid rgba(243, 237, 228, .14); }
.t-tahun { font-family: var(--display); font-size: 30px; line-height: 1.1; color: var(--accent); }
.t-cerita h3 { font-size: 17px; font-weight: 500; line-height: 1.4; }
.t-cerita p { font-size: 14px; color: var(--text-2); margin-top: 4px; }

/* Galeri video */
.t-galeri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; max-width: 720px; margin-top: 8px; }
.momen {
  position: relative; aspect-ratio: 9 / 16; overflow: hidden; padding: 0; cursor: pointer;
  background: #000; border: 1px solid rgba(217, 188, 140, .2); border-radius: 14px; color: var(--text);
  transition: border-color 180ms var(--ease);
}
.momen:hover { border-color: rgba(217, 188, 140, .6); }
.momen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.momen::after { content: ''; position: absolute; inset: 50% 0 0; background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .6)); }
.momen-ikon {
  position: absolute; left: 50%; top: 50%; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px;
  transform: translate(-50%, -50%); border-radius: 22px; background: rgba(0, 0, 0, .4); border: 1px solid var(--accent); color: var(--accent);
  transition: opacity 200ms var(--ease);
}
.momen-ikon .ikon { margin-left: 2px; }
.momen.main .momen-ikon { opacity: 0; }
.momen-judul { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 1; font-size: 13px; text-align: left; line-height: 1.3; }

.layar-momen { width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--text); }
.layar-momen[open] { display: grid; place-items: center; }
.layar-momen::backdrop { background: rgba(0, 0, 0, .9); }
.layar-momen video { height: min(84svh, 960px); max-width: 92vw; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 16px; background: #000; }
.lm-judul { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; font-family: var(--display); font-size: 22px; }
.lm-tutup { position: absolute; top: 16px; right: 16px; }
.lm-geser { position: absolute; top: 50%; transform: translateY(-50%); }
.lm-kiri { left: 16px; }
.lm-kiri .ikon { transform: rotate(180deg); }
.lm-kanan { right: 16px; }

/* Kehadiran dan penutup */
[data-tema='temaram'] .rsvp { margin-top: 4px; }
.t-ucapan h3 { font-family: var(--display); font-weight: 400; font-size: 26px; }
.t-ucapan .sub { margin-top: 4px; }
.t-ucapan .ucapan { max-height: 360px; overflow-y: auto; margin-top: 16px; }
.t-hadiah .daftar-rek { margin-top: 0; }
.t-penutup { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 48px; }
.t-salam { font-family: var(--display); font-size: 22px; }
.t-penutup .kecil { margin-top: 12px; }
.t-nama-penutup { display: block; font-size: 60px; }
.t-keluarga { font-size: 14px; color: var(--text-2); }
.t-kaki { margin-top: 48px; font-size: 12px; color: var(--muted); }
.t-kaki a { color: var(--text-2); }

/* Tombol bulat: musik dan jeda video */
.kendali { position: fixed; right: 16px; bottom: 16px; z-index: 15; display: flex; flex-direction: column; gap: 8px; }
.tertutup .kendali { visibility: hidden; }
.kendali .musik { position: static; }
.t-tombol-bulat {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 22px; cursor: pointer;
  background: rgba(12, 10, 9, .6); color: var(--text-2); border: 1px solid var(--garis-kuat); box-shadow: none;
  transition: background-color 150ms var(--ease);
}
.t-tombol-bulat:hover { background: rgba(34, 29, 24, .9); }
#jeda-video .j-off, #jeda-video[aria-pressed='true'] .j-on { display: none; }
#jeda-video[aria-pressed='true'] .j-off { display: block; }

@media (max-width: 640px) {
  .t-judul { font-size: 36px; }
  .t-orang-panggilan { font-size: 60px; }
  .t-hitung span { font-size: 40px; }
  .t-nama-penutup { font-size: 48px; }
  .babak { padding: 112px 20px 88px; }
  .t-galeri { gap: 8px; }
  .momen-judul { font-size: 11px; left: 8px; right: 8px; bottom: 8px; }
  .lm-geser { top: auto; bottom: 64px; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .v-latar { transform: none; }
  .memutar .k4 { opacity: 1; }
}

/* Undangan pelanggan: tanpa bilah demo */
.tanpa-demo .kemajuan { top: 0; }
.tanpa-demo .babak-kini { top: 12px; }
