/* ==========================================================================
   GROWINDIA - DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

:root {
  --bg-dark: #07090e;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 56, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;

  --gradient-main: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --gradient-text: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #94a3b8 100%);
  
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', sans-serif;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.25);
  --glass-backdrop: blur(16px) saturate(180%);
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.6;
}

body {
  overflow-x: hidden;
  background: var(--bg-dark);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.green-text {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 50%, #4ade80 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Preloader Overlay */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #040508;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-content {
  width: 90%;
  max-width: 440px;
  text-align: center;
  padding: 40px;
  background: rgba(15, 20, 32, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-backdrop);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.loader-logo h2 {
  font-size: 2.2rem;
  letter-spacing: 2px;
  margin-top: 10px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-full);
}

.loader-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  margin: 28px 0 16px 0;
  overflow: hidden;
  position: relative;
}

.loader-bar {
  width: 0%;
  height: 100%;
  background: var(--gradient-main);
  border-radius: var(--radius-full);
  transition: width 0.15s ease-out;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.8);
}

.loader-status {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.loader-percent {
  font-weight: 700;
  color: var(--accent-cyan);
}

.loader-subtext {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 10px;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1200px;
  z-index: 1000;
  background: rgba(11, 14, 22, 0.65);
  border: 1px solid var(--border-color);
  backdrop-filter: var(--glass-backdrop);
  border-radius: var(--radius-full);
  padding: 10px 24px;
  transition: all 0.3s ease;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 1px;
}

.logo-icon {
  width: 14px;
  height: 14px;
  background: var(--accent-primary);
  border-radius: 4px;
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--accent-primary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 32px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.25s ease;
}

.nav-links a:hover {
  color: #fff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

.btn-glow {
  background: var(--gradient-main);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
}

.btn-primary {
  background: #fff;
  color: #07090e;
}

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

.btn-glass {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Hero Scroll Section */
.hero-scroll-container {
  position: relative;
  height: 200vh; /* Full scroll scrub distance for 180 frames */
  width: 100%;
}

.sticky-viewport {
  position: sticky;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #000;
  z-index: 1;
}

/* Main Content Section - Slides seamlessly over canvas upon animation completion */
main {
  position: relative;
  z-index: 10;
  margin-top: -100vh; /* Pulls main directly to bottom of sticky viewport eliminating any gap */
  background: var(--surface, #f9f9ff);
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.scroll-progress-line {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient-main);
  z-index: 10;
  box-shadow: 0 0 10px var(--accent-primary);
}

/* Floating Badges */
.frame-indicator-badge {
  position: absolute;
  top: 100px;
  right: 40px;
  z-index: 10;
  background: rgba(11, 14, 22, 0.6);
  border: 1px solid var(--border-color);
  backdrop-filter: var(--glass-backdrop);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.scroll-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  transition: opacity 0.5s ease;
}

.mouse-icon {
  width: 20px;
  height: 32px;
  border: 2px solid var(--text-dim);
  border-radius: 12px;
  position: relative;
}

.mouse-icon .wheel {
  width: 4px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 2px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollWheel 1.5s infinite;
}

@keyframes scrollWheel {
  0% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 12px); }
}

/* Overlay Text Engine */
.overlay-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

.overlay-step {
  position: absolute;
  max-width: 750px;
  padding: 0 24px;
  text-align: center;
  opacity: 0;
  transform: translateY(30px) scale(0.96);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.overlay-step.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.step-badge {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}

.overlay-step h1, .overlay-step h2 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.step-description {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: #cbd5e1;
  max-width: 580px;
  margin: 0 auto 28px auto;
  line-height: 1.6;
}

.step-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* General Layout Sections */
.section {
  padding: 120px 24px;
  position: relative;
  z-index: 10;
  background: var(--bg-dark);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 60px;
  max-width: 650px;
}

.section-header.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-secondary);
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-backdrop);
  padding: 32px;
  transition: all 0.3s ease;
}

.glass-panel:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

/* Controller Section */
.controller-section {
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
}

.controller-top {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-box {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.metric-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.metric-value {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.slider-wrapper {
  margin-bottom: 32px;
}

.slider-wrapper label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.custom-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.controller-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-icon {
  font-size: 2.2rem;
  width: 56px;
  height: 56px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-card h3 {
  font-size: 1.3rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Tech Stack */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.tech-box {
  background: rgba(18, 24, 38, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}

.tech-name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--accent-cyan);
}

.tech-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 60px 24px;
  background: #040508;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.footer-brand h3 {
  font-size: 1.5rem;
  letter-spacing: 2px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-brand p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  justify-content: center;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .frame-indicator-badge {
    top: 80px;
    right: 20px;
  }
  .overlay-step h1, .overlay-step h2 {
    font-size: 2.2rem;
  }
  .controller-actions {
    flex-direction: column;
  }
}
