/* Wedding invitation - one-page scroll (CSS + HTML only) */

:root {
  --bg0: #ebe6dc;
  --cream: #faf9f5;
  --ink: #2f352e;
  --ink-soft: #3b433a;
  --card-shadow: 0 18px 48px rgba(20, 18, 14, 0.14);
  --card-shadow-2: 0 2px 6px rgba(20, 18, 14, 0.06);
  --radius: 1px;
  --max: 980px;

  --sans: "Cormorant Garamond", "Times New Roman", serif;
  --serif: "Playfair Display", "Ti s New Roman", serif;
  --script: "Great Vibes", cursive;
}

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

html {
  scroll-behavior: smooth;
  height: 100%;
  min-height: 100%;
  min-height: -webkit-fill-available;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Anchor jumps: ruang untuk bar navigasi bawah + safe area (iPhone) */
  scroll-padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--bg0);
  position: relative;
  min-height: 100%;
  min-height: -webkit-fill-available;
  -webkit-tap-highlight-color: transparent;
}

/* Lapisan lantai: warna sahaja (jalur imej di .site-bg-header, skrol ke atas) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg0);
  pointer-events: none;
}

/*
 * Jalur imej di atas: melekat di atas semasa tatal (sticky), ~30% tinggi viewport,
 * imej penuh (tiada potong), nisbah kekal, ulang mengufuk.
 */
.site-bg-header {
  position: -webkit-sticky;
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  /* Di atas kandungan utama supaya seksyen menatal di belakang jalur imej */
  z-index: 35;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  height: min(max(96px, 30vh), 420px);
  height: min(max(96px, 30dvh), 420px);
  min-height: 0;
  background-color: transparent;
  background-image: url("../assets/21_agustus_6.png");
  background-repeat: repeat-x;
  background-size: auto 100%;
  background-position: left top;
  pointer-events: none;
}

@media (max-width: 768px) {
  /* iOS Safari: ≥16px elakkan zoom automatik semasa fokus medan */
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

/* —— Muka hadapan (cover): tutup seluruh laman sehingga pengguna ketik —— */
body.intro-envelope-active {
  overflow: hidden;
  touch-action: none;
}

.intro-envelope {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.intro-envelope:focus {
  outline: none;
}

.intro-envelope:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(47, 53, 46, 0.4);
}

.intro-envelope--exiting {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-envelope__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 92% 75% at 50% 38%, #efeade 0%, #e0d5c8 50%, #c9bba8 100%);
}

.intro-envelope__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 100%;
}

.intro-envelope__scene {
  margin: 0 auto;
  perspective: 920px;
  transform-style: preserve-3d;
}

/* Belakang sampul tertutup: empat penutup segi tiga bertemu di tengah (~3:2) */
.intro-envelope__envelope {
  position: relative;
  width: min(88vw, 300px);
  max-width: 100%;
  aspect-ratio: 3 / 2;
  margin: 0 auto;
  transform-style: preserve-3d;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 16px 42px rgba(20, 18, 14, 0.22);
}

.intro-envelope__paper {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #c4b5a0 0%, #b0a08c 100%);
  z-index: 0;
  border-radius: 3px;
}

