/* ============================================================
   Undangan Pernikahan — Raka & Anindya
   Mobile-first. Tanpa framework. Scroll-snap proximity (aman di
   Android: tidak mengunci tamu di section yang lebih tinggi dari layar).
   ============================================================ */

:root {
  --ink: #14100e;
  --ink-soft: #221c18;
  --cream: #f4ece2;
  --cream-dim: #cbbcad;
  --gold: #c9a227;
  --gold-soft: #e3c56b;
  --rose: #b98a7a;

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --panel-pad: clamp(1.5rem, 5vw, 3rem);
}

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

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

body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body.is-locked {
  overflow: hidden;
  height: 100dvh;
}

img,
iframe {
  display: block;
  max-width: 100%;
}

/* ============================================================
   COVER
   ============================================================ */

.cover {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: var(--panel-pad);
  background:
    radial-gradient(circle at 50% 18%, rgba(201, 162, 39, 0.14), transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(185, 138, 122, 0.12), transparent 60%),
    linear-gradient(170deg, #1b1512 0%, #14100e 55%, #0e0b0a 100%);
  transition:
    opacity 900ms var(--ease),
    visibility 900ms var(--ease),
    transform 900ms var(--ease);
}

.cover.is-open {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.06);
  pointer-events: none;
}

.cover__glow {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
  mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 78%);
}

.cover__inner {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.9rem, 2.5vw, 1.5rem);
  animation: fadeUp 1100ms var(--ease) both;
}

.cover__eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 400;
  padding-left: 0.42em;
}

.cover__names {
  font-family: var(--serif);
  font-weight: 300;
  line-height: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1em;
  padding: clamp(1.4rem, 6vw, 2.6rem) clamp(1.6rem, 8vw, 3.4rem);
  border-radius: 26px;
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.075) 0%,
    rgba(255, 255, 255, 0.028) 40%,
    rgba(255, 255, 255, 0.05) 100%
  );
  border: 1px solid rgba(227, 197, 107, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 24px 60px -20px rgba(0, 0, 0, 0.85),
    0 0 80px -40px rgba(201, 162, 39, 0.6);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
}

.cover__name {
  font-size: clamp(2.9rem, 15vw, 5.2rem);
  letter-spacing: 0.015em;
  background: linear-gradient(180deg, #fff9ec 8%, var(--gold-soft) 55%, #a9841c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.cover__amp {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  color: var(--rose);
  opacity: 0.9;
  line-height: 1;
}

.cover__date {
  font-family: var(--sans);
  font-size: clamp(0.72rem, 3vw, 0.85rem);
  letter-spacing: 0.38em;
  color: var(--cream-dim);
  padding-left: 0.38em;
}

.cover__to {
  margin-top: clamp(0.6rem, 3vw, 1.4rem);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.cover__to-label {
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cream-dim);
  opacity: 0.75;
}

.cover__to-name {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 5vw, 1.5rem);
  color: var(--cream);
}

.btn-open {
  margin-top: clamp(0.8rem, 3vw, 1.6rem);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.95rem 1.7rem;
  border: 1px solid rgba(227, 197, 107, 0.55);
  border-radius: 999px;
  background: linear-gradient(140deg, rgba(201, 162, 39, 0.22), rgba(201, 162, 39, 0.06));
  color: var(--cream);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 320ms var(--ease),
    background 320ms var(--ease),
    box-shadow 320ms var(--ease);
  box-shadow: 0 12px 34px -16px rgba(201, 162, 39, 0.75);
}

.btn-open:active {
  transform: scale(0.97);
}

.btn-open__icon svg {
  width: 16px;
  height: 16px;
  display: block;
  transition: transform 320ms var(--ease);
}

.btn-open__label {
  padding-left: 0.24em;
}

@media (hover: hover) {
  .btn-open:hover {
    background: linear-gradient(140deg, rgba(201, 162, 39, 0.34), rgba(201, 162, 39, 0.12));
    box-shadow: 0 16px 44px -16px rgba(201, 162, 39, 0.9);
  }

  .btn-open:hover .btn-open__icon svg {
    transform: translateX(3px);
  }
}

/* ============================================================
   ISI UNDANGAN
   ============================================================ */

.invitation {
  opacity: 0;
  visibility: hidden;
  transition: opacity 700ms var(--ease);
}

.invitation.is-visible {
  opacity: 1;
  visibility: visible;
  scroll-snap-type: y proximity;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 162, 39, 0.4) transparent;
  position: relative;
}

.invitation::-webkit-scrollbar {
  width: 4px;
}

.invitation::-webkit-scrollbar-thumb {
  background: rgba(201, 162, 39, 0.4);
  border-radius: 99px;
}

