/* ============================================================================
 * Wedding Sumayah & Fauzan — stylesheet
 * Palet: dusty rose & nude (K-01) · Animasi: meriah (K-02) · Mobile-first
 *
 * Aturan yang dipegang di seluruh berkas ini:
 *  1. Hanya `transform` dan `opacity` yang dianimasikan. Menganimasikan
 *     width/top/left memaksa peramban menghitung ulang tata letak tiap frame;
 *     di HP kelas menengah hasilnya patah-patah dan terbaca sebagai "HP lemot".
 *  2. Setiap animasi dekoratif wajib punya jalur mati di blok
 *     prefers-reduced-motion di bagian paling bawah berkas ini.
 * ========================================================================== */

/* ── Font (lokal, tanpa CDN — lihat ADR-001) ─────────────────────────────── */

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-garamond-latin.woff2') format('woff2');
  font-weight: 300 700;        /* variable font: satu berkas, semua ketebalan */
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
  font-family: 'Jost';
  src: url('../fonts/jost-latin.woff2') format('woff2');
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}

@font-face {
  font-family: 'Amiri';
  src: url('../fonts/amiri-arabic.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF;
}


/* ── Token ───────────────────────────────────────────────────────────────── */

:root {
  --blush:       #FBF2EF;
  --blush-deep:  #F3DFDA;
  --rose:        #C4838A;
  --rose-dark:   #9C6068;
  --nude:        #E8CFC4;
  --ink:         #4A3A38;
  --ink-soft:    #7A6260;
  --white-warm:  #FFFCFA;

  --serif: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --sans:  'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --arab:  'Amiri', 'Traditional Arabic', 'Segoe UI', serif;

  --shadow-soft: 0 10px 30px -12px rgba(156, 96, 104, .28);
  --shadow-box:  0 6px 20px -10px rgba(156, 96, 104, .45);
}


/* ── Reset ───────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;            /* cadangan untuk peramban lama */
  min-height: 100svh;           /* svh: tinggi layar TANPA bilah alamat yang
                                   muncul-hilang. Dengan 100vh saja, konten
                                   bawah terpotong di Safari/Chrome mobile. */
  font-family: var(--sans);
  color: var(--ink);
  background: linear-gradient(170deg, var(--blush) 0%, #F8E9E4 45%, var(--blush-deep) 100%);
  background-attachment: fixed;
  overflow-x: hidden;           /* pengaman: kelopak yang bergoyang ke samping
                                   tidak boleh memunculkan scroll horizontal */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1, h2, p, blockquote, figure { margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}


/* ── Latar & cahaya ──────────────────────────────────────────────────────── */

.bg-wash {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  will-change: transform;
}

.glow--a {
  width: 60vmax; height: 60vmax;
  top: -22vmax; left: -18vmax;
  background: radial-gradient(circle, rgba(232, 207, 196, .75), transparent 68%);
  animation: drift 26s ease-in-out infinite;
}

.glow--b {
  width: 52vmax; height: 52vmax;
  bottom: -20vmax; right: -16vmax;
  background: radial-gradient(circle, rgba(196, 131, 138, .38), transparent 68%);
  animation: drift 34s ease-in-out infinite reverse;
}

.glow--c {
  width: 40vmax; height: 40vmax;
  top: 38%; left: 55%;
  background: radial-gradient(circle, rgba(255, 252, 250, .8), transparent 70%);
  animation: drift 30s ease-in-out infinite;
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(3%, 4%, 0) scale(1.08); }
}


/* ── Ornamen sudut ───────────────────────────────────────────────────────── */

.corner {
  position: fixed;
  width: 88px; height: 88px;
  color: var(--rose);
  opacity: .5;
  z-index: 1;
  pointer-events: none;
  animation: cornerIn 1.6s ease-out both;
}

.corner--tl { top: 10px; left: 10px; }
.corner--br { bottom: 10px; right: 10px; transform: rotate(180deg); animation-delay: .25s; }

@keyframes cornerIn {
  from { opacity: 0; }
  to   { opacity: .5; }
}

@media (min-width: 768px) {
  .corner { width: 130px; height: 130px; top: 22px; left: 22px; }
  .corner--br { top: auto; left: auto; bottom: 22px; right: 22px; }
}


/* ── Kelopak berjatuhan (An-1) ───────────────────────────────────────────── */

.petals {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -8vh;
  width: 14px; height: 14px;
  color: var(--rose);
  opacity: 0;
  will-change: transform;
  /* Dua animasi bertumpuk: `fall` menurunkan wadahnya, `sway` di dalam
     membuatnya berayun. Memisahkannya membuat tiap kelopak punya ritme
     goyangan sendiri tanpa terlihat seperti barisan yang serempak. */
  animation: fall linear infinite;
}

.petal svg {
  width: 100%; height: 100%;
  display: block;
  animation: sway ease-in-out infinite alternate;
}

@keyframes fall {
  0%   { transform: translate3d(0, -10vh, 0) rotate(0deg);    opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translate3d(0, 108vh, 0) rotate(420deg);  opacity: 0; }
}

@keyframes sway {
  from { transform: translateX(-26px) rotate(-24deg); }
  to   { transform: translateX(26px)  rotate(24deg); }
}


/* ── Panggung ────────────────────────────────────────────────────────────── */

.stage {
  position: relative;
  z-index: 3;
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(3.5rem, 12vh, 6rem) 1.35rem clamp(3rem, 9vh, 5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 100vh;
  min-height: 100svh;
  justify-content: center;
  gap: clamp(.9rem, 2.4vh, 1.5rem);
}


/* ── Muncul bertahap (An-4) ──────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: revealIn .9s cubic-bezier(.22, .68, .35, 1) forwards;
}

/* Delay bertingkat: tiap elemen menyusul ~110ms setelah yang di atasnya,
   sehingga halaman terasa "dibuka", bukan "muncul sekaligus". */
.reveal[data-reveal="1"]  { animation-delay: .15s; }
.reveal[data-reveal="2"]  { animation-delay: .26s; }
.reveal[data-reveal="3"]  { animation-delay: .37s; }
.reveal[data-reveal="4"]  { animation-delay: .48s; }
.reveal[data-reveal="5"]  { animation-delay: .59s; }
.reveal[data-reveal="6"]  { animation-delay: .70s; }
.reveal[data-reveal="7"]  { animation-delay: .81s; }
.reveal[data-reveal="8"]  { animation-delay: .92s; }
.reveal[data-reveal="9"]  { animation-delay: 1.03s; }
.reveal[data-reveal="10"] { animation-delay: 1.14s; }

@keyframes revealIn {
  to { opacity: 1; transform: translateY(0); }
}


/* ── Pembuka & nama ──────────────────────────────────────────────────────── */

.eyebrow {
  font-size: clamp(.68rem, 3vw, .82rem);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 400;
  padding-left: .3em;           /* mengimbangi letter-spacing di huruf terakhir
                                   supaya teks tetap terlihat betul-betul rata
                                   tengah */
}

.names {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 12.5vw, 5rem);
  line-height: 1.05;
  color: var(--rose-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1em;
  position: relative;
}

/* Shimmer (An-3): kilau menyapu tulisan tiap ~6 detik */
.names__part {
  background-image: linear-gradient(
    100deg,
    var(--rose-dark) 0%, var(--rose-dark) 38%,
    #E7B4B0 48%, #FFF3EE 52%, #E7B4B0 56%,
    var(--rose-dark) 66%, var(--rose-dark) 100%
  );
  background-size: 300% 100%;
  background-position: 120% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6.5s ease-in-out infinite;
}

.names__part:nth-of-type(3) { animation-delay: .8s; }

@keyframes shimmer {
  0%, 62%  { background-position: 130% 0; }
  92%, 100%{ background-position: -30% 0; }
}

.names__amp {
  font-size: .42em;
  color: var(--rose);
  font-style: italic;
  opacity: .85;
  line-height: 1;
}

@media (min-width: 560px) {
  .names { flex-direction: row; gap: .35em; align-items: baseline; }
}

.fullnames {
  font-size: clamp(.72rem, 3.2vw, .86rem);
  color: var(--ink-soft);
  letter-spacing: .09em;
  line-height: 1.8;
}

.fullnames__sep { margin: 0 .5em; color: var(--rose); }


/* ── Pemisah ─────────────────────────────────────────────────────────────── */

.divider {
  display: flex;
  align-items: center;
  gap: .8rem;
  width: min(220px, 62%);
  color: var(--rose);
}

.divider__line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--nude), transparent);
}

