/* ==========================================================
   1. RESET & NORMALIZE
========================================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ==========================================================
   2. VARIABLES GLOBALES (PREMIUM)
========================================================== */
:root {
  /* --- TIPOGRAFÍA REFINADA --- */
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-size-base: 1.0625rem;
  --font-size-sm: 0.875rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;

  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-black: 800;

  /* --- PALETA PREMIUM --- */
  --secondary: #8b5cf6;
  --secondary-gradient: linear-gradient(135deg, #8b5cf6, #a78bfa);

  --color-background: #0a0c10;
  --color-background-elevated: #12151c;
  --color-background-soft: #191e28;
  --color-surface: #151a24;
  --color-surface-hover: #1e2532;
  --color-surface-border: rgba(255, 255, 255, 0.04);

  --color-text: #f1f3f5;
  --color-text-secondary: #9aa4b5;
  --color-text-tertiary: #5f6b7f;
  --color-text-inverse: #0a0c10;

  --color-border: rgba(255, 255, 255, 0.05);
  --color-border-hover: rgba(255, 255, 255, 0.10);
  --color-border-glow: rgba(249, 115, 22, 0.15);

  /* --- ESPACIADO DE TEXTO --- */
  --space-text-xs: 4px;
  --space-text-sm: 10px;
  --space-text-md: 18px;
  --space-text-lg: 28px;
  --space-text-xl: 38px;

  /* --- PROPORCIÓN DE PÁRRAFOS --- */
  --paragraph-gap: 0.65em;
  --paragraph-line-height: 1.75;
  --paragraph-font-size: 1.0625rem;

  /* --- LEAD PARAGRAPH --- */
  --lead-font-size: 1.1875rem;
  --lead-font-weight: var(--font-weight-medium);

  /* --- SOMBRAS PREMIUM --- */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.65);
  --shadow-2xl: 0 24px 80px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 60px rgba(249, 115, 22, 0.12);
  --shadow-glow-strong: 0 0 80px rgba(249, 115, 22, 0.20);

  /* --- RADIOS PREMIUM --- */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-2xl: 36px;
  --radius-full: 9999px;

  /* --- ESPACIADO GENERAL --- */
  --spacing-xs: 4px;
  --spacing-sm: 10px;
  --spacing-md: 18px;
  --spacing-lg: 28px;
  --spacing-xl: 38px;
  --spacing-2xl: 52px;
  --spacing-3xl: 72px;
  --spacing-4xl: 70px;
  --spacing-5xl: 128px;

  --container-max: 1120px;
  --container-padding: 44px;

  /* --- TRANSICIONES --- */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);


  /* --- TOKENS SEMÁNTICOS DE COMPONENTES --- */

  /* Secciones */
  --section-padding-block: var(--spacing-4xl);

  /* Tarjetas de servicios */
  --service-card-padding: var(--spacing-xl);
  --service-card-radius: var(--radius-lg);
  --service-card-background: var(--color-surface);
  --service-card-border: 1px solid var(--color-border);
  --service-card-shadow: none;
  --service-card-hover-shadow: var(--shadow-lg);
  --service-card-hover-border-color: var(--color-border-hover);
  --service-card-hover-translate-y: -6px;

  /* Íconos y textos de servicios */
  --service-icon-size: 2.5rem;
  --service-icon-margin-bottom: var(--spacing-lg);
  --service-title-size: 1.25rem;
  --service-title-weight: var(--font-weight-black);
  --service-title-margin-bottom: var(--spacing-md);
  --service-description-color: var(--color-text-secondary);
  --service-description-line-height: 1.7;

  /* Variante lista */
  --service-list-padding: var(--spacing-xl);
  --service-list-radius: var(--radius-lg);
  --service-list-background: var(--color-surface);
  --service-list-border: 1px solid var(--color-border);
  --service-list-hover-translate-x: var(--spacing-sm);
  --service-list-hover-shadow: var(--shadow-md);

  /* Variante split */
  --service-split-content-padding: var(--spacing-xl);
  --service-split-radius: var(--radius-lg);
  --service-split-background: var(--color-surface);
  --service-split-border: 1px solid var(--color-border);
  --service-split-image-height: 280px;
  --service-split-image-ratio: 16 / 9;

  /* --- TOKENS HERO --- */
  --hero-title-weight: var(--font-weight-black);
  --hero-title-transform: uppercase;
  --hero-title-letter-spacing: -0.03em;
  --hero-title-max-size: 3rem;
  --hero-claim-weight: var(--font-weight-regular);
  --hero-claim-color: var(--color-text-secondary);
  --hero-image-radius: var(--radius-lg);
  --hero-image-border: 1px solid var(--color-border);
  --hero-image-shadow: none;
  --hero-split-gap: var(--spacing-2xl);
  --hero-overlay-background: linear-gradient(to top, rgba(15, 17, 21, 0.85) 0%, rgba(15, 17, 21, 0.3) 50%, rgba(15, 17, 21, 0.1) 100%);

  /* --- TOKENS ABOUT --- */
  --about-section-padding: var(--spacing-4xl);
  --about-grid-gap: var(--spacing-2xl);
  --about-image-height: 380px;
  --about-image-radius: var(--radius-lg);
  --about-image-shadow: none;
  --about-image-hover-scale: 1.02;
  --about-content-max-width: 680px;

  /* --- TOKENS CREDENTIALS / FORMACIÓN --- */
  --credentials-section-padding: var(--spacing-4xl);
  --credential-card-padding: var(--spacing-xl);
  --credential-card-radius: var(--radius-lg);
  --credential-card-background: var(--color-surface);
  --credential-card-border: 1px solid var(--color-border);
  --credential-card-shadow: none;
  --credential-card-hover-shadow: var(--shadow-lg);
  --credential-card-hover-border-color: var(--color-border-hover);
  --credential-card-hover-translate-y: -6px;
  --credential-title-size: 1.1rem;
  --credential-title-weight: var(--font-weight-black);
  --credential-description-color: var(--color-text-secondary);
  --credential-description-size: 0.875rem;
  --credential-description-line-height: 1.7;
  --credential-timeline-number-weight: var(--font-weight-black);
  --credential-compact-hover-indent: var(--spacing-md);

  /* --- TOKENS HERO FULL / STATS --- */
  --hero-full-bottom-gap: 0px;
  --hero-full-overlay-mobile:
    linear-gradient(
      0deg,
      rgba(15, 17, 21, 0.92),
      rgba(15, 17, 21, 0.34) 58%,
      rgba(15, 17, 21, 0.18)
    );
  --hero-full-content-color: var(--color-text);
  --hero-full-claim-color: var(--color-text-secondary);
  --hero-full-text-shadow: none;

  /* --- TOKENS STATS --- */
  --stats-section-margin-top: -30px;
  --stats-section-padding-bottom: var(--spacing-3xl);
  --stats-grid-gap: var(--spacing-md);
  --stats-card-padding: var(--spacing-lg) var(--spacing-md);
  --stats-card-radius: var(--radius-md);
  --stats-card-background: var(--color-surface);
  --stats-card-border: 1px solid var(--color-border);
  --stats-card-shadow: none;
  --stats-card-hover-shadow: var(--shadow-md);
  --stats-card-hover-border-color: var(--color-border-hover);
  --stats-card-hover-translate-y: -4px;
  --stats-number-color: var(--primary);
  --stats-number-gradient: var(--primary-gradient);
  --stats-number-use-gradient: 1;
  --stats-number-weight: var(--font-weight-black);
  --stats-number-size: clamp(1.8rem, 3.5vw, 3rem);
  --stats-label-color: var(--color-text-secondary);
  --stats-label-weight: var(--font-weight-medium);
  --stats-label-size: 0.8rem;

  /* --- TOKENS GALLERY --- */
  --gallery-section-padding: var(--spacing-4xl);
  --gallery-header-width: 680px;
  --gallery-slide-radius: var(--radius-lg);
  --gallery-slide-background: var(--color-surface);
  --gallery-slide-border: 1px solid var(--color-border);
  --gallery-slide-shadow: none;
  --gallery-slide-hover-shadow: none;
  --gallery-slide-hover-border-color: var(--color-border-hover);
  --gallery-slide-hover-scale: 1.03;
  --gallery-arrow-size: 44px;
  --gallery-arrow-background: var(--color-surface);
  --gallery-arrow-border: 1px solid var(--color-border);
  --gallery-arrow-shadow: var(--shadow-md);
  --gallery-arrow-radius: var(--radius-full);
  --gallery-dot-color: var(--color-text-tertiary);
  --gallery-dot-active-color: var(--primary);

  /* --- TOKENS HEADER --- */
  --header-padding-block: 18px;
  --header-background: rgba(15, 17, 21, 0.72);
  --header-background-scrolled: rgba(15, 17, 21, 0.92);
  --header-border: 1px solid var(--color-border);
  --header-shadow-scrolled: var(--shadow-md);
  --header-backdrop-blur: 16px;
  --header-nav-gap: var(--spacing-xl);
  --header-link-color: var(--color-text-secondary);
  --header-link-hover-color: var(--color-text);
  --header-link-weight: var(--font-weight-medium);
  --header-link-underline-height: 2px;
  --header-logo-weight: var(--font-weight-black);
  --header-logo-letter-spacing: 0.08em;

  /* --- TOKENS CONTACTO --- */
  --contact-section-padding: var(--spacing-4xl);
  --contact-grid-gap: var(--spacing-3xl);
  --contact-image-min-height: 320px;
  --contact-image-radius: var(--radius-lg);
  --contact-image-border: 1px solid var(--color-border);
  --contact-image-background: var(--color-surface);
  --contact-image-hover-scale: 1.02;

  --contact-card-padding: var(--spacing-2xl);
  --contact-card-radius: var(--radius-lg);
  --contact-card-background: var(--color-surface);
  --contact-card-border: 1px solid var(--color-border);
  --contact-card-shadow: none;

  --contact-detail-padding: 0;
  --contact-detail-radius: 0;
  --contact-detail-background: transparent;
  --contact-detail-border: 0;
  --contact-detail-shadow: none;

  --contact-secondary-radius: var(--radius-full);
  --contact-secondary-background: transparent;
  --contact-secondary-border: 1px solid var(--color-border);

  /* --- TOKENS FOOTER --- */
  --footer-padding-block: 14px;
  --footer-background: var(--color-background);
  --footer-border: 1px solid var(--color-border);
  --footer-name-weight: var(--font-weight-semibold);
  --footer-identity-size: 0.9rem;
  --footer-copy-size: 0.8rem;
  --footer-content-gap: var(--spacing-md);

  /* --- Z-INDEX --- */
  --z-header: 20;
  --z-overlay: 10;
  --z-dropdown: 30;
  --z-modal: 40;
  --z-tooltip: 50;
}

