/* ============================================================
   Undangan Pernikahan — Nurul & Fahri
   Arah desain : Layout Editorial Minimalis (Demo 1)
                 + Tipografi Demo 2 (Playfair Display · DM Sans · Amiri)
   Palet       : #FFF9D2 (krem) · #00392C (forest green)
   Tema        : Light (default) + Dark (toggle)
   ============================================================ */

/* ─────────────────────────────────────────────
   1. TOKENS — Light Mode (default)
   ───────────────────────────────────────────── */
:root {
  /* Brand */
  --cream: #fff9d2;
  --cream-deep: #f6efba;
  --green: #00392c;
  --green-mid: #1a5542;
  --green-dim: #3a7a5f;
  --gold: #8b6914;
  --gold-warm: #b8860b;
  --white: #fffef2;

  /* Semantic — Light */
  --bg: #fff9d2;
  --bg-alt: #f8f1bd; /* section selang-seling */
  --surface: #fffef2; /* kartu */
  --surface-2: #fbf6d4;
  --ink: #00392c; /* teks utama */
  --ink-soft: #1a5542; /* teks sekunder */
  --ink-mute: #3a7a5f; /* label */
  --accent: #8b6914; /* gold aksen */
  --accent-warm: #b8860b;
  --line: color-mix(in srgb, #00392c 14%, transparent);
  --line-soft: color-mix(in srgb, #00392c 8%, transparent);
  --on-green: #fff9d2; /* teks di atas hijau */

  --field-bg: #fffdf0;
  --field-border: color-mix(in srgb, #00392c 20%, transparent);

  --shadow-card: 0 1px 2px color-mix(in srgb, #00392c 6%, transparent);
  --shadow-lift: 0 18px 40px -24px color-mix(in srgb, #00392c 35%, transparent);

  --pattern-opacity: 0.05;

  /* Type */
  --display: "Playfair Display", Georgia, serif;
  --body: "DM Sans", system-ui, sans-serif;
  --arabic: "Amiri", serif;

  /* Motion / layout */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1140px;
  --pad-x: clamp(20px, 5vw, 56px);
  --sec-y: clamp(72px, 10vw, 130px);

  --z-nav: 50;
  --z-overlay: 80;
  --z-toast: 90;
}

/* ─────────────────────────────────────────────
   1b. TOKENS — Dark Mode
   ───────────────────────────────────────────── */
html.dark {
  --bg: #002016; /* forest sangat tua */
  --bg-alt: #002d22;
  --surface: #033528;
  --surface-2: #0a4030;
  --ink: #fff9d2; /* cream sebagai teks utama */
  --ink-soft: #e8dbac;
  --ink-mute: #a6c2ac;
  --accent: #d4af37; /* gold lebih terang di dark */
  --accent-warm: #e2c463;
  --line: color-mix(in srgb, #fff9d2 16%, transparent);
  --line-soft: color-mix(in srgb, #fff9d2 9%, transparent);
  --on-green: #fff9d2;

  --field-bg: #011c14;
  --field-border: color-mix(in srgb, #fff9d2 22%, transparent);

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lift: 0 20px 44px -22px rgba(0, 0, 0, 0.6);

  --pattern-opacity: 0.09;
}

/* ─────────────────────────────────────────────
   2. RESET / BASE
   ───────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition:
    background-color 0.5s var(--ease),
    color 0.5s var(--ease);
}

img {
  max-width: 100%;
  display: block;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

p {
  text-wrap: pretty;
}
h1,
h2,
h3 {
  text-wrap: balance;
}

/* Pola khatam latar — semua section (motif dari nurul-fahri) */
.pattern-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23996b1a' stroke-width='0.7'%3E%3Cpath d='M44 4 L57 31 L84 44 L57 57 L44 84 L31 57 L4 44 L31 31 Z'/%3E%3Crect x='24' y='24' width='40' height='40' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='7'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 88px 88px;
  opacity: var(--pattern-opacity);
  transition: opacity 0.5s ease;
}
html.dark .pattern-layer {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='88' viewBox='0 0 88 88'%3E%3Cg fill='none' stroke='%23d4af37' stroke-width='0.7'%3E%3Cpath d='M44 4 L57 31 L84 44 L57 57 L44 84 L31 57 L4 44 L31 31 Z'/%3E%3Crect x='24' y='24' width='40' height='40' transform='rotate(45 44 44)'/%3E%3Ccircle cx='44' cy='44' r='7'/%3E%3C/g%3E%3C/svg%3E");
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  position: relative;
  z-index: 1;
}

.sec-pad {
  padding-block: var(--sec-y);
  position: relative;
}
.bg-alt {
  background: var(--bg-alt);
}

/* ─────────────────────────────────────────────
   3. UTIL — Section header (editorial label)
   ───────────────────────────────────────────── */
.sec-label {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: clamp(36px, 5vw, 60px);
}
.sec-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
/* varian: judul section terpusat */
.sec-head {
  text-align: center;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.sec-head h2:first-child {
  margin-top: 0;
}
.sec-head .eyebrow {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.sec-head h2 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.15;
  color: var(--ink);
}
.sec-head .sub {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(15px, 2.2vw, 18px);
  color: var(--ink-soft);
  opacity: 0.85;
  margin-top: 10px;
}
.sec-head .rule {
  width: 56px;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
  margin: 22px auto 0;
}

/* ─────────────────────────────────────────────
   4. NAV
   ───────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 62px;
  padding-inline: var(--pad-x);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.3s,
    background-color 0.3s;
}
.nav.scrolled {
  border-bottom-color: var(--line-soft);
}

.nav-brand {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.nav-brand span {
  color: var(--accent);
  font-style: italic;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav-links > a {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  opacity: 0.75;
  position: relative;
  padding-block: 4px;
  transition: opacity 0.2s;
}
.nav-links > a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.nav-links > a:hover {
  opacity: 1;
}
.nav-links > a:hover::after,
.nav-links > a.active::after {
  width: 100%;
}
.nav-links > a.active {
  opacity: 1;
  color: var(--ink);
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  transition:
    background-color 0.2s,
    color 0.2s;
}
.icon-btn:hover {
  background: var(--line-soft);
  color: var(--ink);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

/* toggle icon swap */
.icon-sound-off,
.icon-moon {
  display: none;
}
html.dark .icon-moon {
  display: block;
}
html.dark .icon-sun {
  display: none;
}
.audio-muted .icon-sound-on {
  display: none;
}
.audio-muted .icon-sound-off {
  display: block;
}

/* Hamburger */
.nav-burger {
  display: none;
}

/* Mobile menu */
.nav-mobile {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-nav) - 1);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition:
    opacity 0.3s,
    transform 0.3s,
    visibility 0.3s;
}
.nav-mobile.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-mobile a {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 500;
  color: var(--ink);
  padding: 10px 24px;
}
.nav-mobile a:hover {
  color: var(--accent);
}

/* ─────────────────────────────────────────────
   5. HERO (editorial centered — Demo 1)
   ───────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 110px var(--pad-x) 70px;
}
/* vertical rules kiri-kanan */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  top: 16%;
  bottom: 16%;
  width: 1px;
  background: var(--line);
  z-index: 1;
}
.hero::before {
  left: clamp(16px, 5vw, 56px);
}
.hero::after {
  right: clamp(16px, 5vw, 56px);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

.bismillah {
  font-family: var(--arabic);
  font-size: clamp(22px, 4vw, 34px);
  direction: rtl;
  color: var(--ink);
  opacity: 0.7;
  line-height: 1.9;
  margin-bottom: clamp(32px, 5vw, 48px);
}

.hero-eyebrow {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: clamp(18px, 3vw, 26px);
}

.hero-names {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(58px, 14vw, 132px);
  line-height: 0.92;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.hero-names .amp {
  display: block;
  font-size: 0.42em;
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
  line-height: 1.5;
}

.hero-rule {
  width: 64px;
  height: 1px;
  background: var(--ink);
  opacity: 0.35;
  margin: clamp(28px, 4vw, 40px) auto;
}

.hero-date {
  font-family: var(--body);
  font-size: clamp(12px, 1.6vw, 14px);
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hero-dua {
  margin-top: clamp(44px, 6vw, 60px);
  max-width: 540px;
  margin-inline: auto;
}
.hero-dua .ar {
  font-family: var(--arabic);
  font-size: clamp(18px, 3vw, 22px);
  direction: rtl;
  color: var(--ink);
  line-height: 2;
  margin-bottom: 14px;
}
.hero-dua .tr {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(14px, 2vw, 16px);
  color: var(--ink-soft);
  line-height: 1.7;
  opacity: 0.88;
}
.hero-from {
  margin-top: 10px;
  font-family: var(--body);
  font-size: 13px;
  color: var(--ink-mute);
  line-height: 1.7;
}
.hero-from strong {
  color: var(--ink-soft);
  font-weight: 600;
}

/* Mihrab arch ornament — behind content, centered */
.hero-mihrab {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  width: clamp(520px, 88vw, 980px);
  opacity: 0.13;
  /* subtle fade at bottom so it blends with page below */
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}
.hero-mihrab img {
  width: 100%;
  height: auto;
  /* inherit accent color via CSS filter trick — green ink in light, cream in dark */
  filter: var(--mihrab-filter, none);
}

/* tint to match brand colors */
:root {
  --mihrab-filter: brightness(0) saturate(100%) invert(14%) sepia(46%)
    saturate(700%) hue-rotate(130deg) brightness(85%);
}
html.dark {
  --mihrab-filter: brightness(0) saturate(100%) invert(99%) sepia(10%)
    saturate(500%) hue-rotate(10deg) brightness(105%);
}

/* on very small screens, reduce size so text doesn't overlap */
@media (max-width: 480px) {
  .hero-mihrab {
    width: clamp(340px, 95vw, 560px);
    opacity: 0.1;
  }
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-family: var(--body);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-mute);
  opacity: 0.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.scroll-cue .arrow {
  width: 1px;
  height: 28px;
  background: var(--ink-mute);
  animation: cueMove 2s var(--ease) infinite;
}
@keyframes cueMove {
  0%,
  100% {
    transform: scaleY(0.4);
    transform-origin: top;
    opacity: 0.3;
  }
  50% {
    transform: scaleY(1);
    transform-origin: top;
    opacity: 0.7;
  }
}

/* ─────────────────────────────────────────────
   6. PROFIL (3-col editorial — Demo 1)
   ───────────────────────────────────────────── */
.profil-grid {
  display: grid;
  grid-template-columns: 1fr 90px 1fr;
  align-items: start;
}

.profil-card {
  position: relative;
}

.profil-photo {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 3/4;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  overflow: hidden;
  position: relative;
}
.profil-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profil-photo .ph {
  font-family: var(--body);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.32;
}
.profil-card.right .profil-photo {
  margin-left: auto;
}
.profil-card.right {
  text-align: right;
}

.profil-role {
  font-family: var(--body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.profil-name {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.08;
  color: var(--ink);
  margin-bottom: 18px;
}
.profil-parents {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(14px, 2vw, 16px);
  color: var(--ink-soft);
  line-height: 1.85;
  opacity: 0.85;
}
.profil-parents strong {
  font-style: normal;
  font-weight: 600;
  opacity: 1;
}
.profil-ig {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mute);
}
.profil-card.right .profil-ig {
  flex-direction: row-reverse;
}
.profil-ig svg {
  width: 15px;
  height: 15px;
}
.profil-ig:hover {
  color: var(--accent);
}

.profil-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: clamp(60px, 12vw, 130px);
  height: 100%;
}
.profil-center .ln {
  width: 1px;
  flex: 1;
  min-height: 60px;
  background: var(--line);
}
.profil-center .amp {
  font-family: var(--display);
  font-style: italic;
  font-size: 38px;
  color: var(--accent);
  padding: 18px 0;
}

/* ─────────────────────────────────────────────
   7. ACARA (countdown + event cards)
   ───────────────────────────────────────────── */
.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 4vw, 48px);
  margin-bottom: clamp(48px, 7vw, 76px);
}
.cd-item {
  text-align: center;
  min-width: 64px;
}
.cd-num {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(36px, 7vw, 64px);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cd-lbl {
  font-family: var(--body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 10px;
}
.cd-sep {
  font-family: var(--display);
  font-size: clamp(28px, 5vw, 48px);
  color: var(--accent);
  opacity: 0.4;
  align-self: flex-start;
  line-height: 1.1;
}

.acara-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 32px);
}
.acara-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: clamp(28px, 4vw, 44px);
  text-align: center;
  box-shadow: var(--shadow-card);
  position: relative;
  transition:
    transform 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}
.acara-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}
.acara-card .ac-orn {
  width: 30px;
  height: 30px;
  color: var(--accent);
  margin: 0 auto 18px;
  opacity: 0.8;
}
.acara-card h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(22px, 3vw, 30px);
  color: var(--ink);
  margin-bottom: 6px;
}
.acara-card .ac-day {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}
.acara-card .ac-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 16px;
}
.acara-card .ac-row .k {
  font-family: var(--body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.acara-card .ac-row .v {
  font-family: var(--display);
  font-size: clamp(16px, 2.4vw, 19px);
  color: var(--ink-soft);
}
.acara-card .ac-row .v.addr {
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.5;
}
.acara-divider {
  width: 40px;
  height: 1px;
  background: var(--line);
  margin: 0 auto 16px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 12px 24px;
  margin-top: 8px;
  border: 1px solid var(--green);
  background: var(--green);
  color: var(--on-green);
  transition:
    background-color 0.25s,
    color 0.25s,
    transform 0.2s;
}
html.dark .btn {
  border-color: var(--accent);
  background: var(--accent);
  color: #002016;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn svg {
  width: 15px;
  height: 15px;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--field-border);
}
html.dark .btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--field-border);
}
.btn-full {
  width: 100%;
  justify-content: center;
}

/* ─────────────────────────────────────────────
   8. KISAH (timeline)
   ───────────────────────────────────────────── */
.kisah-wrap {
  max-width: 720px;
  margin-inline: auto;
  position: relative;
}
.kisah-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--line);
  transform: translateX(-50%);
}
.kisah-item {
  position: relative;
  width: 50%;
  padding: 0 40px 56px;
}
.kisah-item:nth-child(odd) {
  left: 0;
  text-align: right;
}
.kisah-item:nth-child(even) {
  left: 50%;
  text-align: left;
}
.kisah-item .dot {
  position: absolute;
  top: 4px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--accent);
}
.kisah-item:nth-child(odd) .dot {
  right: -6px;
}
.kisah-item:nth-child(even) .dot {
  left: -6px;
}
.kisah-item .yr {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.kisah-item h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(20px, 2.8vw, 26px);
  color: var(--ink);
  margin-bottom: 8px;
}
.kisah-item p {
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.7;
  opacity: 0.9;
}
.kisah-item:last-child {
  padding-bottom: 0;
}

