/* style.css */
/* Custom properties for design system tokens */
:root {
  /* Palet warna disesuaikan dengan Baju Adat Merah & Emas */
  --c-gold-dark: #B8860B;       /* Emas tua - warna logam perhiasan adat */
  --c-gold-light: #D4AF37;      /* Emas terang - payet & sulaman baju adat */
  --c-cream-light: #FAF4EB;     /* Krem lembut - latar belakang halaman */
  --c-cream-deep: #F3E9D9;      /* Krem gelap - sekat section */
  --c-moss: #8B1E2B;            /* Merah Maroon Adat - kain beludru utama */
  --c-dark: #2C1E18;            /* Cokelat gelap kayu - teks utama */
  --c-gray: #7F7366;            /* Abu-abu hangat - deskripsi / teks sekunder */

  --ff-display: 'Playfair Display', serif;
  --ff-arabic: 'Amiri', serif;
  --ff-body: 'Plus Jakarta Sans', sans-serif;

  --fs-hero: clamp(2.2rem, 8vw, 4.5rem);
  --fs-h1: clamp(1.6rem, 5vw, 2.5rem);
  --fs-h2: clamp(1.2rem, 3.5vw, 1.7rem);
  --fs-body: clamp(0.95rem, 2.5vw, 1.1rem);
  --fs-caption: clamp(0.75rem, 2vw, 0.85rem);
  --fs-arabic: clamp(1.4rem, 4vw, 2.2rem);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--ff-body);
  color: var(--c-dark);
  background-color: var(--c-cream-light);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  max-width: 500px; /* Mobile-first container limit */
  margin: 0 auto;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
  background-color: var(--c-cream-light);
}

/* Scroll Snap */
.scroll-container {
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
}

.section {
  scroll-snap-align: start;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem 1.5rem;
  text-align: center;
  position: relative;
  background-color: var(--c-cream-light);
}

.section:nth-child(even) {
  background-color: var(--c-cream-deep);
}

/* Typography & Headings */
h1, h2, h3, .couple-name {
  font-family: var(--ff-display);
  font-weight: 700;
  color: var(--c-gold-dark);
}

p {
  line-height: 1.6;
  font-weight: 400;
  color: var(--c-dark);
  margin-bottom: 1rem;
}

/* Reveal Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1.4s cubic-bezier(0.19, 1, 0.22, 1), transform 1.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Ornamental Divider */
.divider {
  width: 150px;
  height: 30px;
  margin: 1rem auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' fill='%23D4AF37'%3E%3Cpath d='M10,10 Q25,0 50,10 Q75,20 90,10 M50,3 L50,17 M40,10 L60,10' stroke='%23D4AF37' stroke-width='0.8' fill='none'/%3E%3Cpolygon points='50,6 54,10 50,14 46,10'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

/* Floating Music Button */
#music-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--c-gold-light);
  background-color: var(--c-moss);
  color: var(--c-cream-light);
  font-size: 1.1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

#music-btn:active {
  transform: scale(0.9);
}

#music-btn.playing {
  animation: rotateMusic 4s linear infinite, pulseMusic 2s ease-in-out infinite;
}

@keyframes rotateMusic {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulseMusic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0.6); }
  50% { box-shadow: 0 0 0 8px rgba(212,175,55,0); }
}

/* Cover / Overlay screen */
#cover-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: var(--c-dark);
  color: var(--c-cream-light);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 4rem 2rem;
  text-align: center;
  transition: transform 1.5s cubic-bezier(0.85, 0, 0.15, 1), opacity 1.5s ease;
  overflow: hidden;
}

#cover-overlay.open {
  transform: translateY(-100dvh);
  opacity: 0;
  pointer-events: none;
}

#cover-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('img/hero-thumb.webp');
  background-position: center;
  background-size: cover;
  filter: blur(15px);
  transform: scale(1.1);
  opacity: 0.4;
  z-index: -2;
}

#cover-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(139, 30, 43, 0.75), rgba(44, 30, 24, 0.9));
  z-index: -1;
}

#cover-overlay.loaded::before {
  background-image: url('img/hero.webp');
  filter: none;
  transform: scale(1);
  opacity: 0.35;
  transition: opacity 1s ease, filter 1s ease;
}

.cover-title {
  font-family: var(--ff-body);
  font-size: var(--fs-caption);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--c-gold-light);
}

.cover-couple {
  margin: 2rem 0;
}

.cover-couple h1 {
  font-size: var(--fs-hero);
  color: var(--c-cream-light);
  line-height: 1.2;
}

.cover-couple span {
  display: block;
  font-family: var(--ff-display);
  font-size: 2rem;
  color: var(--c-gold-light);
  margin: 0.5rem 0;
}

.btn-open {
  font-family: var(--ff-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 0.75rem 1.5rem;
  background-color: var(--c-gold-light);
  color: var(--c-dark);
  border: 1px solid var(--c-gold-light);
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(212,175,55,0.3);
  transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.btn-open:hover, .btn-open:active {
  background-color: transparent;
  color: var(--c-gold-light);
}

.guest-info {
  margin-top: 2rem;
}

.guest-info span {
  font-size: var(--fs-caption);
  color: var(--c-gray);
  display: block;
  margin-bottom: 0.25rem;
}

.guest-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--c-cream-light);
}

/* S2: Ayat */
.ayat-text {
  font-family: var(--ff-arabic);
  font-size: var(--fs-arabic);
  direction: rtl;
  line-height: 2.2;
  color: var(--c-dark);
  margin-bottom: 1.5rem;
  padding: 0 1rem;
}

.ayat-translation {
  font-size: var(--fs-caption);
  font-style: italic;
  color: var(--c-gray);
}