/* ==========================================================
   3. BASE
========================================================== */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  background-color: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(249, 115, 22, 0.03), transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.02), transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(249, 115, 22, 0.02), transparent 40%);
}

/* --- SELECTION --- */
::selection {
  background-color: var(--primary);
  color: #fff;
}

::-moz-selection {
  background-color: var(--primary);
  color: #fff;
}

/* --- SCROLLBAR PREMIUM --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-background);
}

::-webkit-scrollbar-thumb {
  background: var(--color-text-tertiary);
  border-radius: var(--radius-full);
  transition: background var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* --- IMAGENES --- */
img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  vertical-align: middle;
}

/* --- LINKS PREMIUM --- */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}

a:not([class]) {
  color: var(--primary);
  font-weight: var(--font-weight-medium);
  position: relative;
}

a:not([class])::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--primary-gradient);
  transition: width var(--transition-base);
}

a:not([class]):hover::after {
  width: 100%;
}

a:not([class]):hover {
  color: var(--primary-hover);
}

/* --- LISTAS --- */
ul,
ol {
  list-style: none;
}

/* --- TIPOGRAFÍA BASE PREMIUM --- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-black);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--color-text);
}

/* ==========================================================
   TIPOGRAFÍA BASE PREMIUM - AJUSTADA
========================================================== */

