/* ===== MAIN NAVBAR STYLES ===== */
.main-nav {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  padding: 0 2rem;
  background: rgba(15, 15, 20, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  overflow: visible;
}
.main-nav .nav-menu {
  display: flex;
  align-items: center;
  overflow: visible;
  flex-shrink: 0;
}
.main-nav .nav-logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.main-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav .nav-links li a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.main-nav .nav-links li a:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

/* Modern SaaS Dropdowns - 2025-26 Style */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.nav-dropdown-btn:hover { 
  color: var(--text-primary); 
  background: rgba(255,255,255,0.05);
}
.nav-dropdown-btn::after { 
  content: '↓'; 
  font-size: 0.6rem; 
  transition: transform 0.2s ease;
}
.nav-dropdown:hover .nav-dropdown-btn::after { transform: rotate(180deg); }

/* Nav dropdown positioning - relative to parent li */
.nav-dropdown {
  position: relative;
}

/* Base dropdown content */
.nav-dropdown-content {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: min(820px, 92vw);
  max-width: 92vw;
  overflow-x: auto;
  background: rgba(14, 14, 17, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  z-index: 1100;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-dropdown:hover .nav-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Grid layout for mega menu */
.mega-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}
.mega-section {
  padding: 0.5rem 0.75rem;
}
.mega-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Dropdown items */
.nav-dropdown-content a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.875rem;
  transition: all 0.15s ease;
}
.nav-dropdown-content a:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}
.nav-dropdown-content a svg {
  width: 18px;
  height: 18px;
  opacity: 0.6;
}
.nav-dropdown-content a:hover svg { opacity: 1; }

/* Highlighted item */
.nav-dropdown-content a.highlight {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}
.nav-dropdown-content a.highlight:hover {
  background: rgba(99, 102, 241, 0.25);
}

/* Arrow positioned above dropdown */
.nav-dropdown-content::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: rgba(14, 14, 17, 0.95);
  border-left: 1px solid rgba(255,255,255,0.08);
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* Smaller dropdown for "Cómo Trabajamos" */
.nav-dropdown-content.small {
  min-width: 200px;
}
/* Stack items grid */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.25rem;
}

/* v6 · Kill legacy file-tree sidebar + its toggle (removes the 2nd hamburger) */
.file-tree-toggle,
.file-tree-sidebar,
.file-tree-overlay { display: none !important; }

/* Responsive Mobile Menu */
.mobile-menu-btn { display: none; }
.mobile-nav { display: none; position: fixed; top: 64px; left: 0; right: 0; bottom: 0; background: var(--bg-primary); backdrop-filter: blur(20px); z-index: 999; overflow-y: auto; padding: 1.5rem; }
.mobile-nav.active { display: block; }
.mobile-nav-section { margin-bottom: 1.5rem; }
.mobile-nav-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 0.75rem; }
.mobile-nav-link { display: block; padding: 0.75rem 0; color: var(--text-secondary); text-decoration: none; border-bottom: 1px solid var(--border); font-size: 1rem; }
.mobile-nav-link:hover { color: var(--text-primary); }
.mobile-nav-sub { padding-left: 1rem; }

@media (max-width: 1024px) {
  .nav-dropdown-content { display: none !important; }
  .nav-links { display: none !important; }
  .mobile-menu-btn { display: flex !important; }
  .mobile-nav { display: none; }
  .mobile-nav.active { display: block; }
}

/* Mobile menu button */
.mobile-menu-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-primary);
}

/* Parallax Smooth Scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* Smooth scroll for anchor links */
a[href^="#"] {
  scroll-margin-top: 80px;
}

