/* Tumpeng — undangan tasyakuran: nasi tumpeng di atas tampah, kertas hangat, hijau daun pisang. */
@font-face { font-family: "Fraunces"; font-weight: 300 700; src: url("fonts/fraunces.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400 800; src: url("fonts/plus-jakarta-sans.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Amiri"; src: url("fonts/amiri-bismillah.woff2") format("woff2"); font-display: swap; }

:root {
  --page: #e6d8b9;
  --bg: #f6efdf;
  --bg-2: #efe3c8;
  --card: #fffaf0;
  --ink: #2b2a1f;
  --muted: #6a6450;
  --accent: #2f5d3a;
  --accent-2: #3f7d45;
  --on-accent: #fffaf0;
  --gold: #a9781a;
  --kunyit: #f0b429;
  --line: rgba(47, 93, 58, 0.22);
  --halo: rgba(240, 180, 41, 0.34);
  --shadow: rgba(84, 62, 16, 0.18);
  --display: "Fraunces", Georgia, serif;
  --body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Tone warna (field "tone"): kunyit = bawaan di atas. */
:root[data-tone="pandan"] { --page: #0a1c12; --bg: #12301f; --bg-2: #0e2618; --card: #1a4029; --ink: #f6efdc; --muted: #b7c8b4; --accent: #e7c46a; --accent-2: #f3dc9a; --on-accent: #1c2a12; --gold: #e7c46a; --kunyit: #f0b429; --line: rgba(231, 196, 106, 0.3); --halo: rgba(231, 196, 106, 0.2); --shadow: rgba(0, 0, 0, 0.45); }
:root[data-tone="sogan"] { --page: #d9c39c; --bg: #f1e2c8; --bg-2: #e8d3b0; --card: #fbf2e0; --ink: #3a2415; --muted: #7a5c44; --accent: #6f3a1c; --accent-2: #8d4f28; --on-accent: #fbf2e0; --gold: #a06a17; --kunyit: #c98a2b; --line: rgba(111, 58, 28, 0.25); --halo: rgba(201, 138, 43, 0.34); --shadow: rgba(80, 44, 12, 0.22); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--page); }
body { margin: 0; min-height: 100vh; font-family: var(--body); font-size: 16px; line-height: 1.65; color: var(--ink); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
svg { display: block; }
a { color: var(--accent); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

main {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 0 0, color-mix(in srgb, var(--accent) 8%, transparent) 0 7px, transparent 8px),
    radial-gradient(circle at 22px 22px, color-mix(in srgb, var(--kunyit) 14%, transparent) 0 7px, transparent 8px),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-size: 44px 44px, 44px 44px, auto;
}
@media (min-width: 560px) { main { box-shadow: 0 30px 90px var(--shadow); } }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
p { margin: 0 0 0.8em; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.34em; text-transform: uppercase; color: var(--muted); margin: 0; }

/* ---------- Sampul ---------- */
.cover { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px 44px; text-align: center; }
.sinar {
  position: absolute; top: 50%; left: 50%; width: 560px; height: 560px; margin: -400px 0 0 -280px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, var(--halo) 0 5deg, transparent 5deg 10deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 22%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 22%, transparent 100%);
}
.kerlip { position: absolute; color: var(--kunyit); }
.k1 { width: 18px; height: 18px; top: 9%; left: 12%; }
.k2 { width: 12px; height: 12px; top: 17%; right: 14%; }
.k3 { width: 14px; height: 14px; top: 44%; left: 7%; }
.k4 { width: 10px; height: 10px; top: 38%; right: 8%; }
.cover > :not(.sinar):not(.kerlip) { position: relative; }
.tumpeng { width: min(82%, 310px); aspect-ratio: 320 / 250; height: auto; margin: 14px auto 18px; filter: drop-shadow(0 16px 18px var(--shadow)); }
.acara-nama { font-size: 13px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin: 0 0 10px; max-width: 100%; line-height: 1.5; text-wrap: balance; }
.cover h1 { font-size: clamp(38px, 12.5vw, 54px); font-weight: 600; font-variation-settings: "SOFT" 100, "WONK" 0; color: var(--accent); max-width: 100%; overflow-wrap: anywhere; text-wrap: balance; }
.tgl { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 18px 0 0; font-weight: 700; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); line-height: 1.4; }
.tgl::before, .tgl::after { content: ""; flex: none; width: 26px; height: 1.5px; background: var(--gold); border-radius: 2px; }
.to { margin: 20px auto 0; width: 100%; max-width: 320px; padding: 13px 18px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--card) 80%, transparent); }
.to p { margin: 0; font-size: 13px; color: var(--muted); }
.to .guest { font-family: var(--display); font-weight: 600; font-size: 21px; color: var(--ink); margin-top: 2px; line-height: 1.3; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 22px; border: 0; border-radius: 999px;
  font-family: var(--body); font-size: 15px; font-weight: 700; line-height: 1; color: var(--on-accent); background: var(--accent);
  box-shadow: 0 10px 20px -10px var(--accent); text-decoration: none; cursor: pointer; transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.ghost { color: var(--accent); background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn.wide { width: 100%; }
.btn.done { background: var(--accent-2); color: var(--on-accent); box-shadow: none; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--kunyit); outline-offset: 2px; }
.btn.open { position: relative; margin-top: 26px; padding: 12px 30px; font-size: 16px; }
.btn.open::after { content: ""; position: absolute; inset: -6px; border-radius: inherit; border: 1.5px solid var(--accent); opacity: 0; pointer-events: none; }

/* Gerbang "Buka undangan": tanpa JS semua isi langsung tampil. */
.js body:not(.opened) .isi { display: none; }
.opened .btn.open { display: none; }
.opened .cover { min-height: 0; padding-bottom: 20px; }

/* ---------- Isi ---------- */
.isi { padding: 18px 0 0; }
.isi > section { position: relative; margin: 0 16px 30px; text-align: center; }
section h3 { font-size: 25px; color: var(--accent); margin: 0 0 8px; }
.pembatas { width: 180px; height: 18px; margin: 0 auto 16px; color: var(--gold); }
.panel { padding: 30px 22px 26px; border-radius: 22px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 18px 36px -24px var(--shadow); }

.salam { padding: 10px 8px 0; }
.bismillah { font-family: "Amiri", serif; font-size: 30px; line-height: 1.9; color: var(--accent); margin: 0 0 6px; direction: rtl; }
.opening { font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--ink); margin-bottom: 8px; }
.intro { color: var(--muted); margin: 0; white-space: pre-line; }
.intro b { color: var(--ink); font-weight: 700; }

.potret { width: 178px; height: 218px; margin: 0 auto 20px; padding: 6px; border-radius: 999px 999px 20px 20px; border: 1.5px solid var(--gold); }
.potret img { width: 100%; height: 100%; object-fit: cover; border-radius: 999px 999px 14px 14px; }
.profil h2 { font-size: 25px; line-height: 1.22; color: var(--ink); margin-bottom: 12px; overflow-wrap: anywhere; text-wrap: balance; }
.profil .pembatas { margin-bottom: 10px; }
.desc { color: var(--muted); margin: 0; }
.profil .pembatas:last-child { margin-bottom: 0; }

/* Hitung mundur */
.hitung h3 { font-size: 20px; margin-bottom: 14px; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.countdown div { padding: 14px 4px 10px; border-radius: 16px; background: var(--accent); color: var(--on-accent); }
.countdown b { display: block; font-family: var(--display); font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.countdown span { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.8; }

/* Acara */
.when { font-family: var(--display); font-weight: 600; font-size: 23px; line-height: 1.25; color: var(--ink); margin-bottom: 4px; }
.time { color: var(--gold); font-weight: 700; margin-bottom: 12px; }
.place { display: flex; gap: 6px; justify-content: center; align-items: flex-start; color: var(--muted); text-align: left; max-width: 320px; margin: 0 auto 18px; }
.place svg { width: 18px; height: 18px; flex: none; color: var(--accent); margin-top: 4px; }
.aksi { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.aksi .btn { font-size: 14px; padding: 10px 18px; }

/* Susunan acara */
.susunan h3 { margin-bottom: 18px; }
.rundown { list-style: none; margin: 0; padding: 0; text-align: left; }
.rundown li { position: relative; display: grid; grid-template-columns: 58px 1fr; gap: 26px; padding: 0 4px 20px 6px; }
.rundown li::before { content: ""; position: absolute; left: 73px; top: 7px; width: 11px; height: 11px; border-radius: 50%; background: var(--kunyit); box-shadow: 0 0 0 4px color-mix(in srgb, var(--kunyit) 28%, transparent); }
.rundown li::after { content: ""; position: absolute; left: 78px; top: 22px; bottom: 0; width: 1.5px; background: var(--line); }
.rundown li:last-child { padding-bottom: 0; }
.rundown li:last-child::after { display: none; }
.jam { font-family: var(--display); font-weight: 600; font-size: 19px; color: var(--accent); font-variant-numeric: tabular-nums; text-align: right; }
.apa { font-weight: 600; color: var(--ink); line-height: 1.5; padding-top: 1px; }

/* Doa */
.story { color: var(--ink); white-space: pre-line; }
.ayat { margin: 0; padding: 2px 6px; }
.story + .ayat { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
.ayat blockquote { margin: 0; }
.ayat .latin { font-family: var(--display); font-weight: 500; font-size: 20px; line-height: 1.4; color: var(--accent); margin-bottom: 6px; }
.ayat p { color: var(--muted); font-size: 15px; margin: 0 0 8px; }
.ayat figcaption { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }

/* Galeri */
.galeri h3 { margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; border: 4px solid var(--card); box-shadow: 0 10px 20px -14px var(--shadow); }
.grid img:nth-child(3n + 1) { grid-column: span 2; aspect-ratio: 3 / 2; }

/* Amplop */
.kado > p { color: var(--muted); }
.gift-list { display: grid; gap: 14px; width: 100%; }
.rek { padding: 20px 16px; border: 1.5px dashed var(--gold); border-radius: 16px; background: color-mix(in srgb, var(--kunyit) 9%, transparent); }
.rek p { margin: 0; }
.rek .bank { font-weight: 800; font-size: 14px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.rek .number { font-family: var(--display); font-weight: 600; font-size: 26px; letter-spacing: 0.04em; color: var(--ink); margin: 2px 0; }
.rek .holder { color: var(--muted); margin-bottom: 14px; }

/* RSVP */
.rsvp form { text-align: left; }
.field { display: block; font-weight: 700; font-size: 14px; color: var(--ink); margin-bottom: 14px; }
.field input, .field textarea { display: block; width: 100%; margin-top: 6px; font: inherit; font-weight: 500; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; min-height: 46px; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 0.75; }
.field textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { font-weight: 700; font-size: 14px; color: var(--ink); margin-bottom: 6px; padding: 0; }
.pilih { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pilih label { position: relative; }
.pilih input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pilih span { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-weight: 700; font-size: 14px; line-height: 1.2; text-align: center; color: var(--ink); }
.pilih input:checked + span { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pilih input:focus-visible + span { outline: 3px solid var(--kunyit); outline-offset: 2px; }
.note { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink); background: var(--bg); font-size: 15px; }
.note.ok { border-color: var(--accent-2); }
.wishes { list-style: none; padding: 0; margin: 20px 0 0; text-align: left; max-height: 460px; overflow-y: auto; }
.wishes li { padding: 12px 14px; margin-bottom: 10px; border-radius: 4px 14px 14px 4px; border-left: 3px solid var(--kunyit); background: var(--bg); }
.wishes li.pinned { background: color-mix(in srgb, var(--kunyit) 16%, var(--bg)); }
.wishes p { margin: 0; font-size: 15px; color: var(--ink); }
.wishes .who { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.hadir { font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.wish-reply { color: var(--muted) !important; font-style: italic; margin-top: 4px !important; }

/* Penutup */
.penutup { padding: 6px 12px 0; }
.tumpeng.kecil { width: 120px; margin: 0 auto 14px; }
.penutup p { color: var(--muted); }
.penutup .opening { color: var(--ink); }
.family { margin: 14px 0 0; }
.family b { display: block; font-family: var(--display); font-weight: 600; font-size: 21px; line-height: 1.35; color: var(--accent); margin-top: 4px; }

footer { text-align: center; font-size: 13px; color: var(--muted); padding: 22px 16px 34px; border-top: 1px dashed var(--line); margin: 10px 16px 0; }
footer a { color: var(--accent); font-weight: 700; }

/* Musik */
.music-toggle { position: fixed; right: max(14px, calc(50% - 240px + 14px)); bottom: 18px; z-index: 20; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 8px 20px -6px var(--shadow); }
.music-toggle svg { width: 22px; height: 22px; }
.music-toggle[aria-pressed="true"] svg { animation: putar 4s linear infinite; }

@media (min-width: 560px) { .cover { min-height: 860px; } }
@media (max-height: 640px) { .tumpeng { width: min(62%, 230px); margin: 8px auto 12px; } .cover { padding-top: 28px; padding-bottom: 28px; } }

/* ---------- Animasi ---------- */
@keyframes putar { to { transform: rotate(360deg); } }
@keyframes ambang { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes kerlip { 0%, 100% { opacity: 1; scale: 1; } 50% { opacity: 0.3; scale: 0.7; } }
@keyframes naik { from { opacity: 0; translate: 0 20px; } to { opacity: 1; translate: 0 0; } }
@keyframes denyut { from { opacity: 0.8; scale: 0.96; } to { opacity: 0; scale: 1.14; } }
@keyframes saji { from { opacity: 0; scale: 0.82; translate: 0 26px; } to { opacity: 1; scale: 1; translate: 0 0; } }

@media (prefers-reduced-motion: no-preference) {
  .sinar { animation: putar 90s linear infinite; }
  .kerlip { animation: kerlip 3.4s ease-in-out infinite; }
  .k2 { animation-delay: -1.2s; } .k3 { animation-delay: -2s; } .k4 { animation-delay: -0.6s; }
  .cover .eyebrow { animation: naik 0.8s ease 0.05s both; }
  .cover .tumpeng { animation: saji 1s cubic-bezier(0.34, 1.4, 0.5, 1) 0.1s both, ambang 7s ease-in-out 1.2s infinite; }
  .cover .acara-nama { animation: naik 0.8s ease 0.35s both; }
  .cover h1 { animation: naik 0.9s ease 0.45s both; }
  .cover .tgl, .cover .to { animation: naik 0.8s ease 0.6s both; }
  .cover .btn.open { animation: naik 0.8s ease 0.75s both; }
  .btn.open::after { animation: denyut 2.4s ease-out 1.6s infinite; }
  .opened .isi { animation: naik 0.9s ease both; }
  .rv { opacity: 0; translate: 0 22px; }
  .rv.in { opacity: 1; translate: 0 0; transition: opacity 0.9s ease calc(var(--d, 0) * 1ms), translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--d, 0) * 1ms); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
