/* =========================================================
   COMPONENTS — sampul, hero, efek cahaya, dock, lightbox, form
   ========================================================= */

/* ---------- Efek cahaya: rays + sparkles ---------- */
.rays {
  position: absolute;
  left: 50%; top: -30%;
  width: 170%; height: 120%;
  transform: translateX(-50%);
  background: repeating-conic-gradient(from 180deg at 50% 0%,
    rgba(246, 227, 168, 0) 0deg, rgba(246, 227, 168, .13) 4deg, rgba(246, 227, 168, 0) 9deg,
    rgba(220, 222, 229, 0) 14deg, rgba(220, 222, 229, .08) 17deg, rgba(220, 222, 229, 0) 22deg);
  -webkit-mask-image: radial-gradient(60% 70% at 50% 0%, #000 0%, transparent 75%);
  mask-image: radial-gradient(60% 70% at 50% 0%, #000 0%, transparent 75%);
  pointer-events: none;
  opacity: .8;
}
.rays--soft { opacity: .55; }

.sparkles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.sparkles i {
  position: absolute;
  left: var(--x); top: var(--y);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #fff8e6;
  box-shadow: 0 0 6px 2px rgba(246, 227, 168, .75), 0 0 16px 4px rgba(214, 216, 224, .32);
  opacity: 0;
  transform: scale(var(--s, 1));
}
.sparkles i:nth-child(3n) { background: #f4f4f8; box-shadow: 0 0 6px 2px rgba(230, 230, 238, .8), 0 0 14px 4px rgba(220, 222, 229, .35); }
/* Kilau bintang perak (✦): titik terang + dua garis cahaya bersilang */
.sparkles i:nth-child(2n),
.sparkles.sparkles--silver i {
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  background: radial-gradient(circle, #fff 0 10%, rgba(236, 238, 244, .75) 20%, rgba(220, 222, 229, 0) 58%);
  box-shadow: none;
}
.sparkles i:nth-child(2n)::before, .sparkles i:nth-child(2n)::after,
.sparkles.sparkles--silver i::before, .sparkles.sparkles--silver i::after {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 100%; height: 1px;
  margin-top: -.5px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95), transparent);
}
.sparkles i:nth-child(2n)::after, .sparkles.sparkles--silver i::after { transform: rotate(90deg); }
/* sebagian kilau berwarna emas muda agar perpaduan emas-perak terasa */
.sparkles.sparkles--silver i:nth-child(3n) { background: radial-gradient(circle, #fffaf0 0 10%, rgba(246, 227, 168, .7) 22%, rgba(246, 227, 168, 0) 58%); }

/* ---------- SAMPUL (Section 1) ---------- */
.cover {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  color: var(--on-dark);
  background: var(--wine-night);
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
}
.cover__media, .hero__media {
  position: absolute; inset: 0;
  overflow: hidden;
  background: var(--wine-night);
}
.cover__media img, .hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.cover__media img { object-position: 50% 28%; transform: scale(1.08); }
.cover__tint {
  /* wajah (± 25–47% tinggi) tetap cerah; pita nama & tombol di bawahnya digelapkan + halo lembut → teks emas kontras */
  position: absolute; inset: 0;
  background:
    radial-gradient(75% 38% at 50% 66%, rgba(22, 2, 7, .5), transparent 72%),
    linear-gradient(180deg, rgba(44, 4, 13, .72) 0%, rgba(66, 8, 22, .12) 20%, rgba(66, 8, 22, .1) 40%, rgba(44, 4, 13, .7) 52%, rgba(36, 3, 10, .9) 64%, rgba(22, 2, 7, .97) 100%),
    radial-gradient(90% 60% at 50% 35%, rgba(233, 207, 138, .14), transparent 70%);
}
.cover__media::after, .hero__media::after {
  /* tint rose pada foto hitam-putih/terang: kesan duotone mewah */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(233, 207, 138, .3), rgba(140, 29, 51, .42));
  mix-blend-mode: soft-light;
}
.cover__panel {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + clamp(22px, 5vh, 44px)) var(--gutter) calc(var(--safe-b) + clamp(20px, 4vh, 36px));
  text-align: center;
}
.cover__content {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.cover__eyebrow { margin-bottom: auto; }
.cover__names {
  font-size: clamp(2.7rem, 12.5vw, 4.6rem);
  margin-top: 1rem;
}
.cover__names > span:not(.amp):not(.sr-only) {
  background: var(--grad-gold);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-inline: .06em;
}
.cover__names .amp { color: var(--silver); margin: .08em 0 .02em; }
.cover__date {
  margin-top: .9rem;
  font-family: var(--font-body);
  font-size: 12px;
  letter-spacing: .5em;
  padding-left: .5em;
  color: var(--on-dark);
}
.cover__guest {
  margin-top: clamp(1rem, 3vh, 1.6rem);
  padding: .85rem 1.4rem;
  min-width: min(300px, 100%);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .04));
  border: 1px solid rgba(233, 207, 138, .28);
  line-height: 1.55;
}
.cover__guest { position: relative; border-color: transparent; }
.cover__guest::before {
  /* bingkai metalik emas-perak (gradien di tepi saja, isi tetap transparan) */
  content: "";
  position: absolute; inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: var(--grad-frame);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: .7;
  pointer-events: none;
}
.cover__to { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--on-dark-soft); }
.cover__to-title { font-size: 13px; color: var(--on-dark-soft); }
.cover__guest-name {
  margin-top: .3rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 5.4vw, 1.7rem);
  font-weight: 500;
  line-height: 1.2;
  color: var(--gold-light);
  overflow-wrap: anywhere;
}
.cover__open { margin-top: clamp(1rem, 3vh, 1.6rem); }
.cover__note {
  margin-top: .9rem;
  font-size: 10.5px;
  letter-spacing: .04em;
  color: rgba(251, 245, 239, .6);
}

