/* ==========================================================================
   UNDANGAN RAPI — INVITATION ENGINE CORE STYLESHEET
   Design System: Luxury Minimalist, Mobile-First + Dual-Column Desktop
   Animation: CSS Scroll-Driven (@supports) + IntersectionObserver Fallback
   Accessibility: Mode A+ (Elderly Mode), Reduced Motion, Keyboard Friendly
   ========================================================================== */

/* 1. TYPOGRAPHY & CSS VARIABLES */
@import url('https://fonts.googleapis.com/css2?family=Alex+Brush&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --ur-bg: #FDFBF7;
  --ur-surface: #FFFFFF;
  --ur-text: #2D312E;
  --ur-text-muted: #6B726C;
  --ur-accent: #C5A880;
  --ur-accent-light: #F4EFEA;
  --ur-border: #E8E2D9;
  
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-script: 'Alex Brush', cursive;
  --font-display: 'Playfair Display', serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  
  --font-scale: 1;
  --content-max-w: 680px;
  --ease-smooth: cubic-bezier(0.22, 0.61, 0.36, 1);
  --duration-reveal: 700ms;
}

/* Mode A+ (Lansia / Font Besar) */
html.mode-elderly,
body.mode-elderly {
  --font-scale: 1.18;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--ur-bg);
  color: var(--ur-text);
  font-family: var(--font-sans);
  font-size: calc(15px * var(--font-scale));
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Body lock when cover is closed */
body.cover-locked {
  overflow: hidden;
  height: 100vh;
}

/* Reading Progress Bar (Top of Screen) */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ur-accent), #E5D5C2);
  z-index: 999;
  transform-origin: 0 50%;
  transform: scaleX(0);
}

@supports (animation-timeline: scroll()) {
  .reading-progress-bar {
    animation: progress-grow linear both;
    animation-timeline: scroll();
  }
  @keyframes progress-grow {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
  }
}

/* ==========================================================================
   2. SCROLL ANIMATIONS (CSS Scroll-Driven & Fallback)
   ========================================================================== */

/* Base element styles before JS or animation */
.reveal-item {
  will-change: transform, opacity;
}

/* Once JS initializes, add reveal-init so it hides before appearing */
.reveal-init {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-reveal) var(--ease-smooth),
              transform var(--duration-reveal) var(--ease-smooth);
}

/* Luxe Animation Styles (Lembut, Elegan, Dramatis) */
[data-animation-style="lembut"],
.anim-style-lembut {
  --duration-reveal: 950ms;
  --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
}
[data-animation-style="lembut"] .reveal-init,
.anim-style-lembut .reveal-init {
  transform: translateY(12px);
}

[data-animation-style="elegan"],
.anim-style-elegan {
  --duration-reveal: 750ms;
  --ease-smooth: cubic-bezier(0.22, 0.61, 0.36, 1);
}
[data-animation-style="elegan"] .reveal-init,
.anim-style-elegan .reveal-init {
  transform: translateY(22px);
}

[data-animation-style="dramatis"],
.anim-style-dramatis {
  --duration-reveal: 1050ms;
  --ease-smooth: cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-animation-style="dramatis"] .reveal-init,
.anim-style-dramatis .reveal-init {
  transform: translateY(35px) scale(0.97);
}

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