/* S3: Mempelai */
.mempelai-container {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  width: 100%;
  margin-top: 2rem;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.profile-img-wrapper {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px solid var(--c-gold-light);
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.profile-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.25rem;
}

.profile-username {
  font-family: var(--ff-body);
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--c-gold-dark);
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.profile-parents {
  font-size: var(--fs-caption);
  color: var(--c-gray);
}

/* S4: Acara */
.acara-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  margin-top: 1.5rem;
}

.acara-card {
  background: white;
  border-radius: 12px;
  padding: 2rem 1.5rem;
  border: 1px solid var(--c-cream-deep);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.acara-card h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--c-gold-dark);
}

.acara-time {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.btn-action {
  display: inline-block;
  font-family: var(--ff-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  background-color: var(--c-moss);
  color: white;
  border: none;
  border-radius: 20px;
  text-decoration: none;
  cursor: pointer;
  margin-top: 1rem;
  box-shadow: 0 4px 8px rgba(45,80,22,0.2);
  transition: background-color 0.2s;
}

.btn-action:hover, .btn-action:active {
  background-color: var(--c-gold-dark);
}

/* S5: Countdown */
.countdown-container {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  width: 100%;
  max-width: 380px;
}

.countdown-box {
  background-color: var(--c-moss);
  color: var(--c-cream-light);
  padding: 0.8rem 0.25rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.countdown-box .val {
  font-family: var(--ff-display);
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 700;
  line-height: 1.1;
}

.countdown-box .label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.25rem;
  color: var(--c-gold-light);
}

/* S6: Kisah Cinta */
.timeline {
  position: relative;
  width: 100%;
  margin-top: 2rem;
  padding-left: 1.5rem;
  text-align: left;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--c-gold-light);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
}

.timeline-item::before {
  content: '❤';
  position: absolute;
  left: -1.45rem;
  top: 2px;
  width: 16px;
  height: 16px;
  font-size: 0.7rem;
  background-color: var(--c-cream-light);
  color: var(--c-gold-dark);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
}

.timeline-item:nth-child(even)::before {
  background-color: var(--c-cream-deep);
}

.timeline-date {
  font-weight: 700;
  color: var(--c-gold-dark);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.timeline-title {
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

/* S7: Galeri */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  width: 100%;
  margin-top: 1.5rem;
}

.gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 3/4;
  box-shadow: 0 3px 6px rgba(0,0,0,0.1);
  cursor: pointer;
  background-color: var(--c-cream-deep);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Lightbox Overlay */
#lightbox {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#lightbox.active {
  opacity: 1;
  pointer-events: all;
}

#lightbox-img {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
  border-radius: 4px;
}

#lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: transparent;
  color: white;
  border: none;
  font-size: 2rem;
  cursor: pointer;
}

/* S8: Ucapan */
.form-group {
  margin-bottom: 1rem;
  text-align: left;
  width: 100%;
}

.form-group label {
  display: block;
  font-size: var(--fs-caption);
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--c-dark);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--c-cream-deep);
  border-radius: 6px;
  background-color: white;
  font-family: var(--ff-body);
  font-size: 0.9rem;
  color: var(--c-dark);
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--c-gold-light);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.btn-submit {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--c-moss);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(45,80,22,0.2);
  transition: background-color 0.2s;
}

.btn-submit:hover, .btn-submit:active {
  background-color: var(--c-gold-dark);
}

.ucapan-list {
  width: 100%;
  margin-top: 2rem;
  max-height: 250px;
  overflow-y: auto;
  text-align: left;
  padding-right: 0.25rem;
}

/* Scrollbar ucapan */
.ucapan-list::-webkit-scrollbar {
  width: 4px;
}
.ucapan-list::-webkit-scrollbar-track {
  background: var(--c-cream-deep);
}
.ucapan-list::-webkit-scrollbar-thumb {
  background: var(--c-gold-light);
  border-radius: 2px;
}

.ucapan-card {
  background-color: white;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border-left: 3px solid var(--c-gold-light);
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.ucapan-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.ucapan-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--c-gold-dark);
}

.badge-kehadiran {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
}

.badge-kehadiran.hadir {
  background-color: #e2f0d9;
  color: var(--c-moss);
}

.badge-kehadiran.tidak-hadir {
  background-color: #fce4d6;
  color: #c00000;
}

.badge-kehadiran.belum-pasti {
  background-color: #fff2cc;
  color: #7f6000;
}

.ucapan-msg {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--c-dark);
}

.ucapan-time {
  font-size: 0.7rem;
  color: var(--c-gray);
  margin-top: 0.25rem;
}

/* S9: Hadiah */
.kado-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  margin-top: 1.5rem;
}

.kado-card {
  background-color: white;
  border-radius: 10px;
  padding: 1.5rem;
  border: 1px solid var(--c-cream-deep);
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

.kado-logo {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--c-moss);
  margin-bottom: 0.5rem;
}

.kado-number {
  font-family: var(--ff-body);
  font-size: 1.1rem;
  letter-spacing: 1px;
  font-weight: 600;
  margin: 0.5rem 0;
  color: var(--c-dark);
}

.kado-holder {
  font-size: var(--fs-caption);
  color: var(--c-gray);
  margin-bottom: 1rem;
}

.btn-copy {
  font-family: var(--ff-body);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  background-color: var(--c-cream-deep);
  color: var(--c-dark);
  border: 1px solid var(--c-gold-light);
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-copy:active {
  transform: scale(0.95);
}

.btn-copy.copied {
  background-color: var(--c-moss);
  color: white;
  border-color: var(--c-moss);
}

/* S10: Penutup */
.penutup-text {
  margin-bottom: 2rem;
}

.penutup-couple {
  font-family: var(--ff-display);
  font-size: 2.2rem;
  color: var(--c-gold-dark);
  margin-bottom: 2rem;
}
