/* ============================================================
   Undangan Walimatul Khitan — Darel Daffa Yusuf
   Easing premium ala iOS: cubic-bezier(0.16, 1, 0.3, 1)
   ============================================================ */

:root {
  --ivory: #FAF6EF;
  --ivory-deep: #F2EBDD;
  --ink: #2A2722;
  --ink-soft: #5B554B;
  --splash-bg: #1C1A14;

  /* Aksen — di-override per sesi di bawah */
  --accent-green: #2C5F2E;
  --accent-gold: #8B6914;
  --gold-line: #C2A661;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 480px;

  --serif: "Cormorant Garamond", Georgia, serif;
  --body: "Lato", system-ui, sans-serif;
  --arab: "Amiri", serif;
}

/* Sesi 1 — hijau tua dominan + emas */
body.sesi-1 {
  --accent-green: #2C5F2E;
  --accent-gold: #8B6914;
  --gold-line: #C2A661;
  --accent-1: #2C5F2E;
  --accent-2: #8B6914;
}
/* Sesi 2 — emas tua dominan + hijau aksen */
body.sesi-2 {
  --accent-green: #7A5C1E;
  --accent-gold: #3D7A40;
  --gold-line: #B89A52;
  --accent-1: #7A5C1E;
  --accent-2: #3D7A40;
}

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

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

body {
  font-family: var(--body);
  background: #15140f;
  color: var(--ink);
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Kolom utama, center di desktop ---- */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  background-color: var(--ivory);
  background-image:
    radial-gradient(135% 55% at 50% -8%, rgba(44,95,46,0.05), transparent 62%),
    radial-gradient(120% 45% at 50% 108%, rgba(194,166,97,0.06), transparent 60%),
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='84' height='84' viewBox='0 0 84 84'><g fill='none' stroke='%23CBBE9F' stroke-width='0.9' opacity='0.5'><rect x='30' y='30' width='24' height='24'/><rect x='30' y='30' width='24' height='24' transform='rotate(45 42 42)'/><rect x='-12' y='-12' width='24' height='24'/><rect x='-12' y='-12' width='24' height='24' transform='rotate(45 0 0)'/><rect x='72' y='-12' width='24' height='24'/><rect x='72' y='-12' width='24' height='24' transform='rotate(45 84 0)'/><rect x='-12' y='72' width='24' height='24'/><rect x='-12' y='72' width='24' height='24' transform='rotate(45 0 84)'/><rect x='72' y='72' width='24' height='24'/><rect x='72' y='72' width='24' height='24' transform='rotate(45 84 84)'/></g></svg>");
  background-repeat: no-repeat, no-repeat, repeat;
  background-position: top center, bottom center, center;
  background-size: 100% 520px, 100% 460px, 84px 84px;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(0,0,0,0.28);
}

/* Trim ornamen emas di tepi atas & bawah */
.shell::before,
.shell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 30px;
  z-index: 4;
  pointer-events: none;
  background-repeat: repeat-x;
  background-position: center;
  background-size: 40px 30px;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='30' viewBox='0 0 40 30'><g fill='none' stroke='%23B08D4C' stroke-width='1.3'><path d='M0 7 H40'/><path d='M20 12 l6 6 l-6 6 l-6 -6 Z'/><circle cx='0' cy='18' r='1.6'/><circle cx='40' cy='18' r='1.6'/></g></svg>");
}
.shell::before { top: 0; }
.shell::after { bottom: 0; transform: scaleY(-1); }

/* Latar ambient partikel emas */
.ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.particle {
  position: absolute;
  bottom: -10px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-line), transparent 70%);
  opacity: 0;
  will-change: transform, opacity;
}

.content { position: relative; z-index: 2; }

/* Saat splash masih ada, kunci scroll */
body.locked { overflow: hidden; height: 100vh; }

