:root {
  --bg-dark: #050508;
  --bg-glass: rgba(20, 20, 28, 0.6);
  --glass-border: rgba(255, 255, 255, 0.06);
  --primary: #4F46E5;
  --primary-glow: rgba(79, 70, 229, 0.5);
  --secondary: #E11D48;
  --secondary-glow: rgba(225, 29, 72, 0.5);
  --accent: #10B981;
  --text-main: #FFFFFF;
  --text-muted: #94A3B8;
  --font-headings: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

h1, h2, h3, h4, .logo-text, .percentage {
  font-family: var(--font-headings);
  font-weight: 800;
  letter-spacing: -0.02em;
}

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

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

/* Background Mesh & Animations */
.background-mesh {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.8;
}

.grid-stroke { stroke: rgba(255, 255, 255, 0.02); }

.moving-glow {
  animation: moveGlow 20s infinite alternate ease-in-out;
}

@keyframes moveGlow {
  0% { transform: translate(-20%, -20%) scale(1); }
  100% { transform: translate(20%, 20%) scale(1.5); }
}

/* Typography Utilities */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glassmorphism */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  position: relative;
  z-index: 1;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px var(--primary-glow);
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0; width: 100%;
  padding: 1.5rem 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(5, 5, 8, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem 0;
}

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

.logo-text { font-size: 1.5rem; }
.highlight { color: var(--primary); }

.nav-links { display: flex; gap: 2rem; }
.nav-links a {
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color 0.3s;
}
.nav-links a:hover { color: var(--text-main); }

/* Hero Section */
.hero {
  padding-top: 150px;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 30px;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

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

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.hero-title {
  font-size: 4rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

/* SVG Hero Animations */
.hero-visual {
  animation: floatChart 6s ease-in-out infinite;
}
@keyframes floatChart {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.chart-area-anim {
  animation: revealArea 2s cubic-bezier(0.16, 1, 0.3, 1) forwards, pulseArea 4s infinite alternate;
}

.chart-line-anim {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: drawLine 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.5s, drawGlow 2s infinite alternate 3s;
}

@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes drawGlow { 0% { filter: drop-shadow(0 0 5px var(--primary-glow)); stroke-width: 4; } 100% { filter: drop-shadow(0 0 15px var(--primary)); stroke-width: 5; } }
@keyframes revealArea { 0% { opacity: 0; transform: translateY(20px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes pulseArea { 0% { opacity: 0.7; } 100% { opacity: 1; } }

.anim-ring {
  transform-origin: center;
  animation: rotateRing 15s linear infinite;
}
.c1 { stroke-dasharray: 10 30; stroke-width: 2; }
.c2 { animation-direction: reverse; animation-duration: 20s; stroke-dasharray: 15 25; stroke-width: 2; }

@keyframes rotateRing { to { transform: rotate(360deg); } }

.node {
  animation: floatNode 2.5s ease-in-out infinite alternate;
  transform-origin: center;
}
@keyframes floatNode {
  0% { transform: translateY(0px) scale(1); filter: drop-shadow(0 0 5px var(--accent)); }
  100% { transform: translateY(-10px) scale(1.3); filter: drop-shadow(0 0 20px var(--accent)); }
}

/* Marquee */
.marquee-section {
  padding: 2rem 0;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  overflow: hidden;
  background: rgba(0,0,0,0.3);
  margin-bottom: 5rem;
}

.marquee-content {
  display: flex;
  white-space: nowrap;
  animation: scrollText 30s linear infinite;
  gap: 3rem;
  font-family: var(--font-headings);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

@keyframes scrollText {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Services */
.section-title { margin-bottom: 4rem; }
.section-title.center { text-align: center; }
.section-title h2 { font-size: 3rem; margin-bottom: 1rem; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.service-card {
  padding: 2.5rem;
  transition: transform 0.3s;
}

.service-card:hover {
  transform: translateY(-10px);
  border-color: rgba(79, 70, 229, 0.3);
}

.service-svg {
  width: 60px; height: 60px;
  margin-bottom: 1.5rem;
}

.svg-trace {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  transition: stroke-dashoffset 1s ease;
}

.service-card:hover .svg-trace {
  stroke-dashoffset: 0;
}

.primary-trace { stroke: var(--primary); }

.service-card h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.service-card p { color: var(--text-muted); }

/* Expandable Service Details */
.service-card { cursor: pointer; position: relative; overflow: hidden; }
.service-card::after {
  content: '+ Ver Más';
  display: block;
  margin-top: 1rem;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.3s;
}
.service-card.expanded::after { display: none; }

.service-details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.5s ease, padding 0.5s ease;
}

.service-card.expanded .service-details {
  max-height: 400px;
  opacity: 1;
  padding-top: 1.5rem;
}

.service-divider {
  border: 0;
  height: 1px;
  background: var(--glass-border);
  margin-bottom: 1.5rem;
}

.service-desc-extended {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
}

.service-graphic {
  background: rgba(0,0,0,0.4);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid var(--glass-border);
}

.mini-chart { width: 100%; height: auto; max-width: 200px; display: block; margin: 0 auto; }

/* SVG Animations Inside Cards */
.service-card.expanded .line-grow {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: drawLine 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.3s;
}

.service-card.expanded .bar-grow {
  transform-origin: bottom;
  transform: scaleY(0);
  animation: growUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes growUp { to { transform: scaleY(1); } }

.spin-slow {
  transform-origin: center;
  stroke-dasharray: 20;
  animation: spinDash 10s linear infinite;
}
@keyframes spinDash { to { transform: rotate(360deg); } }

.flow-line {
  stroke-dasharray: 5,5;
  animation: marchFlow 1s linear infinite;
}
@keyframes marchFlow { to { stroke-dashoffset: -10; } }

/* Process */
.process { padding: 5rem 0; }
.process-wrapper h2 { text-align: center; margin-bottom: 2rem; font-size: 3rem; }
.timeline { display: flex; justify-content: space-between; margin-top: 5rem; position: relative; }
.timeline-item { flex: 1; text-align: center; padding: 0 1rem; position: relative; z-index: 2; }
.timeline-line-svg {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 6px;
  transform: translateY(-50%);
  z-index: 1;
  overflow: visible;
}
.step-card { padding: 2rem 1rem; position: relative; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.step-card:hover { transform: translateY(-10px); box-shadow: 0 10px 30px var(--primary-glow); border-color: var(--primary); }
.step-num {
  font-family: var(--font-headings);
  font-size: 3rem;
  color: rgba(255,255,255,0.05);
  position: absolute;
  top: 10px; right: 20px;
}

/* Cases Circular Charts */
.cases { padding: 5rem 0; }
.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; text-align: center; }
.metric-card { padding: 3rem; }
.circular-chart { display: block; margin: 0 auto 1.5rem auto; max-width: 120px; max-height: 120px; }
.circle-bg { fill: none; stroke: rgba(255,255,255,0.05); stroke-width: 2; }
.circle-anim { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.c-cyan { stroke: var(--accent); }
.c-rose { stroke: var(--secondary); }
.c-indigo { stroke: var(--primary); }

.percentage {
  fill: #fff;
  font-size: 8px; /* Due to SVG viewBox size */
  text-anchor: middle;
}

/* About / CEO */
.about { padding: 5rem 0; }
.ceo-card { padding: 4rem; text-align: center; max-width: 600px; margin: 0 auto; box-shadow: 0 0 40px rgba(79, 70, 229, 0.1); }

/* Contact Form */
.contact { padding: 5rem 0; }
.lead-form { max-width: 600px; margin: 0 auto; padding: 3rem; }
.lead-form h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.lead-form input {
  width: 100%;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: white;
  font-family: var(--font-body);
}
.lead-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 15px var(--primary-glow); }
.lead-form button { width: 100%; }

/* Scroll Animations */
.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 3rem; }
  .services-grid, .metrics-grid, .timeline { display: flex; flex-direction: column; }
  .nav-links { display: none; }
}

/* Lang Switcher */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 1rem;
    color: var(--text-muted);
}
.lang-switch a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}
.lang-switch a:hover {
    color: var(--primary);
}
.lang-switch a.active {
    color: var(--text-light);
}

/* WhatsApp Float */
.whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 9999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.whatsapp-float:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
}
.whatsapp-float .wa-icon {
    width: 35px;
    height: 35px;
}
