/* Tema "Malam Teduh": langit malam yang tenang. Arah desain dan alasan tiap keputusan ada di DESIGN.md.
   Dimuat setelah invitation.css hanya bila tema = malam. Biru malam keabuan, lavender redup, putih bulan, aksen krem lampu.
   Motif: bulan separuh di cakrawala dan titik bintang. Gradien hanya untuk langit; bidang isi datar. */
.theme-malam {
  --bg: #252a45; --bg2: #1d2138; --ink: #f1eff6; --muted: #c3c0dc;
  --primary: #f0dcb4; --deep: #1d2138; --on-primary: #1d2138; --accent: #f0dcb4; --card: #2f3557;
  --line: rgba(195, 192, 220, .24);
  --malam: #252a45; --kelam: #1d2138; --lavender: #8e8bb0; --bulan: #f1eff6; --lampu: #f0dcb4;
  --serif: "Ovo", "Lora", Georgia, serif;
  --r: 12px; --r-kartu: 20px; /* 12 untuk yang diklik, 20 untuk kartu */
  --langit: linear-gradient(180deg, #1d2138 0%, #2a3054 62%, #3a406a 100%);
  color-scheme: dark; /* daftar pilihan bawaan peramban ikut gelap */
  --bintang: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='320' height='320'%3E%3Cg fill='%23f1eff6'%3E%3Ccircle cx='22' cy='34' r='1.3'/%3E%3Ccircle cx='96' cy='12' r='.8' opacity='.7'/%3E%3Ccircle cx='168' cy='58' r='1' opacity='.8'/%3E%3Ccircle cx='284' cy='26' r='1.5'/%3E%3Ccircle cx='236' cy='96' r='.7' opacity='.6'/%3E%3Ccircle cx='52' cy='122' r='.9' opacity='.7'/%3E%3Ccircle cx='132' cy='150' r='.6' opacity='.6'/%3E%3Ccircle cx='302' cy='164' r='1' opacity='.8'/%3E%3Ccircle cx='14' cy='214' r='.7' opacity='.6'/%3E%3Ccircle cx='198' cy='204' r='1.4' opacity='.9'/%3E%3Ccircle cx='102' cy='252' r='1' opacity='.7'/%3E%3Ccircle cx='260' cy='268' r='.8' opacity='.7'/%3E%3Ccircle cx='164' cy='300' r='.6' opacity='.6'/%3E%3Ccircle cx='40' cy='292' r='1.2' opacity='.8'/%3E%3C/g%3E%3C/svg%3E");
  /* Bulan separuh di atas cakrawala dengan dua garis pantulan */
  --terbit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 66'%3E%3Cpath fill='%23f0dcb4' d='M54 44a26 26 0 0 1 52 0z'/%3E%3Cg stroke='%238e8bb0' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M6 46H154'/%3E%3Cpath d='M58 53H102'/%3E%3Cpath d='M70 60H90'/%3E%3C/g%3E%3C/svg%3E");
  --cakrawala: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 18'%3E%3Cpath fill='%23f0dcb4' d='M70 13a10 10 0 0 1 20 0z'/%3E%3Cpath stroke='%238e8bb0' stroke-width='1.2' stroke-linecap='round' d='M4 14.5H156'/%3E%3C/svg%3E");
  /* Dua lapis perbukitan gelap di kaki langit */
  --bukit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='90' viewBox='0 0 360 90'%3E%3Cpath fill='%232d3358' d='M0 40C60 8 110 14 180 36S300 72 360 40V90H0z'/%3E%3Cpath fill='%23252a45' d='M0 70C50 50 100 52 160 66S310 90 360 70V90H0z'/%3E%3C/svg%3E");
}
.theme-malam .page { box-shadow: 0 0 40px rgba(0, 0, 0, .35); }

/* ---------- Tipografi: Ovo hanya punya satu ketebalan ---------- */
.theme-malam h1, .theme-malam h2, .theme-malam h3, .theme-malam .cname, .theme-malam .names, .theme-malam .hero-names,
.theme-malam .h, .theme-malam .salam, .theme-malam .to-name, .theme-malam .wishes h3 {
  font-family: var(--serif); font-style: normal; font-weight: 400;
}
.theme-malam .eyebrow { text-transform: none; letter-spacing: .03em; font-size: .96rem; color: var(--muted); }

/* ---------- Gerak: gerbang, muncul saat digulir, kelip bintang di latar (ambient.css) ---------- */
.theme-malam .sky, .theme-malam .hero-pat { display: none; }
.theme-malam .btn-open { animation: fadeUp 1s ease 1.2s both; }
.theme-malam .countdown [data-cd="s"], .theme-malam .sound-btn.on::after, .theme-malam .scroll-hint span { animation: none; }
.js .theme-malam [data-reveal] { transform: translateY(18px); transition-duration: 1.4s; }
.js .theme-malam [data-reveal="fade"] { transform: none; }
.js .theme-malam [data-reveal].in { transform: none; }

/* Bulan terbit dan pembatas cakrawala */
.ml-terbit { display: block; width: 150px; height: 62px; margin: 0 auto 14px; background: var(--terbit) center / contain no-repeat; }
.theme-malam .ml-divider { width: 160px; height: 18px; margin: 0 auto 24px; background: var(--cakrawala) center / contain no-repeat; }

/* ---------- Gerbang: langit malam memudar naik ---------- */
.theme-malam .gate { color: var(--ink); background: var(--langit); overflow: clip; }
.js .theme-malam .gate { background: transparent; }
.ml-langit { position: absolute; inset: 0; z-index: 1; background: var(--bukit) center bottom / 360px 90px repeat-x, var(--bintang), var(--langit); }
.js .ml-langit { transition: transform 1.7s cubic-bezier(.55, 0, .35, 1) .3s, opacity 1.1s ease .75s; }
.js body.theme-malam.is-opening .ml-langit { transform: translateY(-38%); opacity: 0; }
.theme-malam .gate-content { width: min(100%, 400px); padding: 48px 30px 96px; }
.js .theme-malam .gate-content { max-height: 100%; padding-top: 22px; padding-bottom: 22px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; transition: transform 1.3s cubic-bezier(.6, 0, .3, 1) .3s, opacity .6s ease .3s; }
.js .theme-malam .gate-content::-webkit-scrollbar { display: none; }
.js body.theme-malam.is-opening .gate-content { transform: translateY(-30vh); opacity: 0; }
.theme-malam .gate .ml-terbit { width: 130px; height: 54px; margin-bottom: 10px; }
.theme-malam .gate .eyebrow { margin-bottom: 6px; }
.theme-malam .gate .names { font-size: clamp(2.7rem, 13vw, 3.5rem); line-height: 1.14; margin-bottom: 10px; color: var(--bulan); }
.theme-malam .names i { font: 400 .55em var(--serif); color: var(--lampu); line-height: 1.35; }
.theme-malam .cover-date { color: var(--muted); letter-spacing: .02em; margin-bottom: 18px; }
.theme-malam .to { background: rgba(29, 33, 56, .72); border: 1px solid var(--line); border-radius: var(--r-kartu); max-width: 300px; padding: 14px 16px; margin-bottom: 20px; }
.theme-malam .to-note { color: var(--muted); }
.theme-malam .sound-note { color: var(--ink); margin-top: 14px; padding: 6px 12px; border-radius: var(--r); background: rgba(29, 33, 56, .72); }
.theme-malam .btn-open { background: var(--lampu); color: var(--kelam); border-radius: var(--r); font-weight: 600; letter-spacing: .01em; padding: 13px 38px; transition: background .25s; }
.theme-malam .btn-open:hover { background: #f8e9ca; box-shadow: none; transform: none; }
.theme-malam .btn-open:focus-visible { outline: 3px solid var(--bulan); outline-offset: 3px; box-shadow: none; }

/* ---------- Hero: langit berbintang dengan perbukitan di kaki ---------- */
.theme-malam .hero { color: var(--ink); background: var(--bukit) center bottom / 360px 90px repeat-x, var(--bintang), var(--langit); }
.theme-malam .hero-in { padding: 56px 28px 138px; }
.theme-malam .hero .bismillah { color: var(--bulan); font-size: 1.55rem; margin-bottom: 18px; }
.theme-malam .hero-names { font-size: clamp(3rem, 15vw, 4.2rem); line-height: 1.14; color: var(--bulan); margin: 4px 0 20px; overflow-wrap: anywhere; }
.theme-malam .hero-names i { font: 400 .5em var(--serif); color: var(--lampu); line-height: 1.5; }
.theme-malam .hero-date { display: inline-block; margin: 0; padding: 9px 4px; border-top: 1px solid var(--lavender); border-bottom: 1px solid var(--lavender); color: var(--lampu); opacity: 1; letter-spacing: .04em; }
.theme-malam .scroll-hint { bottom: 62px; margin-left: -22px; width: 44px; height: 44px; border: 0; border-radius: 50%; }
.theme-malam .scroll-hint span { left: 50%; top: 14px; width: 12px; height: 12px; margin-left: -6px; background: none; border: solid var(--lampu); border-width: 0 2px 2px 0; border-radius: 0; rotate: 45deg; }

/* ---------- Bagian umum: dua kedalaman malam, disambung garis cakrawala ---------- */
.theme-malam .sec { padding: 62px 26px; background: var(--malam); }
.theme-malam .sec.alt { background: var(--kelam); border-top: 1px solid var(--lavender); border-bottom: 1px solid var(--lavender); }
.theme-malam #rsvp { border-bottom: 0; }
.theme-malam .h { color: var(--bulan); font-size: 1.95rem; line-height: 1.35; }
.theme-malam .salam { color: var(--lampu); font-size: 1.2rem; line-height: 1.65; }
.theme-malam .intro { color: var(--muted); }

/* Mempelai: karakter di jendela terang berbingkai garis ganda */
.theme-malam .couple { gap: 16px; margin-bottom: 40px; }
.theme-malam .amp { font: 400 2.3rem var(--serif); color: var(--lampu); }
.theme-malam .avatar { width: 184px; margin: 0 auto 22px; padding: 7px; border: 1px solid var(--lavender); border-radius: 30px; }
.theme-malam .avatar::before { display: none; }
.theme-malam .avatar .avatar-frame { width: 100%; height: auto; aspect-ratio: 5 / 6; border: 0; border-radius: 24px; box-shadow: none; background: #e9e5f2; }
.theme-malam .avatar .avatar-frame img { animation: none; }
.theme-malam .cname { color: var(--bulan); font-size: 1.5rem; line-height: 1.4; overflow-wrap: anywhere; }
.theme-malam .parents { color: var(--muted); }

.theme-malam .quote { background: var(--card); border: 0; border-radius: var(--r-kartu); padding: 30px 22px; }
.theme-malam .quote::before { content: none; }
.theme-malam .quote .arab { color: var(--bulan); }
.theme-malam .quote .terjemah { font-style: normal; color: var(--muted); }
.theme-malam .quote footer { color: var(--lampu); }

/* Hitung mundur */
.theme-malam .countdown { gap: 8px; margin-bottom: 34px; }
.theme-malam .countdown div { background: var(--card); color: var(--lampu); border: 0; border-radius: var(--r); padding: 14px 4px 12px; }
.theme-malam .countdown b { font: 400 1.85rem/1.2 var(--serif); font-variant-numeric: tabular-nums; }
.theme-malam .countdown span { text-transform: none; letter-spacing: .02em; font-size: .76rem; color: var(--muted); opacity: 1; }
.theme-malam .countdown.done { color: var(--lampu); }

/* Acara: tanggal di atas garis cakrawala */
.theme-malam .event.ev-split { margin-bottom: 20px; padding: 28px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-kartu); box-shadow: none; }
.theme-malam .event::before { display: none; }
.theme-malam .ev-badge { display: flex; flex-direction: column; align-items: center; margin-bottom: 16px; color: var(--lampu); }
.theme-malam .ev-badge b { font: 400 3.6rem/1.05 var(--serif); }
.theme-malam .ev-badge span { font-size: .85rem; color: var(--muted); }
.theme-malam .ev-badge::after { content: ""; width: 140px; height: 16px; margin-top: 12px; background: var(--cakrawala) center / contain no-repeat; }
.theme-malam .event h3 { color: var(--bulan); font-size: 1.5rem; }
.theme-malam .ev-addr { color: var(--muted); }

/* Adab: butir bertanda satu titik terang */
.theme-malam .notes li { background: var(--card); border: 0; border-radius: var(--r); padding: 14px 16px 14px 44px; }
.theme-malam .notes li::before { content: ""; left: 18px; top: 22px; width: 8px; height: 8px; border-radius: 50%; background: var(--lampu); animation: none; }

/* Tanda kasih */
.theme-malam .acc { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-kartu); box-shadow: none; padding: 22px 18px; overflow-wrap: anywhere; }
.theme-malam .acc .num { font: 400 1.55rem var(--serif); letter-spacing: .05em; color: var(--lampu); }

/* Tombol dan formulir */
.theme-malam .btn, .theme-malam .btn.small { border-radius: var(--r); min-height: 44px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
.theme-malam .btn:hover { transform: none; box-shadow: none; }
.theme-malam .btn:focus-visible { outline: 3px solid var(--bulan); outline-offset: 2px; box-shadow: none; }
.theme-malam .rsvp-form input:not([type="radio"]), .theme-malam .rsvp-form select, .theme-malam .rsvp-form textarea { border: 1px solid var(--lavender); border-radius: var(--r); background: var(--card); color: var(--ink); }
.theme-malam .rsvp-form input:focus, .theme-malam .rsvp-form select:focus, .theme-malam .rsvp-form textarea:focus { outline: 3px solid var(--lampu); outline-offset: 1px; box-shadow: none; }
.theme-malam .rsvp-form ::placeholder { color: var(--muted); opacity: 1; }
.theme-malam .radios label { border: 1px solid var(--lavender); border-radius: var(--r); background: var(--card); min-height: 44px; }
.theme-malam .radios label:has(input:checked) { border-color: var(--lampu); background: #414878; }
.theme-malam .radios input { accent-color: var(--lampu); }
.theme-malam .rsvp-form .btn { background: var(--lampu); border-color: var(--lampu); color: var(--kelam); padding: 13px; }
.theme-malam .wishes h3 { color: var(--bulan); }
.theme-malam .wishes li { border: 0; border-radius: var(--r); background: var(--card); }

/* Penutup: kembali ke langit */
.theme-malam .closing { padding: 76px 26px 150px; background: var(--bukit) center bottom / 360px 90px repeat-x, var(--bintang), var(--langit); }
.theme-malam .closing .intro, .theme-malam .closing .salam { color: var(--ink); }
.theme-malam .closing .salam { font-size: 1.05rem; }
.theme-malam .closing .doa { color: var(--bulan); }
.theme-malam .closing .names.small { color: var(--lampu); font-size: 2.15rem; line-height: 1.35; }
.theme-malam .closing .credit { color: var(--muted); }

/* Navigasi bawah dan tombol melayang */
.theme-malam .dock { background: var(--card); border: 1px solid var(--lavender); border-radius: var(--r-kartu); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); -webkit-backdrop-filter: none; backdrop-filter: none; }
.theme-malam .dock a { color: var(--muted); border-radius: var(--r); }
.theme-malam .dock a.on { background: var(--lampu); color: var(--kelam); }
.theme-malam .dock a:focus-visible { outline-color: var(--bulan); }
.js .theme-malam .sound-btn, .js .theme-malam .motion-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--card); border: 1px solid var(--lavender); color: var(--lampu); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.theme-malam .sound-btn:focus-visible, .theme-malam .motion-btn:focus-visible { outline-color: var(--bulan); }
.theme-malam .sound-btn.on::after { display: none; }

@media (min-width: 560px) { .theme-malam .page { border-radius: var(--r-kartu); } }
