/* main.css - Core styles, variables, Rangoli overlays, waves, and animations */

:root {
  /* Theme Color Palette */
  --cream-base: #FCFAF2;
  --cream-tint: #F3ECE0;
  --cream-light: #FFFDF9;
  
  --saffron-primary: #C53030; /* Crimson Red */
  --saffron-light: #F56565;
  --saffron-dark: #742A2A;
  
  --terracotta: #E53E3E;
  --terracotta-dark: #9B2C2C;
  --terracotta-light: #FC8181;
  
  --teal-warm: #0F766E;
  --teal-deep: #134E4A;
  --teal-light: #E0F2F1;
  
  --coral: #E53E3E;
  --indigo-dark: #1E1B4B;
  --indigo-light: #4F46E5;

  --red-primary: #C53030;
  --red-light: #F56565;
  --red-dark: #742A2A;

  /* Typography */
  --font-serif: 'Poppins', sans-serif;
  --font-sans: 'Poppins', sans-serif;
}

/* Global Reset & Base Styles */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  background-color: var(--cream-base);
  color: var(--teal-deep);
  font-family: var(--font-sans);
}

/* Custom Premium Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--cream-base);
  border-left: 1px solid var(--cream-tint);
}
::-webkit-scrollbar-thumb {
  background: var(--teal-warm);
  border-radius: 999px;
  border: 2px solid var(--cream-base);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--saffron-primary);
}

/* Top Scroll Progress Bar */
.scroll-progress-indicator {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(to right, var(--saffron-primary), var(--terracotta));
  width: 0%;
  z-index: 100;
  transition: width 0.1s ease;
}

/* Curved SVGs & Wave Dividers */
.wave-divider {
  position: absolute;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}
.wave-divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 45px;
}

/* Rangoli Overlay Pattern & Geometrics */
.rangoli-overlay {
  background-image: radial-gradient(var(--cream-tint) 1px, transparent 1px),
                    radial-gradient(var(--cream-tint) 1px, var(--cream-base) 1px);
  background-size: 24px 24px;
  background-position: 0 0, 12px 12px;
}

.rangoli-grid-pattern {
  background-image: linear-gradient(to right, rgba(243, 236, 224, 0.4) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(243, 236, 224, 0.4) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Auto-Scroll Partners Marquee Track */
@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 35s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

/* Floating Mesh Blobs (Background) */
.mesh-blob {
  filter: blur(80px);
  mix-blend-mode: multiply;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3D Transform Frameworks & Utilities */
.perspective-1200 {
  perspective: 1200px;
  transform-style: preserve-3d;
}

.preserve-3d {
  transform-style: preserve-3d;
}

.backface-hidden {
  backface-visibility: hidden;
}

/* Timeline 3D Page Flips */
.timeline-card-wrapper {
  perspective: 1200px;
  transform-style: preserve-3d;
  width: 100%;
}

.timeline-card {
  transform-style: preserve-3d;
  backface-visibility: hidden;
  opacity: 0;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.2s ease;
  transform: rotateY(75deg);
  transform-origin: right center;
}

/* Odd/Right side timeline cards: rotate counter-clockwise and pivot left */
.timeline-card.is-right {
  transform: rotateY(-75deg);
  transform-origin: left center;
}

/* When timeline element is in view */
.timeline-card.in-view {
  transform: rotateY(0deg) !important;
  opacity: 1 !important;
}

/* Mobile override: all cards pivot left since line is on left border */
@media (max-width: 767px) {
  .timeline-card.is-left {
    transform: rotateY(-75deg) !important;
    transform-origin: left center !important;
  }
}

/* Stat Cards 3D Flip Down */
.stat-card-wrapper {
  perspective: 1000px;
  transform-style: preserve-3d;
  width: 100%;
}

.stat-card {
  transform-style: preserve-3d;
  backface-visibility: hidden;
  opacity: 0;
  transform: rotateX(90deg);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1), opacity 1s ease;
}

.stat-card.in-view {
  transform: rotateX(0deg);
  opacity: 1;
}

/* Floating Outline Elements Animation Loop */
@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(2deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

.float-loop-1 { animation: float 6s ease-in-out infinite; }
.float-loop-2 { animation: float 7s ease-in-out infinite; }
.float-loop-3 { animation: float 8s ease-in-out infinite; }
.float-loop-4 { animation: float 9s ease-in-out infinite; }

/* Morphing Navbar Shell States */
.nav-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  display: flex;
  justify-content: center;
  transition: padding 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.nav-header.is-hidden {
  transform: translateY(-120%);
}

/* Unscrolled Normal State */
.nav-header.is-normal .nav-bar-container {
  width: 100%;
  max-width: 1280px;
  height: 80px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 0;
  border-bottom: 1px solid rgba(197, 48, 48, 0.15);
  padding: 0 16px;
  box-shadow: 0 4px 20px rgba(197, 48, 48, 0.03);
}

@media (min-width: 640px) {
  .nav-header.is-normal .nav-bar-container {
    padding: 0 24px;
  }
}

/* Scrolled Pill State */
.nav-header.is-pill {
  padding: 16px 16px 0;
}

.nav-header.is-pill .nav-bar-container {
  width: min(1000px, 95vw);
  height: 56px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border-radius: 999px;
  border: 1px solid rgba(197, 48, 48, 0.25);
  padding: 0 16px;
  box-shadow:
    0 16px 40px rgba(197, 48, 48, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Logo Sizing Transitions */
#navbar-logo {
  height: 36px;
  transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 768px) {
  .nav-header.is-normal #navbar-logo {
    height: 56px;
  }
  .nav-header.is-pill #navbar-logo {
    height: 40px;
  }
}

/* Mobile Menu Hamburger color - always red */
#mobile-menu-open {
  color: var(--red-primary) !important;
}

.nav-bar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  pointer-events: auto;
  box-sizing: border-box;
  transition: 
    width 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    height 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    padding 0.5s ease,
    background 0.4s ease,
    border-radius 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.4s ease;
}

/* Links Cluster */
.nav-links-cluster {
  display: none;
}

@media (min-width: 1024px) {
  .nav-links-cluster {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
    pointer-events: none;
  }

  .nav-header.is-pill .nav-links-cluster {
    gap: 0;
  }
}

.nav-link-wrapper {
  cursor: pointer;
  padding: 4px;
  pointer-events: auto;
}

.nav-link-item {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--red-primary);
  transition: color 0.3s ease, background 0.3s ease;
}

.nav-link-item:hover, .nav-link-item.active {
  color: var(--red-dark);
  background: rgba(197, 48, 48, 0.08);
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-delay: -1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    background-attachment: initial !important;
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    transform: none !important;
    filter: none !important;
  }
}