.divider__mark { font-size: .8rem; opacity: .8; }


/* ── Tanggal ─────────────────────────────────────────────────────────────── */

.date {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 5.2vw, 1.6rem);
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--ink);
}

.date__time {
  display: block;
  font-family: var(--sans);
  font-size: .62em;
  letter-spacing: .18em;
  color: var(--ink-soft);
  margin-top: .35em;
}


/* ── Hitung mundur ───────────────────────────────────────────────────────── */

.countdown {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
  padding: .5rem 0;
}

.countdown__intro {
  font-size: clamp(.66rem, 2.9vw, .78rem);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-left: .26em;
}

/* Denyut cincin (An-6) — menandai countdown sebagai pusat halaman */
.countdown::before,
.countdown::after {
  content: '';
  position: absolute;
  top: 55%; left: 50%;
  width: 260px; height: 260px;
  margin: -130px 0 0 -130px;
  border: 1px solid var(--nude);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: ringPulse 5.5s ease-out infinite;
}

.countdown::after { animation-delay: 2.75s; }

@keyframes ringPulse {
  0%   { transform: scale(.72); opacity: 0; }
  22%  { opacity: .55; }
  100% { transform: scale(1.5); opacity: 0; }
}

.cd-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);   /* 2×2 di layar tersempit: memaksa
                                              4 kolom pada 320px membuat angka
                                              menyusut sampai sulit dibaca */
  gap: .6rem;
  width: 100%;
  max-width: 460px;
}

