/* ==========================================================================
   DigitalFlow - Main Stylesheet (Base, Tokens, Layout & Typography)
   Diseño Visual UI Premium: Blanco Puro + Off-White + Azul Rey Oficial
   Anti-Slop Architecture · High-End Visual Agency Standard
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  /* ========================================================================
     1. PALETA DE COLORES Y ATMÓSFERA VISUAL
     ======================================================================== */
  
  /* Fondos Dominantes: Blanco Puro & Off-White Ultra Limpios */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f0f4f8;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-glass-card: rgba(255, 255, 255, 0.95);
  
  /* Identidad Primaria: Azul Rey Vibrante Oficial */
  --primary-royal: #0052ff;
  --primary-royal-hover: #0045d8;
  --primary-royal-active: #023ec7;
  --primary-royal-deep: #0a58ca;
  --primary-royal-subtle: rgba(0, 82, 255, 0.06);
  --primary-royal-tint: rgba(0, 82, 255, 0.12);
  --primary-royal-light: #eff4ff;

  /* Contrastes de Alto Impacto: Azul Marino Profundo de Élite */
  --bg-dark-contrast: #070e22;
  --bg-dark-surface: #0a1128;
  --bg-dark-card: #0f1836;
  --bg-dark-glass: rgba(7, 14, 34, 0.92);

  /* Acentos Eléctricos & Micro-Destellos Activos */
  --accent-cyan: #00b4d8;
  --accent-ice: #00d2ff;
  --accent-sky: #0284c7;
  --accent-emerald: #10b981;
  --accent-emerald-subtle: rgba(16, 185, 129, 0.12);
  --accent-amber: #f59e0b;
  --accent-danger: #ef4444;

  /* Tipografía y Contraste Impecable */
  --text-main: #070e22;         /* Azul marino ultra profundo para legibilidad total */
  --text-heading: #040816;
  --text-body: #1e293b;
  --text-muted: #475569;        /* Slate balanceado de alta gama */
  --text-dim: #64748b;
  --text-inverse: #ffffff;
  --text-inverse-muted: #cbd5e1;

  /* Bordes Nítidos de 1px Anti-Slop */
  --border-subtle: rgba(10, 88, 202, 0.09);
  --border-medium: rgba(10, 88, 202, 0.16);
  --border-strong: rgba(10, 88, 202, 0.28);
  --border-focus: #0052ff;
  --border-dark: rgba(255, 255, 255, 0.12);

  /* Sombras Multicapa Sutiles y Elegantes (Cero manchas turbias) */
  --shadow-xs: 0 1px 2px rgba(7, 14, 34, 0.04);
  --shadow-sm: 0 2px 8px rgba(7, 14, 34, 0.04), 0 1px 2px rgba(0, 82, 255, 0.03);
  --shadow-md: 0 10px 25px -4px rgba(7, 14, 34, 0.06), 0 4px 10px -2px rgba(0, 82, 255, 0.04);
  --shadow-lg: 0 20px 40px -8px rgba(7, 14, 34, 0.08), 0 8px 16px -4px rgba(0, 82, 255, 0.05);
  --shadow-xl: 0 30px 60px -12px rgba(7, 14, 34, 0.11), 0 12px 24px -6px rgba(0, 82, 255, 0.07);
  --shadow-royal: 0 10px 28px -4px rgba(0, 82, 255, 0.28);
  --shadow-royal-hover: 0 18px 38px -4px rgba(0, 82, 255, 0.38);
  --shadow-inner: inset 0 1px 1px rgba(255, 255, 255, 0.9);

  /* Gradientes de Autor (Prohibidos gradientes morados genéricos) */
  --gradient-brand: linear-gradient(135deg, #0052ff 0%, #0a58ca 100%);
  --gradient-brand-vibrant: linear-gradient(135deg, #0052ff 0%, #0070f3 55%, #00d2ff 100%);
  --gradient-royal-subtle: linear-gradient(180deg, #eff4ff 0%, #ffffff 100%);
  --gradient-glow: linear-gradient(135deg, rgba(0, 82, 255, 0.08) 0%, rgba(0, 210, 255, 0.05) 100%);
  --gradient-card: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  --gradient-text: linear-gradient(135deg, #070e22 20%, #0a58ca 100%);
  --gradient-text-accent: linear-gradient(135deg, #0052ff 0%, #0a58ca 50%, #00b4d8 100%);

  /* ========================================================================
     2. TIPOGRAFÍA Y ESCALAS
     ======================================================================== */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', sans-serif;

  /* Radios de Borde (Doppelrand / Doble Bisel) */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Físicas de Animación y Transición (Mass & Spring Cubic-Bezier) */
  --transition-fast: 160ms cubic-bezier(0.32, 0.72, 0, 1);
  --transition-normal: 280ms cubic-bezier(0.32, 0.72, 0, 1);
  --transition-smooth: 520ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-max-width: 1240px;
  --header-height: 80px;
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  color-scheme: light;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  /* Fondo sutil off-white ultra limpio con micro-destellos de azul rey */
  background-image: 
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(0, 82, 255, 0.045), transparent 70%),
    radial-gradient(circle at 95% 30%, rgba(0, 210, 255, 0.03), transparent 45%),
    radial-gradient(circle at 5% 70%, rgba(0, 82, 255, 0.035), transparent 50%);
  background-attachment: fixed;
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
  width: 9px;
}

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

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-secondary);
}

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

::selection {
  background-color: var(--primary-royal);
  color: #ffffff;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

ul, ol {
  list-style: none;
}

/* ==========================================================================
   Typography Scale
   ========================================================================== */

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

h1 {
  font-size: clamp(2.5rem, 5.2vw + 1rem, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.038em;
  line-height: 1.08;
}

h2 {
  font-size: clamp(2rem, 3.5vw + 0.5rem, 3.1rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h3 {
  font-size: clamp(1.35rem, 2vw + 0.4rem, 1.85rem);
  letter-spacing: -0.02em;
}

h4 {
  font-size: 1.25rem;
}

p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.text-gradient {
  background: var(--gradient-text-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-gradient-silver {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-cyan {
  color: var(--accent-cyan);
}

.text-blue {
  color: var(--primary-royal);
}

.text-lead {
  font-size: 1.25rem;
  color: var(--text-body);
  font-weight: 400;
  line-height: 1.6;
}

/* ==========================================================================
   Layout Containers & Grids
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.section {
  padding: 7rem 0;
  position: relative;
}

@media (max-width: 768px) {
  .section {
    padding: 4.75rem 0;
  }
}

.section-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 3.5rem auto;
}

.section-header.text-left {
  text-align: left;
  margin-left: 0;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.785rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary-royal);
  background: var(--primary-royal-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.38rem 0.95rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
}

.section-title {
  margin-bottom: 1.25rem;
}

.section-description {
  font-size: 1.125rem;
  color: var(--text-muted);
}

/* Grillas Flexibles */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

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

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Accesibilidad & Utilidades Globales
   ========================================================================== */

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

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

.blur-spot {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}

.blur-spot-cyan {
  background: rgba(0, 210, 255, 0.08);
  width: 380px;
  height: 380px;
}

.blur-spot-blue {
  background: rgba(0, 82, 255, 0.08);
  width: 480px;
  height: 480px;
}

.blur-spot-purple {
  background: rgba(10, 88, 202, 0.06);
  width: 420px;
  height: 420px;
}

@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;
  }
}