/* ============================================================
   SPLASH
   ============================================================ */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: var(--splash-bg);
  background-image:
    radial-gradient(60% 45% at 50% 42%, rgba(201,162,75,0.18), transparent 70%),
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'><g fill='none' stroke='%23C9A24B' stroke-width='1' opacity='0.16'><rect x='25' y='25' width='22' height='22'/><rect x='25' y='25' width='22' height='22' transform='rotate(45 36 36)'/><rect x='-11' y='-11' width='22' height='22'/><rect x='-11' y='-11' width='22' height='22' transform='rotate(45 0 0)'/><rect x='61' y='-11' width='22' height='22'/><rect x='61' y='-11' width='22' height='22' transform='rotate(45 72 0)'/><rect x='-11' y='61' width='22' height='22'/><rect x='-11' y='61' width='22' height='22' transform='rotate(45 0 72)'/><rect x='61' y='61' width='22' height='22'/><rect x='61' y='61' width='22' height='22' transform='rotate(45 72 72)'/></g></svg>");
  background-repeat: no-repeat, repeat;
  background-position: center, center;
  background-size: 100% 100%, 72px 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform: translateY(0);
  transition: transform 0.7s var(--ease);
}
.splash.lift { transform: translateY(-100%); }

.splash-particles { position: absolute; inset: 0; pointer-events: none; }
.splash-particles .particle { background: radial-gradient(circle, #C9A24B, transparent 70%); }

.splash-inner { position: relative; text-align: center; padding: 0 32px; }
.bismillah {
  font-family: var(--arab);
  font-size: clamp(34px, 11vw, 52px);
  color: #E7C977;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.bismillah.show { opacity: 1; transform: translateY(0); }
.splash-sub {
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(231,201,119,0.6);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease) 0.25s, transform 0.8s var(--ease) 0.25s;
}
.splash-sub.show { opacity: 1; transform: translateY(0); }

.splash-hint {
  margin-top: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(231,201,119,0.8);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.splash-hint.show {
  opacity: 1;
  transform: translateY(0);
  animation: hintPulse 1.9s ease-in-out 0.8s infinite;
}
.splash-hint span { font-size: 14px; }
@keyframes hintPulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* ============================================================
   ORNAMEN
   ============================================================ */
.spin-slow { animation: spin 40s linear infinite; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--gold-line);
  margin: 0 auto;
}
.divider .line {
  height: 1px;
  width: 56px;
  background: linear-gradient(90deg, transparent, var(--gold-line));
}
.divider .line.r { background: linear-gradient(270deg, transparent, var(--gold-line)); }
.divider svg { width: 22px; height: 22px; }

/* ============================================================
   SECTION dasar
   ============================================================ */
section { padding: 0 28px; position: relative; }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent-gold);
  font-weight: 700;
}

/* HERO header */
.hero { padding-top: 54px; text-align: center; }
.hero .corner-orn { color: var(--gold-line); margin: 0 auto 22px; display: block; width: 52px; height: 52px; }
.hero .eyebrow { display: block; margin-bottom: 10px; }
.kicker-arab {
  font-family: var(--arab);
  font-size: 20px;
  color: var(--accent-green);
  margin-top: 6px;
}

/* Foto Darel */
.photo-wrap {
  margin: 36px 0 8px;
  position: relative;
  padding: 0 14px;
}
.photo-frame {
  position: relative;
  border: 1px solid var(--gold-line);
  padding: 8px;
  background: var(--ivory);
}
.photo-frame::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(194,166,97,0.35);
  pointer-events: none;
}
.photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  filter: blur(4px);
  transform: scale(1.05);
  opacity: 0;
  transition: filter 1.2s var(--ease), transform 1.2s var(--ease), opacity 0.9s var(--ease);
}
.photo-frame img.focused {
  filter: blur(0);
  transform: scale(1);
  opacity: 1;
}

