/* base.css · reinicio, tipografía, botones, foco y utilidades.
   El contenido se muestra sin JavaScript; cada mejora tiene su propia bandera de disponibilidad. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  letter-spacing: var(--tr-body);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100svh;
}

img, svg, video { display: block; max-width: 100%; }
img, video { height: auto; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, figure, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
[hidden] { display: none !important; }
/* la selección de texto va en tinta, como los botones de la página: el rojo solo vive en el panel y en el emblema */
::selection { background: var(--text); color: var(--bg); }

/* foco: siempre visible con teclado, nunca con el clic */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; left: 12px; top: 12px; z-index: 100;
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 16px; border-radius: var(--r-pill);
  background: var(--text); color: var(--bg);
  font-size: var(--fs-ui); font-weight: 500; line-height: 1.25;
  transform: translateY(calc(-100% - 24px));
  transition: transform var(--t-hover) var(--ease-ui);
}
.skip:focus-visible { transform: none; }

/* ── composición ── */
.contenedor { width: min(100% - 2 * var(--margen), var(--container)); margin-inline: auto; }

/* ── tipografía ── */
.display, .h2, .h3 { font-weight: 500; }
.display, .h2 { word-spacing: 0.05em; }
.display { font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: var(--tr-display); text-wrap: balance; }
.h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: var(--tr-h2); text-wrap: balance; }
.h3, .h2--menor { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--tr-h3); text-wrap: balance; }
.lead { font-size: var(--fs-lead); line-height: var(--lh-lead); letter-spacing: var(--tr-lead); color: var(--muted); max-width: 36rem; }
.nota, .rotulo { font-size: var(--fs-nota); line-height: var(--lh-nota); letter-spacing: 0; color: var(--muted); }
p, dd, li { text-wrap: pretty; }
b, strong { font-weight: 600; }
.nw { white-space: nowrap; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* ── botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 16px; border-radius: var(--r-pill);
  font-size: var(--fs-ui); font-weight: 500; line-height: 1; letter-spacing: 0; white-space: nowrap;
  transition: background-color var(--t-hover) var(--ease-ui);
}
.btn { gap: 8px; }
.btn__marca { width: 18px; height: 18px; flex: none; }
.btn--lg { height: 48px; padding: 0 24px; font-size: var(--fs-body); }
.btn--tinta { background: var(--btn-ink-bg); color: var(--btn-ink-fg); }
.btn--contorno { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
@media (hover: hover) { .btn--contorno:hover { background: var(--control); } }
@media (hover: hover) { .btn--tinta:hover { background: var(--btn-ink-hover); } }

/* botón de texto: Pausar, Continuar, Ver de nuevo, Reproducir */
.btn-texto {
  display: inline-flex; align-items: center; min-height: 28px;
  font-size: var(--fs-ui); font-weight: 500; line-height: var(--lh-ui); letter-spacing: 0; color: var(--text);
  text-underline-offset: 3px; text-decoration-thickness: 1px;
}
@media (hover: hover) { .btn-texto:hover { text-decoration-line: underline; } }

/* botón de tema */
.btn-icono {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-pill);
  color: var(--text);
  transition: color var(--t-hover) var(--ease-ui);
}
.btn-icono svg { width: 20px; height: 20px; }
@media (hover: hover) { .btn-icono:hover { color: color-mix(in srgb, var(--text) 60%, transparent); } }

/* con puntero táctil, todo lo que se pulsa mide al menos 44 px */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-texto { min-height: 44px; padding-inline: 8px; }
}

/* cambio de tema: fundido de 360 ms de toda la página */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 360ms; animation-timing-function: var(--ease-ui); }

/* movimiento reducido: nada de transiciones */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* enlace dentro de un párrafo: subrayado siempre visible */
.enlace { color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
@media (hover: hover) { .enlace:hover { text-decoration-thickness: 2px; } }

/* enlace suelto con objetivo de 44 px */
.enlace-bloque { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 4px; margin-inline: -4px; color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
