/**
 * HubCorzo - Design System Tokens (Brad Frost & Atomic Design)
 * Conforme a WCAG 2.2 AA (Ratios verificados sobre fondo #0A0F1F y fondos claros)
 */

:root {
  /* --- Superficies y Fondos --- */
  --bg-base:        #0A0F1F;
  --bg-surface:     #111A2E;
  --bg-elevated:    #1A2540;
  --bg-card:        rgba(17, 26, 46, 0.75);
  --border:         #1E293B;
  --border-focus:   #22D3EE;

  /* --- Textos y Contraste WCAG 2.2 AA --- */
  --text-primary:   #F1F5F9;  /* 17.4:1 ✓ AAA sobre #0A0F1F */
  --text-secondary: #CBD5E1;  /* 12.9:1 ✓ AAA sobre #0A0F1F */
  --text-muted:     #94A3B8;  /*  7.4:1 ✓ AA  sobre #0A0F1F */
  --text-subtle:    #64748B;  /*  4.0:1 (Solo decorativo o >= 24px) */

  /* --- Colores de Marca y Acción --- */
  --brand:          #25D366;  /* 9.6:1 sobre #0A0F1F */
  --on-brand:       #04140A;  /* 9.5:1 texto sobre botón verde */
  --brand-strong:   #16A34A;
  --brand-on-light: #15803D;  /* 5.0:1 texto sobre blanco puro */
  --accent:         #22D3EE;  /* 10.6:1 sobre #0A0F1F */
  --accent-on-light:#0E7490;  /* 5.4:1 texto sobre blanco puro */
  --gold:           #F59E0B;  /* 8.9:1 sobre #0A0F1F */
  --gold-on-light:  #B45309;  /* 5.0:1 sobre blanco puro */

  /* --- Tipografía Unificada (Inter) --- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --fs-xs:   0.8125rem; /* 13px - Notas legales */
  --fs-sm:   0.875rem;  /* 14px - Badges y etiquetas */
  --fs-base: 1rem;      /* 16px - CUERPO BASE */
  --fs-lg:   1.125rem;  /* 18px */
  --fs-xl:   1.375rem;  /* 22px - h4 */
  --fs-2xl:  1.75rem;   /* 28px - h3 */
  --fs-3xl:  2.25rem;   /* 36px - h2 sección */
  --fs-4xl:  3rem;      /* 48px - h2 portada */
  --fs-5xl:  3.75rem;   /* 60px - h1 portada */

  /* --- Sombras y Efectos --- */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --glow-brand: 0 0 24px rgba(37, 211, 102, 0.2);
  --glow-accent: 0 0 24px rgba(34, 211, 238, 0.2);

  /* --- Transiciones --- */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Contención de Desbordamiento Horizontal (Zero Horizontal Scroll) --- */
html, body {
  max-width: 100%;
  overflow-x: clip;
}

.ambient-orb-1,
.ambient-orb-2,
.ambient-light,
.ambient-glow,
canvas#sparkles {
  max-width: 100vw;
  overflow: hidden;
  pointer-events: none;
}

/* --- Utilidades Globales de Accesibilidad --- */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 16px;
  background: var(--brand);
  color: var(--on-brand);
  padding: 12px 24px;
  font-weight: 700;
  font-size: var(--fs-base);
  z-index: 99999;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 16px;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* --- Indicador de Foco Visible (WCAG 2.4.7) --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent) !important;
  outline-offset: 2px !important;
}

/* --- Tipografía Fluida de Titulares (clamp) --- */
h1, .hero-title {
  font-size: clamp(2rem, 1.25rem + 3.2vw, var(--fs-5xl));
  line-height: 1.1;
  letter-spacing: -0.025em;
}

/* --- Gradiente de Titular Unificado --- */
.text-gradient {
  background: linear-gradient(90deg, #22D3EE 0%, #25D366 100%) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  display: inline-block;
}

.nav-logo-text-strong {
  color: var(--brand);
}

.nav-logo-text-strong-light {
  color: var(--brand-on-light, #15803D);
}

/* --- Áreas Táctiles Mínimas 44x44px (WCAG 2.5.5 / 2.5.8) --- */
.touch-target,
.nav-link,
.mobile-link,
.footer a,
.btn-primary,
.btn-secondary,
.btn-ghost,
.accordion-header {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* --- Reglas Universales de Barra de Navegación (Xquads Design Squad) --- */
.nav-links a,
.nav-link,
.btn-nav,
.nav-tab-glow,
.nav-tab-semilla {
  white-space: nowrap !important;
}

/* --- Red de Seguridad sin JavaScript y Reducción de Movimiento --- */
@media (scripting: none) {
  .reveal, [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, [data-reveal] {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