/* Nama besar */
.name-block { text-align: center; padding-top: 30px; }
.name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(40px, 13vw, 60px);
  line-height: 1.04;
  color: var(--accent-green);
  letter-spacing: 0.5px;
}
.name .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.name.reveal .word { opacity: 1; transform: translateY(0); }

.name-orn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 22px auto 0;
  color: var(--gold-line);
}
.name-orn .grow {
  height: 1px;
  width: 0;
  background: var(--gold-line);
  transition: width 0.8s var(--ease) 0.55s;
}
.name-orn.reveal .grow { width: 64px; }
.name-orn svg { width: 16px; height: 16px; flex: none; }

/* Teks ajakan */
.invite-text {
  text-align: center;
  margin: 34px auto 0;
  max-width: 360px;
}
.invite-text .sunda {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.6;
  color: var(--ink);
  font-style: italic;
}
.invite-text .indo {
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ============================================================
   Reveal util (IntersectionObserver)
   ============================================================ */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

.reveal-left { opacity: 0; transform: translateX(-30px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal-left.in { opacity: 1; transform: translateX(0); }

.reveal-scale { opacity: 0; transform: scale(0.97); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal-scale.in { opacity: 1; transform: scale(1); }

/* ============================================================
   INFO ACARA
   ============================================================ */
.info { padding-top: 84px; text-align: center; }
.section-title {
  font-family: var(--serif);
  font-size: 34px;
  color: var(--accent-green);
  font-weight: 600;
  margin-top: 16px;
}
.info-card {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.info-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(194,166,97,0.28);
}
.info-row:last-child { border-bottom: none; }
.info-row .ic {
  flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  color: var(--accent-gold);
}
.info-row .ic svg { width: 24px; height: 24px; }
.info-row .label {
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-gold);
  font-weight: 700;
}
.info-row .value {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  line-height: 1.3;
}
.info-row .value small {
  display: block;
  font-family: var(--body);
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.session-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 24px;
  color: var(--accent-green);
  white-space: nowrap;
}

/* ============================================================
   COUNTDOWN
   ============================================================ */
.countdown { padding-top: 88px; text-align: center; }
.cd-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.cd-cell {
  background: var(--ivory-deep);
  border: 1px solid rgba(194,166,97,0.3);
  border-radius: 4px;
  padding: 18px 4px 12px;
  position: relative;
  overflow: hidden;
}
.cd-num {
  font-family: var(--serif);
  font-size: clamp(32px, 11vw, 44px);
  font-weight: 600;
  color: var(--accent-green);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  display: inline-block;
}
.cd-num.flip { animation: flipNum 0.5s var(--ease); }
@keyframes flipNum {
  0%   { transform: translateY(0); opacity: 1; }
  40%  { transform: translateY(-60%); opacity: 0; }
  41%  { transform: translateY(60%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.cd-label {
  margin-top: 8px;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 0.6s var(--ease) 0.6s;
}
.cd-grid.labels-in .cd-label { opacity: 1; }

/* ============================================================
   AYAT
   ============================================================ */
.ayat { padding-top: 92px; text-align: center; }
.ayat-box {
  margin-top: 28px;
  padding: 40px 22px;
  border-top: 1px solid var(--gold-line);
  border-bottom: 1px solid var(--gold-line);
  position: relative;
}
.ayat-arab {
  font-family: var(--arab);
  font-size: clamp(26px, 8.5vw, 36px);
  line-height: 2;
  color: var(--accent-green);
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.ayat-arab.in { opacity: 1; transform: translateY(0); }
.ayat-trans {
  margin-top: 20px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.8s var(--ease) 0.3s;
}
.ayat-trans.in { opacity: 1; }
.ayat-src {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-gold);
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.8s var(--ease) 0.45s;
}
.ayat-src.in { opacity: 1; }

/* ============================================================
   MAPS
   ============================================================ */
.maps { padding-top: 90px; text-align: center; }
.map-frame {
  margin-top: 26px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--gold-line);
  line-height: 0;
}
.map-frame iframe { width: 100%; height: 280px; border: 0; display: block; filter: grayscale(0.2) contrast(1.02); }
.addr {
  margin-top: 18px;
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
  line-height: 1.4;
}
.addr small { display: block; font-family: var(--body); font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

/* ============================================================
   TOMBOL
   ============================================================ */
.actions { padding-top: 30px; display: flex; flex-direction: column; gap: 14px; }
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 17px 22px;
  border-radius: 50px;
  font-family: var(--body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.4s var(--ease), background-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-wa {
  background: var(--accent-green);
  color: #fff;
  box-shadow: 0 10px 26px -12px var(--accent-green);
}
.btn-wa:hover { background: color-mix(in srgb, var(--accent-green) 85%, #000); transform: scale(1.02); }
.btn-wa:active { transform: scale(0.97); }
.btn-map {
  background: transparent;
  color: var(--accent-gold);
  border-color: var(--gold-line);
}
.btn-map:hover { background: var(--ivory-deep); transform: scale(1.02); }
.btn-map:active { transform: scale(0.97); }

.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255,255,255,0.4);
  pointer-events: none;
  animation: rippleGo 0.6s var(--ease);
}
.btn-map .ripple { background: rgba(194,166,97,0.35); }
@keyframes rippleGo { to { transform: scale(2.6); opacity: 0; } }

/* ============================================================
   PENUTUP
   ============================================================ */
.closing { padding: 96px 28px 70px; text-align: center; }
.closing .salam-arab {
  font-family: var(--arab);
  font-size: 22px;
  color: var(--accent-green);
  margin-bottom: 18px;
}
.closing p { color: var(--ink-soft); font-size: 15px; max-width: 320px; margin: 0 auto; }
.closing .kel {
  margin-top: 26px;
  font-family: var(--serif);
  font-size: 26px;
  color: var(--accent-green);
}
.closing .heart { color: var(--gold-line); margin: 22px auto 0; width: 34px; height: 34px; }
.switch-link {
  display: inline-block;
  margin-top: 34px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-gold);
  text-decoration: none;
  border-bottom: 1px solid var(--gold-line);
  padding-bottom: 3px;
  white-space: nowrap;
  transition: opacity 0.3s var(--ease);
}
.switch-link:hover { opacity: 0.65; }

.credit { margin-top: 40px; font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(91,85,75,0.45); }

/* Badge pojok sesi */
.session-badge {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 50px;
  background: var(--accent-green);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  box-shadow: 0 8px 22px -10px rgba(0,0,0,0.5);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.session-badge.show { opacity: 1; transform: translateY(0); }
.session-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold-line); }

@media (min-width: 520px) {
  .session-badge { right: max(14px, calc(50% - var(--maxw)/2 + 14px)); }
}

/* ============================================================
   TOMBOL MUSIK
   ============================================================ */
.music-toggle {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 95;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: var(--accent-green);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 8px 22px -10px rgba(0,0,0,0.55);
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), background-color 0.3s var(--ease);
}
.music-toggle.show { opacity: 1; transform: translateY(0); }
.music-toggle:active { transform: scale(0.94); }
.music-disc { display: grid; place-items: center; width: 100%; height: 100%; }
.music-toggle svg { width: 22px; height: 22px; }
.music-toggle.playing .music-disc { animation: spin 5s linear infinite; }

@media (min-width: 520px) {
  .music-toggle { left: max(18px, calc(50% - var(--maxw)/2 + 18px)); }
}

/* ============================================================
   Reduced motion — tampilkan semua, tanpa gerak
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .splash { display: none; }
  .photo-frame img { filter: none; transform: none; opacity: 1; }
  .name .word, .name-orn .grow, .reveal, .reveal-left, .reveal-scale,
  .ayat-arab, .ayat-trans, .ayat-src, .cd-label, .session-badge {
    opacity: 1 !important; transform: none !important; width: auto; }
  .name-orn .grow { width: 64px; }
}