/* Native CSS Scroll-Driven Animations */
@supports (animation-timeline: view()) {
  .css-scroll-driven .reveal-fade-up {
    animation: css-fade-up var(--duration-reveal) var(--ease-smooth) both;
    animation-timeline: view();
    animation-range: entry 10% cover 30%;
  }

  .css-scroll-driven .reveal-fade-in {
    animation: css-fade-in var(--duration-reveal) var(--ease-smooth) both;
    animation-timeline: view();
    animation-range: entry 10% cover 30%;
  }

  .css-scroll-driven .reveal-zoom-in {
    animation: css-zoom-in var(--duration-reveal) var(--ease-smooth) both;
    animation-timeline: view();
    animation-range: entry 10% cover 30%;
  }

  @keyframes css-fade-up {
    from {
      opacity: 0;
      transform: translateY(22px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes css-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes css-zoom-in {
    from {
      opacity: 0;
      transform: scale(0.95);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
}

/* Parallax Component */
.parallax-wrap {
  overflow: hidden;
  position: relative;
}

.parallax-layer {
  will-change: transform;
}

@supports (animation-timeline: scroll()) {
  .css-scroll-driven .parallax-layer {
    animation: css-parallax linear both;
    animation-timeline: scroll();
  }
  @keyframes css-parallax {
    from { transform: translateY(-8%); }
    to { transform: translateY(8%); }
  }
}

/* Reduced Motion Override */
@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;
  }
  .parallax-layer {
    transform: none !important;
  }
  .reveal-init {
    opacity: 1 !important;
    transform: none !important;
  }
}

.mode-reduced-motion .reveal-item {
  transform: none !important;
  transition: opacity 300ms ease !important;
}

.mode-reduced-motion .parallax-layer {
  transform: none !important;
  animation: none !important;
}

/* Subtle Shimmer & Swaying Leaves Keyframes */
@keyframes sway-leaf {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(3deg); }
}

@keyframes gold-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.gold-gradient-text {
  background: linear-gradient(135deg, #A88349 0%, #D4AF37 50%, #A88349 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   3. RESPONSIVE DUAL-COLUMN LAYOUT (DESKTOP) & SINGLE-COLUMN (MOBILE)
   ========================================================================== */

.invitation-root {
  min-height: 100vh;
  position: relative;
}

/* Desktop layout container */
@media (min-width: 1024px) {
  .invitation-container {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
  }

  /* Left Sticky Column: Hero Photography */
  .invitation-sticky-sidebar {
    width: 44%;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    background-color: #1a1a1a;
  }

  .invitation-sticky-sidebar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
  }

  .invitation-sticky-sidebar-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.15) 50%, rgba(0,0,0,0.3) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 3rem;
    color: #ffffff;
    box-sizing: border-box;
  }

  /* Right Scrollable Column: Content */
  .invitation-scroll-content,
  .invitation-content-flow {
    width: 56%;
    max-width: none;
    background-color: var(--ur-bg);
    overflow-y: visible;
  }

  .invitation-content-inner {
    max-width: var(--content-max-w);
    margin: 0 auto;
    padding: 2rem 2.5rem 8rem 2.5rem;
    box-sizing: border-box;
  }
}

/* Mobile & Tablet layout (< 1024px) */
@media (max-width: 1023px) {
  .invitation-container {
    display: block;
    width: 100%;
  }

  .invitation-sticky-sidebar {
    display: none;
  }

  .invitation-scroll-content,
  .invitation-content-flow {
    width: 100%;
  }

  .invitation-content-inner {
    max-width: 540px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 7rem 1.25rem;
    box-sizing: border-box;
  }
}

/* ==========================================================================
   4. COVER / ENVELOPE (SAMPUL TERTUTUP & BUKA UNDANGAN)
   ========================================================================== */

.invitation-cover-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: #1F2220;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1),
              opacity 1s cubic-bezier(0.77, 0, 0.175, 1);
}

.invitation-cover-overlay.is-opened {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* Luxe Opening Animation Variants */
.invitation-cover-overlay.open-anim-curtain.is-opened {
  transform: scale(1.08);
  opacity: 0;
  filter: blur(10px);
  pointer-events: none;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 1s ease, filter 1s ease;
}

.invitation-cover-overlay.open-anim-fade.is-opened {
  transform: scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: transform 1.2s ease, opacity 1.2s ease;
}

.invitation-cover-overlay.open-anim-dramatic.is-opened {
  transform: translateY(-120%) scale(1.04);
  opacity: 0;
  pointer-events: none;
  transition: transform 1.3s cubic-bezier(0.77, 0, 0.175, 1), opacity 1.1s ease;
}

/* Cultural Script Slot (Aksara Nusantara & Chinese Hanzi) */
.cover-script-slot {
  font-family: 'Noto Sans Javanese', 'Noto Sans Sundanese', 'Noto Sans Balinese', 'Noto Sans Batak', 'Noto Serif SC', 'Noto Naskh Arabic', serif;
  font-weight: 500;
}

.cover-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
  filter: brightness(0.85);
}