.intro-envelope__letter {
  position: absolute;
  left: 11%;
  right: 11%;
  top: 18%;
  bottom: 28%;
  background: var(--cream);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  box-shadow: 0 4px 22px rgba(20, 18, 14, 0.14);
  border: 1px solid rgba(40, 44, 36, 0.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.intro-envelope--opened .intro-envelope__letter {
  visibility: visible;
  /* Lapisan surat dinaikkan selepas penutup atas selesai (≈1.06s) supaya kekal di atas sampul */
  animation: intro-letter-reveal 0.75s cubic-bezier(0.33, 1.08, 0.65, 1) 0.82s forwards,
    intro-letter-stack 0.001s linear 1.15s forwards;
}

@keyframes intro-letter-reveal {
  0% {
    opacity: 0;
    transform: translate3d(0, 44%, 0) scale(0.92);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, -6%, 0) scale(1);
  }
}

@keyframes intro-letter-stack {
  to {
    z-index: 15;
  }
}

.intro-envelope__names {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 5.5vw, 1.9rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.15;
}

.intro-envelope__sub {
  font-family: var(--serif);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Penutup bawah: segi tiga menunjuk ke atas, tapak = tepi bawah */
.intro-envelope__flap--bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 54%;
  z-index: 2;
  background: linear-gradient(0deg, #9d8c78 0%, #a89482 45%, #b09a86 100%);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.08);
}

/* Penutup kiri & kanan: bertemu di garis pusat mendatar */
.intro-envelope__flap--left {
  position: absolute;
  left: 0;
  top: 0;
  width: 52%;
  height: 100%;
  z-index: 3;
  background: linear-gradient(90deg, #b5a590 0%, #a89682 100%);
  clip-path: polygon(0 0, 0 100%, 100% 50%);
  box-shadow: inset -2px 0 3px rgba(0, 0, 0, 0.06);
}

.intro-envelope__flap--right {
  position: absolute;
  right: 0;
  top: 0;
  width: 52%;
  height: 100%;
  z-index: 3;
  background: linear-gradient(270deg, #b5a590 0%, #a89682 100%);
  clip-path: polygon(100% 0, 100% 100%, 0 50%);
  box-shadow: inset 2px 0 3px rgba(0, 0, 0, 0.06);
}

/* Penutup atas: segi tiga besar ke bawah, hujung lebar sedikit (ikut rupa “rounded tip”) */
.intro-envelope__flap--top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 62%;
  z-index: 5;
  background: linear-gradient(180deg, #e2d8ca 0%, #d0c2b0 40%, #c0b09e 100%);
  clip-path: polygon(0 0, 100% 0, 70% 76%, 50% 92%, 30% 76%);
  transform-origin: 50% 0;
  box-shadow: 0 10px 22px rgba(20, 18, 14, 0.15), inset 0 -1px 0 rgba(255, 255, 255, 0.2);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.intro-envelope--opened .intro-envelope__flap--top {
  animation: intro-flap-open 1.06s cubic-bezier(0.42, 0.02, 0.2, 1) forwards;
}

@-webkit-keyframes intro-flap-open {
  from {
    -webkit-transform: rotateX(0deg);
    transform: rotateX(0deg);
  }
  to {
    -webkit-transform: rotateX(172deg);
    transform: rotateX(172deg);
  }
}

@keyframes intro-flap-open {
  from {
    transform: rotateX(0deg);
  }
  to {
    transform: rotateX(172deg);
  }
}

.intro-envelope__hint {
  margin: 20px 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: rgba(59, 67, 58, 0.78);
  text-transform: uppercase;
  transition: opacity 0.35s ease;
}

.intro-envelope--opened .intro-envelope__hint {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .intro-envelope {
    transition: opacity 0.28s ease, visibility 0.28s ease;
  }

  .intro-envelope--opened .intro-envelope__flap--top {
    animation: none;
    transform: rotateX(172deg);
  }

  .intro-envelope--opened .intro-envelope__letter {
    animation: none;
    opacity: 1;
    visibility: visible;
    z-index: 15;
    transform: translate3d(0, -6%, 0) scale(1);
  }
}

/* Kesan kelopak: tsParticles (canvas) — lihat js/particles-petals.js */
.tsparticles-petals {
  position: fixed;
  inset: 0;
  /* Di atas seksyen & jalur imej (25), di bawah navigasi bawah (50) — pointer-events: none kekal */
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

.tsparticles-petals canvas {
  display: block;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 12px;
  padding: 10px 14px;
  background: var(--cream);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  z-index: 9999;
}
.skip-link:focus {
  left: 12px;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding-top: 8px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  background: rgba(250, 249, 245, 0.92);
  border-top: 1px solid rgba(50, 55, 45, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.bottom-nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: center;
  align-items: center;
}

.bottom-nav__inner a {
  font-family: var(--serif);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 8px 12px;
  border-radius: 999px;
  transition: background 160ms ease;
}

.bottom-nav__inner a:hover,
.bottom-nav__inner a:focus-visible {
  background: rgba(47, 53, 46, 0.06);
  outline: none;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  position: relative;
  /* Di bawah jalur imej (35) supaya seksyen menatal di belakangnya */
  z-index: 20;
  /* Tiada margin negatif — seksyen home bermula di bawah jalur imej */
  margin-top: 0;
}

.panel {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  padding-top: 28px;
  padding-bottom: calc(42px + 58px + env(safe-area-inset-bottom, 0px));
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  scroll-snap-align: start;
  opacity: 0.14;
  transition: opacity 0.55s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Galeri / hadiah / RSVP / buku tetamu: kandungan lebih pendek — jangan paksa 100vh supaya jarak antara seksyen tidak besar */
#gallery.panel,
#gifts.panel,
#rsvp.panel,
#guestbook.panel,
#guestbook-write.panel,
#guestbook-outro.panel {
  min-height: unset;
}

/* Seksyen pertama: mula selepas jalur imej — sedikit jarak dari tepi bawah imej */
main.app > .panel:first-of-type {
  padding-top: max(20px, env(safe-area-inset-top, 0px));
}

/* In-view section: full opacity immediately (no slow fade-in while reading) */
.panel.scroll-section--active {
  opacity: 1;
  transition: none;
}

/* "One page scroll" feel */
main.app {
  scroll-snap-type: y proximity;
}

.panel--hero {
  display: grid;
  align-items: start;
  justify-items: center;
  align-content: start;
  position: relative;
}

.hero-wrap {
  width: min(100%, 560px);
}

.card {
  width: 100%;
  background-color: transparent;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  border: 1px solid rgba(40, 44, 36, 0.08);
  transition: background-color 0.55s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.panel.scroll-section--active .card {
  background-color: var(--cream);
  transition: none;
}

.card--inv {
  display: flex;
  flex-direction: column;
  min-height: min(88vh, 640px);
}

.card__content {
  flex: 1 1 auto;
  padding: 18px 28px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Jarak menegak konsisten antara setiap blok di kad jemputan (home) */
.card--inv .card__content {
  gap: clamp(16px, 3.2vw, 24px);
}

.card--inv .script.script--hero {
  margin-bottom: 0;
  padding-bottom: 0;
  font-size: clamp(0.72rem, 1.55vw, 0.92rem);
  letter-spacing: 0.01em;
  line-height: 1.35;
  white-space: normal;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.card--inv .hero-photo {
  margin: 0;
}

.card--inv .names {
  margin: 18px 0 22px;
  padding: 14px 0 10px;
  font-size: clamp(0.98rem, 2.6vw, 1.36rem);
  letter-spacing: 0.11em;
  line-height: 1.32;
  max-width: 100%;
}

.card--inv .names span {
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}

.card--inv .date {
  margin: 0;
  font-weight: 400;
  font-size: clamp(0.68rem, 1.45vw, 0.82rem);
  letter-spacing: 0.03em;
  line-height: 1.6;
  text-transform: none;
  overflow-wrap: anywhere;
}

.card--inv .venue {
  margin: 0;
}

.card--inv .inv-home-details {
  margin: 0 auto clamp(14px, 3.2vw, 26px);
  padding: 0;
  max-width: min(100%, 26em);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.65rem, 2vw, 0.95rem);
}

.card--inv .inv-home-details__item {
  margin: 0;
  width: 100%;
  text-align: center;
}

.card--inv .inv-home-details__label {
  margin: 0 0 0.22em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(0.62rem, 1.45vw, 0.76rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.35;
  color: rgba(47, 53, 46, 0.52);
}

.card--inv .inv-home-details__value {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(0.72rem, 1.75vw, 0.88rem);
  letter-spacing: 0.04em;
  line-height: 1.45;
  text-wrap: balance;
  color: var(--ink-soft);
}

.card--inv .script.script--footer {
  margin-top: auto;
  padding-top: clamp(12px, 2.5vw, 20px);
  font-size: clamp(0.82rem, 1.85vw, 0.98rem);
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.card--inv .inv-hashtag {
  margin-top: 0;
}

.lead {
  margin: 8px 0 16px;
  font-size: clamp(0.72rem, 2.2vw, 0.88rem);
  letter-spacing: 0.22em;
  text-transform: lowercase;
  line-height: 1.75;
  color: var(--ink-soft);
}

.script {
  margin: 0 0 14px;
  font-family: var(--script);
  font-size: clamp(1.85rem, 5.5vw, 2.65rem);
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.12;
}

.script--hero {
  font-family: var(--sans);
  font-size: clamp(0.9rem, 2.1vw, 1.08rem);
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.02em;
  line-height: 1.25;
  white-space: nowrap;
  margin-bottom: 0;
  padding-bottom: 16px;
}

.script--footer {
  margin-top: auto;
  padding-top: 16px;
}

.inv-hashtag {
  display: block;
  margin-top: 10px;
  font-family: var(--serif);
  font-size: clamp(0.72rem, 2.2vw, 0.82rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
}

.names {
  margin: 0 0 16px;
  padding: 16px 0 0;
  border: 0;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15em;
}

.names span {
  display: block;
  white-space: nowrap;
}

.date {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(0.84rem, 2.4vw, 0.98rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.45;
}

.venue {
  margin: 0;
  font-size: clamp(0.78rem, 2.3vw, 0.92rem);
  letter-spacing: 0.06em;
  line-height: 1.65;
  font-style: normal;
  color: var(--ink-soft);
}

.hero-photo {
  margin: 16px 0 0;
  width: min(100%, 360px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  padding: 8px;
  background-color: rgba(250, 249, 245, 0.92);
  border: 1px solid rgba(40, 44, 36, 0.22);
  box-shadow:
    inset 0 0 0 1px rgba(40, 44, 36, 0.08),
    0 8px 22px rgba(20, 18, 14, 0.1);
  flex-shrink: 0;
  align-self: center;
}

.hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left center;
  border-radius: 50%;
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.95rem;
  color: rgba(47, 53, 46, 0.7);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.scroll-hint__line {
  width: 46px;
  height: 1px;
  background: rgba(47, 53, 46, 0.35);
}

/* Content sections */
.content-card {
  max-width: 760px;
  margin: 0 auto;
  background-color: transparent;
  border: 1px solid rgba(40, 44, 36, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow-2);
  padding: 34px 22px;
  transition: background-color 0.55s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.panel.scroll-section--active .content-card {
  background-color: var(--cream);
  transition: none;
}

.content-card__header {
  text-align: center;
  margin-bottom: 18px;
}

.kicker {
  margin: 0 0 10px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
}

h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  letter-spacing: 0.06em;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.info {
  grid-column: span 6;
  padding: 18px 16px;
  border-radius: 1px;
  border: 1px solid rgba(40, 44, 36, 0.08);
  background-color: transparent;
  transition: background-color 0.55s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.panel.scroll-section--active .info {
  background-color: #fff;
  transition: none;
}

.info--wide {
  grid-column: span 12;
  text-align: center;
}

.info h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.98rem;
}

.info__value {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.info__meta {
  margin: 8px 0 0;
  color: var(--ink-soft);
  line-height: 1.6;
  letter-spacing: 0.04em;
}

.info-grid--details {
  gap: 16px 14px;
}

.info__meta--address {
  max-width: 42ch;
  margin-left: auto;
  margin-right: auto;
}

.info__meta--center {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  max-width: 36ch;
}

.info__actions {
  margin: 14px 0 0;
}

.info__link {
  display: inline-block;
  font-family: var(--serif);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(47, 53, 46, 0.35);
  padding-bottom: 2px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.info__link:hover,
.info__link:focus-visible {
  color: var(--ink-soft);
  border-bottom-color: rgba(59, 67, 58, 0.45);
}

.info--contact .info__meta:first-of-type {
  margin-top: 0;
}

.info--contact {
  text-align: center;
}

.contact-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.contact-list a {
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(47, 53, 46, 0.2);
  transition: border-color 0.2s ease;
}

.contact-list a:hover,
.contact-list a:focus-visible {
  border-bottom-color: rgba(47, 53, 46, 0.45);
}

.contact-list__name {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.info-grid--details > .schedule {
  grid-column: span 12;
  margin-top: 0;
}

.schedule {
  margin-top: 20px;
  padding: 20px 18px;
  border-radius: 1px;
  border: 1px solid rgba(40, 44, 36, 0.08);
  background-color: transparent;
  text-align: center;
  transition: background-color 0.55s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.panel.scroll-section--active .schedule {
  background-color: #fff;
  transition: none;
}

.schedule__heading {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.schedule__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.schedule__item {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.25em 1em;
  max-width: 28rem;
}

.schedule__time {
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.schedule__label {
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.fineprint {
  margin: 20px 0 0;
  text-align: center;
  color: rgba(59, 67, 58, 0.85);
  letter-spacing: 0.03em;
}

.story-visual {
  margin-top: 8px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(40, 44, 36, 0.08);
  box-shadow: var(--card-shadow-2);
}

.story-visual img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.gallery-item {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(40, 44, 36, 0.08);
  box-shadow: var(--card-shadow-2);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 249, 245, 0.85);
  min-height: 0;
}

.gallery-item img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(88vh, 920px);
  object-fit: contain;
  margin: 0 auto;
}

.gift-lead {
  margin: 0 auto 18px;
  max-width: 640px;
  text-align: center;
  color: var(--ink-soft);
  line-height: 1.65;
  letter-spacing: 0.04em;
}

.gift-reveal {
  margin: 8px auto 0;
  max-width: 440px;
  border: 1px solid rgba(40, 44, 36, 0.1);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.35);
}

.gift-reveal__summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  text-align: center;
  font-family: var(--serif);
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  user-select: none;
  transition: background 0.2s ease;
}

.gift-reveal__summary::-webkit-details-marker {
  display: none;
}

.gift-reveal__summary::marker {
  content: "";
}

.gift-reveal__summary:hover,
.gift-reveal__summary:focus-visible {
  background: rgba(47, 53, 46, 0.05);
  outline: none;
}

.gift-reveal__media {
  padding: 0 12px 16px;
}

.gift-reveal__media img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 1px;
  border: 1px solid rgba(40, 44, 36, 0.08);
}

.content-card--rsvp {
  max-width: 820px;
}

.rsvp-form {
  margin: 18px auto 0;
  max-width: 620px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.field {
  grid-column: span 6;
  display: grid;
  gap: 8px;
  padding: 0;
}

.field--full {
  grid-column: span 12;
}

.field span {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid rgba(40, 44, 36, 0.18);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 1px;
  font-family: var(--sans);
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 110px;
}

.btn {
  margin-top: 16px;
  width: 100%;
  min-height: 44px;
  padding: 13px 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(47, 53, 46, 0.92);
  color: #fff;
  font-family: var(--serif);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.88rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}

.btn:hover {
  background: rgba(47, 53, 46, 1);
}

.field__error {
  display: block;
  min-height: 1.25em;
  font-size: 0.82rem;
  color: #7a2424;
  letter-spacing: 0.02em;
}

.field--invalid input,
.field--invalid select,
.field--invalid textarea {
  border-color: rgba(122, 36, 36, 0.45);
  box-shadow: 0 0 0 1px rgba(122, 36, 36, 0.12);
}

.rsvp-form__summary {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(122, 36, 36, 0.08);
  border: 1px solid rgba(122, 36, 36, 0.2);
  color: #5c1c1c;
  font-size: 0.92rem;
  line-height: 1.5;
}

.rsvp-form__summary:empty {
  display: none;
}

.rsvp-form__summary--success {
  background: rgba(47, 53, 46, 0.08);
  border-color: rgba(47, 53, 46, 0.22);
  color: var(--ink);
}

.guestbook-entries {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(40, 44, 36, 0.12);
}

/* Senarai ucapan terus di bawah tajuk seksyen (bukan selepas borang) */
.guestbook-entries--lead {
  margin-top: 18px;
  padding-top: 0;
  border-top: none;
}

.guestbook-entries__empty {
  margin: 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.55;
  letter-spacing: 0.03em;
}

.guestbook-entries__empty[hidden] {
  display: none;
}

.guestbook-carousel[hidden] {
  display: none !important;
}

.guestbook-carousel__viewport {
  overflow: hidden;
  width: 100%;
  border-radius: 1px;
  border: 1px solid rgba(40, 44, 36, 0.1);
  background: rgba(255, 255, 255, 0.45);
}

.guestbook-carousel__track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  transition: transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

.guestbook-carousel__slide {
  flex: 0 0 auto;
  box-sizing: border-box;
  margin: 0;
  padding: 18px 20px;
  border-right: 1px solid rgba(40, 44, 36, 0.06);
}

.guestbook-carousel__slide:last-child {
  border-right: 0;
}

.guestbook-carousel__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.guestbook-carousel__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(40, 44, 36, 0.14);
  background: rgba(250, 249, 245, 0.95);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.guestbook-carousel__arrow:hover,
.guestbook-carousel__arrow:focus-visible {
  background: rgba(255, 255, 255, 1);
  outline: none;
}

.guestbook-carousel__arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.guestbook-carousel__counter {
  margin: 0;
  min-width: 4.5em;
  text-align: center;
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

@media (prefers-reduced-motion: reduce) {
  .guestbook-carousel__track {
    transition: none !important;
  }
}

.guestbook-entries__item {
  margin: 0;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
}

.guestbook-entries__name {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}

.guestbook-entries__message {
  margin: 0 0 10px;
  white-space: pre-wrap;
  line-height: 1.55;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.guestbook-entries__time {
  display: block;
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: rgba(59, 67, 58, 0.75);
}

.btn--ghost {
  margin-top: 0;
  min-height: 44px;
  background: transparent;
  color: rgba(47, 53, 46, 0.92);
  border: 1px solid rgba(47, 53, 46, 0.35);
  touch-action: manipulation;
}

.btn--ghost:hover {
  background: rgba(47, 53, 46, 0.06);
}

.app-notice {
  position: fixed;
  z-index: 60;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(
    420px,
    calc(100vw - 32px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))
  );
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  margin: 0 16px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  font-family: var(--sans);
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: center;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(40, 44, 36, 0.18);
}

.app-notice--error {
  z-index: 10060;
  background: #fff8f8;
  border: 1px solid rgba(122, 36, 36, 0.28);
  color: #4a1818;
}

.form-note {
  margin: 12px 0 0;
  color: rgba(59, 67, 58, 0.9);
  font-size: 0.95rem;
  text-align: center;
  line-height: 1.6;
}

.form-note code {
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(40, 44, 36, 0.14);
  background: rgba(255, 255, 255, 0.4);
}

.footer {
  position: relative;
  z-index: 2;
  padding: 24px 18px calc(32px + 58px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  text-align: center;
  color: rgba(47, 53, 46, 0.7);
  letter-spacing: clamp(0.01em, 0.15vw, 0.04em);
  font-size: clamp(0.52rem, 2.05vw, 0.95rem);
  opacity: 1;
  transition: none;
}

.footer::-webkit-scrollbar {
  display: none;
}

.footer.scroll-section--active {
  opacity: 1;
  transition: none;
}

/* Penutup buku tetamu: sentiasa jelas (scroll-fade mudah tertumpu pada borang panjang). */
#guestbook-outro.panel {
  opacity: 1;
  transition: none;
}

#guestbook-outro.panel .content-card--guestbook-outro {
  position: relative;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  padding: clamp(28px, 6vw, 44px) clamp(22px, 5vw, 36px);
  background-color: var(--cream);
  background-image: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.5) 0%,
    transparent 42%,
    rgba(47, 53, 46, 0.03) 100%
  );
  border: 1px solid rgba(47, 53, 46, 0.16);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.65),
    inset 0 0 0 7px rgba(250, 249, 245, 1),
    inset 0 0 0 8px rgba(47, 53, 46, 0.09),
    var(--card-shadow-2);
  transition: none;
  overflow: visible;
}

#guestbook-outro.panel .content-card--guestbook-outro::after {
  content: "";
  position: absolute;
  inset: 15px;
  z-index: 0;
  border: 1px solid rgba(47, 53, 46, 0.07);
  pointer-events: none;
}

.guestbook-outro-corner {
  position: absolute;
  z-index: 2;
  width: 22px;
  height: 22px;
  pointer-events: none;
  border-color: rgba(47, 53, 46, 0.38);
  border-style: solid;
}

.guestbook-outro-corner--tl {
  top: 7px;
  left: 7px;
  border-width: 2px 0 0 2px;
}

.guestbook-outro-corner--tr {
  top: 7px;
  right: 7px;
  border-width: 2px 2px 0 0;
}

.guestbook-outro-corner--bl {
  bottom: 7px;
  left: 7px;
  border-width: 0 0 2px 2px;
}

.guestbook-outro-corner--br {
  bottom: 7px;
  right: 7px;
  border-width: 0 2px 2px 0;
}

.guestbook-outro-kicker {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(0.72rem, 2.4vw, 0.88rem);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(47, 53, 46, 0.55);
}

.guestbook-outro-rule {
  position: relative;
  z-index: 1;
  width: min(200px, 55vw);
  height: 1px;
  margin: 0 auto 18px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(47, 53, 46, 0.22) 20%,
    rgba(47, 53, 46, 0.22) 80%,
    transparent
  );
}

.guestbook-outro-rule--bottom {
  margin: 20px auto 0;
}

.guestbook-outro-lead {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  font-family: var(--serif);
  font-size: clamp(0.95rem, 3.1vw, 1.08rem);
  line-height: 1.75;
  letter-spacing: 0.03em;
  color: rgba(47, 53, 46, 0.88);
}

.footer p {
  margin: 0;
  flex: 0 0 auto;
}

.footer-hashtag {
  display: inline;
  margin: 0;
  flex: 0 0 auto;
  font-family: var(--serif);
  font-size: 1em;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: rgba(47, 53, 46, 0.55);
  white-space: nowrap;
}

.footer-hashtag::before {
  content: "·";
  margin-right: 0.35em;
  font-weight: 400;
  color: rgba(47, 53, 46, 0.45);
}

.audio-float {
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: calc(20px + 58px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
}

.audio-float__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(40, 44, 36, 0.14);
  background: rgba(250, 249, 245, 0.92);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--card-shadow-2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}

.audio-float__btn:hover {
  background: rgba(255, 255, 255, 0.95);
}

.audio-float__btn[aria-pressed="true"] {
  background: rgba(47, 53, 46, 0.92);
  color: #fff;
  border-color: transparent;
}

.audio-float__icon {
  font-size: 1rem;
  opacity: 0.9;
}

.audio-float__label {
  line-height: 1;
}

/* Motion accessibility */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tsparticles-petals {
    display: none !important;
  }

  .panel,
  .footer {
    opacity: 1 !important;
    transition: none;
  }

  .panel .card,
  .panel .content-card {
    background-color: var(--cream);
    transition: none;
  }

  .panel .info {
    background-color: #fff;
    transition: none;
  }

  .panel .schedule {
    background-color: #fff;
    transition: none;
  }
}

@media (max-width: 720px) {
  body {
    overflow-x: hidden;
  }

  .site-bg-header {
    height: min(max(64px, 18vh), 220px);
    height: min(max(64px, 18dvh), 220px);
  }

  .card--inv .card__content {
    gap: clamp(10px, 2.8vw, 16px);
    padding: 16px 16px 20px;
  }

  .card--inv .script--hero {
    font-size: clamp(0.72rem, 3.15vw, 0.9rem);
    letter-spacing: 0.01em;
    line-height: 1.25;
    padding-bottom: 8px;
  }

  .card--inv .names {
    padding-top: 16px;
    padding-bottom: 10px;
    margin-top: 14px;
    margin-bottom: 18px;
    font-size: clamp(0.96rem, 4.1vw, 1.22rem);
    letter-spacing: 0.11em;
    line-height: 1.3;
    gap: 0.22em;
  }

  .card--inv .names span {
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }

  .card--inv .date {
    margin-bottom: 8px;
    font-weight: 400;
    font-size: clamp(0.68rem, 3vw, 0.82rem);
    letter-spacing: 0.03em;
    line-height: 1.6;
    text-transform: none;
    overflow-wrap: anywhere;
  }

  .card--inv .script--footer {
    font-size: clamp(0.76rem, 3.25vw, 0.92rem);
    letter-spacing: 0.025em;
    line-height: 1.5;
    padding-top: 10px;
  }

  .panel {
    padding-top: 22px;
  }

  .info {
    grid-column: span 12;
  }

  .field {
    grid-column: span 12;
  }

  /* Bar navigasi satu baris sahaja pada mudah alih */
  .bottom-nav__inner {
    flex-wrap: nowrap;
    justify-content: stretch;
    gap: 0;
    max-width: none;
    width: 100%;
    padding-inline: 4px;
  }

  .bottom-nav__inner a {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.55rem, 2.35vw, 0.72rem);
    letter-spacing: 0.02em;
    padding: 9px 3px;
    text-align: center;
    white-space: nowrap;
    touch-action: manipulation;
  }

  .content-card,
  .card__content {
    max-width: 100%;
  }

  .gift-reveal__summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
  }
}

/* iOS Safari: isyarat sentuhan untuk slaid buku tetamu */
@supports (-webkit-touch-callout: none) {
  .guestbook-carousel__viewport {
    cursor: grab;
  }

  .guestbook-carousel__viewport:active {
    cursor: grabbing;
  }
}

