/* ============================================
   IMMERSIVE DESIGN SYSTEM & ANIMATIONS
   Theme: Dual-Nature (Agraris & Pesisir)
   ============================================ */

/* --- ROOT VARIABLES --- */
:root {
  --transition-fast: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-normal: all 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-slow: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-morph: border-radius 0.8s cubic-bezier(0.25, 1, 0.5, 1), background 0.8s ease, border-color 0.8s ease;
  
  /* Agraris Color Scheme */
  --agraris-bg: #0e1611;
  --agraris-bg-light: #16241b;
  --agraris-primary: #3d6b4f;
  --agraris-accent: #b8963e;
  --agraris-text: #f4efe6;
  
  /* Bahari Color Scheme */
  --bahari-bg: #071524;
  --bahari-bg-light: #0d2238;
  --bahari-primary: #2176ae;
  --bahari-accent: #c4a35a;
  --bahari-text: #eef5db;
}

/* --- LENIS SMOOTH SCROLL OPTIMIZATION --- */
html.lenis {
  height: auto;
}

.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis-smooth [data-lenis-prevent] {
  overflow: clip;
}

.lenis-target {
  position: relative;
  overflow: hidden;
}

.parallax-hero {
  position: relative;
  width: 100%;
  height: 120vh; /* Controlled entirely by GSAP ScrollTrigger */
  background: #08111e;
  overflow: hidden;
  z-index: 1;
}

/* Sections below the hero must stack above it */
.parallax-hero ~ section,
.parallax-hero ~ .dual-theme-section,
.parallax-hero ~ .scrub-section {
  position: relative;
  z-index: 2;
}

.parallax-viewport {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
}

.parallax-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: cover;
  will-change: transform;
  transform-origin: center bottom;
}

/* Sky gradient (shifts from night to sunset on scroll) */
.layer-sky {
  z-index: 0;
  background: linear-gradient(180deg, #050b14 0%, #0a1628 30%, #132844 55%, #1e3a52 70%, #2d4a5a 85%, #1a2f3d 100%);
  background-size: 100% 200%;
  background-position: 0% 0%;
}

.layer-stars {
  z-index: 1;
  opacity: 0.6;
  pointer-events: none;
}

.star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: star-glow var(--dur, 3s) ease-in-out infinite alternate;
}

@keyframes star-glow {
  0% { opacity: 0.15; transform: scale(0.8); }
  100% { opacity: 0.85; transform: scale(1.15); }
}

/* Subtle glowing sun orb */
.layer-sun {
  position: absolute;
  z-index: 2;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,244,210,0.6) 25%, rgba(255,200,100,0.25) 50%, transparent 70%);
  box-shadow: 0 0 80px 20px rgba(255, 212, 121, 0.15);
  top: 22%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Soft cloud wisps via CSS gradient */
.layer-clouds {
  z-index: 3;
  background:
    radial-gradient(ellipse 600px 80px at 20% 25%, rgba(255,255,255,0.06) 0%, transparent 100%),
    radial-gradient(ellipse 500px 60px at 65% 18%, rgba(255,255,255,0.04) 0%, transparent 100%),
    radial-gradient(ellipse 400px 50px at 80% 35%, rgba(255,255,255,0.05) 0%, transparent 100%);
}

/* Village PNG illustration — far depth */
.layer-mountains-far {
  z-index: 4;
  /* background-image set inline via Blade */
}

/* Gradient terrain silhouette */
.layer-mountains-near {
  z-index: 5;
  background: linear-gradient(180deg, transparent 55%, rgba(20,45,30,0.4) 75%, rgba(14,32,20,0.7) 100%);
}

/* Beach PNG illustration — mid-ground depth */
.layer-village {
  z-index: 6;
  /* background-image set inline via Blade */
}

/* Bottom gradient fade to match next section */
.layer-beach {
  z-index: 7;
  background: linear-gradient(180deg, transparent 60%, rgba(10,18,14,0.6) 80%, rgba(8,14,10,0.95) 100%);
}

/* Cinematic vignette frame */
.layer-trees {
  z-index: 8;
  background: radial-gradient(ellipse 80% 70% at 50% 50%, transparent 40%, rgba(0,0,0,0.5) 100%);
}

/* Atmospheric mist */
.layer-mist {
  z-index: 10;
  background: linear-gradient(180deg, transparent 40%, rgba(244, 239, 230, 0.04) 70%, rgba(244, 239, 230, 0.12) 100%);
  pointer-events: none;
}

/* Hero Content */
.hero-content-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}

.hero-logo {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.25);
  padding: 10px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  margin-bottom: 25px;
  animation: logo-float 6s ease-in-out infinite;
}

/* When inside circular-text wrapper, disable conflicting animation & margin */
.hero-circular-wrapper .hero-logo {
  animation: none;
  margin-bottom: 0;
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero-main-title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
  line-height: 1.1;
}