.cover-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  margin: auto;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.cover-subtitle {
  font-family: var(--font-sans);
  font-size: calc(11px * var(--font-scale));
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #E2DDD5;
  margin-bottom: 0.85rem;
}

.cover-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, calc(2.4rem * var(--font-scale)));
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 1rem 0;
}

.cover-date {
  font-family: var(--font-serif);
  font-size: calc(1.15rem * var(--font-scale));
  letter-spacing: 0.2em;
  color: #E8E2D9;
  margin-bottom: 1.25rem;
}

.cover-guest-box {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1.1rem 1.75rem;
  margin: 0.75rem 0 1.5rem 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.cover-guest-label {
  font-size: calc(11.5px * var(--font-scale));
  color: #C8C2BA;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.cover-guest-name {
  font-family: var(--font-serif);
  font-size: calc(1.5rem * var(--font-scale));
  font-weight: 600;
  color: #FFFFFF;
}

.btn-open-invitation {
  background: #FFFFFF;
  color: #1F2220;
  font-family: var(--font-sans);
  font-size: calc(13px * var(--font-scale));
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.95rem 2rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 100%;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  box-sizing: border-box;
}

.btn-open-invitation:hover {
  background: #F4EFEA;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

.btn-open-invitation:active {
  transform: translateY(0);
}

/* ==========================================================================
   5. FLOATING MUSIC BUTTON & BADGE
   ========================================================================== */

.music-floating-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 998;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 640px) {
  .music-floating-container {
    bottom: 80px; /* Above mobile bottom nav */
    right: 18px;
  }
}

.music-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ur-surface);
  color: var(--ur-text);
  border: 1px solid var(--ur-border);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.music-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 25px rgba(0,0,0,0.16);
}

.music-btn:focus-visible {
  box-shadow: 0 0 0 3px var(--ur-accent);
}

.music-disc-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.music-btn.is-playing .music-disc-icon {
  animation: disc-rotate 5s linear infinite;
}

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

.music-label-badge {
  background: rgba(31, 34, 32, 0.88);
  backdrop-filter: blur(6px);
  color: #FFFFFF;
  font-size: calc(11px * var(--font-scale));
  font-weight: 500;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.music-label-badge.fade-out {
  opacity: 0;
  transform: translateX(8px);
}

/* ==========================================================================
   6. MOBILE BOTTOM NAVIGATION (< 640px)
   ========================================================================== */

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 640px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 62px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--ur-border);
    z-index: 990;
    justify-content: space-around;
    align-items: center;
    padding: 0 6px;
    box-sizing: border-box;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.04);
  }

  .nav-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--ur-text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    transition: color 0.2s ease;
  }

  .nav-action-item svg {
    width: 20px;
    height: 20px;
    margin-bottom: 2px;
  }

  .nav-action-item.active,
  .nav-action-item:hover {
    color: var(--ur-accent);
  }
}

/* Floating Quick Menu / Accessibility Toolbar (Top Right) */
.invitation-toolbar {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 995;
  display: flex;
  gap: 8px;
}

.toolbar-btn {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--ur-border);
  color: var(--ur-text);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: calc(11px * var(--font-scale));
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
}