/* ---------- HERO (Section 2) ---------- */
.hero {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--on-dark);
  background: var(--wine-night);
  overflow: hidden;
  isolation: isolate;
}
.hero__media img { object-position: 50% 24%; }
.hero__tint {
  /* foto studio sangat terang → pita teks (± 45–85%) dibuat gelap agar nama emas tetap kontras */
  position: absolute; inset: 0;
  background:
    radial-gradient(80% 36% at 50% 64%, rgba(22, 2, 7, .55), transparent 72%),
    linear-gradient(180deg, rgba(44, 4, 13, .7) 0%, rgba(66, 8, 22, .18) 22%, rgba(66, 8, 22, .14) 38%, rgba(44, 4, 13, .72) 50%, rgba(36, 3, 10, .9) 62%, rgba(22, 2, 7, .97) 100%),
    radial-gradient(100% 70% at 50% 110%, rgba(212, 169, 71, .2), transparent 60%);
}
.hero__panel {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  /* ruang bawah = dock + penanda "Gulir"; baris tanggal cukup sempit sehingga tidak bertabrakan dengan tombol mengambang */
  padding: 90px var(--gutter) calc(var(--dock-h) + var(--safe-b) + 84px);
  text-align: center;
}
.hero__content { display: flex; flex-direction: column; align-items: center; }
.hero__names {
  margin-top: .8rem;
  font-size: clamp(3rem, 14vw, 5.2rem);
}
.hero__names > span:not(.amp):not(.sr-only) {
  background: var(--grad-gold);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-inline: .06em;
}
.hero__names .amp { color: var(--silver); margin: .06em 0; }
.hero__tagline {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.2rem, 5vw, 1.6rem);
  font-weight: 300;
  letter-spacing: .04em;
  /* perak foil */
  background: var(--grad-silver);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-inline: .1em;
}
.hero__date {
  display: flex; align-items: center; gap: 14px;
  margin-top: 1.1rem;
  font-size: 12.5px;
  letter-spacing: .42em;
  padding-left: .42em;
  color: var(--on-dark);
}
.hero__line { width: 32px; height: 1px; background: var(--grad-silver); }
.hero__day { margin-top: .35rem; font-size: 12px; letter-spacing: .14em; color: var(--on-dark-soft); }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: calc(var(--dock-h) + var(--safe-b) + 18px);
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 44px; min-height: 44px;
  font-size: 9.5px; letter-spacing: .32em; text-transform: uppercase;
  color: var(--on-dark-soft);
  text-decoration: none;
}