@media (min-width: 380px) {
  .cd-grid { grid-template-columns: repeat(4, 1fr); gap: .55rem; }
}

.cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
}

.cd-box {
  width: 100%;
  aspect-ratio: 1 / 1.08;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--white-warm), #FDF4F1);
  border: 1px solid var(--nude);
  border-radius: 14px;
  box-shadow: var(--shadow-box);
  position: relative;
  overflow: hidden;
  perspective: 420px;
}

/* Garis kilau tipis di tepi atas kotak — memberi kesan permukaan, bukan
   sekadar kotak datar */
.cd-box::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent);
}

.cd-num {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 9vw, 2.9rem);
  font-weight: 400;
  line-height: 1;
  color: var(--rose-dark);
  font-variant-numeric: tabular-nums;   /* angka berlebar sama: tanpa ini kotak
                                           "goyang" tiap detik saat 1 berganti
                                           jadi 8 */
  display: block;
  will-change: transform;
}

/* Flip angka (An-2) — dipasang JS hanya saat nilainya benar-benar berubah */
.cd-num.is-flip { animation: flipNum .55s cubic-bezier(.4, .1, .3, 1); }

@keyframes flipNum {
  0%   { transform: rotateX(0deg);    opacity: 1; }
  45%  { transform: rotateX(-88deg);  opacity: .15; }
  55%  { transform: rotateX(88deg);   opacity: .15; }
  100% { transform: rotateX(0deg);    opacity: 1; }
}

.cd-label {
  font-size: clamp(.6rem, 2.7vw, .7rem);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-left: .2em;
}


/* ── Mode purna-acara ────────────────────────────────────────────────────── */

.after {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding: 1.2rem 0;
}

.after__title {
  font-family: var(--serif);
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 300;
  color: var(--rose-dark);
  letter-spacing: .03em;
}

.after__body {
  font-size: clamp(.8rem, 3.4vw, .92rem);
  color: var(--ink-soft);
  letter-spacing: .06em;
}

.after__date {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 5.4vw, 1.7rem);
  color: var(--ink);
  letter-spacing: .04em;
}


/* ── Kutipan ─────────────────────────────────────────────────────────────── */

.quote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .85rem;
  padding: 0 .3rem;
}

.quote__arabic {
  font-family: var(--arab);
  font-size: clamp(1.15rem, 5.6vw, 1.6rem);
  line-height: 2.15;            /* teks Arab butuh tinggi baris jauh lebih
                                   longgar: harakat di atas & bawah huruf akan
                                   bersinggungan dengan baris tetangganya */
  color: var(--rose-dark);
  max-width: 34ch;
}

.quote__translation {
  font-size: clamp(.78rem, 3.4vw, .9rem);
  line-height: 1.85;
  color: var(--ink-soft);
  font-style: italic;
  max-width: 46ch;
}

.quote__source {
  font-family: var(--sans);
  font-size: clamp(.66rem, 2.9vw, .76rem);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--rose);
  font-style: normal;
  padding-left: .2em;
}


/* ── Lokasi ──────────────────────────────────────────────────────────────── */

