/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  /* Color Palette */
  --bg: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --red: #ef4444;
  --primary: #0f172a;
  --primary-accent: #123b68;
  --border-color: rgba(18, 59, 104, 0.15);

  /* Spacing & Layout */
  --header-height: 92px;
  --radius-md: 14px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.25s ease;
  --transition-smooth: 0.35s ease;
  --transition-slow: 0.65s ease;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  margin: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Compensación de scroll para navegadores fijos */
section[id] {
  scroll-margin-top: var(--header-height);
}

/* ==========================================================================
   UTILITY COMPONENTS
   ========================================================================== */

/* Glassmorphism */
.glass {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Icon Containers */
.icon-box {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

/* Eyebrows / Badges */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #d7ebff;
  border-radius: var(--radius-full);
  padding: 0.5rem 0.8rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-eyebrow {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Cards & Interactions */
.service-card,
.card-hover {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.service-card:hover,
.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  border-color: var(--border-color);
}

/* Back to top button */
.back-top {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.back-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ==========================================================================
   ANIMATIONS & REVEAL ON SCROLL
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

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

.step-line {
  position: absolute;
  top: 24px;
  left: calc(50% + 24px);
  right: calc(-50% + 24px);
  height: 1px;
  background: #dbe4ef;
}

/* ==========================================================================
   HERO SECTION & SLIDER
   ========================================================================== */
.hero,
#hero-slider {
  min-height: 760px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-slider-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-slider-bg .slide {
  position: absolute;
  inset: 0;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.5s ease-in-out, transform 7s ease;
  animation: zoomHero 12s linear infinite;
}

.hero-slider-bg .slide.active {
  opacity: 1;
  transform: scale(1);
}

.hero-overlay-1 {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(90deg, rgba(107, 125, 147, 0.93) 0%, rgba(171, 190, 210, 0.84) 48%, rgba(146, 170, 198, 0.45) 100%),
    linear-gradient(0deg, rgba(159, 171, 185, 0.42), transparent 45%);
  z-index: 1;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(90deg, rgba(5, 17, 32, 0.93) 0%, rgba(7, 25, 46, 0.84) 48%, rgba(7, 25, 46, 0.45) 100%),
    linear-gradient(0deg, rgba(5, 17, 32, 0.42), transparent 45%);
  z-index: 1;
}

.hero-content,
#hero-slider .max-w-7xl {
  position: relative;
  z-index: 2;
}

@keyframes zoomHero {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.10);
  }
}

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

/* Capa blanca translúcida para contraste y accesibilidad */
.parallax-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.88);
  z-index: 1;
}

/* Posicionar contenido sobre la máscara */
.parallax-section > * {
  position: relative;
  z-index: 2;
}
/* Estilo base para todas las secciones con fondo */
#software, 
#digitalizacion, 
#capital-humano, 
#fiscal {
    background-size: cover;        /* Cubre todo el ancho y alto de la sección */
    background-position: top;   /* Centra la imagen */
    background-repeat: no-repeat;  /* Evita que la imagen se repita */
}
/* Fondos por Sección */
#software { background-image: url("../img/foto1.webp"); }
#digitalizacion { background-image: url("../img/foto2.webp"); }
#capital-humano { background-image: url("../img/foto3.webp"); }
#fiscal { background-image: url("../img/foto4.webp"); }

#software { 
    background: linear-gradient(rgba(0, 0, 0, 0.75), rgba(64, 68, 73, 0.55)), url("../img/foto1.webp") center/cover no-repeat; 
}
#digitalizacion { 
    background: linear-gradient(rgba(0, 0, 0, 0.75), rgba(64, 68, 73, 0.55)), url("../img/foto2.webp") center/cover no-repeat; 
}
#capital-humano { 
    background: linear-gradient(rgba(0, 0, 0, 0.75), rgba(64, 69, 73, 0.55)), url("../img/foto3.webp") center/cover no-repeat; 
}
#fiscal { 
    background: linear-gradient(rgba(0, 0, 0, 0.75), rgba(64, 69, 73, 0.55)), url("../img/foto4.webp") center/cover no-repeat; 
}

/* ==========================================================================
   RESPONSIVE & ACCESSIBILITY
   ========================================================================== */
@media (max-width: 1023px) {
  .hero,
  #hero-slider {
    min-height: auto;
    padding: 4rem 0;
  }

  .step-line {
    display: none;
  }
}

@media (max-width: 768px) {
  /* En móviles se deshabilita parallax fixed por rendimiento en iOS/Android */
  .parallax-section {
    background-attachment: scroll;
  }
}

/* Accesibilidad: Reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-slider-bg .slide {
    animation: none;
  }
}