/* ===== Templat: Taman Kayangan (taman kayangan, air terjun, lukisan cat minyak pastel) ===== */
:root {
  --ivory: #F5EFE6;
  --ivory-2: #EFE6D8;
  --sand: #E4D6C1;
  --sage: #A3AE8F;
  --blush: #E7CBC4;
  --gold: #B39468;
  --gold-soft: rgba(179,148,104,.45);
  --ink: #5E4B3F;
  --ink-soft: #8A776A;
  --script: 'Allura', cursive;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --caps: 'Marcellus', Georgia, serif;

  /* Tema pembukaan seragam */
  --op-bg: var(--ivory-2);
  --op-ink: var(--ink);
  --op-ink-soft: var(--ink-soft);
  --op-accent: var(--gold);
  --op-seam: 0 solid transparent;
  --op-seal-bg: radial-gradient(circle at 35% 30%, #F7F0E4, #D9C6A4 70%, #C3A77A);
  --op-seal-ink: var(--ink);
  --op-seal-ring: 1px solid rgba(179,148,104,.7);
  --op-seal-shadow: 0 10px 24px -8px rgba(94,75,63,.55), inset 0 0 0 2px rgba(255,255,255,.6);
  --op-font-names: 'Allura', cursive;
  --op-font-label: 'Marcellus', Georgia, serif;
  --op-font-body: 'Cormorant Garamond', Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); background: #E9DFD0; font: 500 19px/1.55 var(--serif); }
a { color: inherit; }
img { max-width: 100%; display: block; }
.ico { width: 1.1em; height: 1.1em; display: inline-block; vertical-align: -0.16em; }

.page { position: relative; max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--ivory); overflow: hidden; padding-bottom: 104px; box-shadow: 0 0 50px rgba(94,75,63,.15); }
.arabic { font-family: 'Amiri', serif; font-size: 1.5rem; line-height: 1.9; direction: rtl; color: var(--ink); }
.muted { color: var(--ink-soft); }
.script { font-family: var(--script); font-weight: 400; }
.caps { font-family: var(--caps); text-transform: uppercase; letter-spacing: .24em; font-size: .74rem; color: var(--ink-soft); }

/* ---- Pembukaan: lukisan penuh terbelah dua seperti tirai ---- */
.op .tk-art { position: absolute; top: 0; bottom: 0; width: 100vw; overflow: hidden; background: var(--ivory-2); }
/* Adegan diskala "cover" pada skrin, kedudukan menegak 30% (sama seperti background-position) */
.op .tk-scene { position: absolute; --w: max(100vw, 56.25vh); width: var(--w); left: 50%; margin-left: calc(var(--w) / -2); top: calc((100vh - var(--w) * 1.7778) * .3); }
.op-l .tk-art { left: 0; }
.op-r .tk-art { right: 0; }
.op-content { max-width: min(78vw, 340px); margin-top: -16vh; padding: 0; }
/* Cahaya kabus lembut di belakang teks supaya mudah dibaca & tidak bertembung dengan lukisan */
.op-content::before {
  content: ""; position: absolute; inset: -22% -26%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(247,241,232,.92), rgba(247,241,232,.7) 55%, rgba(247,241,232,0));
}
.op-eyebrow { font-size: .74rem; letter-spacing: .3em; }
.op-names { font-size: clamp(2.4rem, min(14vw, 7vh), 4.2rem); margin: 8px 0 4px; color: var(--ink); }
.op-names.is-long { font-size: clamp(2rem, min(10.5vw, 5.3vh), 3.2rem); }
.tk-hero .names.is-long { font-size: 11cqw; }
@media (max-height: 720px) { .op-content { margin-top: -12vh; } .op-seal { width: 64px; height: 64px; margin: 14px auto 6px; } .op-initials { font-size: 1.6rem; } }
.op-amp { font-family: var(--serif); font-style: italic; font-size: .4em; color: var(--gold); margin: 0; }
.op-date { font-size: .9rem; letter-spacing: .34em; }
.op-seal { width: 78px; height: 78px; margin: 22px auto 8px; }
.op-initials { font-size: 1.9rem; }
.op-cta { font-size: .7rem; letter-spacing: .34em; }

/* ---- Adegan berlapis (pembukaan & hero) ----
   Lapisan: latar (zum keluar + bernafas) → air terjun mengalir → kabus → bangau & rama-rama → bunga depan.
   --sy = jarak skrol, --tx/--ty = sengetan telefon / tetikus (-1..1), ditetapkan oleh fx.js */