.panel {
  position: relative;
  min-height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: normal;
  display: grid;
  place-items: center;
  padding: var(--panel-pad);
  overflow: hidden;
}

.panel__content {
  width: 100%;
  max-width: 34rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.6rem);
}

.section-label {
  font-size: 0.66rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  padding-left: 0.34em;
  position: relative;
  padding-bottom: 0.85rem;
}

.section-label::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.panel--quote {
  background:
    radial-gradient(circle at 50% 0%, rgba(201, 162, 39, 0.1), transparent 60%),
    var(--ink);
}

.arabic {
  font-size: clamp(1.35rem, 6vw, 1.85rem);
  line-height: 2.1;
  color: var(--gold-soft);
  font-weight: 400;
}

.quote {
  font-family: var(--serif);
  font-size: clamp(1.1rem, 4.4vw, 1.42rem);
  line-height: 1.8;
  color: var(--cream);
  font-style: italic;
  font-weight: 300;
}

.quote__source {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.couple {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.4rem, 5vw, 2.2rem);
  width: 100%;
}

.couple__person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.couple__photo {
  width: clamp(7.5rem, 34vw, 10rem);
  aspect-ratio: 3 / 4;
  border-radius: 200px 200px 16px 16px;
  border: 1px solid rgba(227, 197, 107, 0.35);
  background-size: cover;
  background-position: center 20%;
  box-shadow:
    0 22px 50px -24px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
}

/* Placeholder gradien — ganti dengan foto asli via background-image */
.couple__photo--one {
  background-image:
    linear-gradient(160deg, rgba(185, 138, 122, 0.5), rgba(20, 16, 14, 0.15)),
    radial-gradient(circle at 50% 30%, #6b5445, #2a211c 70%);
}

.couple__photo--two {
  background-image:
    linear-gradient(160deg, rgba(201, 162, 39, 0.35), rgba(20, 16, 14, 0.15)),
    radial-gradient(circle at 50% 30%, #6a5a45, #2a231c 70%);
}

.couple__name {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 6.5vw, 2rem);
  font-weight: 400;
  color: var(--cream);
  letter-spacing: 0.01em;
}

.couple__desc {
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--cream-dim);
}

.couple__divider {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--rose);
  opacity: 0.85;
  line-height: 1;
}

.panel--countdown {
  background:
    radial-gradient(circle at 50% 100%, rgba(185, 138, 122, 0.12), transparent 62%),
    var(--ink-soft);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.45rem, 2.5vw, 0.9rem);
  width: 100%;
  max-width: 24rem;
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: clamp(0.65rem, 3vw, 1rem) clamp(0.2rem, 1.5vw, 0.5rem);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(227, 197, 107, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.countdown__value {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 7.5vw, 2.1rem);
  font-weight: 400;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.countdown__label {
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.countdown__note {
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  color: var(--cream-dim);
}

.events {
  display: flex;
  flex-direction: column;
  gap: clamp(1.1rem, 4vw, 1.6rem);
  width: 100%;
}

.event {
  padding: clamp(1.1rem, 4.5vw, 1.6rem);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
  border: 1px solid rgba(227, 197, 107, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.event__time {
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.event__title {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 5.5vw, 1.7rem);
  font-weight: 400;
  color: var(--cream);
}

.event__place {
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--cream-dim);
}

.btn-map {
  margin-top: 0.4rem;
  display: inline-block;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(227, 197, 107, 0.45);
  background: rgba(201, 162, 39, 0.12);
  color: var(--gold-soft);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 260ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn-map:active {
  background: rgba(201, 162, 39, 0.28);
}

.map-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(227, 197, 107, 0.2);
  box-shadow: 0 20px 46px -28px rgba(0, 0, 0, 0.9);
  background: rgba(255, 255, 255, 0.03);
}

.map-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(0.35) contrast(1.05) brightness(0.92);
}

.panel--rsvp {
  background:
    radial-gradient(circle at 50% 0%, rgba(201, 162, 39, 0.08), transparent 55%),
    var(--ink);
}

.rsvp__lead {
  font-size: 0.82rem;
  line-height: 1.75;
  color: var(--cream-dim);
  max-width: 26rem;
}

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: 100%;
  max-width: 24rem;
}

.rsvp-form input,
.rsvp-form select,
.rsvp-form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(227, 197, 107, 0.22);
  background: rgba(255, 255, 255, 0.045);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 300;
  transition: border-color 240ms var(--ease), background 240ms var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.rsvp-form textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.rsvp-form select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold-soft) 50%),
    linear-gradient(135deg, var(--gold-soft) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% + 2px),
    calc(100% - 13px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.rsvp-form input::placeholder,
.rsvp-form textarea::placeholder {
  color: rgba(203, 188, 173, 0.5);
}

.rsvp-form input:focus,
.rsvp-form select:focus,
.rsvp-form textarea:focus {
  outline: none;
  border-color: rgba(227, 197, 107, 0.6);
  background: rgba(255, 255, 255, 0.07);
}

.rsvp-form select option {
  background: var(--ink-soft);
  color: var(--cream);
}

.btn-submit {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(227, 197, 107, 0.5);
  background: linear-gradient(140deg, rgba(201, 162, 39, 0.3), rgba(201, 162, 39, 0.1));
  color: var(--cream);
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 260ms var(--ease), background 260ms var(--ease);
}

.btn-submit:active {
  transform: scale(0.98);
}

.wishes {
  width: 100%;
  max-width: 24rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.6rem;
  max-height: 14rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 162, 39, 0.35) transparent;
}

