/* ==========================================================================
   DENTARO · BASE
   --------------------------------------------------------------------------
   Estilos globales que aplican a TODO el sitio:
     1. Fuentes autoalojadas
     2. Reset moderno
     3. Tipografía base
     4. Accesibilidad (foco visible, enlace de salto, texto solo para lectores)
     5. Utilidades de maquetación (contenedor, sección)
     6. Animación de aparición al hacer scroll
     7. Movimiento reducido
   Depende de: tokens.css
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. FUENTES
   Geist Variable (SIL Open Font License, ver /assets/fonts/LICENSE-Geist.txt).
   Autoalojada: no depende de Google Fonts y carga más rápido.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}


/* Geist Mono Variable: código, números y etiquetas técnicas. */
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}


/* --------------------------------------------------------------------------
   2. RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + var(--space-4)); /* Anclas no quedan bajo el header */
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-height: 100dvh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

img {
  height: auto;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}


/* --------------------------------------------------------------------------
   3. TIPOGRAFÍA BASE
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

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

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

h3 {
  font-size: var(--text-xl);
  letter-spacing: var(--tracking-snug);
  line-height: var(--leading-snug);
}

p {
  text-wrap: pretty;
}

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

::selection {
  background-color: var(--palette-blue-600);
  color: var(--color-button-text);
}


/* --------------------------------------------------------------------------
   4. ACCESIBILIDAD
   -------------------------------------------------------------------------- */

/* Foco visible solo al navegar con teclado; nunca se elimina sin reemplazo. */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Enlace "Saltar al contenido": oculto hasta recibir foco con Tab. */
.skip-link {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-skip);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--gradient-button);
  color: var(--color-button-text);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--duration-fast) var(--ease-out);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* Texto visible solo para lectores de pantalla. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}


/* --------------------------------------------------------------------------
   5. UTILIDADES DE MAQUETACIÓN
   -------------------------------------------------------------------------- */

/* Contenedor centrado con márgenes laterales seguros en móvil. */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-gutter);
}

/* Espaciado vertical estándar de cada sección. */
.section {
  padding-block: var(--space-section);
}

/* Encabezado de sección: título arriba, texto debajo (apilados). */
.section-head {
  display: grid;
  gap: var(--space-4);
  max-width: 44rem;
  margin-bottom: var(--space-12);
}

.section-head__lead {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  max-width: var(--measure);
}

/* Etiqueta pequeña sobre un título, con estilo de comentario de código.
   Máximo 1 cada 3 secciones. */
.eyebrow {
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.eyebrow::before {
  content: "// ";
  color: var(--color-text-muted);
}

/* Texto con el degradado de marca (usar solo en 1 o 2 palabras clave). */
.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Fondo con cuadrícula técnica, desvanecida hacia los bordes. */
.tech-grid {
  position: relative;
  isolation: isolate;
}

.tech-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%);
  pointer-events: none;
}


/* --------------------------------------------------------------------------
   6. APARICIÓN AL HACER SCROLL
   El JS (modules/reveal.js) agrega .is-pending a los [data-reveal] y la
   quita cuando entran en pantalla. Sin JS, todo se ve normal.
   -------------------------------------------------------------------------- */
[data-reveal].is-pending {
  opacity: 0;
  transform: translateY(24px);
}

[data-reveal] {
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
  transition-delay: calc(var(--reveal-index, 0) * 80ms);
}


/* --------------------------------------------------------------------------
   7. MOVIMIENTO REDUCIDO
   Respeta a quien pidió menos animación en su sistema operativo.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  [data-reveal].is-pending {
    opacity: 1;
    transform: none;
  }
}