.tk-scene { position: relative; aspect-ratio: 864 / 1536; overflow: hidden; --sy: 0; --tx: 0; --ty: 0; }
.tk-bg, .tk-fg { position: absolute; inset: 0; will-change: transform; }
.tk-bg { transform: translate3d(calc(var(--tx) * -7px), calc(var(--ty) * -6px + var(--sy) * .28px), 0) scale(1.07); }
.tk-fg { transform: translate3d(calc(var(--tx) * 18px), calc(var(--ty) * 12px - var(--sy) * .12px), 0) scale(1.08); pointer-events: none; }
.tk-fg img, .tk-kb > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tk-kb { position: absolute; inset: 0; transform-origin: 60% 38%; animation: tk-kb 7s cubic-bezier(.2,.6,.2,1) both, tk-breathe 16s ease-in-out 7s infinite alternate; }
.page .tk-kb { animation: none; transform: scale(1.16); }
.page .kb-go .tk-kb { animation: tk-kb 4.5s cubic-bezier(.2,.6,.2,1) both, tk-breathe 16s ease-in-out 4.5s infinite alternate; }
@keyframes tk-kb { from { transform: scale(1.2); } to { transform: scale(1); } }
@keyframes tk-breathe { from { transform: scale(1); } to { transform: scale(1.035) translate(-.6%, .4%); } }

/* Kabus di kaki air terjun */
.tk-mist { position: absolute; left: 40%; top: 54%; width: 64%; height: 17%; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255,251,243,.8), rgba(255,251,243,0) 70%); filter: blur(5px);
  animation: tk-mist 11s ease-in-out infinite alternate; }
@keyframes tk-mist { from { transform: translateX(-10%) scale(1); opacity: .5; } to { transform: translateX(7%) scale(1.12); opacity: .95; } }

/* Bangau terbang merentasi langit (kanan → kiri), kemudian berehat sebelum ulang */
.tk-flyer { position: absolute; pointer-events: none; }
.tk-flyer img { width: 100%; height: auto; display: block; }
.tk-egret { width: 28%; left: 0; top: 1%; animation: tk-egret 26s linear infinite; }
.tk-egret img { transform-origin: 60% 70%; animation: tk-glide 1.8s ease-in-out infinite alternate; }
@keyframes tk-egret {
  0% { transform: translate(380%, 6%); } 30% { transform: translate(160%, -14%); }
  62% { transform: translate(-130%, 0); } 100% { transform: translate(-130%, 0); }
}
@keyframes tk-glide { from { transform: scaleY(1) rotate(0); } to { transform: scaleY(.9) rotate(-3deg); } }

/* Rama-rama: berlegar di sekitar bunga, sayap mengepak */
.tk-bfly { width: 7%; }
.tk-bfly img { animation: tk-flap .22s ease-in-out infinite alternate; }
.tk-bfly.b1 { left: 14%; top: 72%; animation: tk-wander1 15s ease-in-out infinite; }
.tk-bfly.b2 { left: 74%; top: 66%; width: 5.5%; animation: tk-wander2 19s ease-in-out infinite; filter: hue-rotate(-18deg) brightness(1.05); }
.tk-bfly.b2 img { animation-duration: .18s; }
@keyframes tk-flap { from { transform: scaleX(1); } to { transform: scaleX(.32); } }
@keyframes tk-wander1 {
  0%, 100% { transform: translate(0, 0) rotate(-15deg); } 25% { transform: translate(140%, -120%) rotate(20deg); }
  50% { transform: translate(260%, -40%) rotate(70deg); } 75% { transform: translate(90%, 60%) rotate(-40deg); }
}
@keyframes tk-wander2 {
  0%, 100% { transform: translate(0, 0) rotate(10deg); } 30% { transform: translate(-160%, -90%) rotate(-30deg); }
  60% { transform: translate(-60%, -200%) rotate(15deg); } 80% { transform: translate(80%, -60%) rotate(40deg); }
}

@media (prefers-reduced-motion: reduce) {
  .tk-kb, .page .kb-go .tk-kb, .tk-mist, .tk-egret, .tk-egret img, .tk-bfly, .tk-bfly img { animation: none !important; }
  .page .tk-kb { transform: none; }
  .tk-egret { display: none; }
}

/* ---- Hero ---- */
.tk-hero { position: relative; container-type: inline-size; }
.tk-hero::after { z-index: 1; content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22%; background: linear-gradient(to bottom, rgba(245,239,230,0), var(--ivory)); }
.tk-hero-content { position: absolute; left: 10%; right: 10%; top: 9%; z-index: 2; text-align: center; padding: 6cqw 4cqw; }
.tk-hero-content::before { content: ""; position: absolute; inset: -6% -8%; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(247,241,232,.9), rgba(247,241,232,.65) 55%, rgba(247,241,232,0)); }
.tk-hero .arabic { font-size: 4.8cqw; line-height: 1.6; margin-bottom: 1.6cqw; }
.tk-hero .caps { font-size: 2.7cqw; }
.tk-hero .names { font-family: var(--script); font-size: 15cqw; line-height: 1; margin: 2cqw 0; overflow-wrap: anywhere; }
.tk-hero .names > span:not(.fx-ch):not(.fx-word) { display: block; font-family: var(--serif); font-style: italic; font-size: .38em; color: var(--gold); }
.tk-hero .date { font-size: 4.6cqw; font-weight: 600; }