.hero-tagline {
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  color: var(--gold-light);
  font-style: italic;
  margin-bottom: 8px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

.hero-loc {
  font-size: 0.9rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 35px;
  font-weight: 500;
}

.hero-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 38px;
  background: rgba(184, 150, 62, 0.25);
  border: 1.5px solid rgba(184, 150, 62, 0.5);
  color: #fff;
  font-weight: 700;
  border-radius: 50px;
  transition: var(--transition-normal);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  text-decoration: none;
}

.hero-cta-btn:hover {
  transform: translateY(-4px);
  background: rgba(184, 150, 62, 0.45);
  box-shadow: 0 15px 35px rgba(184, 150, 62, 0.35);
  border-color: #fff;
}

.scroll-down-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 26;
  opacity: 0.8;
  animation: bounce-arrow 2s infinite;
}

@keyframes bounce-arrow {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 10px); }
}

/* --- DUA SISI MENTARAMAN (THEME TOGGLE SYSTEM) --- */
.dual-theme-section {
  position: relative;
  padding: 120px 0;
  transition: background 0.8s ease, color 0.8s ease;
  overflow: hidden;
}

.dual-theme-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.03) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 40%);
  pointer-events: none;
}

/* Theme State Classes */
.theme-agraris {
  background: var(--agraris-bg);
  color: var(--agraris-text);
}

.theme-bahari {
  background: var(--bahari-bg);
  color: var(--bahari-text);
}

/* Custom Interactive Switcher Control */
.theme-switcher-container {
  display: flex;
  justify-content: center;
  margin-bottom: 60px;
  position: relative;
  z-index: 10;
}

.theme-switcher-track {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50px;
  padding: 6px;
  display: inline-flex;
  gap: 4px;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.theme-switcher-btn {
  padding: 14px 28px;
  border-radius: 50px;
  border: none;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  transition: var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

.theme-switcher-btn.active {
  color: #fff;
}

.theme-switcher-pill {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 6px;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--agraris-primary), #4a825d);
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), width 0.6s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.theme-bahari .theme-switcher-pill {
  background: linear-gradient(135deg, var(--bahari-primary), #3b8cc4);
}

/* Dual Design Cards Grid */
.dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  position: relative;
}

.dual-design-card {
  border-radius: 24px;
  padding: 45px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-morph);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.15);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Card custom styling based on theme state */
.theme-agraris .card-left {
  background: rgba(30, 45, 36, 0.7);
  backdrop-filter: blur(24px) saturate(1.5) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.5) !important;
  border-color: rgba(61, 107, 79, 0.35);
  box-shadow: 0 20px 50px rgba(14, 22, 17, 0.6);
  border-radius: 30px 10px 30px 30px;
}

.theme-agraris .card-right {
  opacity: 0.45;
  filter: grayscale(80%) blur(1px);
}

.theme-bahari .card-right {
  background: rgba(15, 35, 45, 0.7);
  backdrop-filter: blur(24px) saturate(1.5) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.5) !important;
  border-color: rgba(33, 118, 174, 0.35);
  box-shadow: 0 20px 50px rgba(7, 21, 36, 0.6);
  border-radius: 10px 30px 30px 30px;
}

.theme-bahari .card-left {
  opacity: 0.45;
  filter: grayscale(80%) blur(1px);
}

.dual-card-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: #fff;
  transition: var(--transition-normal);
}

.theme-agraris .card-left .dual-card-title {
  color: var(--agraris-accent);
}

.theme-bahari .card-right .dual-card-title {
  color: var(--bahari-accent);
}

.dual-card-desc {
  font-size: 1.05rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 30px;
}

.dual-card-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 35px;
}

.dual-feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.dual-feature-item svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--agraris-accent);
  transition: var(--transition-normal);
}

.theme-bahari .dual-feature-item svg {
  color: var(--bahari-accent);
}

.dual-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition-normal);
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.theme-agraris .card-left .dual-card-btn {
  background: var(--agraris-accent);
  color: #1e2d24;
  box-shadow: 0 4px 15px rgba(184, 150, 62, 0.3);
}

.theme-agraris .card-left .dual-card-btn:hover {
  transform: translateY(-3px);
  background: #cbb061;
  box-shadow: 0 8px 25px rgba(184, 150, 62, 0.45);
}

.theme-bahari .card-right .dual-card-btn {
  background: var(--bahari-accent);
  color: #071524;
  box-shadow: 0 4px 15px rgba(196, 163, 90, 0.3);
}

.theme-bahari .card-right .dual-card-btn:hover {
  transform: translateY(-3px);
  background: #d4bd7e;
  box-shadow: 0 8px 25px rgba(196, 163, 90, 0.45);
}

