/* Balon — undangan pesta ulang tahun anak. Krem hangat, balon warna-warni, bendera segitiga, konfeti. */
@font-face { font-family: "Fredoka"; src: url("fonts/fredoka.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Nunito"; src: url("fonts/nunito.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --cream: #fff7ec;
  --paper: #fffdf9;
  --ink: #2e2a4f;
  --muted: #5d5878;
  --line: #f0e2cf;
  --coral: #ff7b6b;
  --coral-d: #c63f30;
  --sun: #ffc94a;
  --mint: #4fbf9f;
  --sky: #62a8e5;
  --lilac: #b08ae0;
  --display: "Fredoka", "Baloo 2", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/1.65 var(--body);
  color: var(--ink);
  background:
    radial-gradient(40% 50% at 8% 20%, rgba(255, 201, 74, .28), transparent 70%),
    radial-gradient(40% 50% at 92% 70%, rgba(98, 168, 229, .22), transparent 70%),
    url("confetti.svg") 0 0 / 260px,
    #ffe6d3;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
img { max-width: 100%; display: block; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; line-height: 1.15; }

main {
  max-width: 480px;
  margin: 0 auto;
  background: var(--cream) url("confetti.svg") 30px 60px / 220px;
  min-height: 100vh;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(46, 42, 79, .05), 0 30px 80px rgba(198, 63, 48, .16);
}
@media (min-width: 560px) {
  body { padding: 32px 0; }
  main { border-radius: 36px; }
}

/* Gerbang sampul: hanya bila JS jalan, isi disembunyikan sampai "Buka undangan". */
.js:not(.opened) main > section:not(.cover),
.js:not(.opened) footer { display: none; }
.opened .open { display: none; }
.js.opened main > section:not(.cover) { animation: muncul .7s ease both; }

/* ---------- Sampul ---------- */
.cover {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 92px 24px 64px;
  background:
    radial-gradient(120% 60% at 50% 0%, #dff0ff 0%, rgba(223, 240, 255, 0) 70%),
    radial-gradient(70% 22% at 50% 74%, rgba(255, 214, 190, .75) 0%, rgba(255, 225, 207, 0) 100%);
}
.bunting { position: absolute; top: 0; left: 0; width: 100%; height: 64px; }
.bunting .f1 { fill: var(--coral); }
.bunting .f2 { fill: var(--sun); }
.bunting .f3 { fill: var(--mint); }
.bunting .f4 { fill: var(--sky); }
.bunting .f5 { fill: var(--lilac); }

.balloons { position: absolute; inset: 0; pointer-events: none; }
.b { position: absolute; width: 60px; height: 100px; animation: apung 6s ease-in-out infinite; }
.b1 { color: var(--coral); left: 4%; top: 15%; width: 64px; height: 107px; }
.b2 { color: var(--sun); left: 24%; top: 9%; width: 46px; height: 77px; animation-delay: -2s; animation-duration: 7s; }
.b3 { color: var(--sky); right: 5%; top: 13%; width: 62px; height: 103px; animation-delay: -1s; }
.b4 { color: var(--mint); right: 25%; top: 10%; width: 42px; height: 70px; animation-delay: -3s; animation-duration: 6.6s; }
.b5 { color: var(--lilac); left: 3%; bottom: 7%; width: 52px; height: 87px; animation-delay: -4s; animation-duration: 7.4s; }
.b6 { color: var(--coral); right: 4%; bottom: 9%; width: 50px; height: 83px; animation-delay: -2.6s; }

.cover-body { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; animation: pop .8s cubic-bezier(.2, .9, .3, 1.3) both; }
.eyebrow { font: 700 12px/1.4 var(--body); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.cover h1 { display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 100%; }
.cover h1 .small { font-size: 22px; font-weight: 500; color: var(--ink); }
.cover h1 .nick {
  font-size: clamp(54px, 18vw, 80px);
  font-weight: 700;
  line-height: 1;
  color: var(--coral-d);
  text-shadow: 3px 3px 0 var(--sun);
  overflow-wrap: anywhere;
  padding: 0 4px;
}

.age {
  position: relative;
  width: 112px;
  height: 126px;
  margin: 8px 0 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50% 50% 48% 48% / 56% 56% 44% 44%;
  background: radial-gradient(circle at 32% 26%, #9fcbf2 0 10%, var(--sky) 42%, #3f86c9 100%);
  color: #fff;
  box-shadow: inset -8px -10px 0 rgba(0, 0, 0, .08);
  animation: apung 5s ease-in-out infinite;
}
.age::after { content: ""; position: absolute; bottom: -8px; left: 50%; width: 16px; height: 10px; transform: translateX(-50%); background: #3f86c9; clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%); }
.age::before { content: ""; position: absolute; top: 100%; left: 50%; width: 2px; height: 26px; margin-top: 2px; background: #a79bb8; border-radius: 2px; }
.age span { font: 700 11px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: #fff; margin-top: 6px; }
.age b { font: 700 60px/1 var(--display); text-shadow: 0 3px 0 rgba(0, 0, 0, .12); }

.date { display: inline-block; padding: 8px 18px; border-radius: 999px; background: var(--paper); border: 2px solid var(--line); font-weight: 700; font-size: 15px; }
.to { margin-top: 4px; padding: 12px 22px; border-radius: 20px; background: rgba(255, 255, 255, .72); border: 2px dashed #e9cdb4; }
.to p { font-size: 13px; color: var(--muted); }
.to .guest { font: 600 21px/1.3 var(--display); color: var(--ink); margin-top: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--coral-d);
  color: #fff;
  font: 700 16px/1.2 var(--body);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 0 #8f2b20;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #8f2b20; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, .music-toggle:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.btn.ghost { background: var(--paper); color: var(--ink); border: 2px solid var(--ink); box-shadow: 0 5px 0 var(--ink); }
.btn.small { min-height: 44px; padding: 10px 18px; font-size: 15px; }
.open { margin-top: 8px; padding: 14px 32px; font-size: 17px; }
.open::before { content: "🎈"; font-size: 18px; }

/* ---------- Bagian umum ---------- */
main > section:not(.cover) { position: relative; padding: 56px 24px; text-align: center; }
main > section h3 {
  font-size: 30px;
  font-weight: 600;
  margin-bottom: 22px;
  padding-bottom: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='10' viewBox='0 0 72 10'%3E%3Cpath d='M2 5q6-5 12 0t12 0 12 0 12 0 12 0 8 0' fill='none' stroke='%23ff7b6b' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center bottom / 72px 10px no-repeat;
}

/* Pengantar */
.intro { padding-top: 64px !important; }
.hi { font-size: 34px; color: var(--ink); margin-bottom: 14px; }
.message { max-width: 380px; margin: 0 auto; font-size: 17px; color: var(--muted); }
.star { position: absolute; width: 22px; height: 22px; color: var(--sun); }
.s-a { left: 26px; top: 40px; transform: rotate(-12deg); }
.s-b { right: 30px; top: 92px; width: 16px; height: 16px; color: var(--lilac); }
.star-card {
  position: relative;
  margin: 34px auto 0;
  padding: 30px 22px 28px;
  max-width: 380px;
  border-radius: 32px;
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: 0 10px 0 #ffe2c8;
}
.photo { width: 168px; height: 168px; margin: -6px auto 18px; padding: 6px; border-radius: 50%; background: conic-gradient(var(--coral), var(--sun), var(--mint), var(--sky), var(--lilac), var(--coral)); }
.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; border: 4px solid var(--paper); }
.star-card .eyebrow { margin-bottom: 8px; }
.star-card h3.name { margin: 0; padding: 0; background: none; }
.name { font-size: 28px; font-weight: 600; color: var(--coral-d); overflow-wrap: anywhere; }
.turning { margin-top: 6px; font-size: 16px; color: var(--muted); }
.turning b { color: var(--ink); }
.parents { margin-top: 14px; padding-top: 14px; border-top: 2px dotted var(--line); font-size: 15px; color: var(--muted); }

/* Hitung mundur */
.count { padding-top: 28px !important; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 380px; margin: 0 auto; }
.countdown div { padding: 14px 4px 10px; border-radius: 22px; background: #ffe0da; box-shadow: 0 5px 0 rgba(46, 42, 79, .07); }
.countdown div:nth-child(2) { background: #fff0c4; }
.countdown div:nth-child(3) { background: #d6f3ea; }
.countdown div:nth-child(4) { background: #dcebfa; }
.countdown b { display: block; font: 700 32px/1.1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
.countdown span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* Acara */
.ticket {
  max-width: 400px;
  margin: 0 auto;
  padding: 26px 22px;
  border-radius: 30px;
  background: var(--paper);
  border: 2px solid var(--line);
  box-shadow: 0 10px 0 #ffe2c8;
  text-align: left;
}
.row { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; }
.row + .row { border-top: 2px dotted var(--line); }
.ico { flex: none; width: 44px; height: 44px; border-radius: 16px; background: #ffe0da center / 22px no-repeat; }
.ico-cal { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c63f30' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.ico-time { background-color: #fff0c4; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5700a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.ico-pin { background-color: #d6f3ea; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23217a62' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E"); }
.label { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.val { font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.45; margin-top: 2px; }
.theme { margin: 14px 0 4px; padding: 14px 16px; border-radius: 20px; background: #efe5fb; border: 2px dashed #c9b1ec; text-align: center; }
.theme p:last-child { font: 600 18px/1.35 var(--display); margin-top: 4px; color: #4b2f7a; }
.actions { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.actions .btn { width: 100%; }

/* Galeri */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 22px; border: 4px solid var(--paper); box-shadow: 0 6px 0 #ffe2c8; }
.grid img:nth-child(3n+1) { grid-column: span 2; aspect-ratio: 16 / 10; }

/* Kado */
.gifts > p { max-width: 360px; margin: 0 auto 20px; color: var(--muted); }
.gift-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 380px;
  margin: 0 auto;
  padding: 20px 22px;
  border-radius: 26px;
  text-align: left;
  background: linear-gradient(135deg, #ffd9cf, #ffe9b8);
  border: 2px solid #f6cbb3;
}
.gift-card b { font: 600 18px/1.2 var(--display); }
.gift-card .number { font: 700 22px/1.3 var(--body); letter-spacing: .04em; margin: 2px 0; overflow-wrap: anywhere; }
.gift-card p { font-size: 14px; color: #4a4364; }

/* RSVP & ucapan */
.note { max-width: 380px; margin: 0 auto 16px; padding: 14px 18px; border-radius: 18px; background: #dcebfa; font-weight: 600; }
form { display: flex; flex-direction: column; gap: 16px; max-width: 400px; margin: 0 auto; text-align: left; }
form > label, fieldset { display: flex; flex-direction: column; gap: 8px; font-weight: 700; font-size: 15px; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { margin-bottom: 8px; padding: 0; }
fieldset { flex-direction: row; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 999px; background: var(--paper); border: 2px solid var(--line); font-weight: 700; cursor: pointer; }
.pill:has(input:checked) { border-color: var(--coral-d); background: #ffe0da; }
.pill input { accent-color: var(--coral-d); width: 18px; height: 18px; margin: 0; }
input:not([type=radio]), textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 2px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
}
textarea { min-height: 120px; resize: vertical; }
form .btn { align-self: stretch; }
.wishes { list-style: none; margin: 28px auto 0; padding: 0; max-width: 400px; display: flex; flex-direction: column; gap: 12px; text-align: left; }
.wishes li { padding: 16px 18px; border-radius: 22px; background: var(--paper); border: 2px solid var(--line); }
.wishes li.pinned { border-color: var(--sun); background: #fff6dc; }
.wishes b { font-family: var(--display); font-weight: 600; font-size: 17px; }
.wishes span { font-size: 13px; color: #217a62; font-weight: 700; }
.wishes p { margin-top: 4px; color: var(--muted); overflow-wrap: anywhere; }
.wishes .wish-reply { margin-top: 8px; padding-left: 12px; border-left: 3px solid var(--coral); font-size: 14px; }

/* Penutup */
.closing { padding-bottom: 40px !important; }
.mini-balloons { position: relative; height: 92px; width: 140px; margin: 0 auto 18px; }
.mini-balloons .b { width: 46px; height: 77px; top: 0; bottom: auto; }
.mini-balloons .b1 { left: 4px; top: 12px; }
.mini-balloons .b3 { left: 47px; right: auto; top: 0; color: var(--sun); }
.mini-balloons .b5 { left: 90px; top: 14px; color: var(--sky); }
.closing > p { max-width: 360px; margin: 0 auto; font-size: 17px; color: var(--muted); }
.family { margin-top: 20px !important; }
.family b { display: inline-block; margin-top: 4px; font: 600 21px/1.35 var(--display); color: var(--ink); }

footer { padding: 22px 24px 36px; text-align: center; font-size: 13px; color: var(--muted); }
footer a { color: var(--coral-d); font-weight: 800; text-decoration: none; }

.music-toggle {
  position: fixed;
  right: max(16px, calc(50% - 240px + 16px));
  bottom: 20px;
  z-index: 20;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  color: var(--coral-d);
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(46, 42, 79, .2), inset 0 0 0 3px var(--coral);
}
.music-toggle[aria-pressed=true] span { display: inline-block; animation: putar 3s linear infinite; }

/* Konfeti saat sampul dibuka (dibuat JS). */
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.burst i { position: absolute; top: -20px; left: var(--x); width: 8px; height: 14px; border-radius: 2px; background: var(--c); animation: jatuh var(--t) var(--d) cubic-bezier(.3, .2, .6, 1) forwards; }
.burst i.round { width: 10px; height: 10px; border-radius: 50%; }

@keyframes apung { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-14px) rotate(3deg); } }
@keyframes pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes muncul { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes jatuh { to { transform: translateY(110vh) rotate(var(--r)); opacity: .9; } }
@keyframes putar { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .burst { display: none; }
}
html:not(.js) .count { display: none; }

/* Amplop: beberapa rekening/e-wallet */
.gift-list { display: grid; gap: 14px; width: 100%; }

/* ---------- Animasi ---------- */
:root { --rv-dur: 850; }
.rv { opacity: 0; scale: .7; translate: 0 26px; }
.rv.in { opacity: 1; translate: 0 0; scale: 1; rotate: 0deg; filter: blur(0) brightness(1); clip-path: none; transition: opacity 0.85s cubic-bezier(.34,1.56,.64,1) calc(var(--d, 0) * 1ms), translate 0.85s cubic-bezier(.34,1.56,.64,1) calc(var(--d, 0) * 1ms), scale 0.85s cubic-bezier(.34,1.56,.64,1) calc(var(--d, 0) * 1ms), rotate 0.85s cubic-bezier(.34,1.56,.64,1) calc(var(--d, 0) * 1ms), filter 0.85s cubic-bezier(.34,1.56,.64,1) calc(var(--d, 0) * 1ms), clip-path 0.85s cubic-bezier(.34,1.56,.64,1) calc(var(--d, 0) * 1ms); }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; translate: none; scale: none; rotate: none; filter: none; clip-path: none; } }

@media (prefers-reduced-motion: no-preference) {
  .bunting { transform-origin: 50% 0; animation: mo-ayun 6s ease-in-out infinite alternate; }
  .star-card .star { animation: mo-putar 24s linear infinite; }
}
@keyframes mo-denyut { 0%, 100% { scale: 1; } 50% { scale: 1.08; } }
@keyframes mo-ambang { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }
@keyframes mo-ayun { from { rotate: -2.2deg; } to { rotate: 2.2deg; } }
@keyframes mo-putar { to { rotate: 360deg; } }
@keyframes mo-kerlip { 0%, 100% { opacity: 1; scale: 1; } 50% { opacity: .35; scale: .72; } }
@keyframes mo-kilau { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes mo-geser { from { translate: -26px 0; } to { translate: 26px 0; } }
@keyframes mo-garis { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes mo-naik { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
@keyframes mo-blur { from { opacity: 0; filter: blur(10px); scale: 1.05; } to { opacity: 1; filter: blur(0); scale: 1; } }
@keyframes mo-pop { from { opacity: 0; scale: .55; rotate: -8deg; } to { opacity: 1; scale: 1; rotate: 0deg; } }
@keyframes mo-nudge { 0%, 100% { translate: 0 0; } 50% { translate: 5px 0; } }
@keyframes mo-hujan { to { background-position: 0 520px, 0 520px, 0 520px, 0 780px, 0 780px; } }

/* Foto sampul (opsional): lengkung seperti jendela; tinggi menyesuaikan layar supaya tombol "Buka undangan" tetap terjangkau. */
.cover-photo { position: relative; z-index: 1; flex: none; display: block; width: auto; height: clamp(96px, 17svh, 150px); aspect-ratio: 4 / 5; margin: 8px auto 6px; border-radius: 999px 999px 16px 16px; overflow: hidden; border: 3px solid rgba(255, 255, 255, 0.85); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22); }
.cover-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* Cover lebih tinggi dari layar (foto sampul + layar pendek): tetap bisa digulir ke tombol "Buka undangan". */
.js body.locked { overflow: visible; }
/* Bentuk foto sampul khas Balon: lingkaran miring dengan cincin warna-warni. */
.cover-photo { aspect-ratio: 1 / 1; margin: 16px auto 14px; border: 5px solid #fff; border-radius: 50%; box-shadow: 0 0 0 4px var(--sun), 0 0 0 8px var(--coral), 0 12px 22px rgba(46, 42, 79, 0.2); transform: rotate(-4deg); }
@media (max-height: 700px) { .cover-photo { display: none; } } /* layar pendek: sampul seperti semula supaya tombol tetap terlihat */