h1 {
  font-size: clamp(2rem, 3.2vw, 3rem);
}

h2 {
  font-size: clamp(1.6rem, 2.2vw, 1.7rem);
}

h3 {
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
}

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

/* ==========================================================
   4. LAYOUT
========================================================== */
.container {
  width: min(100% - var(--container-padding), var(--container-max));
  margin: 0 auto;
}

.section {
  padding: var(--spacing-4xl) 0;
  position: relative;
}

/* --- DECORACIÓN DE SECCIÓN (línea sutil) --- */
.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  opacity: 0.3;
}

.section:first-of-type::before {
  display: none;
}

/* ==========================================================
   5. CLASES GLOBALES DE TEXTO (PREMIUM)
========================================================== */

/* --- EYEBROW PREMIUM --- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: var(--font-weight-black);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  margin-bottom: var(--space-text-sm);
  opacity: 0.85;
  position: relative;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
}

.eyebrow::after {
  content: "";
  display: inline-block;
  width: 20px;
  height: 2px;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
}

/* --- TÍTULOS PREMIUM --- */
.section-title {
  margin-bottom: var(--space-text-md);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: var(--font-weight-black);
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: var(--color-text);
  position: relative;
}

.section-title .highlight {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title + * {
  margin-top: 0;
}

/* --- PÁRRAFOS PREMIUM --- */
.paragraphs {
  display: flex;
  flex-direction: column;
  gap: var(--paragraph-gap);
}

.paragraphs p {
  line-height: var(--paragraph-line-height);
  font-size: var(--paragraph-font-size);
  color: var(--color-text-secondary);
}

.paragraphs .lead {
  font-size: var(--lead-font-size);
  font-weight: var(--lead-font-weight);
  color: var(--color-text);
  opacity: 0.92;
}

.paragraphs .lead + p {
  margin-top: var(--space-text-sm);
}

/* --- BLOQUE DE TEXTO COMPLETO --- */
.text-block {
  max-width: 680px;
}

.text-block .eyebrow {
  margin-bottom: var(--space-text-sm);
}

.text-block .section-title {
  margin-bottom: var(--space-text-md);
}

.text-block .paragraphs {
  margin-top: 0;
}

/* ==========================================================
   6. ANIMACIONES
   Sistema único basado en IntersectionObserver + .is-visible
========================================================== */

:root {
  --reveal-distance: 30px;
  --reveal-distance-large: 60px;
  --reveal-distance-horizontal: 40px;
  --reveal-scale: 0.92;
  --reveal-duration: 0.7s;
  --reveal-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/*
 * Las clases se declaran más abajo, junto al sistema .is-visible.
 * En esta sección quedan únicamente los tokens compartidos.
 */

/* ==========================================================
   7. BOTONES PREMIUM
========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  min-height: 50px;
  padding: 0 var(--spacing-xl);
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  user-select: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* --- Efecto de brillo en hover --- */
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transition: left var(--transition-slow);
}

.btn:hover::before {
  left: 100%;
}

/* --- PRIMARY --- */
.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 24px rgba(249, 115, 22, 0.30);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 40px rgba(249, 115, 22, 0.45);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

/* --- SECONDARY --- */
.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--color-border-hover);
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-md);
}

