/* ============================================================
   THM — Base Styles
   Estilos globales: body, tipografía, selección, scrollbar.
   ============================================================ */

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ----------------------------------------------------------
   TIPOGRAFÍA GLOBAL
   ---------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
}

h1 { font-size: clamp(var(--text-4xl), 6vw, var(--text-7xl)); }
h2 { font-size: clamp(var(--text-3xl), 4vw, var(--text-5xl)); }
h3 { font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl)); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

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

strong {
  font-weight: var(--weight-semibold);
  color: var(--color-text-primary);
}

/* ----------------------------------------------------------
   GRADIENTE EN TEXTO (utility)
   ---------------------------------------------------------- */
.text-gradient {
  background: var(--color-accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ----------------------------------------------------------
   SELECCIÓN DE TEXTO
   ---------------------------------------------------------- */
::selection {
  background-color: rgba(79, 70, 229, 0.4);
  color: var(--color-text-primary);
}

/* ----------------------------------------------------------
   SCROLLBAR PERSONALIZADA (Chrome/Edge/Safari)
   ---------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-accent-1);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-2);
}

/* ----------------------------------------------------------
   FOCUS VISIBLE (Accesibilidad)
   ---------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--color-accent-2);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ----------------------------------------------------------
   BOTONES BASE
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

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

.btn-primary {
  background: var(--color-accent-grad);
  color: #fff;
  border: none;
  box-shadow: var(--glow-accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-accent-lg);
}

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

.btn-ghost {
  background: var(--glass-bg);
  color: var(--color-text-primary);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
}

.btn-ghost:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-hover);
  transform: translateY(-1px);
}

/* ----------------------------------------------------------
   SECTION BASE
   ---------------------------------------------------------- */
.section {
  padding: var(--space-24) 0;
  position: relative;
}

@media (max-width: 1024px) {
  .section {
    padding: var(--space-16) 0;
  }
}

@media (max-width: 640px) {
  .section {
    padding: var(--space-12) 0;
  }
}

/* ----------------------------------------------------------
   BADGE
   ---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--glass-bg);
  color: var(--color-text-muted);
}

.badge--accent {
  border-color: rgba(79, 70, 229, 0.4);
  background: rgba(79, 70, 229, 0.1);
  color: var(--color-accent-2);
}

/* SVG icons inside badges inherit the badge color */
.badge svg {
  flex-shrink: 0;
  color: inherit;
}

/* ----------------------------------------------------------
   SECTION HEADER (reutilizable)
   ---------------------------------------------------------- */
.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-16);
}

.section-header .badge {
  margin-bottom: var(--space-4);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

/* ----------------------------------------------------------
   SEPARADOR DECORATIVO
   ---------------------------------------------------------- */
.divider {
  width: 60px;
  height: 2px;
  background: var(--color-accent-grad);
  border-radius: var(--radius-full);
  margin: var(--space-4) auto 0;
}

/* ----------------------------------------------------------
   VISIBILIDAD (para animaciones de reveal)
   ---------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

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

/* Fallback si JS no carga */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
  }
}
