/* ============================================================
   DevLyon Web - Estilos base
   ============================================================
   Reset, tipografía, layout, secciones, utilidades.
   ============================================================ */

/* ── Reset moderno ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image: var(--gradient-bg-radial);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Tipografía ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--color-text);
}

h1 { font-size: clamp(2.5rem, 6vw, var(--fs-6xl)); }
h2 { font-size: clamp(2rem, 4vw, var(--fs-4xl)); }
h3 { font-size: clamp(1.5rem, 3vw, var(--fs-3xl)); }
h4 { font-size: var(--fs-xl); }

p {
  line-height: var(--lh-relaxed);
  color: var(--color-text-muted);
}

a {
  color: var(--color-purple-light);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-cyan);
}

code, pre {
  font-family: var(--font-mono);
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-3xl) 0;
  position: relative;
  z-index: var(--z-content);
}

.section--tight {
  padding: var(--space-2xl) 0;
}

/* ── Encabezados de sección ───────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-header__subtitle {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--color-green);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg-surface);
}

.section-header__title {
  font-size: clamp(2rem, 4vw, var(--fs-4xl));
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--space-sm);
}

.section-header__description {
  max-width: 600px;
  margin: 0 auto;
  color: var(--color-text-muted);
}

/* ── Grids ────────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: var(--space-md);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* ── Utilidades ───────────────────────────────────────────── */
.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); }
.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-purple { color: var(--color-purple-light); }
.text-blue { color: var(--color-blue); }
.text-green { color: var(--color-green); }
.text-muted { color: var(--color-text-muted); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.hidden { display: none !important; }

/* ── Skip link (accesibilidad) ────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-purple);
  color: white;
  padding: var(--space-sm) var(--space-md);
  border-radius: 0 0 var(--radius-md) 0;
  z-index: var(--z-modal);
  transition: top var(--duration-fast) var(--ease-out);
}

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

/* ── Scrollbar custom ─────────────────────────────────────── */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--color-purple-dark);
}

/* ── Selección de texto ───────────────────────────────────── */
::selection {
  background: var(--color-purple);
  color: white;
}

/* ── Focus visible (accesibilidad) ────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-cyan);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .grid--3, .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .section {
    padding: var(--space-2xl) 0;
  }
}
