/* ==========================================================================
   ESTILOS BASE, RESET Y TIPOGRAFÍA (DARK MODE)
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-page);
  color-scheme: dark;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-secondary);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

main {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  overflow-x: clip;
}

/* Selección de texto */
::selection {
  background-color: rgba(56, 189, 248, 0.3);
  color: #ffffff;
}

/* Enlaces e imágenes */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

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

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

button {
  cursor: pointer;
}

ul, ol {
  list-style: none;
}

/* Encabezados y Tipografía */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.22;
}

h3 {
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 600;
}

p {
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

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

/* Contenedor central */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* Secciones */
.section {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
  position: relative;
}

.section--subtle {
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section--dark {
  background-color: var(--bg-page);
  color: var(--text-secondary);
}

/* Cabeceras de Sección Centradas */
.section-header {
  text-align: center;
  max-width: 820px;
  margin: 0 auto var(--space-12);
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.35rem 0.9rem;
  background-color: var(--color-primary-subtle);
  color: var(--color-primary-light);
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-3);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.section-tag--accent {
  background-color: var(--color-accent-subtle);
  color: var(--color-accent-hover);
  border-color: rgba(245, 158, 11, 0.3);
}

.section-title {
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.section-description {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Resaltado de texto */
.text-highlight {
  color: var(--color-primary-light);
  position: relative;
}

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

/* Enfoque accesible */
:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 2px;
}