/* Parallax sections */
.parallax-section {
  position: relative;
  overflow: hidden;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* Subtle parallax on hero */
.hero-parallax {
  transform: translateZ(0);
  will-change: transform;
}

/* Smooth reveal animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animations */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Theme CSS - Editorial-Consultoría · v5 */
:root {
  --bg-primary: #0f0f14;
  --bg-secondary: #14141b;
  --bg-card: #17171f;
  --bg-elevated: #1c1c25;
  --text-primary: #f5f5f7;
  --text-secondary: #a3a3ad;
  --text-muted: #6b6b78;
  --accent: #ffffff;
  --accent-hover: #ffffff;
  --accent-red: #C8102E;
  --accent-red-soft: #E63946;
  --accent-red-bg: rgba(200, 16, 46, 0.08);
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.14);
  --glow: rgba(99, 102, 241, 0.15);
  --shadow: rgba(0, 0, 0, 0.4);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* v5 · kill all "AI gradient" decorative layers */
.bg-orbs,
.tech-grid,
.tech-dots,
.tech-particles,
.scanline,
.corner-frame,
.noise-bg,
.mesh-gradient,
.glow-line {
  display: none !important;
}

/* v6 · Light theme (off-white + black + red) */
[data-theme="light"] {
  --bg-primary: #faf8f3;
  --bg-secondary: #f1ede4;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --text-primary: #0a0a0a;
  --text-secondary: #444444;
  --text-muted: #8a8a8a;
  --accent: #0a0a0a;
  --accent-hover: #C8102E;
  --accent-red: #C8102E;
  --accent-red-soft: #E63946;
  --accent-red-bg: rgba(200, 16, 46, 0.06);
  --border: rgba(10, 10, 10, 0.10);
  --border-hover: rgba(10, 10, 10, 0.22);
  --shadow: rgba(0, 0, 0, 0.08);
}

/* Accent red applied SPARINGLY as editorial detail */
.plain-eyebrow,
.origin-eyebrow,
.area-num,
.eyebrow,
.case-sector { color: var(--accent-red) !important; }

.testimonial .quote::before { color: var(--accent-red); }

.partner-link,
.area-stack a:hover { color: var(--accent-red); }

.pillar-card::before,
.origin-lesson { border-left-color: var(--accent-red) !important; }

a.highlight { color: var(--accent-red); }

/* Light-theme component touch-ups */
[data-theme="light"] .main-nav {
  background: rgba(250, 248, 243, 0.92);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .nav-dropdown-content {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.05);
}
[data-theme="light"] .nav-dropdown-content::before {
  background: rgba(255, 255, 255, 0.98);
  border-left-color: var(--border);
  border-top-color: var(--border);
}
[data-theme="light"] .nav-dropdown-content a:hover {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}
[data-theme="light"] .cta-primary {
  background: var(--accent-red) !important;
  color: #ffffff !important;
}
[data-theme="light"] .cta-primary:hover {
  filter: brightness(0.92);
  box-shadow: 0 8px 24px rgba(200,16,46,0.25);
}
[data-theme="light"] .cta-secondary {
  background: #ffffff;
  border-color: var(--text-primary);
  color: var(--text-primary);
}
[data-theme="light"] .cta-secondary:hover {
  background: var(--accent-red-bg);
  color: var(--accent-red);
  border-color: var(--accent-red);
}
[data-theme="light"] .feature-card .feature-icon,
[data-theme="light"] .hero-stat-icon,
[data-theme="light"] .action-box .action-icon {
  background: var(--bg-secondary) !important;
  border-color: var(--border);
}
[data-theme="light"] .testimonial,
[data-theme="light"] .anchor-stat,
[data-theme="light"] .partner-card,
[data-theme="light"] .case-card,
[data-theme="light"] .pillar-card,
[data-theme="light"] .feature-card,
[data-theme="light"] .cta-box,
[data-theme="light"] .tile-nav-item,
[data-theme="light"] .area-stack a,
[data-theme="light"] .stack-pill,
[data-theme="light"] .df-form,
[data-theme="light"] .audit-promise {
  background: var(--bg-card);
  border: 1px solid var(--border);
}
[data-theme="light"] .partner-avatar {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}
[data-theme="light"] .anchor-stat .anchor-value { color: var(--text-primary) !important; }
[data-theme="light"] .compare-col.highlight {
  background: #ffffff;
  border-color: var(--accent-red);
}
[data-theme="light"] .compare-col.highlight .compare-type,
[data-theme="light"] .compare-col.highlight .compare-action { color: var(--accent-red); }
[data-theme="light"] .compare-col.highlight::before {
  background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
}
[data-theme="light"] .faq-item summary::after { color: var(--accent-red); }
[data-theme="light"] .faq-item[open] { border-color: var(--accent-red); }
[data-theme="light"] .area-stack a:hover {
  border-color: var(--accent-red);
  background: var(--accent-red-bg);
}
[data-theme="light"] .nav-links a:hover,
[data-theme="light"] .nav-dropdown-btn:hover { color: var(--accent-red); }
[data-theme="light"] .partner-link { color: var(--accent-red); }
[data-theme="light"] .footer { background: var(--bg-secondary); }

/* Theme toggle button (in navbar) */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  margin-left: 0.5rem;
  transition: border-color 0.15s, color 0.15s;
}
.theme-toggle-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.theme-toggle-btn svg { width: 16px; height: 16px; }
.theme-toggle-btn .icon-sun { display: none; }
.theme-toggle-btn .icon-moon { display: block; }
[data-theme="light"] .theme-toggle-btn .icon-sun { display: block; }
[data-theme="light"] .theme-toggle-btn .icon-moon { display: none; }

/* Global dark body */
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

p { color: var(--text-secondary); }

a { color: inherit; text-decoration: none; }

/* Subtle gradient background for entire page */
.page-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 60% at 50% -20%, rgba(99, 102, 241, 0.06) 0%, transparent 60%),
    var(--bg-primary);
  pointer-events: none;
  z-index: 0;
}

/* Light theme overrides */
[data-theme="light"] {
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-card: #f4f4f5;
  --bg-elevated: #ffffff;
  --text-primary: #09090b;
  --text-secondary: #52525b;
  --text-muted: #a1a1aa;
  --accent: #18181b;
  --accent-hover: #27272a;
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.14);
  --glow: rgba(99, 102, 241, 0.1);
  --shadow: rgba(0, 0, 0, 0.08);
}

/* Animated Theme Toggle - RuixenUI style */
.theme-toggle {
  position: relative;
  width: 60px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9999px;
  cursor: pointer;
  padding: 0;
  outline: none;
}

.toggle-track {
  position: absolute;
  inset: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
}

.toggle-thumb {
  position: absolute;
  left: 3px;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
  border-radius: 50%;
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

[data-theme="light"] .toggle-thumb {
  transform: translateX(28px);
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.4);
}

.toggle-icons {
  display: flex;
  width: 100%;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.toggle-icon {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
  transition: opacity 0.3s;
}

[data-theme="light"] .sun-icon {
  opacity: 1;
}

[data-theme="light"] .moon-icon {
  opacity: 0.3;
}

.moon-icon {
  opacity: 0.3;
}

[data-theme="light"] .moon-icon {
  opacity: 1;
}

[data-theme="light"] .sun-icon {
  opacity: 0.3;
}