/* --- HEADER --- */
.btn-header {
  background: var(--primary-gradient);
  color: #fff;
  min-height: 40px;
  padding: 0 var(--spacing-lg);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.25);
}

.btn-header:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 30px rgba(249, 115, 22, 0.35);
}

/* ==========================================================
   8. CARDS PREMIUM
========================================================== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  position: relative;
}

.card::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-lg);
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition-base);
  z-index: -1;
  filter: blur(6px);
}

.card:hover::after {
  opacity: 0.5;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
}

/* ==========================================================
   9. UTILIDADES PREMIUM
========================================================== */
.text-muted {
  color: var(--color-text-secondary);
}

.text-center {
  text-align: center;
}

.text-balance {
  text-wrap: balance;
}

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

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

.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- MÁRGENES UTILITARIOS --- */
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }
.mt-2xl { margin-top: var(--spacing-2xl); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==========================================================
   10. SECTION HEADER (PREMIUM)
========================================================== */
.section-header {
  max-width: 680px;
  margin: 0 auto var(--spacing-3xl);
  text-align: center;
}

.section-header .eyebrow {
  margin-bottom: var(--space-text-sm);
}

.section-header .section-title {
  margin-bottom: var(--space-text-md);
}

.section-header p:not(.eyebrow):not(.section-title) {
  color: var(--color-text-secondary);
  font-size: var(--font-size-lg);
  line-height: 1.8;
  max-width: 560px;
  margin: 0 auto;
}

/* ==========================================================
   11. ANIMACIONES DE ENTRADA
   Único sistema del proyecto: estado inicial + .is-visible
========================================================== */

.animate-fade-in,
.animate-fade-up,
.animate-fade-down,
.animate-fade-left,
.animate-fade-right,
.animate-scale,
.animate-slide-up,
.animate-stagger > * {
  opacity: 0;
  transition:
    opacity var(--reveal-duration) var(--reveal-ease),
    transform var(--reveal-duration) var(--reveal-ease);
  will-change: opacity, transform;
}

.animate-fade-in,
.animate-fade-up,
.animate-stagger > * {
  transform: translateY(var(--reveal-distance));
}

.animate-fade-down {
  transform: translateY(
    calc(var(--reveal-distance) * -1)
  );
}

.animate-fade-left {
  transform: translateX(
    calc(var(--reveal-distance-horizontal) * -1)
  );
}

.animate-fade-right {
  transform: translateX(
    var(--reveal-distance-horizontal)
  );
}

.animate-scale {
  transform: scale(var(--reveal-scale));
}

.animate-slide-up {
  transform: translateY(
    var(--reveal-distance-large)
  );
}

.animate-fade-in.is-visible,
.animate-fade-up.is-visible,
.animate-fade-down.is-visible,
.animate-fade-left.is-visible,
.animate-fade-right.is-visible,
.animate-scale.is-visible,
.animate-slide-up.is-visible,
.animate-stagger.is-visible > * {
  opacity: 1;
  transform: none;
}

/* Stagger progresivo */
.animate-stagger > *:nth-child(1) {
  transition-delay: 0.05s;
}

.animate-stagger > *:nth-child(2) {
  transition-delay: 0.10s;
}

.animate-stagger > *:nth-child(3) {
  transition-delay: 0.15s;
}

.animate-stagger > *:nth-child(4) {
  transition-delay: 0.20s;
}

.animate-stagger > *:nth-child(5) {
  transition-delay: 0.25s;
}

.animate-stagger > *:nth-child(6) {
  transition-delay: 0.30s;
}

.animate-stagger > *:nth-child(7) {
  transition-delay: 0.35s;
}

.animate-stagger > *:nth-child(8) {
  transition-delay: 0.40s;
}

/* Delays manuales opcionales */
.delay-1 {
  transition-delay: 0.1s;
}

.delay-2 {
  transition-delay: 0.2s;
}

.delay-3 {
  transition-delay: 0.3s;
}

.delay-4 {
  transition-delay: 0.4s;
}

.delay-5 {
  transition-delay: 0.5s;
}

/* ==========================================================
   PRELOADER
========================================================== */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--color-background);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--color-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================================
   BACK TO TOP