/* Floating background decoration */
.bubble-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  bottom: -20px;
  animation: float-bubbles var(--dur, 8s) ease-in infinite;
  pointer-events: none;
}

@keyframes float-bubbles {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  20% { opacity: 0.4; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-350px) scale(0.6); opacity: 0; }
}

/* --- IMAGE SCRUB SECTION --- */
.scrub-section {
  position: relative;
  width: 100%;
  height: 400vh;
  background: #050a08;
  overflow: visible;
}

.sticky-video-container {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  z-index: 5;
}

.scrub-image-panels {
  position: absolute;
  inset: 0;
}

.scrub-panel {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: opacity, transform;
  transition: none;
}

.scrub-panel-1 { opacity: 1; z-index: 1; }
.scrub-panel-2 { opacity: 0; z-index: 2; }
.scrub-panel-3 { opacity: 0; z-index: 3; }

.scrub-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.7) 100%);
  z-index: 6;
  pointer-events: none;
}

.scrub-caption-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 7;
  pointer-events: none;
}

.scrub-caption {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  text-align: center;
  color: #fff;
  visibility: hidden;
  background: rgba(5, 12, 8, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(184, 150, 62, 0.2);
  border-radius: 20px;
  padding: 36px 48px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.scrub-caption h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 16px;
  color: #b8963e;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.scrub-caption p {
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  color: #f4efe6;
  line-height: 1.8;
  max-width: 600px;
  margin: 0 auto;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

/* Fallback vector scrubber */
.vector-scrub-scene {
  position: absolute;
  inset: 0;
  display: none;
  background: linear-gradient(135deg, #091724, #082d1c);
  z-index: 4;
}

.vector-scrub-scene svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- PREMIUM CARD DESIGN UPDATES --- */
.glass-card-premium {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px) saturate(120%);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 35px;
  transition: var(--transition-slow);
}

.glass-card-premium:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(184, 150, 62, 0.35);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.3);
  transform: translateY(-5px);
}

.glass-card-light {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(15px) saturate(140%) !important;
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02) !important;
  transition: var(--transition-normal) !important;
}

.glass-card-light:hover {
  background: #ffffff !important;
  border-color: rgba(61, 107, 79, 0.3) !important;
  box-shadow: 0 20px 45px rgba(61, 107, 79, 0.08) !important;
  transform: translateY(-5px);
}

/* Dynamic counter items */
.counter-ring-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Wave divider adjustments */
.wave-divider {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  line-height: 0;
  z-index: 2;
  pointer-events: none;
}

.wave-divider-top { top: -2px; }
.wave-divider-bottom { bottom: -2px; }
.wave-divider svg { display: block; width: 100%; height: auto; }

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 1024px) {
  .dual-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .dual-design-card {
    min-height: auto;
  }
}

@media (max-width: 768px) {
  .parallax-hero {
    height: 100vh;
  }
  
  .hero-main-title {
    font-size: clamp(2.2rem, 9vw, 4rem);
  }
  
  .hero-tagline {
    font-size: clamp(1rem, 4vw, 1.4rem);
  }
  
  .hero-logo {
    width: 85px;
    height: 85px;
    margin-bottom: 15px;
  }
  
  .dual-theme-section {
    padding: 80px 0;
  }
  
  .dual-card-title {
    font-size: 1.8rem;
  }
  
  .stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .grid-3 {
    grid-template-columns: 1fr !important;
  }
  
  .grid-2 {
    grid-template-columns: 1fr !important;
  }

  .theme-agraris .card-right,
  .theme-bahari .card-left {
    display: none !important;
  }

  .theme-switcher-btn {
    padding: 10px 16px;
    font-size: 0.82rem;
  }

  .dual-feature-item span { font-size: 11px !important; }
  .dual-feature-item svg { width: 15px !important; height: 15px !important; }
  .dual-card-btn { font-size: 11px !important; padding: 11px 22px !important; }
  .dual-design-card > div > span:first-child { font-size: 9px !important; margin-bottom: 5px !important; }

  .scrub-section {
    height: 400vh;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .hero-cta-btn {
    padding: 12px 24px;
    font-size: 0.9rem;
  }

  .hero-loc {
    letter-spacing: 2px;
    font-size: 0.75rem;
  }
}

/* --- POTENSI BADGE --- */
.potensi-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--forest-mid), var(--earth-warm));
  color: #fff;
  padding: 4px 14px;
  border-radius: 30px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

/* --- FLOATING LOGO ANIMATION --- */
.float-anim {
  animation: logo-float 5s ease-in-out infinite;
}

.float-anim-delay {
  animation: logo-float 5s ease-in-out infinite;
  animation-delay: 1.2s;
}

/* --- REDUCED MOTION --- */
@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-hero {
    height: 100vh;
  }

  .scrub-section {
    height: auto;
  }
}