/* ─────────────────────────────────────────────
   9. GALERI (grid + lightbox)
   ───────────────────────────────────────────── */
.galeri-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.gal-item {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  cursor: pointer;
  position: relative;
}
.gal-item:nth-last-child(1),
.gal-item:nth-last-child(8) {
  grid-column: span 4;
  aspect-ratio: 4;
}
.gal-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.gal-item:hover img {
  transform: scale(1.06);
}
.gal-item .ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--body);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.3;
}
.gal-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--green) 0%, transparent);
  transition: background-color 0.3s;
}
.gal-item:hover::after {
  background: color-mix(in srgb, var(--green) 12%, transparent);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: color-mix(in srgb, var(--green) 92%, transparent);
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s,
    visibility 0.3s;
}
html.dark .lightbox {
  background: rgba(0, 0, 0, 0.9);
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
}
.lightbox img {
  max-width: 90vw;
  max-height: 86vh;
  object-fit: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.lightbox .lb-close,
.lightbox .lb-nav {
  position: absolute;
  color: var(--cream);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, #000 25%, transparent);
  border-radius: 50%;
}
.lightbox .lb-close {
  top: 22px;
  right: 22px;
}
.lightbox .lb-nav.prev {
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
}
.lightbox .lb-nav.next {
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
}
.lightbox .lb-nav svg,
.lightbox .lb-close svg {
  width: 22px;
  height: 22px;
}

/* ─────────────────────────────────────────────
   10. RSVP + FORM dasar
   ───────────────────────────────────────────── */
.form-card {
  max-width: 560px;
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: clamp(28px, 4vw, 44px);
  box-shadow: var(--shadow-card);
}
.field {
  margin-bottom: 20px;
}
.field label {
  display: block;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 8px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  padding: 12px 14px;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.2s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.field textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.6;
}
.field .counter {
  text-align: right;
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 6px;
}
.field-err {
  color: #c0392b;
  font-size: 12px;
  margin-top: 6px;
  display: none;
}
.field.invalid input,
.field.invalid textarea,
.field.invalid select {
  border-color: #c0392b;
}
.field.invalid .field-err {
  display: block;
}

/* radio hadir/tidak */
.rsvp-choice {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;  /* contain absolute-positioned inputs */
}
.rsvp-choice label {
  flex: 1;
  min-width: 120px;   /* cegah label terlalu gepeng di HP sempit */
  text-align: center;
  cursor: pointer;
  border: 1px solid var(--field-border);
  padding: 14px;
  font-family: var(--body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
  transition: all 0.2s;
  margin: 0;
}
.rsvp-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.rsvp-choice input:checked + label,
.rsvp-choice label.checked {
  background: var(--green);
  color: var(--on-green);
  border-color: var(--green);
}
html.dark .rsvp-choice input:checked + label {
  background: var(--accent);
  color: #002016;
  border-color: var(--accent);
}

.form-success {
  display: none;
  text-align: center;
  padding: 28px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.form-success.show {
  display: block;
}
.form-success .ic {
  width: 40px;
  height: 40px;
  color: var(--accent);
  margin: 0 auto 14px;
}
.form-success h4 {
  font-family: var(--display);
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-success p {
  font-size: 14px;
  color: var(--ink-soft);
}

/* ─────────────────────────────────────────────
   11. HADIAH (rekening + copy)
   ───────────────────────────────────────────── */
.hadiah-intro {
  max-width: 520px;
  margin: 0 auto clamp(36px, 5vw, 52px);
  text-align: center;
  font-family: var(--body);
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.hadiah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 760px;
  margin-inline: auto;
}
.rek-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.rek-bank {
  font-family: var(--display);
  font-weight: 500;
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rek-bank .tag {
  font-family: var(--body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  padding: 3px 9px;
}
.rek-no {
  font-family: var(--body);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.rek-an {
  font-family: var(--body);
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: 18px;
}
.btn-copy {
  width: 100%;
  justify-content: center;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--field-border);
  color: var(--ink-soft);
  transition: all 0.2s;
}
.btn-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-copy svg {
  width: 15px;
  height: 15px;
}
.btn-copy.copied {
  background: var(--green);
  color: var(--on-green);
  border-color: var(--green);
}
html.dark .btn-copy.copied {
  background: var(--accent);
  color: #002016;
}
.btn-copy-addr {
  max-width: 200px;
  margin: 16px auto 0;
}

.hadiah-addr {
  max-width: 520px;
  margin: 28px auto 0;
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  padding: 24px;
}
.hadiah-addr .k {
  font-family: var(--body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 10px;
}
.hadiah-addr .v {
  font-family: var(--display);
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ─────────────────────────────────────────────
   12. AYAT
   ───────────────────────────────────────────── */
.ayat-row {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
  max-width: 920px;
  margin: 0 auto clamp(40px, 6vw, 64px);
}
.ayat-row.flip {
  grid-template-columns: 200px 1fr;
}
.ayat-row.flip .ayat-text {
  order: 2;
}
.ayat-text .ar {
  font-family: var(--arabic);
  font-size: clamp(20px, 3.4vw, 28px);
  direction: rtl;
  color: var(--ink);
  line-height: 2.1;
  margin-bottom: 18px;
}
.ayat-text .tr {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(15px, 2.2vw, 18px);
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 12px;
  opacity: 0.9;
}
.ayat-text .ref {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.ayat-orn {
  color: var(--accent);
  opacity: 0.55;
  display: grid;
  place-items: center;
}
.ayat-orn svg {
  width: 100%;
  max-width: 180px;
}

.ayat-closing {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
  padding-top: clamp(20px, 4vw, 36px);
}
.ayat-closing p {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(16px, 2.4vw, 20px);
  color: var(--ink-soft);
  line-height: 1.7;
}
.ayat-closing .stars {
  color: var(--accent);
  margin-top: 16px;
  letter-spacing: 0.5em;
}

/* ─────────────────────────────────────────────
   13. BUKU TAMU
   ───────────────────────────────────────────── */
.tamu-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 7fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: stretch;
}

/* form-card di dalam tamu tidak perlu max-width kecil */
.tamu .form-card {
  max-width: 100%;
  margin-inline: 0;
}
.tamu-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.tamu-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 6px;
  /* max-height mengikuti tinggi form di sebelah kiri */
}
.tamu-count {
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 18px;
  flex-shrink: 0;
}
.tamu-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 540px;
  overflow-y: auto;
  padding-right: 6px;
}
.tamu-entry {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  padding: 16px 18px;
}
.tamu-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--green);
  color: var(--on-green);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 500;
}
html.dark .tamu-avatar {
  background: var(--accent);
  color: #002016;
}
.tamu-entry .body {
  flex: 1;
  min-width: 0;
}
.tamu-entry .nm {
  font-family: var(--body);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.tamu-entry .nm .from {
  font-weight: 400;
  font-size: 11px;
  color: var(--ink-mute);
}
.tamu-entry .msg {
  font-family: var(--display);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-top: 4px;
}
.tamu-empty {
  font-family: var(--body);
  font-size: 14px;
  color: var(--ink-mute);
  font-style: italic;
  padding: 20px 0;
}

/* ─────────────────────────────────────────────
   14. FOOTER
   ───────────────────────────────────────────── */
.footer {
  background: var(--green);
  color: var(--cream);
  text-align: center;
  padding: clamp(56px, 8vw, 88px) var(--pad-x);
  position: relative;
}
html.dark .footer {
  background: var(--bg-alt);
}
.footer .ar {
  font-family: var(--arabic);
  font-size: clamp(22px, 4vw, 30px);
  color: var(--cream);
  opacity: 0.9;
  margin-bottom: 20px;
}
.footer .names {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(28px, 5vw, 44px);
  color: var(--cream);
  margin-bottom: 8px;
}
.footer .names .amp {
  font-style: italic;
  color: var(--accent-warm);
}
html.dark .footer .names .amp {
  color: var(--accent);
}
.footer .date {
  font-family: var(--body);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--cream) 75%, transparent);
}
.footer .credit {
  margin-top: 36px;
  font-family: var(--body);
  font-size: 11px;
  color: color-mix(in srgb, var(--cream) 55%, transparent);
  letter-spacing: 0.08em;
}
.footer .credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.footer .credit a:hover { opacity: 1; }

/* scroll-to-top */
.to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-nav);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green);
  color: var(--on-green);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.3s,
    transform 0.3s,
    visibility 0.3s;
}
html.dark .to-top {
  background: var(--accent);
  color: #002016;
}
.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top svg {
  width: 18px;
  height: 18px;
}

