/* Undangan digital Sekar — gaya bersama untuk semua tema.
   Tata letak mengikuti unslop (heydamir/unslop, CC BY 4.0): kelipatan 4px, satu aksen, tanpa gradien warna. */

:root {
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --r-kontrol: 10px;
  --r-kartu: 16px;
}

[data-tema='sogan'] {
  --bg: #f3ebdd; --surface: #faf5ec; --raised: #ece2d1;
  --text: #2b2118; --text-2: #5c4a3a; --muted: #7a6654;
  --accent: #7a3b1d; --on-accent: #fbf4e8; --orn: #7a3b1d; --orn-o: .42;
  --garis: rgba(43, 33, 24, .1); --garis-kuat: rgba(43, 33, 24, .18);
  --display: 'Cormorant Garamond', Georgia, serif; --w-display: 500; --body: 'Figtree', system-ui, sans-serif;
  --positif: #4d6b3c; --negatif: #a33a2a;
}
[data-tema='melati'] {
  --bg: #f6f5ef; --surface: #fdfdf9; --raised: #ebeee5;
  --text: #1d231f; --text-2: #48524b; --muted: #646f67;
  --accent: #46624c; --on-accent: #f8faf5; --orn: #46624c; --orn-o: .6;
  --garis: rgba(29, 35, 31, .09); --garis-kuat: rgba(29, 35, 31, .18);
  --display: 'Newsreader', Georgia, serif; --w-display: 400; --body: 'DM Sans', system-ui, sans-serif;
  --positif: #3f7a4f; --negatif: #b1453a;
}
[data-tema='senja'] {
  --bg: #0e1119; --surface: #131722; --raised: #1b2030;
  --text: #eef0f5; --text-2: #a9b0c0; --muted: #868fa5;
  --accent: #d2b07a; --on-accent: #17120a; --orn: #d2b07a; --orn-o: .55;
  --garis: rgba(238, 240, 245, .08); --garis-kuat: rgba(238, 240, 245, .16);
  --display: 'Bodoni Moda', Georgia, serif; --w-display: 400; --body: 'Instrument Sans', system-ui, sans-serif;
  --positif: #6fbf8e; --negatif: #e5736b;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
body.tertutup { overflow: hidden; }
h1, h2, h3, p, ol, ul, dl, dd, blockquote, figure, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.angka { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Bilah demo */
.demo-bar {
  position: fixed; inset: 0 0 auto; z-index: 30; height: 40px;
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 16px;
  background: var(--raised); border-bottom: 1px solid var(--garis);
  font-size: 13px; color: var(--text-2);
}
.demo-bar a { color: var(--accent); font-weight: 500; text-decoration: none; white-space: nowrap; }
.demo-bar a:hover { text-decoration: underline; }
.demo-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body:not(.embed) { padding-top: 40px; }
.embed .demo-bar, .embed .musik { display: none; }

/* Ornamen */
.orn { display: block; color: var(--orn); opacity: var(--orn-o); }
.orn-pita { width: 100%; height: 48px; }
.orn-sulur, .orn-cakrawala { width: 200px; height: auto; margin: 0 auto; }
.orn-wadah { display: flex; justify-content: center; }
[data-tema='sogan'] .orn-wadah .orn-pita { height: 32px; width: 160px; border-radius: 4px; }

/* Tipe bersama */
.kecil { font-size: 13px; color: var(--muted); letter-spacing: .01em; }
.nama {
  font-family: var(--display); font-weight: var(--w-display);
  display: flex; flex-direction: column; align-items: center;
  font-size: clamp(52px, 15vw, 68px); line-height: 1.02; letter-spacing: -0.02em;
}
.nama .dan { color: var(--accent); font-size: .62em; line-height: 1.2; }
.judul { font-family: var(--display); font-weight: var(--w-display); font-size: 32px; line-height: 1.15; letter-spacing: -0.01em; }
.sub { font-size: 14px; color: var(--text-2); margin-top: 8px; }
.salam { font-family: var(--display); font-weight: var(--w-display); font-size: 22px; line-height: 1.3; }

/* Sampul */
.sampul {
  position: fixed; inset: 0; z-index: 20;
  display: grid; grid-template-rows: auto 1fr auto;
  background: var(--bg); text-align: center;
  padding: 56px 16px 16px;
  transition: transform 700ms var(--ease), visibility 0s linear 700ms;
}
.embed .sampul { padding-top: 16px; }
.sampul::before {
  content: ''; position: absolute; inset: 52px 12px 12px; pointer-events: none;
  border: 1px solid var(--orn); opacity: .28; border-radius: 20px;
}
.embed .sampul::before { inset: 12px; }
.sampul.terbuka { transform: translateY(-100%); visibility: hidden; }
.sampul-orn { padding: 12px 8px; }
.sampul-isi { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 16px; }
.sampul-tgl { font-size: 15px; color: var(--text-2); }
.label-tamu {
  margin-top: 16px; min-width: 232px; max-width: 320px; padding: 10px 20px 14px;
  background: var(--surface); border: 1px solid var(--garis); border-radius: 12px;
  transform: rotate(-1.5deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 12px 24px rgba(0, 0, 0, .08);
}
[data-tema='senja'] .label-tamu { background: var(--raised); box-shadow: 0 12px 24px rgba(0, 0, 0, .35); }
.label-tamu p:first-child { font-size: 12px; color: var(--muted); padding-bottom: 6px; border-bottom: 1px dashed var(--garis-kuat); }
.tamu { font-size: 18px; font-weight: 500; line-height: 1.4; margin-top: 4px; overflow-wrap: anywhere; }
.sampul .tombol { margin-top: 8px; }

/* Tata letak isi */
.tata { min-height: 100vh; }
.panel { display: none; }
.kolom { max-width: 480px; margin: 0 auto; padding: 0 24px; }
@media (min-width: 960px) {
  .tata { display: grid; grid-template-columns: 1fr 520px; }
  .panel {
    display: grid; place-items: center; position: sticky; top: 40px; height: calc(100vh - 40px);
    background: var(--raised); border-right: 1px solid var(--garis); text-align: center; padding: 48px;
  }
  .embed .panel { top: 0; height: 100vh; }
  .panel-isi { display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; max-width: 480px; }
  .panel .orn-pita { width: 240px; height: 40px; }
  .panel .nama { font-size: 88px; }
  .kolom { max-width: none; width: 520px; padding: 0 40px; background: var(--surface); }
}

.bagian { padding: 64px 0; border-top: 1px solid var(--garis); text-align: center; }
.bagian:first-child { border-top: 0; }
.pembuka { display: flex; flex-direction: column; gap: 16px; padding-top: 56px; }
.pembuka > p:not(.salam) { color: var(--text-2); }
.kutipan { margin-top: 16px; padding: 24px; background: var(--raised); border-radius: var(--r-kartu); }
.kutipan p { font-size: 15px; color: var(--text); }
.kutipan cite { display: block; margin-top: 12px; font-style: normal; font-size: 13px; color: var(--muted); }

/* Mempelai */
.mempelai .judul { margin-bottom: 32px; }
.orang { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lengkung {
  width: 128px; height: 168px; margin-bottom: 16px; padding: 6px;
  border: 1px solid var(--garis-kuat); border-radius: 64px 64px 12px 12px;
}
.lengkung span {
  display: grid; place-items: center; width: 100%; height: 100%;
  background: var(--raised); border-radius: 58px 58px 6px 6px;
  font-family: var(--display); font-weight: var(--w-display); font-size: 64px; line-height: 1; color: var(--accent);
}
.orang-panggilan { font-family: var(--display); font-weight: var(--w-display); font-size: 36px; line-height: 1.15; }
.orang-nama { font-size: 16px; font-weight: 500; }
.orang-ortu { font-size: 14px; color: var(--text-2); max-width: 300px; }
.dan-besar { font-family: var(--display); font-size: 40px; color: var(--accent); margin: 24px 0; line-height: 1; }

/* Hitung mundur */
.hitung-kotak { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 24px; }
.hitung-kotak div { display: flex; flex-direction: column; gap: 4px; padding: 16px 0; background: var(--raised); border-radius: 12px; }
.hitung-kotak span { font-size: 28px; line-height: 1; font-weight: 500; }
.hitung-kotak small { font-size: 12px; color: var(--muted); }

/* Acara */
.daftar-acara { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; text-align: left; }
.acara { padding: 24px; background: var(--bg); border: 1px solid var(--garis); border-radius: var(--r-kartu); }
.acara-nama { font-family: var(--display); font-weight: var(--w-display); font-size: 26px; line-height: 1.2; }
.acara-rinci { display: flex; flex-direction: column; gap: 12px; margin: 16px 0 20px; }
.acara-rinci div { display: grid; grid-template-columns: 16px 1fr; gap: 12px; align-items: start; }
.acara-rinci dt { color: var(--muted); padding-top: 3px; }
.acara-rinci dd { font-size: 14px; color: var(--text-2); }
.acara-rinci strong { color: var(--text); font-weight: 500; }
.aksi { display: flex; flex-wrap: wrap; gap: 8px; }

/* Tombol */
.tombol {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: var(--r-kontrol); border: 1px solid transparent;
  font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), transform 150ms var(--ease);
}
.tombol:active { transform: scale(.98); }
.tombol-1 { background: var(--accent); color: var(--on-accent); }
.tombol-1:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
[data-tema='senja'] .tombol-1:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.tombol-2 { background: var(--surface); border-color: var(--garis-kuat); color: var(--text); }
.tombol-2:hover { background: var(--raised); }
.tombol-2 .ikon { color: var(--muted); }
.tombol-kecil { height: 36px; padding: 0 12px; flex: none; }

/* Cerita */
.cerita { margin-top: 24px; text-align: left; }
.cerita li { display: grid; grid-template-columns: 48px 1fr; gap: 16px; }
.cerita li > div { padding: 0 0 24px 20px; border-left: 1px solid var(--garis-kuat); position: relative; }
.cerita li > div::before {
  content: ''; position: absolute; left: -4px; top: 7px; width: 7px; height: 7px; border-radius: 4px; background: var(--accent);
}
.cerita li:last-child > div { padding-bottom: 0; }
.cerita-tahun { font-size: 13px; color: var(--muted); padding-top: 1px; }
.cerita h3 { font-size: 16px; font-weight: 500; line-height: 1.4; }
.cerita p { font-size: 14px; color: var(--text-2); margin-top: 4px; }

/* Formulir */
.rsvp { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; text-align: left; }
.isian { display: flex; flex-direction: column; gap: 8px; }
.isian > span, .pilihan legend { font-size: 13px; color: var(--text-2); }
.isian input, .isian select, .isian textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r-kontrol);
  background: var(--bg); border: 1px solid var(--garis-kuat);
  transition: border-color 150ms var(--ease);
}
.isian textarea { resize: vertical; min-height: 88px; }
.isian input:focus, .isian select:focus, .isian textarea:focus { outline: none; border-color: var(--accent); }
.pilihan { border: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pilihan legend { margin-bottom: 8px; }
.pilihan label { position: relative; }
.pilihan input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pilihan span {
  display: grid; place-items: center; height: 40px; border-radius: 8px; font-size: 14px;
  background: var(--bg); border: 1px solid var(--garis-kuat);
  transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease);
}
.pilihan input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pilihan input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-jumlah][hidden] { display: none; }
.rsvp .tombol { align-self: stretch; }
.status { font-size: 14px; color: var(--text-2); min-height: 22px; }

