/* Kubus — pernikahan bergaya 3D: panel tebal bertumpuk, bayangan lembut, cincin dan bola melayang. */
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 500 800; font-display: swap; }

:root {
  --bg: #e9e6f7;
  --card: #fbfaff;
  --edge: #d7d1f2;
  --soft: #efebff;
  --ink: #2b2350;
  --ink-deep: #1a1440;
  --muted: #5a5378;
  --violet: #6e5bd0;
  --violet-deep: #4b3ba6;
  --lilac: #a796f2;
  --peach: #ffb37a;
  --cream: #ffe1c7;
  --sans: "Bricolage Grotesque", system-ui, sans-serif;
  --lift: 0 8px 0 var(--edge), 0 18px 26px rgba(60, 40, 140, .14);
 /* warna hasil tone (dulu ditulis langsung) */ --tn-1: #2b2350; --tn-2: #a796f2; --tn-3: #6e5bd0; --tn-4: #4632a0; --tn-5: #3c288c; --tn-6: #d9dce6; --tn-7: #505a78; --tn-8: #d7d1f2; --tn-9: #cfc8ee; --tn-10: #c6beea; --tn-11: #bdb4e5; --tn-12: #4b3ba6; --tn-13: #1f1555; --tn-14: #3f3866;
}

/* Tone warna (field "tone"): ungu = bawaan di atas. */
:root[data-tone="cokelat"] { --edge: #f2dbd1; --ink: #503123; --ink-deep: #402014; --muted: #785f53; --violet: #d07d5b; --violet-deep: #a6593b; --lilac: #f2b396; --tn-1: #503123; --tn-2: #f2b396; --tn-3: #d07d5b; --tn-4: #a05432; --tn-5: #8c4928; --tn-6: #e6d9da; --tn-7: #785055; --tn-8: #f2dbd1; --tn-9: #eed4c8; --tn-10: #eaccbe; --tn-11: #e5c3b4; --tn-12: #a6593b; --tn-13: #552715; --tn-14: #664538; }
:root[data-tone="hijau"] { --edge: #d1f2e2; --ink: #23503a; --ink-deep: #144029; --muted: #537866; --violet: #5bd095; --violet-deep: #3ba66e; --lilac: #96f2c5; --tn-1: #23503a; --tn-2: #96f2c5; --tn-3: #5bd095; --tn-4: #32a06a; --tn-5: #288c5d; --tn-6: #d9e6da; --tn-7: #507853; --tn-8: #d1f2e2; --tn-9: #c8eedc; --tn-10: #beead5; --tn-11: #b4e5cd; --tn-12: #3ba66e; --tn-13: #155534; --tn-14: #38664e; }
:root[data-tone="toska"] { --edge: #d1eef2; --ink: #234b50; --ink-deep: #143d40; --muted: #537478; --violet: #5bc5d0; --violet-deep: #3b9da6; --lilac: #96e7f2; --tn-1: #234b50; --tn-2: #96e7f2; --tn-3: #5bc5d0; --tn-4: #3294a0; --tn-5: #287f8c; --tn-6: #d9e6e2; --tn-7: #50786b; --tn-8: #d1eef2; --tn-9: #c8eaee; --tn-10: #bee5ea; --tn-11: #b4dfe5; --tn-12: #3b9da6; --tn-13: #154f55; --tn-14: #386266; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
h1, h2, p { margin: 0; }
a { color: var(--ink); }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
.page { max-width: 480px; margin: 0 auto; padding: 22px 20px 30px; min-height: 100vh; display: flex; flex-direction: column; gap: 26px; overflow: hidden; background: var(--bg); }
main { display: flex; flex-direction: column; gap: 30px; }
.block { display: flex; flex-direction: column; gap: 14px; }
.block h2, .head h2 { font-weight: 800; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; }
.panel { border-radius: 26px; background: var(--card); box-shadow: var(--lift); }
.lead { font-size: 15px; line-height: 1.55; color: var(--muted); }
.head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.head small { font-size: 13px; color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 22px; border: 0; border-radius: 20px; text-decoration: none; cursor: pointer; font: 700 16px/1.2 var(--sans); transition: transform .12s, box-shadow .12s; }
.btn-dark { background: var(--ink); color: var(--card); box-shadow: 0 8px 0 var(--ink-deep), 0 16px 24px color-mix(in srgb, var(--tn-1) 30%, transparent); }
.btn-dark:active { transform: translateY(5px); box-shadow: 0 3px 0 var(--ink-deep); }
.btn-violet { background: var(--violet); color: #fff; box-shadow: 0 5px 0 var(--violet-deep); }
.btn-soft { background: var(--card); color: var(--violet-deep); box-shadow: var(--lift); min-height: 50px; align-self: flex-start; }
.btn-sm { min-height: 46px; padding: 0 16px; border-radius: 16px; font-size: 14px; }
.btn.copied { background: #4caf7a; }

/* Sampul: adegan 3D sederhana */
.cover { min-height: calc(100vh - 52px); min-height: calc(100svh - 52px); display: flex; flex-direction: column; justify-content: center; gap: 36px; }
.cover[hidden] { display: none; }
.scene { position: relative; height: 560px; perspective: 900px; }
.orb { position: absolute; border-radius: 50%; z-index: 0; }
.orb-a { top: 6px; left: -6px; width: 92px; height: 92px; background: radial-gradient(circle at 32% 28%, #ffe1c7 0%, #ffb37a 45%, #e07f45 100%); box-shadow: 0 18px 30px rgba(120, 60, 20, .25); animation: melayang 6s ease-in-out infinite; }
.orb-b { top: 360px; right: -10px; width: 70px; height: 70px; background: radial-gradient(circle at 32% 28%, #e8e2ff 0%, var(--tn-2) 50%, var(--tn-3) 100%); box-shadow: 0 16px 26px color-mix(in srgb, var(--tn-4) 28%, transparent); animation: melayang 7s ease-in-out infinite; }
.slab { position: absolute; top: 40px; left: 12px; right: 12px; height: 440px; border-radius: 34px; background: var(--card); transform: rotateX(8deg) rotateY(-12deg) rotateZ(1deg); box-shadow: 0 40px 60px color-mix(in srgb, var(--tn-5) 22%, transparent), 0 6px 0 var(--edge), inset 0 -10px 20px color-mix(in srgb, var(--tn-3) 8%, transparent); padding: 30px 20px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center; }
.rings { position: relative; width: 150px; height: 96px; }
.ring { position: absolute; top: 10px; width: 76px; height: 76px; border-radius: 50%; border: 13px solid; }
.ring.gold { left: 14px; border-color: #f2c14e; box-shadow: inset -4px -6px 8px rgba(150, 100, 0, .35), inset 4px 5px 6px rgba(255, 250, 220, .8), 0 10px 14px rgba(150, 100, 0, .25); }
.ring.silver { left: 60px; border-color: var(--tn-6); box-shadow: inset -4px -6px 8px color-mix(in srgb, var(--tn-7) 35%, transparent), inset 4px 5px 6px rgba(255, 255, 255, .9), 0 10px 14px color-mix(in srgb, var(--tn-7) 25%, transparent); }
.title { display: flex; flex-direction: column; gap: 6px; }
.eyebrow { font-weight: 700; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--violet); }
.cover .names { font-weight: 800; font-size: 56px; line-height: .92; letter-spacing: -.04em; text-shadow: 0 1px 0 var(--tn-8), 0 2px 0 var(--tn-9), 0 3px 0 var(--tn-10), 0 4px 0 var(--tn-11), 0 10px 14px color-mix(in srgb, var(--tn-5) 18%, transparent); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chips span { padding: 10px 14px; border-radius: 16px; background: var(--soft); font-weight: 700; font-size: 15px; box-shadow: inset 0 -4px 0 var(--edge); }
.guest { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 22px; background: var(--ink); color: var(--card); padding: 16px 18px; box-shadow: 0 14px 0 var(--ink-deep), 0 24px 30px color-mix(in srgb, var(--tn-1) 30%, transparent); display: flex; flex-direction: column; gap: 2px; z-index: 2; }
.guest span { font-size: 13px; opacity: .8; }
.guest b { font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.cover .open { margin-top: 12px; }
@keyframes melayang { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes melayang2 { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(8px) rotate(-4deg); } }

.js .cover { position: fixed; inset: 0; z-index: 40; overflow-y: auto; padding: 22px 20px; background: var(--bg); 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; }
@media (min-width: 560px) { .js .cover { padding-inline: calc(50% - 240px + 20px); } }

/* Isi */
.salam-card { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.salam-card b { font-weight: 700; font-size: 17px; }
.salam-card p { font-size: 16px; line-height: 1.6; color: var(--muted); }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.person { padding: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.shot { height: 150px; border-radius: 18px; overflow: hidden; display: flex; }
.shot.peach { background: var(--cream); box-shadow: inset 0 -8px 16px rgba(224, 127, 69, .25); }
.shot.lilac { background: #e2dcff; box-shadow: inset 0 -8px 16px color-mix(in srgb, var(--tn-3) 25%, transparent); }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot span { margin: auto; font-weight: 800; font-size: 40px; color: var(--violet); }
.person b { font-weight: 800; font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }
.parents { font-size: 13px; line-height: 1.4; color: var(--muted); }
.ig { font-size: 13px; font-weight: 700; color: var(--violet); overflow-wrap: anywhere; }

.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.countdown div { aspect-ratio: 1; border-radius: 20px; background: var(--violet); color: #fff; box-shadow: 0 8px 0 var(--violet-deep), 0 16px 22px color-mix(in srgb, var(--tn-12) 30%, transparent), inset 0 4px 6px rgba(255, 255, 255, .25); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.countdown b { font-weight: 800; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.countdown span { font-size: 12px; font-weight: 500; }
html:not(.js) .countdown { display: none; }

.event { padding: 18px; display: flex; gap: 14px; align-items: center; }
.time { flex-shrink: 0; width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; }
.time.peach { background: var(--peach); box-shadow: 0 6px 0 #e07f45, inset 0 4px 6px rgba(255, 255, 255, .4); color: #4a2205; }
.time.lilac { background: var(--lilac); box-shadow: 0 6px 0 var(--violet), inset 0 4px 6px rgba(255, 255, 255, .4); color: var(--tn-13); }
.event > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.event b { font-weight: 800; font-size: 19px; }
.event span:not(.time) { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.link { margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--violet); }

.polaroids { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; padding: 10px 0; }
.polaroids figure { margin: 0; padding: 8px; border-radius: 20px; background: var(--card); box-shadow: 0 20px 30px color-mix(in srgb, var(--tn-5) 20%, transparent); transform: rotate(-4deg); }
.polaroids figure:nth-child(even) { transform: rotate(4deg) translateY(14px); }
.polaroids img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 13px; background: var(--cream); }

.gift { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gift > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bank { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--violet); }
.number { font-size: 21px; font-weight: 800; overflow-wrap: anywhere; }
.holder { font-size: 13px; color: var(--muted); }

.note { padding: 14px 16px; border-radius: 18px; background: var(--card); font-size: 14px; color: var(--muted); }
.done { padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.done b { font-weight: 800; font-size: 22px; }
.done p { font-size: 15px; color: var(--muted); }
.form { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.field.row { flex-direction: row; align-items: center; justify-content: space-between; }
.field input, .field textarea { width: 100%; min-height: 50px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--soft); box-shadow: inset 0 3px 6px color-mix(in srgb, var(--tn-5) 12%, transparent); color: var(--ink); font: 500 16px/1.4 var(--sans); }
.field.row input { width: 96px; text-align: center; font-weight: 800; font-size: 20px; }
.field textarea { padding: 12px 14px; min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 3px solid var(--violet); outline-offset: 2px; }
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.opt { position: relative; }
.opt input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.opt span { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 16px; background: var(--soft); box-shadow: 0 5px 0 var(--edge); font-weight: 700; font-size: 15px; text-align: center; }
.opt input:checked + span { background: var(--violet); color: #fff; box-shadow: 0 5px 0 var(--violet-deep); }
.opt input:focus-visible + span { outline: 3px solid var(--violet); outline-offset: 3px; }

.wishes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; max-height: 560px; overflow-y: auto; padding-bottom: 8px; }
.wishes li { border-radius: 22px; padding: 14px 16px; box-shadow: 0 6px 0 var(--edge), 0 12px 18px color-mix(in srgb, var(--tn-5) 10%, transparent); display: flex; gap: 12px; align-items: flex-start; }
.av { flex-shrink: 0; width: 40px; height: 40px; border-radius: 14px; background: var(--lilac); color: var(--tn-13); box-shadow: 0 4px 0 var(--violet); display: flex; align-items: center; justify-content: center; font: 800 16px/1 var(--sans); font-style: normal; text-transform: uppercase; }
.wishes li > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.who { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.who strong { font-size: 15px; }
.who small { font-size: 12px; color: var(--muted); }
.wishes p:not(.who) { font-size: 15px; line-height: 1.5; color: var(--tn-14); overflow-wrap: anywhere; }
.wish-reply { margin-top: 4px; padding: 6px 10px; border-radius: 10px; background: var(--soft); font-size: 14px; }

.closing { border-radius: 30px; background: var(--ink); color: var(--card); padding: 30px 22px; box-shadow: 0 10px 0 var(--ink-deep); display: flex; flex-direction: column; gap: 8px; }
.closing b { font-weight: 800; font-size: 34px; line-height: 1; }
.closing span { font-size: 15px; opacity: .85; }
footer { text-align: center; font-size: 13px; color: var(--muted); }

.music-toggle { position: fixed; bottom: 16px; right: max(14px, calc(50% - 226px)); z-index: 50; width: 48px; height: 48px; border: 0; border-radius: 16px; background: var(--card); color: var(--violet); box-shadow: 0 6px 0 var(--edge), 0 12px 18px color-mix(in srgb, var(--tn-5) 16%, transparent); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.music-toggle svg { width: 20px; height: 20px; }
.music-toggle[aria-pressed="false"]::after { content: ""; position: absolute; width: 26px; height: 2px; background: var(--violet); transform: rotate(-45deg); }
html:not(.js) .music-toggle { display: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orb { animation: none; }
  .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 40px; scale: .93; }
.rv.in { opacity: 1; translate: 0 0; scale: 1; rotate: 0deg; transition: opacity 1s cubic-bezier(.3, 1.3, .5, 1) calc(var(--d, 0) * 1ms), translate 1s cubic-bezier(.3, 1.3, .5, 1) calc(var(--d, 0) * 1ms), scale 1s cubic-bezier(.3, 1.3, .5, 1) calc(var(--d, 0) * 1ms), rotate 1s cubic-bezier(.3, 1.3, .5, 1) calc(var(--d, 0) * 1ms), clip-path 1s cubic-bezier(.3, 1.3, .5, 1) calc(var(--d, 0) * 1ms); }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; translate: none; scale: none; rotate: none; clip-path: none; } }

@media (prefers-reduced-motion: no-preference) {
  .slab { animation: ambang 7s ease-in-out infinite, masuk 1.2s cubic-bezier(.2, .8, .2, 1) both; }
  .ring.gold { animation: goyang 4s ease-in-out infinite; }
  .ring.silver { animation: goyang 4s -2s ease-in-out infinite; }
  .guest { animation: muncul 1s .9s both; }
  .cover .open { animation: muncul 1s 1.2s both; }
  .btn-dark:hover { translate: 0 -2px; }
  .countdown div { animation: lompat 3s ease-in-out infinite; }
  .countdown div:nth-child(2) { animation-delay: .15s; }
  .countdown div:nth-child(3) { animation-delay: .3s; }
  .countdown div:nth-child(4) { animation-delay: .45s; }
}
@keyframes ambang { 0%, 100% { transform: rotateX(8deg) rotateY(-12deg) rotateZ(1deg) translateY(0); } 50% { transform: rotateX(5deg) rotateY(-7deg) rotateZ(0deg) translateY(-8px); } }
@keyframes masuk { from { opacity: 0; scale: .85; translate: 0 50px; } to { opacity: 1; scale: 1; translate: 0 0; } }
@keyframes muncul { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
@keyframes goyang { 0%, 100% { translate: 0 0; rotate: -4deg; } 50% { translate: 0 -6px; rotate: 4deg; } }
@keyframes lompat { 0%, 70%, 100% { translate: 0 0; } 85% { translate: 0 -5px; } }

/* 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 Kubus: kotak membulat 3D yang miring. */
.cover-photo { aspect-ratio: 1 / 1; margin: 12px auto 16px; border: 5px solid var(--card); border-radius: 26px; box-shadow: 0 8px 0 var(--edge), 0 18px 30px rgba(43, 35, 80, 0.22); transform: rotate(-4deg); }
@media (max-height: 700px) { .cover-photo { display: none; } } /* layar pendek: sampul seperti semula supaya tombol tetap terlihat */