.wishes::-webkit-scrollbar {
  width: 3px;
}

.wishes::-webkit-scrollbar-thumb {
  background: rgba(201, 162, 39, 0.35);
  border-radius: 99px;
}

.wish {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.wish__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.wish__name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--gold-soft);
}

.wish__badge {
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  border-radius: 99px;
  border: 1px solid rgba(227, 197, 107, 0.3);
  color: var(--cream-dim);
  white-space: nowrap;
}

.wish__badge--hadir {
  border-color: rgba(120, 200, 140, 0.45);
  color: #96d9a9;
}

.wish__badge--tidak {
  border-color: rgba(220, 120, 120, 0.4);
  color: #e0a0a0;
}

.wish__text {
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--cream-dim);
  word-break: break-word;
}

.wishes__empty {
  font-size: 0.74rem;
  color: rgba(203, 188, 173, 0.55);
  font-style: italic;
  padding: 0.6rem 0;
}

.panel--closing {
  background:
    radial-gradient(circle at 50% 45%, rgba(201, 162, 39, 0.14), transparent 58%),
    linear-gradient(180deg, var(--ink) 0%, #0b0908 100%);
}

.closing__lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 4.2vw, 1.3rem);
  color: var(--cream-dim);
}

.closing__names {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 12vw, 3.6rem);
  font-weight: 300;
  line-height: 1.1;
  background: linear-gradient(180deg, #fff9ec, var(--gold-soft) 60%, #a9841c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.closing__note {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  color: rgba(203, 188, 173, 0.7);
}

/* ============================================================
   FLOATING UI
   ============================================================ */

.music-toggle {
  position: fixed;
  right: clamp(0.9rem, 4vw, 1.6rem);
  bottom: calc(clamp(0.9rem, 4vw, 1.6rem) + env(safe-area-inset-bottom, 0px));
  z-index: 55;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(227, 197, 107, 0.35);
  background: rgba(20, 16, 14, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--gold-soft);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 260ms var(--ease), opacity 400ms var(--ease);
  animation: fadeUp 600ms var(--ease) both;
}

.music-toggle[hidden] {
  display: none;
}

.music-toggle svg {
  width: 19px;
  height: 19px;
}

.music-toggle.is-spinning .music-toggle__on {
  animation: spin 7s linear infinite;
}

.music-toggle:active {
  transform: scale(0.92);
}

.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 54;
  width: 20px;
  height: 20px;
  color: rgba(203, 188, 173, 0.65);
  pointer-events: none;
  opacity: 0;
  transition: opacity 500ms var(--ease);
  animation: bob 2.1s ease-in-out infinite;
}

.scroll-hint svg {
  width: 100%;
  height: 100%;
}

.scroll-hint.is-visible {
  opacity: 1;
}

/* ============================================================
   ANIMASI
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 900ms var(--ease), transform 900ms var(--ease);
}

.reveal.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

/* ============================================================
   LAYAR LEBIH BESAR (tablet/desktop — tetap "dipersempit" agar
   proporsi undangan mobile terjaga)
   ============================================================ */

@media (min-width: 640px) {
  .invitation.is-visible {
    max-width: 480px;
    margin: 0 auto;
    border-left: 1px solid rgba(227, 197, 107, 0.1);
    border-right: 1px solid rgba(227, 197, 107, 0.1);
    box-shadow: 0 0 90px -30px rgba(0, 0, 0, 0.9);
  }

  .couple {
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: clamp(0.8rem, 3vw, 1.6rem);
  }

  .couple__person {
    flex: 1;
    min-width: 0;
  }

  .couple__divider {
    align-self: center;
    padding-top: 3rem;
  }
}

/* ============================================================
   AKSESIBILITAS
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