.toolbar-btn:hover {
  background: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.toolbar-btn.is-active {
  background: var(--ur-accent);
  color: #FFFFFF;
  border-color: var(--ur-accent);
}

/* ==========================================================================
   7. INVITATION SECTIONS & CARDS
   ========================================================================== */

.invitation-section {
  padding: 3.5rem 0;
  text-align: center;
  position: relative;
}

.section-tagline {
  font-family: var(--font-sans);
  font-size: calc(11px * var(--font-scale));
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ur-accent);
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: calc(2rem * var(--font-scale));
  line-height: 1.25;
  color: var(--ur-text);
  margin: 0 0 1.5rem 0;
  font-weight: 500;
}

.section-divider {
  width: 48px;
  height: 1px;
  background-color: var(--ur-accent);
  margin: 1.25rem auto 2.5rem auto;
}

/* Quote Card */
.quote-card {
  font-family: var(--font-serif);
  font-size: calc(1.05rem * var(--font-scale));
  font-style: italic;
  line-height: 1.8;
  color: var(--ur-text-muted);
  max-width: 580px;
  margin: 0 auto;
}

.quote-source {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: calc(12px * var(--font-scale));
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ur-accent);
  margin-top: 1rem;
}

/* Couple Card */
.couple-grid {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-top: 2rem;
}

@media (min-width: 640px) {
  .couple-grid {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
  }
}

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

.couple-photo-wrap {
  width: 170px;
  height: 220px;
  border-radius: 120px 120px 16px 16px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
  border: 4px solid #FFFFFF;
  margin-bottom: 1.25rem;
  background-color: #EFECE6;
}

.couple-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.couple-photo-wrap:hover img {
  transform: scale(1.04);
}

.couple-nickname {
  font-family: var(--font-script);
  font-size: calc(2.4rem * var(--font-scale));
  color: var(--ur-accent);
  line-height: 1.2;
  margin: 0.25rem 0;
}

.couple-fullname {
  font-family: var(--font-serif);
  font-size: calc(1.2rem * var(--font-scale));
  font-weight: 600;
  color: var(--ur-text);
  margin-bottom: 0.4rem;
}

.couple-parents {
  font-size: calc(12.5px * var(--font-scale));
  color: var(--ur-text-muted);
  line-height: 1.6;
  max-width: 240px;
}

.couple-ampersand {
  font-family: var(--font-script);
  font-size: 3rem;
  color: var(--ur-accent);
  align-self: center;
  margin: 1rem 0;
}

/* Event Cards */
.event-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  margin-top: 1.5rem;
}

.event-card {
  background: var(--ur-surface);
  border: 1px solid var(--ur-border);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.03);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.06);
}

.event-card-title {
  font-family: var(--font-serif);
  font-size: calc(1.5rem * var(--font-scale));
  font-weight: 600;
  color: var(--ur-text);
  margin: 0 0 0.8rem 0;
}

.event-card-date {
  font-family: var(--font-serif);
  font-size: calc(1.2rem * var(--font-scale));
  letter-spacing: 0.15em;
  color: var(--ur-accent);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.event-card-time {
  font-size: calc(13px * var(--font-scale));
  color: var(--ur-text-muted);
  margin-bottom: 1rem;
}

.event-card-venue {
  font-size: calc(14px * var(--font-scale));
  font-weight: 600;
  color: var(--ur-text);
  margin-bottom: 0.25rem;
}

.event-card-address {
  font-size: calc(12.5px * var(--font-scale));
  color: var(--ur-text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* Countdown Timer */
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  max-width: 440px;
  margin: 1.5rem auto;
}

.countdown-box {
  background: var(--ur-surface);
  border: 1px solid var(--ur-border);
  border-radius: 12px;
  padding: 1rem 0.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.countdown-num {
  font-family: var(--font-serif);
  font-size: calc(1.8rem * var(--font-scale));
  font-weight: 700;
  color: var(--ur-accent);
  line-height: 1;
  display: block;
  margin-bottom: 0.25rem;
}

.countdown-unit {
  font-size: calc(10px * var(--font-scale));
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ur-text-muted);
}

/* Magazine Gallery */
.magazine-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .magazine-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  cursor: pointer;
  background-color: #EFECE6;
  aspect-ratio: 1;
}

.gallery-item.span-2 {
  grid-column: span 2;
  aspect-ratio: 16/9;
}

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

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

/* Buttons */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 30px;
  font-size: calc(12.5px * var(--font-scale));
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--ur-accent);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: #B3956F;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--ur-text);
  border-color: var(--ur-border);
}