/* ---- Bahagian ---- */
.sec { position: relative; padding: 26px 20px; text-align: center; }
.tk-head { margin-bottom: 18px; }
.tk-head img { width: 74%; max-width: 310px; height: auto; margin: 0 auto 2px; }
.tk-head h2 { font-family: var(--script); font-weight: 400; font-size: clamp(2.6rem, 11vw, 3.1rem); line-height: 1.05; margin: 0; color: var(--ink); }

.tk-card {
  position: relative; background: rgba(255,252,246,.78); border-radius: 22px; padding: 26px 20px;
  border: 1px solid var(--gold-soft); box-shadow: 0 0 0 5px var(--ivory), 0 0 0 6px rgba(179,148,104,.25), 0 20px 34px -26px rgba(94,75,63,.6);
}
.tk-card.arch { border-radius: 200px 200px 22px 22px; padding-top: 64px; }
/* Kandungan pertama dalam kad gerbang dikecilkan supaya tidak melepasi lengkung */
.tk-card.arch > :first-child { padding-left: 13%; padding-right: 13%; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em; cursor: pointer; text-decoration: none;
  font: 400 .84rem var(--caps); letter-spacing: .16em; text-transform: uppercase;
  color: #FFFDF8; background: var(--ink); border: 1px solid var(--ink); border-radius: 999px; padding: .85em 1.5em;
  transition: transform .2s, background .2s;
}
.btn:hover { background: #4A3A30; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--gold-soft); }
.btn.sm { font-size: .74rem; padding: .62em 1.15em; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* ---- Jemputan ---- */
.hosts { font-family: var(--script); font-size: 2.2rem; line-height: 1.15; white-space: pre-line; margin: 8px 0 14px; }
.greeting { font-style: italic; margin: 0 0 14px; }
.couple-full { font-family: var(--script); font-size: 2.3rem; line-height: 1.1; overflow-wrap: anywhere; }
.couple-full span { display: block; font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--gold); margin: 6px 0; }

/* ---- Menghitung hari (gerbang batu) ---- */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.countdown div { aspect-ratio: 3 / 4; border-radius: 999px 999px 10px 10px; background: rgba(255,252,246,.85); border: 1px solid var(--gold-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 10%; }
.countdown b { font-family: var(--serif); font-weight: 500; font-size: 1.9rem; line-height: 1; }
.countdown span { font-family: var(--caps); font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); margin-top: 4px; }

/* ---- Maklumat majlis ---- */
.details { list-style: none; margin: 0; padding: 0; }
.details li { padding: 14px 0; border-bottom: 1px solid rgba(179,148,104,.25); }
.details li:first-child { padding-top: 0; }
.details li:last-child { border-bottom: 0; padding-bottom: 0; }
.details .k { display: block; margin-bottom: 3px; }
.details .v { display: block; font-size: 1.15rem; }
.details .v.big { font-size: 1.45rem; font-weight: 600; line-height: 1.25; }

/* ---- Aturcara ---- */
.sched { list-style: none; margin: 0; padding: 0; text-align: left; }
.sched li { display: flex; align-items: baseline; gap: 10px; padding: 9px 0; }
.sched .t { flex-shrink: 0; min-width: 96px; font-weight: 700; font-size: .98rem; }
.sched .dots { flex: 1; border-bottom: 1px dotted var(--gold); transform: translateY(-4px); min-width: 12px; opacity: .6; }
.sched .i { text-align: right; max-width: 60%; }
.sched li.no-t .i { text-align: center; max-width: none; flex: 1; }

/* ---- Galeri mozek (gaya simanten): baris sama tinggi, lebar berselang-seli ---- */
.gallery { display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: clamp(118px, 33vw, 162px); gap: 4px; border-radius: 14px; overflow: hidden; }
.gallery .g { display: block; position: relative; overflow: hidden; cursor: zoom-in; background: var(--sand); }
.gallery .g img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.gallery .g:hover img { transform: scale(1.06); }
.gallery .s2 { grid-column: span 2; }
.gallery .s3 { grid-column: span 3; }
.gallery .s4 { grid-column: span 4; }
.gallery .s6 { grid-column: span 6; }
/* Animasi zum naik semasa skrol */
.gallery .g.reveal { opacity: 0; transform: translateY(26px) scale(.86); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.gallery .g.reveal.in { opacity: 1; transform: none; }

/* ---- RSVP ---- */
.rsvp-form { text-align: left; }
.rsvp-form .f { margin-bottom: 14px; }
.rsvp-form .l { display: block; margin-bottom: 6px; }
.rsvp-form input[type=text], .rsvp-form input[type=tel], .rsvp-form select, .rsvp-form textarea {
  width: 100%; font: 500 1.08rem var(--serif); color: var(--ink); background: #FFFDF8; -webkit-appearance: none; appearance: none;
  border: 1px solid rgba(179,148,104,.5); border-radius: 12px; padding: .65em .9em; outline: none;
}
.rsvp-form select { background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.4em; }
.rsvp-form textarea { min-height: 90px; resize: vertical; }
.rsvp-form input:focus, .rsvp-form select:focus, .rsvp-form textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(179,148,104,.18); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: .5em; border-radius: 999px; background: #FFFDF8; border: 1px solid rgba(179,148,104,.5); cursor: pointer; font-size: 1rem; line-height: 1.2; }
.choice input:checked + label { background: var(--ink); border-color: var(--ink); color: #FFFDF8; }
.choice input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 2px; }
.err { color: #A0463C; font-size: .92rem; margin-top: 4px; }
.note { border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; text-align: left; background: #FFFDF8; border: 1px solid var(--gold-soft); }
.note.ok { background: #F1F5EC; border-color: #CCD9C0; color: #48603D; }
.note.bad { background: #FBEEEA; border-color: #EDCBC3; color: #8E3B36; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Ucapan ---- */
.wishes { display: grid; gap: 12px; text-align: left; max-height: 470px; overflow-y: auto; padding: 4px 2px 8px; }
.wish { background: rgba(255,252,246,.85); border-radius: 16px; padding: 12px 16px; border: 1px solid var(--gold-soft); }
.wish .who { font-family: var(--script); font-size: 1.9rem; line-height: 1.05; }
.wish .when { font-size: .8rem; color: var(--ink-soft); }
.wish p { margin: 4px 0 0; overflow-wrap: anywhere; }

/* ---- Salam kaut ---- */
.gift-acc { background: #FFFDF8; border-radius: 16px; padding: 16px; margin-top: 14px; border: 1px solid var(--gold-soft); }
.gift-acc .no { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; letter-spacing: .06em; margin: 4px 0; overflow-wrap: anywhere; }
.gift-qr { max-width: 220px; margin: 14px auto 0; background: #fff; border-radius: 14px; padding: 10px; border: 1px solid var(--gold-soft); }
.gift-note { white-space: pre-line; margin: 14px 0 0; }

/* ---- Hubungi ---- */
.contacts { display: grid; gap: 10px; }
.contact { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #FFFDF8; border-radius: 999px; padding: 8px 8px 8px 20px; border: 1px solid var(--gold-soft); text-align: left; }
.contact .n { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.contact .acts { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--ivory-2); color: var(--ink); text-decoration: none; }
.icon-btn.call { background: var(--ink); color: #FFFDF8; }
.icon-btn svg { width: 19px; height: 19px; }

/* ---- Penutup: lukisan kolam ---- */
.tk-pond { position: relative; margin-top: 10px; }
.tk-pond img { width: 100%; height: auto; }
.tk-pond::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 30%; background: linear-gradient(var(--ivory), rgba(245,239,230,0)); }
.footer { padding: 18px 20px 8px; text-align: center; font-size: .92rem; color: var(--ink-soft); }

/* ---- Bar navigasi bawah ---- */
.dock {
  position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
  width: calc(100% - 24px); max-width: 440px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: rgba(250,245,237,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 999px; border: 1px solid var(--gold-soft); box-shadow: 0 12px 26px -14px rgba(94,75,63,.6); padding: 6px;
}
.dock a, .dock button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 6px 2px; border-radius: 999px;
  font: 400 .62rem var(--caps); letter-spacing: .1em; text-transform: uppercase; color: var(--ink);
  background: none; border: 0; text-decoration: none; cursor: pointer;
}
.dock a:hover, .dock button:hover { background: var(--ivory-2); }
.dock svg { width: 20px; height: 20px; }
.dock .playing svg { animation: tk-spin 3s linear infinite; }
@keyframes tk-spin { to { transform: rotate(360deg); } }

.preview-ribbon { position: sticky; top: 0; z-index: 45; background: var(--ink); color: #FFFDF8; padding: 8px 14px; font-size: .95rem; text-align: center; }
.preview-ribbon a { color: #FFFDF8; font-weight: 700; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 480px) { .page { box-shadow: none; } body { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { .dock .playing svg { animation: none; } .reveal { opacity: 1; transform: none; transition: none; } }