/* toast copy */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: var(--z-toast);
  background: var(--green);
  color: var(--on-green);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  padding: 12px 22px;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s,
    transform 0.3s,
    visibility 0.3s;
}
html.dark .toast {
  background: var(--accent);
  color: #002016;
}
.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ─────────────────────────────────────────────
   15. REVEAL ANIMATIONS
   ───────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.reveal.d1 {
  transition-delay: 0.08s;
}
.reveal.d2 {
  transition-delay: 0.16s;
}
.reveal.d3 {
  transition-delay: 0.24s;
}
.reveal.d4 {
  transition-delay: 0.32s;
}

/* ─────────────────────────────────────────────
   16. RESPONSIVE
   ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-links > a {
    display: none;
  }
  .nav-burger {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
  }
  .nav-burger svg {
    width: 22px;
    height: 22px;
  }

  .acara-grid {
    grid-template-columns: 1fr;
  }
  .tamu-layout {
    grid-template-columns: 1fr;
  }
  .galeri-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  /* reset spanning items di tablet */
  .gal-item:nth-last-child(1),
  .gal-item:nth-last-child(8) {
    grid-column: span 1;
    aspect-ratio: 1;
  }
}

@media (max-width: 640px) {
  /* ── Global overflow guard ── */
  .container,
  .form-card,
  .rsvp-choice,
  .hadiah-grid,
  .rek-card {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* kurangi padding form-card agar tidak sempit */
  .form-card {
    padding: 22px 18px;
  }
  .profil-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .profil-center {
    flex-direction: row;
    padding: 28px 0;
    width: 100%;
  }
  .profil-center .ln {
    width: auto;
    height: 1px;
    flex: 1;
    min-height: 0;
  }
  .profil-center .amp {
    padding: 0 18px;
  }
  .profil-card.right {
    text-align: left;
  }
  .profil-card.right .profil-photo {
    margin-left: auto;
    margin-right: auto;
  }
  .profil-card.right .profil-ig {
    flex-direction: row;
  }
  .profil-photo {
    margin-inline: auto;
  }

  .ayat-row,
  .ayat-row.flip {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .ayat-row.flip .ayat-text {
    order: initial;
  }
  .ayat-text .ar {
    direction: rtl;
  }
  .ayat-orn {
    order: -1;
  }
  .ayat-orn svg {
    max-width: 120px;
  }

  .kisah-wrap::before {
    left: 6px;
  }
  .kisah-item {
    width: 100%;
    left: 0 !important;
    text-align: left !important;
    padding: 0 0 44px 32px;
  }
  .kisah-item:nth-child(odd) .dot,
  .kisah-item:nth-child(even) .dot {
    left: 1px;
    right: auto;
  }

  .galeri-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  /* reset semua spanning — 2 kolom cukup flat di HP */
  .gal-item:nth-child(1),
  .gal-item:nth-child(8),
  .gal-item:nth-last-child(1),
  .gal-item:nth-last-child(8) {
    grid-row: span 1;
    grid-column: span 1;
    aspect-ratio: 1;
  }
  /* foto terakhir jadi banner lebar di bagian bawah */
  .gal-item:last-child {
    grid-column: span 2;
    aspect-ratio: 16 / 7;
  }

  .countdown {
    gap: 10px;
  }
  .cd-item {
    min-width: 52px;
  }
  .cd-sep {
    display: none;
  }

  .hero::before,
  .hero::after {
    display: none;
  }
}

/* ─────────────────────────────────────────────
   17. ACCESSIBILITY
   ───────────────────────────────────────────── */
@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;
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