========================================================== */
.back-to-top {
  position: fixed;
  bottom: var(--spacing-xl);
  right: var(--spacing-xl);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition-base);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  z-index: var(--z-tooltip);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--shadow-glow-strong);
}

@media (max-width: 850px) {
  .back-to-top {
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
}

/* ==========================================================
   12. RESPONSIVE 
========================================================== */
@media (max-width: 850px) {
  :root {
    --container-padding: 28px;
    --spacing-4xl: 64px;
    --spacing-5xl: 80px;
    --paragraph-font-size: 1rem;
    --lead-font-size: 1.0625rem;
    --font-size-base: 1rem;
  }

  .section-header {
    margin-bottom: var(--spacing-2xl);
    text-align: left;
  }

  .section-header p:not(.eyebrow):not(.section-title) {
    max-width: 100%;
    margin: 0;
  }

  .section-title {
    font-size: clamp(1.75rem, 5vw, 2.2rem);
  }

  .btn {
    min-height: 44px;
    padding: 0 var(--spacing-lg);
    font-size: 0.8125rem;
  }

  .btn-header {
    min-height: 38px;
    padding: 0 var(--spacing-md);
  }

  .eyebrow {
    font-size: 0.6rem;
  }

  .eyebrow::before,
  .eyebrow::after {
    width: 14px;
  }

  .text-block {
    max-width: 100%;
  }

  .section::before {
    width: 40px;
  }
}

@media (max-width: 480px) {
  :root {
    --container-padding: 20px;
    --spacing-4xl: 48px;
    --spacing-3xl: 48px;
    --paragraph-gap: 0.5em;
    --space-text-md: 14px;
  }

  .btn {
    min-height: 40px;
    padding: 0 var(--spacing-md);
    font-size: 0.75rem;
  }

  .section-title {
    font-size: clamp(1.5rem, 6vw, 1.8rem);
  }

  .eyebrow {
    font-size: 0.55rem;
    letter-spacing: 0.15em;
  }

  .eyebrow::before,
  .eyebrow::after {
    width: 10px;
  }

  .animate-stagger > *:nth-child(n) {
    transition-delay: 0s !important;
  }

  .section::before {
    width: 30px;
  }
}

/* ==========================================================
   13. PREFERS-REDUCED-MOTION (accesibilidad)
========================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-fade-in,
  .animate-fade-up,
  .animate-fade-down,
  .animate-fade-left,
  .animate-fade-right,
  .animate-scale,
  .animate-slide-up,
  .animate-stagger > * {
    opacity: 1 !important;
    transform: none !important;
  }
}

section[id] {
  scroll-margin-top: 90px;
}

.header-logo {
  display: block;
  width: auto;
  max-width: 150px;
  height: 38px;
  object-fit: contain;
}

.header.scrolled {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}