/* ---------- Bingkai lengkung (arch) untuk potret ---------- */
.arch {
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 340px;
}
.arch::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 999px 999px 30px 30px;
  border: 1px solid rgba(212, 169, 71, .6);
  pointer-events: none;
}
.arch::after {
  /* bingkai perak kedua, sedikit bergeser → kesan berlapis */
  content: "";
  position: absolute;
  inset: -18px -4px -4px -18px;
  border-radius: 999px 999px 34px 34px;
  border: 1px solid rgba(164, 167, 178, .45);
  pointer-events: none;
}
.arch__frame {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 999px 999px 22px 22px;
  overflow: hidden;
  background: var(--blush);
  box-shadow: var(--shadow-soft);
  /* Safari: pastikan radius memotong gambar yang di-transform */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}
.arch__frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 22%);
}
.arch--lg { max-width: 400px; }

/* ---------- DOCK: navigasi + tombol musik/auto-scroll ---------- */
.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: 0 12px calc(var(--safe-b) + 12px);
  pointer-events: none;
}
.dock > * { pointer-events: auto; }
.bottom-nav {
  display: flex;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(44, 4, 13, .78);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid rgba(233, 207, 138, .28);
  box-shadow: 0 14px 40px -12px rgba(22, 2, 7, .6);
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 60px;
  height: 50px;
  border-radius: 999px;
  color: rgba(251, 245, 239, .78);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .02em;
  text-decoration: none;
  line-height: 1.2;
  transition: color .3s, background-color .3s, transform .3s var(--ease-lux);
  touch-action: manipulation;
}
.bottom-nav a .icon { width: 19px; height: 19px; }
.bottom-nav a:active { transform: scale(.94); }
.bottom-nav a.is-active {
  color: var(--wine-deep);
  background: var(--grad-gold-btn);
}

.fab-stack {
  position: absolute;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--safe-b) + 12px + 62px + 12px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.fab {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  padding: 0;
  border-radius: 50%;
  color: var(--gold-light);
  background: rgba(44, 4, 13, .78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(233, 207, 138, .4);
  box-shadow: 0 10px 28px -10px rgba(22, 2, 7, .6);
  transition: transform .3s var(--ease-lux), border-color .3s, color .3s, opacity .3s;
  touch-action: manipulation;
}
.fab:active { transform: scale(.92); }
.fab .icon { width: 20px; height: 20px; }
.fab__disc { display: grid; place-items: center; }
.fab__eq {
  position: absolute;
  bottom: 9px;
  display: flex; gap: 2px; align-items: flex-end;
  height: 7px;
  opacity: 0;
  transition: opacity .3s;
}
.fab__eq i { width: 2px; height: 100%; border-radius: 1px; background: var(--gold-soft); transform-origin: bottom; transform: scaleY(.35); }
.fab--music.is-playing { border-color: var(--gold); }
.fab--music.is-playing .fab__disc { transform: translateY(-3px); }
.fab--music.is-playing .fab__eq { opacity: 1; }
.fab--music.needs-tap::after {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--gold-soft);
}
.fab--music.is-unavailable { opacity: .45; }
.fab--scroll[aria-pressed="false"] { color: var(--on-dark-soft); border-color: rgba(251, 245, 239, .25); }
.fab--scroll[aria-pressed="false"]::before {
  content: "";
  position: absolute; width: 22px; height: 1.5px;
  background: currentColor; transform: rotate(-45deg); border-radius: 1px;
}
.fab-status {
  position: absolute;
  right: 58px;
  bottom: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(44, 4, 13, .85);
  border: 1px solid rgba(233, 207, 138, .3);
  color: var(--gold-light);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity .35s, transform .35s var(--ease-lux);
  pointer-events: none;
}
.fab-status.is-visible { opacity: 1; transform: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  z-index: 90;
  max-width: min(88vw, 420px);
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(44, 4, 13, .92);
  border: 1px solid rgba(233, 207, 138, .35);
  color: var(--on-dark);
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 14px 40px -14px rgba(22, 2, 7, .7);
  opacity: 0;
  transform: translate(-50%, -12px);
  transition: opacity .35s, transform .45s var(--ease-lux);
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- LIGHTBOX ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(18, 2, 6, .95);
  color: var(--on-dark);
  touch-action: none;
  overscroll-behavior: contain;
  opacity: 0;
  transition: opacity .35s var(--ease-lux);
}
.lightbox.is-open { opacity: 1; }
.lightbox__stage {
  position: absolute;
  inset: calc(env(safe-area-inset-top, 0px) + 64px) 0 calc(var(--safe-b) + 116px);
  display: grid;
  place-items: center;
  padding: 0 12px;
  cursor: grab;
}
.lightbox__picture { display: contents; }
.lightbox__stage.is-loading::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 1px solid rgba(233, 207, 138, .2);
  border-top-color: var(--gold-soft);
  animation: spin 1s linear infinite;
}
.lightbox__stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  will-change: transform, opacity;
}
.lightbox__caption {
  position: absolute;
  left: 20px; right: 20px;
  bottom: calc(var(--safe-b) + 76px);
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  line-height: 1.4;
  color: var(--on-dark-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lightbox__counter {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-b) + 28px);
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--gold-soft);
}
.lightbox__btn {
  position: absolute;
  display: grid; place-items: center;
  width: 48px; height: 48px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(233, 207, 138, .35);
  background: rgba(255, 255, 255, .06);
  color: var(--gold-light);
  transition: background-color .3s, transform .3s var(--ease-lux);
  touch-action: manipulation;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, .14); }