.venue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .38rem;
  margin-top: .4rem;
}

.venue__pin {
  width: 22px; height: 22px;
  color: var(--rose);
  margin-bottom: .1rem;
  animation: pinFloat 3.4s ease-in-out infinite;
}

@keyframes pinFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

.venue__name {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 5.6vw, 1.65rem);
  color: var(--ink);
  letter-spacing: .03em;
}

.venue__city {
  font-size: clamp(.72rem, 3.1vw, .82rem);
  color: var(--ink-soft);
  letter-spacing: .12em;
}

/* Tombol */
.btn {
  --ripple-x: 50%;
  --ripple-y: 50%;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-top: .85rem;
  padding: .8rem 1.6rem;
  min-height: 46px;             /* target sentuh nyaman di HP */
  font-family: var(--sans);
  font-size: clamp(.74rem, 3.2vw, .84rem);
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--white-warm);
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  isolation: isolate;
  transition: transform .25s ease, box-shadow .25s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -12px rgba(156, 96, 104, .5);
}

.btn:active { transform: translateY(0) scale(.98); }

.btn:focus-visible {
  outline: 2px solid var(--rose-dark);
  outline-offset: 3px;
}

.btn__icon { width: 15px; height: 15px; flex: none; }

/* Ripple (An-7) — titik asalnya diisi JS dari posisi sentuhan */
.btn::after {
  content: '';
  position: absolute;
  top: var(--ripple-y); left: var(--ripple-x);
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  transform: scale(0);
  opacity: 0;
  z-index: -1;
}

.btn.is-rippling::after { animation: ripple .65s ease-out; }

@keyframes ripple {
  0%   { transform: scale(0);  opacity: .65; }
  100% { transform: scale(22); opacity: 0; }
}


/* ── Penutup ─────────────────────────────────────────────────────────────── */

.footer-note {
  margin-top: .8rem;
  font-size: clamp(.7rem, 3vw, .8rem);
  line-height: 1.9;
  color: var(--ink-soft);
  max-width: 40ch;
}

.noscript {
  position: relative;
  z-index: 9;
  margin: 1rem auto;
  max-width: 34rem;
  padding: 1rem 1.2rem;
  background: var(--white-warm);
  border: 1px solid var(--nude);
  border-radius: 12px;
  color: var(--ink);
  font-size: .85rem;
  line-height: 1.7;
  text-align: center;
}


/* ── Layar lebar ─────────────────────────────────────────────────────────── */

@media (min-width: 768px) {
  .stage { gap: 1.5rem; padding-inline: 2rem; }
  .cd-box { border-radius: 18px; }
}

/* Layar pendek & lebar (HP dimiringkan): kurangi jarak agar seluruh isi tetap
   muat tanpa scroll panjang */
@media (max-height: 560px) and (orientation: landscape) {
  .stage { padding-block: 2.5rem; gap: .7rem; justify-content: flex-start; }
  .countdown::before, .countdown::after { display: none; }
  .cd-grid { max-width: 380px; }
}


/* ══════════════════════════════════════════════════════════════════════════
 * HEMAT GERAK — wajib, dan sengaja diletakkan paling akhir agar menang
 *
 * Pengguna yang menyalakan setelan ini di perangkatnya sering melakukannya
 * karena animasi memicu pusing atau mual. Mengabaikannya membuat halaman ini
 * tidak bisa mereka pakai sama sekali.
 *
 * Yang dimatikan: SELURUH animasi dekoratif.
 * Yang TETAP jalan: angka hitung mundur — itu informasi, bukan hiasan.
 * ══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {

  .glow,
  .petal,
  .petal svg,
  .names__part,
  .venue__pin,
  .countdown::before,
  .countdown::after,
  .corner {
    animation: none !important;
  }

  /* Elemen yang mengandalkan animasi untuk terlihat harus dipaksa tampil —
     sekadar mematikan animasinya akan meninggalkannya pada keadaan awal
     (opacity: 0), yaitu halaman kosong. */
  .reveal {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  .names__part {
    background-image: none;
    color: var(--rose-dark);
    -webkit-text-fill-color: var(--rose-dark);
  }

  .petals { display: none; }

  .cd-num.is-flip { animation: none !important; }

  .btn, .btn:hover, .btn:focus-visible { transition: none; transform: none; }
  .btn.is-rippling::after { animation: none !important; }
}
