/* ============================================================
   CENTINELA SMART — base.css
   Reset universal, estilos base y clases de utilidad.
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  /* Evitar que el texto se escale en iOS al rotar */
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  /* Patrón sutil de cuadrícula para efecto de "interfaz técnica" */
  background-image:
    linear-gradient(rgba(0, 245, 212, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 212, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  overflow-x: hidden;
}

/* --- TIPOGRAFÍA BASE --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

/* Títulos de sección con acento cian */
h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-xl);
}

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

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

a:hover {
  color: white;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul, ol {
  list-style: none;
}

/* --- TEXTOS MONOESPACIADOS (estilo terminal) --- */
.mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--cyan);
  letter-spacing: 0.05em;
}

/* Etiqueta de sección (ej: "[ SERVICIOS ]") */
.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--cyan);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--cyan);
}

/* Línea decorativa bajo subtítulos */
.title-accent {
  display: inline-block;
  position: relative;
}

.title-accent::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}

/* --- CONTENEDOR PRINCIPAL --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* --- SECCIONES --- */
section {
  padding: var(--space-24) 0;
}

/* --- UTILIDADES --- */
.text-cyan    { color: var(--cyan); }
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.text-left    { text-align: left; }

/* Separador decorativo tipo "terminal" */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan-dim), transparent);
  margin: var(--space-8) 0;
}

/* --- ANIMACIONES DE ENTRADA (scroll reveal) ---
   Las clases .reveal se activan con JS cuando el elemento entra en pantalla.
   Por defecto están ocultas; cuando se añade la clase .visible se animan.
*/
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Variante: entrada desde la izquierda */
.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Variante: entrada desde la derecha */
.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* --- ACCESIBILIDAD --- */
/* Saltar al contenido principal (para lectores de pantalla y teclado) */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--cyan);
  color: var(--bg-deep);
  padding: var(--space-2) var(--space-4);
  font-weight: bold;
  z-index: 10000;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* Estilos de foco visibles para navegación por teclado */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Reducir movimiento para usuarios con preferencia de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, .reveal-left, .reveal-right {
    opacity: 1;
    transform: none;
  }
}

/* --- RESPONSIVE BASE --- */
@media (max-width: 768px) {
  h2 { font-size: var(--text-2xl); }
  section { padding: var(--space-16) 0; }
  .container { padding: 0 var(--space-4); }
}