.lightbox__btn:active { transform: scale(.92); }
.lightbox__close { top: calc(env(safe-area-inset-top, 0px) + 12px); right: 12px; }
.lightbox__prev { left: 20px; bottom: calc(var(--safe-b) + 14px); }
.lightbox__next { right: 20px; bottom: calc(var(--safe-b) + 14px); }

/* ---------- FORM (RSVP) ---------- */
.field { display: grid; gap: 8px; margin-bottom: 1.35rem; text-align: left; }
.field__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-ink);
}
.field__input {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(166, 124, 46, .35);
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  font-size: 16px; /* ≥16px: cegah auto-zoom iOS */
  line-height: 1.4;
  transition: border-color .25s, box-shadow .25s;
  -webkit-appearance: none;
  appearance: none;
}
textarea.field__input { min-height: 96px; resize: vertical; }
.field__input:focus { border-color: var(--gold-deep); box-shadow: 0 0 0 4px rgba(212, 169, 71, .2); outline: none; }
.field__input[aria-invalid="true"] { border-color: #b3261e; }
.field__error { font-size: 12.5px; color: #b3261e; }
.field__hint { font-size: 12px; color: var(--ink-soft); }

.choice-group { border: 0; padding: 0; margin: 0 0 1.35rem; min-width: 0; }
.choice-group legend { padding: 0; margin-bottom: 8px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }
.choice-group.is-disabled { opacity: .55; }
.field__optional { font-weight: 400; letter-spacing: .04em; text-transform: none; color: var(--ink-soft); }
.choice { position: relative; flex: 1 1 0; min-width: 0; }
.choice--num { flex: 0 0 auto; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px;
  min-width: 50px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(166, 124, 46, .35);
  background: rgba(255, 255, 255, .85);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: background-color .25s, border-color .25s, color .25s, box-shadow .25s;
}
.choice input:checked + span {
  border-color: var(--gold-deep);
  background: var(--grad-gold-btn);
  color: var(--wine-deep);
  box-shadow: 0 8px 22px -12px rgba(166, 124, 46, .8);
}
.choice input:focus-visible + span { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
.choice input:disabled + span { opacity: .45; }