.btn-outline:hover {
  background: #FFFFFF;
  border-color: var(--ur-accent);
  color: var(--ur-accent);
}

/* Toast Message */
.ur-toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(31, 34, 32, 0.92);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.ur-toast.is-active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   8. MOBILE RESPONSIVENESS & FLUID TYPOGRAPHY (< 640px & < 380px)
   ========================================================================== */
@media (max-width: 640px) {
  /* Cover & Open Button: Anti-Tenggelam & 100% Width */
  .invitation-cover-overlay {
    padding: 1.25rem 1rem !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .cover-content {
    width: 100% !important;
    max-width: 420px !important;
    margin: auto !important;
    padding: 0.75rem 0 !important;
    box-sizing: border-box !important;
  }

  .cover-wax-seal {
    width: 58px !important;
    height: 58px !important;
    margin: 0 auto 0.75rem auto !important;
  }

  .cover-subtitle {
    font-size: 10.5px !important;
    letter-spacing: 0.22em !important;
    margin-bottom: 0.35rem !important;
  }

  .cover-script-slot {
    font-size: clamp(1.2rem, 4.2vw, 1.45rem) !important;
    margin-bottom: 0.25rem !important;
  }

  .cover-title {
    font-size: clamp(1.5rem, 5.2vw, 2.1rem) !important;
    line-height: 1.2 !important;
    margin: 0 0 0.4rem 0 !important;
  }

  .cover-date {
    font-size: clamp(0.95rem, 3.4vw, 1.15rem) !important;
    letter-spacing: 0.15em !important;
    margin-bottom: 0.75rem !important;
  }

  .cover-guest-box {
    padding: 0.85rem 1.25rem !important;
    margin: 0.5rem 0 0.85rem 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 12px !important;
  }

  .cover-guest-label {
    font-size: 10.5px !important;
    margin-bottom: 0.25rem !important;
  }

  .cover-guest-name {
    font-size: clamp(1.2rem, 4.5vw, 1.65rem) !important;
    line-height: 1.2 !important;
  }

  /* TOMBOL BUKA UNDANGAN MOBILE: 100% WIDTH, ANTI-TENGGELAM */
  .btn-open-invitation,
  #btnOpenInvitation {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.6rem !important;
    padding: 0.9rem 1.5rem !important;
    font-size: 13.5px !important;
    letter-spacing: 0.1em !important;
    border-radius: 50px !important;
    margin-top: 0.25rem !important;
    box-sizing: border-box !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3) !important;
  }

  /* Root Container & Content Flow */
  .invitation-root,
  .invitation-container,
  .invitation-scroll-content,
  .invitation-content-flow {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  .invitation-content-inner {
    padding: 1.25rem 1rem 6.5rem 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* Sections & Headings */
  .invitation-section {
    padding: 2.5rem 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .section-tagline {
    font-size: 10px !important;
    letter-spacing: 0.2em !important;
    margin-bottom: 0.5rem !important;
  }

  .section-title {
    font-size: clamp(1.4rem, 5vw, 1.85rem) !important;
    line-height: 1.3 !important;
    margin: 0 0 0.85rem 0 !important;
  }

  .section-divider {
    width: 36px !important;
    margin: 0.85rem auto 1.75rem auto !important;
  }

  /* Quote Card */
  .quote-card {
    font-size: clamp(0.95rem, 3.6vw, 1.1rem) !important;
    line-height: 1.75 !important;
    padding: 0 0.25rem !important;
  }

  /* Couple Card */
  .couple-grid {
    gap: 1.75rem !important;
    width: 100% !important;
    margin-top: 1.25rem !important;
  }

  .couple-card {
    width: 100% !important;
    max-width: 100% !important;
  }

  .couple-photo-wrap {
    width: clamp(140px, 42vw, 170px) !important;
    height: clamp(180px, 54vw, 220px) !important;
    border-radius: 90px 90px 14px 14px !important;
    margin-bottom: 1rem !important;
  }

  .couple-nickname {
    font-size: clamp(2rem, 6.5vw, 2.5rem) !important;
  }

  .couple-fullname {
    font-size: clamp(1.1rem, 3.8vw, 1.25rem) !important;
    margin-bottom: 0.3rem !important;
  }

  .couple-parents {
    max-width: 300px !important;
    width: 100% !important;
    font-size: 12px !important;
    line-height: 1.55 !important;
    padding: 0 0.5rem !important;
    box-sizing: border-box !important;
  }

  .couple-ampersand {
    font-size: 2.2rem !important;
    margin: 0.25rem 0 !important;
  }

  /* Events Stack & Event Cards */
  .event-cards-stack {
    gap: 1.25rem !important;
    margin-top: 1.25rem !important;
    width: 100% !important;
  }

  .event-card {
    padding: 1.35rem 1rem !important;
    border-radius: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .event-card-title {
    font-size: clamp(1.2rem, 4.2vw, 1.45rem) !important;
    margin-bottom: 0.45rem !important;
  }

  .event-card-date {
    font-size: clamp(1.05rem, 3.6vw, 1.18rem) !important;
    letter-spacing: 0.1em !important;
    margin-bottom: 0.3rem !important;
  }

  .event-card-time {
    font-size: 12.5px !important;
    margin-bottom: 0.75rem !important;
  }

  .event-card-venue {
    font-size: 13.5px !important;
  }

  .event-card-address {
    font-size: 12px !important;
    margin-bottom: 1rem !important;
    line-height: 1.5 !important;
  }

  .event-card .btn-action {
    flex: 1 1 calc(50% - 0.5rem) !important;
    min-width: 120px !important;
    padding: 0.6rem 0.85rem !important;
    font-size: 12px !important;
    box-sizing: border-box !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* Countdown Grid */
  .countdown-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
    max-width: 100% !important;
    margin: 1.25rem auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .countdown-box {
    padding: 0.65rem 0.2rem !important;
    border-radius: 10px !important;
  }

  .countdown-num {
    font-size: clamp(1.2rem, 4.4vw, 1.55rem) !important;
  }

  .countdown-unit {
    font-size: 8.5px !important;
    letter-spacing: 0.08em !important;
  }

  /* Gallery Grid */
  .magazine-gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-top: 1.25rem !important;
  }

  .gallery-item {
    border-radius: 10px !important;
  }

  /* RSVP Form & Cards */
  #section-rsvp > div,
  #rsvpForm {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Map Container */
  #section-map > div {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Toolbar Top Right */
  .invitation-toolbar {
    top: 12px !important;
    right: 12px !important;
    gap: 6px !important;
  }

  .toolbar-btn {
    padding: 5px 9px !important;
    font-size: 11px !important;
  }

  /* Floating Music Button */
  .music-floating-container {
    bottom: 74px !important;
    right: 14px !important;
  }

  .music-btn {
    width: 44px !important;
    height: 44px !important;
  }

  .music-disc-icon {
    width: 22px !important;
    height: 22px !important;
  }
}

/* Extra Small Phones (< 380px) */
@media (max-width: 380px) {
  .cover-title {
    font-size: 1.5rem !important;
  }

  .cover-guest-name {
    font-size: 1.25rem !important;
  }

  .countdown-box {
    padding: 0.5rem 0.15rem !important;
  }

  .countdown-num {
    font-size: 1.15rem !important;
  }

  .countdown-unit {
    font-size: 8px !important;
  }

  .event-card .btn-action {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
}
