/*
 * BIOtime-iscom · base: reinicio mínimo, tipografía, foco, iconos y utilidades.
 * Los colores y medidas salen SIEMPRE de tokens.css.
 */

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--fuente);
  font-size: var(--texto-m);
  line-height: var(--interlinea);
  color: var(--color-texto);
  background: var(--color-fondo);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

/* Hay una capa abierta encima (modal, panel, cajón): la página de atrás no se desplaza. */
body.sin-desplazar {
  overflow: hidden;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
  margin: 0;
}

h1, h2, h3, h4 {
  line-height: var(--interlinea-titulo);
  font-weight: var(--peso-fuerte);
  text-wrap: balance;
}

h1 { font-size: var(--texto-2xl); }
h2 { font-size: var(--texto-xl); }
h3 { font-size: var(--texto-l); }
h4 { font-size: var(--texto-m); }

ul, ol {
  padding: 0;
  list-style: none;
}

a {
  color: var(--color-primario-texto);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* `hidden` manda siempre, aunque el componente defina su propio `display`. */
[hidden] {
  display: none !important;
}

/* ── Foco: visible para teclado, discreto para ratón ── */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-foco);
  outline-offset: 2px;
  border-radius: var(--radio-1);
}

/* Títulos y contenedores que reciben foco por programa (al navegar) no necesitan el anillo. */
[tabindex="-1"]:focus-visible {
  outline: none;
}

::selection {
  background: color-mix(in srgb, var(--color-primario) 28%, transparent);
}

/* ── Iconos (ui/iconos.js) ── */
.icono {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

.icono .relleno {
  fill: currentColor;
  stroke: none;
}

/* ── Utilidades ── */
.solo-lectores {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.texto-suave { color: var(--color-texto-suave); }
.texto-tenue { color: var(--color-texto-tenue); }
.texto-chico { font-size: var(--texto-s); }
.texto-fuerte { font-weight: var(--peso-fuerte); }
.sin-salto { white-space: nowrap; }

.mono {
  font-family: var(--fuente-mono);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}

.pila {
  display: flex;
  flex-direction: column;
  gap: var(--esp-4);
}

.pila--chica { gap: var(--esp-2); }
.pila--grande { gap: var(--esp-6); }

.fila {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--esp-3);
}

.fila--separada { justify-content: space-between; }
.fila--fin { justify-content: flex-end; }

.rejilla-2,
.rejilla-3 {
  display: grid;
  gap: var(--esp-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}

.rejilla-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}

.tecla {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 6px;
  font-family: var(--fuente);
  font-size: var(--texto-xs);
  line-height: 1.5;
  text-align: center;
  color: var(--color-texto-suave);
  background: var(--color-superficie-2);
  border: 1px solid var(--color-borde);
  border-bottom-width: 2px;
  border-radius: var(--radio-1);
}

/* Pantalla de arranque, mientras llega el primer «¿quién soy?». */
.arranque {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  color: var(--color-texto-tenue);
}

.sin-script {
  max-width: 480px;
  margin: 20vh auto;
  padding: var(--esp-6);
  text-align: center;
}

/* ── Menos movimiento para quien lo pide ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