/* Ucapan */
.ucapan { margin-top: 24px; text-align: left; }
.ucapan li { padding: 16px 0; border-bottom: 1px solid var(--garis); }
.ucapan li:first-child { border-top: 1px solid var(--garis); }
.u-atas { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.u-nama { font-size: 14px; font-weight: 500; }
.u-waktu { font-size: 12px; color: var(--muted); white-space: nowrap; }
.u-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.u-status::before { content: ''; width: 6px; height: 6px; border-radius: 3px; background: var(--muted); }
.u-status[data-s='hadir']::before { background: var(--positif); }
.u-status[data-s='tidak']::before { background: var(--negatif); }
.u-teks { font-size: 14px; color: var(--text-2); margin-top: 8px; overflow-wrap: anywhere; }
.ucapan .baru { animation: masuk 400ms var(--ease); }

/* Hadiah */
.daftar-rek { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.rek {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 16px 16px 20px; background: var(--raised); border-radius: 12px; text-align: left;
}
.rek-alamat { margin-top: 8px; }
.rek-bank { font-size: 13px; color: var(--muted); }
.rek-no { font-size: 20px; font-weight: 500; line-height: 1.4; letter-spacing: .01em; }
.rek-nama { font-size: 13px; color: var(--text-2); }

/* Penutup */
.penutup { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.penutup > p:first-child { color: var(--text-2); }
.penutup .kecil { margin-top: 16px; }
.nama-penutup { font-size: 44px; }
.keluarga { font-size: 14px; color: var(--text-2); }
.penutup .orn-wadah { margin-top: 16px; }
.kaki { padding: 24px 0 96px; border-top: 1px solid var(--garis); text-align: center; font-size: 12px; color: var(--muted); }
.kaki a { color: var(--text-2); }

/* Musik dan notifikasi */
.musik {
  position: fixed; right: 16px; bottom: 16px; z-index: 15; width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: 22px; cursor: pointer;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--garis-kuat);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  transition: background-color 150ms var(--ease);
}
.musik:hover { background: var(--raised); }
.musik .m-on, .musik[aria-pressed='true'] .m-off { display: none; }
.musik[aria-pressed='true'] .m-on { display: block; }
.tertutup .musik { visibility: hidden; }
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translate(-50%, 8px);
  padding: 10px 16px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.toast.tampil { opacity: 1; transform: translate(-50%, 0); }

/* Satu animasi masuk saat undangan dibuka */
.dibuka .kolom > .bagian:first-child, .dibuka .panel-isi { animation: masuk 500ms var(--ease) both; }
@keyframes masuk { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; }
}
