/* Anime — undangan bergaya komik/anime: garis tebal hitam, sunburst, kuning-pink-biru. */
@font-face { font-family: "Dela Gothic One"; src: url("fonts/dela-gothic-one-jp.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+5a5a, U+5f0f, U+7d50; }
@font-face { font-family: "Dela Gothic One"; src: url("fonts/dela-gothic-one.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Zen Maru Gothic"; src: url("fonts/zen-maru-gothic-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Zen Maru Gothic"; src: url("fonts/zen-maru-gothic-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Zen Maru Gothic"; src: url("fonts/zen-maru-gothic-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --ink: #111;
  --paper: #fffdf8;
  --dot: #e3ded3;
  --yellow: #ffd84d;
  --pink: #ff4f86;
  --blue: #2f6fde;
  --shot: #f3efe6;
  --display: "Dela Gothic One", "Zen Maru Gothic", sans-serif;
  --sans: "Zen Maru Gothic", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 700 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.page { max-width: 480px; margin: 0 auto; min-height: 100vh; padding: 14px; display: flex; flex-direction: column; gap: 14px; background: var(--paper); overflow: hidden; }
@media (min-width: 560px) { .page { box-shadow: 0 0 0 4px var(--ink), 14px 14px 0 4px var(--pink); margin-block: 20px; min-height: calc(100vh - 40px); } }
main { display: flex; flex-direction: column; gap: 24px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 18px; border: 4px solid var(--ink); background: var(--paper); color: var(--ink); text-decoration: none; cursor: pointer; font: 400 14px/1.2 var(--display); box-shadow: 5px 5px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.btn-yellow { background: var(--yellow); }
.btn-pink { background: var(--pink); }
.btn-white { background: #fff; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 13px; box-shadow: 4px 4px 0 var(--ink); align-self: flex-start; margin-top: 6px; }
.btn-big { min-height: 56px; font-size: 16px; }
.btn.copied { background: #8be28b; }

.tag { padding: 8px 12px; border: 4px solid var(--ink); font: 400 15px/1.3 var(--display); color: #fff; background: var(--blue); }
.tag.pink { background: var(--pink); color: var(--ink); }
.chapter { display: flex; flex-direction: column; gap: 10px; }
.lead { font-size: 15px; line-height: 1.55; }

/* Sampul */
.cover { display: flex; flex-direction: column; gap: 14px; min-height: calc(100vh - 28px); min-height: calc(100svh - 28px); }
.cover[hidden] { display: none; }
.burst { position: relative; flex: 1 1 auto; min-height: 520px; border: 4px solid var(--ink); overflow: hidden; background: repeating-conic-gradient(from 0deg at 50% 46%, var(--ink) 0deg 1.6deg, var(--paper) 1.6deg 9deg); }
.burst::before { content: ""; position: absolute; left: 50%; top: 46%; width: 250px; height: 250px; margin: -125px 0 0 -125px; border-radius: 50%; background: var(--paper); }
.ep { position: absolute; top: 16px; left: 16px; padding: 6px 12px; background: var(--ink); color: var(--paper); font: 400 13px/1.2 var(--display); letter-spacing: .06em; text-transform: uppercase; }
.kanji { position: absolute; top: 70px; right: 18px; writing-mode: vertical-rl; font: 400 20px/1.2 var(--display); letter-spacing: .2em; }
.burst .names { position: absolute; left: 0; right: 0; top: 46%; transform: translateY(-50%); text-align: center; font: 400 58px/.95 var(--display); text-transform: uppercase; overflow-wrap: anywhere; }
.names span { color: var(--pink); font-size: 48px; }
.sticker { position: absolute; left: 22px; bottom: 96px; padding: 12px 16px; background: #fff; border: 3px solid var(--ink); border-radius: 26px; font-weight: 900; font-size: 18px; transform: rotate(-4deg); }
.doki { position: absolute; right: 18px; bottom: 86px; font: 400 30px/1.1 var(--display); color: var(--pink); transform: rotate(8deg); text-shadow: 3px 3px 0 var(--ink); }
.bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; background: var(--ink); color: var(--paper); display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 15px; }
.guest { border: 4px solid var(--ink); padding: 16px; display: flex; flex-direction: column; gap: 6px; background-color: var(--paper); background-image: radial-gradient(var(--dot) 1.2px, transparent 1.4px); background-size: 9px 9px; }
.guest span { font-size: 14px; }
.guest b { font: 400 22px/1.3 var(--display); overflow-wrap: anywhere; }
.cover .open { align-self: stretch; min-height: 56px; font-size: 16px; }

.js .cover { position: fixed; inset: 0; z-index: 40; overflow-y: auto; padding: 14px; background: var(--paper); transition: transform 1s cubic-bezier(.7, 0, .2, 1), opacity 1s ease; }
.js:not(.is-open) body { overflow: hidden; }
.js.is-open .cover { transform: translateY(-100%); opacity: .6; }
.js.no-anim .cover { transition: none; }
html:not(.js) .cover .open { display: none; }

/* Para tokoh */
.cast { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card { border: 4px solid var(--ink); display: flex; flex-direction: column; min-width: 0; background: var(--paper); }
.card.low { margin-top: 28px; }
.shot { height: 180px; background-color: var(--shot); background-image: radial-gradient(var(--ink) 1px, transparent 1.3px); background-size: 7px 7px; display: flex; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot span { margin: auto; padding: 8px 14px; background: var(--paper); font: 400 28px/1 var(--display); }
.who { padding: 10px; border-top: 4px solid var(--ink); display: flex; flex-direction: column; gap: 2px; }
.who b { font: 400 18px/1.2 var(--display); }
.who .full { font-size: 12px; opacity: .8; }
.who .parents { font-size: 13px; line-height: 1.4; }
.who .ig { font-size: 13px; font-weight: 900; color: var(--blue); overflow-wrap: anywhere; }
.story { grid-column: span 2; position: relative; border: 4px solid var(--ink); padding: 18px 16px; background: #fff; margin-bottom: 14px; }
.story p { font-size: 16px; line-height: 1.6; }
.tbc { position: absolute; right: 10px; bottom: -14px; padding: 2px 10px; background: var(--pink); border: 3px solid var(--ink); font: 400 13px/1.4 var(--display); text-transform: uppercase; }

/* Hari H */
.card-ev { border: 4px solid var(--ink); padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; background: #fff; }
.tilt-l { transform: rotate(-1deg); }
.tilt-r { transform: rotate(1deg); }
.card-ev h3 { font: 400 22px/1.2 var(--display); }
.when { font-weight: 900; font-size: 16px; }
.place { font-size: 14px; }
.airing { border: 4px solid var(--ink); background: var(--ink); color: var(--paper); padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; line-height: 1.4; }
.airing b { font: 400 40px/1 var(--display); color: var(--pink); font-variant-numeric: tabular-nums; }
html:not(.js) .airing { display: none; }

.grid { display: grid; grid-template-columns: 1.3fr 1fr; grid-auto-rows: 130px; gap: 8px; }
.grid img { width: 100%; height: 100%; object-fit: cover; border: 4px solid var(--ink); background: var(--shot); }
.grid img:nth-child(3n + 1) { grid-column: 1; grid-row: span 2; }
.grid img:nth-child(3n + 2), .grid img:nth-child(3n) { grid-column: 2; }

.gift-card { border: 4px solid var(--ink); background: #fff; padding: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; box-shadow: 5px 5px 0 var(--ink); }
.gift-card > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bank { font: 400 13px/1.3 var(--display); color: var(--blue); text-transform: uppercase; }
.number { font-size: 20px; font-weight: 900; overflow-wrap: anywhere; }
.holder { font-size: 13px; }
.gift-card .btn { margin: 0; flex-shrink: 0; align-self: center; }

/* RSVP */
.note { padding: 12px 14px; border: 3px dashed var(--ink); font-size: 14px; }
.done { border: 4px solid var(--ink); background: #fff; padding: 20px 16px; box-shadow: 5px 5px 0 var(--ink); }
.done b { font: 400 22px/1.2 var(--display); display: block; margin-bottom: 6px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 900; }
.field.row { flex-direction: row; align-items: center; justify-content: space-between; border: 4px solid var(--ink); background: #fff; padding: 8px 12px; }
.field input, .field textarea { width: 100%; min-height: 50px; padding: 0 12px; border: 4px solid var(--ink); border-radius: 0; background: #fff; color: var(--ink); font: 700 16px/1.4 var(--sans); }
.field.row input { width: 90px; min-height: 44px; border-width: 3px; text-align: center; font: 400 20px/1 var(--display); }
.field textarea { padding: 10px 12px; min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--blue); outline-offset: 2px; }
.opts { display: flex; flex-direction: column; gap: 12px; }
.opt { position: relative; display: block; }
.opt input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.opt span { display: flex; align-items: center; min-height: 54px; padding: 0 16px; border: 4px solid var(--ink); background: #fff; font: 400 15px/1.2 var(--display); box-shadow: 5px 5px 0 var(--ink); }
.opt input:checked + span { background: var(--yellow); }
.opt input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 3px; }

.comments-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--ink); color: var(--paper); font: 400 15px/1.3 var(--display); text-transform: uppercase; }
.comments-head small { font: 700 13px/1 var(--sans); text-transform: none; }
.comments { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-height: 560px; overflow-y: auto; }
.comments li { display: flex; gap: 10px; align-items: flex-start; }
.av { flex-shrink: 0; width: 40px; height: 40px; border: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; font: 400 15px/1 var(--display); font-style: normal; text-transform: uppercase; background: var(--yellow); }
.comments li:nth-child(3n + 2) .av { background: var(--pink); }
.comments li:nth-child(3n) .av { background: #9be0ff; }
.bubble { flex: 1; min-width: 0; border: 3px solid var(--ink); border-radius: 4px 18px 18px 18px; background: #fff; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.who2 { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.who2 em { font-size: 12px; font-style: normal; font-weight: 700; color: var(--blue); }
.bubble p:not(.who2) { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.wish-reply { margin-top: 4px; padding: 6px 10px; border-left: 4px solid var(--pink); background: var(--shot); font-size: 13px; }

.closing { border: 4px solid var(--ink); background: var(--ink); color: var(--paper); padding: 28px 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 15px; }
.closing .big { font: 400 34px/1.2 var(--display); text-transform: uppercase; }
footer { padding: 4px 0 14px; text-align: center; font-size: 12px; }

.music-toggle { position: fixed; bottom: 16px; right: max(14px, calc(50% - 226px)); z-index: 50; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border: 3px solid var(--ink); background: var(--yellow); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); cursor: pointer; }
.music-toggle svg { width: 18px; height: 18px; }
.music-toggle[aria-pressed="false"]::after { content: ""; position: absolute; width: 26px; height: 3px; background: var(--ink); transform: rotate(-45deg); }
html:not(.js) .music-toggle { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .js .cover { transition: opacity .3s ease; }
  .js.is-open .cover { transform: none; opacity: 0; }
}

/* Tombol musik muncul setelah undangan dibuka */
.js:not(.is-open) .music-toggle { display: none; }

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

/* ---------- Animasi ---------- */
.rv { opacity: 0; translate: 0 20px; scale: .85; rotate: -3deg; }
.rv.in { opacity: 1; translate: 0 0; scale: 1; rotate: 0deg; transition: opacity .7s cubic-bezier(.34, 1.56, .64, 1) calc(var(--d, 0) * 1ms), translate .7s cubic-bezier(.34, 1.56, .64, 1) calc(var(--d, 0) * 1ms), scale .7s cubic-bezier(.34, 1.56, .64, 1) calc(var(--d, 0) * 1ms), rotate .7s cubic-bezier(.34, 1.56, .64, 1) calc(var(--d, 0) * 1ms), clip-path .7s 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; clip-path: none; } }

.burst { background: none; isolation: isolate; }
.burst::before { z-index: -1; }
.burst::after { content: ""; position: absolute; z-index: -2; left: -70%; width: 240%; top: -74%; height: 240%; background: repeating-conic-gradient(from 0deg at 50% 50%, var(--ink) 0deg 1.6deg, var(--paper) 1.6deg 9deg); }
@media (prefers-reduced-motion: no-preference) {
  .burst::after { animation: putar 90s linear infinite; }
  .burst .names { animation: pop .9s cubic-bezier(.34, 1.56, .64, 1) .2s both; }
  .ep { animation: geser .6s both; }
  .kanji { animation: muncul .8s .6s both; }
  .sticker { animation: pop .7s cubic-bezier(.34, 1.56, .64, 1) .8s both, goyang 3.4s 1.6s ease-in-out infinite; }
  .doki { animation: pop .7s cubic-bezier(.34, 1.56, .64, 1) 1s both, denyut 1.3s 1.7s ease-in-out infinite; }
  .bar, .guest, .cover .open { animation: muncul .7s 1.1s both; }
  .airing b { animation: denyut 1.6s ease-in-out infinite; display: inline-block; }
  .tbc { animation: goyang 3s ease-in-out infinite; }
}
@keyframes putar { to { rotate: 360deg; } }
@keyframes pop { from { opacity: 0; scale: .5; } to { opacity: 1; scale: 1; } }
@keyframes geser { from { opacity: 0; translate: -30px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes muncul { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }
@keyframes goyang { 0%, 100% { rotate: -2deg; } 50% { rotate: 3deg; } }
@keyframes denyut { 0%, 100% { scale: 1; } 50% { scale: 1.1; } }

/* 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 Anime: panel komik miring dengan garis tebal dan bayangan keras. */
.cover-photo { aspect-ratio: 1 / 1; margin: 12px auto; border: 4px solid var(--ink); border-radius: 6px; box-shadow: 6px 6px 0 var(--pink); transform: rotate(-3deg); }
@media (max-height: 700px) { .cover-photo { display: none; } } /* layar pendek: sampul seperti semula supaya tombol tetap terlihat */
