/* =========================================================================
   Desa Marga Mulya — Modern Studio & Interactive Experience Stylesheet
   Base: Pristine White & Deep Forest Green (#092617, #0F3822, #175435)
   High-contrast, zero white-on-white text issues, cinematic scroll motion
   ========================================================================= */

:root {
  --bg-white:      #FFFFFF;
  --bg-surface:    #F9FAF9;
  --bg-soft:       #F3F5F3;
  --forest-deep:   #092617;
  --forest-dark:   #0F3822;
  --forest-main:   #175435;
  --forest-light:  #246E47;
  --forest-accent: #2FA368;
  --sand-gold:     #C9A25D;

  --text-dark:     #0F1914;
  --text-body:     #374151;
  --text-muted:    #6B7280;
  --border-light:  #E5E7EB;
  --border-subtle: rgba(15, 56, 34, 0.08);

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth:   cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--bg-white);
  color: var(--text-dark);
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-white);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-x: clip;
  padding-top: 5rem; /* Space for fixed navbar on sub-pages */
}

body.hal-beranda {
  padding-top: 0 !important; /* Fullscreen hero on homepage */
}

/* Base Headings Color Override to Prevent Any Invisible White Text */
h1, h2, h3, h4, h5, h6 {
  color: var(--forest-deep);
}

#hero-content h1, #hero-content h2, #hero-content p {
  color: #FFFFFF !important;
}
#hero-content .btn-hero-white, #hero-content .btn-hero-white * {
  color: #0F1914 !important;
}

/* Global White-on-White Text Contrast Cure Across All Pages */
.hal-informasi .text-white:not(button):not(.badge-pill *):not([class*="bg-forest-9"] *):not(.bingkai *),
.hal-profil .text-white:not(button):not([class*="bg-forest-9"] *):not(.bingkai *),
.hal-layanan .text-white:not(button):not([class*="bg-forest-9"] *):not(.bingkai *),
.hal-potensi .text-white:not(button):not([class*="bg-forest-9"] *):not(.bingkai *),
.hal-galeri .text-white:not(button):not([class*="bg-forest-9"] *):not(.bingkai *),
.hal-kabar .text-white:not(button):not([class*="bg-forest-9"] *):not(.bingkai *),
.hal-kontak .text-white:not(button):not([class*="bg-forest-9"] *):not(.bingkai *) {
  color: #0F1914 !important;
}

.hal-informasi .text-gray-300,
.hal-profil .text-gray-300,
.hal-layanan .text-gray-300,
.hal-potensi .text-gray-300,
.hal-galeri .text-gray-300,
.hal-kabar .text-gray-300,
.hal-kontak .text-gray-300 {
  color: #374151 !important;
}

.hal-informasi .text-gray-400,
.hal-profil .text-gray-400,
.hal-layanan .text-gray-400,
.hal-potensi .text-gray-400,
.hal-galeri .text-gray-400,
.hal-kabar .text-gray-400,
.hal-kontak .text-gray-400 {
  color: #4B5563 !important;
}

/* Borders and Backgrounds on Light Mode */
.border-white\/10 {
  border-color: #E5E7EB !important;
}
.border-white\/15, .border-white\/20 {
  border-color: #D1D5DB !important;
}
.bg-white\/\[0\.02\], .bg-white\/\[0\.03\], .bg-white\/5 {
  background-color: #F9FAF9 !important;
  border: 1px solid #E5E7EB !important;
}
.bg-white\/10:not(.bingkai *) {
  background-color: #F3F4F6 !important;
}
.bingkai__tutup {
  background-color: rgba(20, 48, 31, 0.85) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
}

/* Glass Panels and Cards */
.glass-panel {
  background: #FFFFFF !important;
  border: 1px solid #E5E7EB !important;
  box-shadow: 0 4px 20px -2px rgba(15, 56, 34, 0.05) !important;
  color: var(--text-dark) !important;
}

.badge-clean {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #F0F5F2;
  color: var(--forest-dark);
  border: 1px solid #C3D7CB;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #F0F5F2 !important;
  color: var(--forest-main) !important;
  border: 1px solid #C3D7CB !important;
}

/* Custom Text Selection */
::selection {
  background-color: var(--forest-dark);
  color: #FFFFFF;
}

/* Clean Header Unified With Page */
.header-seamless {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: all 0.35s var(--ease-smooth);
}
.header-seamless.is-scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border-bottom-color: var(--border-light);
}

/* Fullscreen Overlay Menu State */
#fullscreen-menu.is-active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Custom Reading Scroll Progress Bar */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #175435, #2FA368, #C9A25D);
  z-index: 9999;
  transition: width 0.08s linear;
}

/* Hero Village Image Scaling & Parallax */
#hero-village-img {
  transform-origin: center center;
  will-change: transform;
}

/* Canvas 3D Hero Particles */
#hero-canvas-3d {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Dynamic Text Kinetic Highlighter on Scroll */
.text-highlight-kinetic {
  display: inline;
  background: linear-gradient(120deg, rgba(47, 163, 104, 0.22) 0%, rgba(47, 163, 104, 0.22) 100%);
  background-repeat: no-repeat;
  background-size: 100% 40%;
  background-position: 0 88%;
  padding: 0 4px;
  border-radius: 4px;
}

/* Horizontal Scroll Container (Carousel yang kalau di-scroll bisa geser) */
.carousel-scroll-container {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.carousel-scroll-container::-webkit-scrollbar {
  display: none;
}

.carousel-card {
  will-change: transform;
  transition: transform 0.4s var(--ease-out-expo), border-color 0.3s ease, box-shadow 0.4s ease;
}
.carousel-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Sticky Shuffle Deck Cards */
.sticky-shuffle-card {
  will-change: transform, filter, opacity;
  transform-origin: top center;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.sticky-shuffle-card:hover {
  border-color: rgba(47, 163, 104, 0.4) !important;
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.7) !important;
}

/* Card Split / Fan Out ("Mecah") Animation Effect */
.card-split-container {
  perspective: 1000px;
}
.card-split-item {
  transition: transform 0.8s var(--ease-out-expo), opacity 0.8s var(--ease-out-expo);
  will-change: transform, opacity;
}
.card-split-item.is-clustered {
  opacity: 0.2;
  transform: scale(0.92) translateY(45px);
}
.card-split-item.is-split {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* Smooth Entrance Reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s var(--ease-out-expo), transform 0.75s var(--ease-out-expo);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Fix any table texts in sub-pages */
table th, table td {
  color: var(--text-dark);
}

/* Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .card-split-item {
    opacity: 1 !important;
    transform: none !important;
  }
}
