/* Fuentes locales — del kit de marca. [REVISAR]: coloca aquí los .woff2
   con licencia de uso web; mientras tanto el sitio usa el fallback del
   sistema definido en variables.css sin romper el layout. */
@font-face {
  font-family: 'Archivo Black';
  src: url('../fonts/archivo-black/ArchivoBlack-Regular.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/ibm-plex-sans/IBMPlexSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/ibm-plex-sans/IBMPlexSans-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono/IBMPlexMono-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono/IBMPlexMono-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* Evita que el nav sticky tape el destino al saltar a un ancla (#anos-despues,
   #comentarios, etc.) — el alto aproximado del nav son ~73px (padding + botón
   de 40px + borde). */
main [id] {
  scroll-margin-top: 88px;
}

body {
  margin: 0;
  background: var(--color-carbon);
  color: var(--color-hueso);
  font-family: var(--fuente-cuerpo);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Textura de grano — "el desgaste es bienvenido, el brillo no". Puro CSS,
   sin imagen ni petición extra: ruido SVG inline, opacidad mínima, decorativo. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Transición nativa entre páginas — progressive enhancement, sin JS ni librería. */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 240ms;
  animation-timing-function: ease;
}

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

a {
  color: var(--color-ambar);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 220ms ease;
}

a:hover,
a:focus-visible {
  background-size: 100% 1px;
}

/* Componentes con su propio feedback de hover (botón, nav, tarjetas) no
   necesitan el subrayado animado de los links de prosa. */
.nav__menu a,
.nav__marca,
.boton,
.card-ficha__enlace,
.card-serie,
.card-ver-serie {
  background-image: none;
}

:focus-visible {
  outline: 2px solid var(--color-ambar);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--fuente-titular);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.1;
  margin: 0 0 var(--espacio-2);
  color: var(--color-hueso);
}

h1 {
  font-size: clamp(2.25rem, 5vw + 1rem, 4rem);
}

h2 {
  font-size: clamp(1.75rem, 3vw + 1rem, 2.5rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 var(--espacio-2);
  max-width: 65ch;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

table {
  border-collapse: collapse;
  width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sin-scroll {
  overflow: hidden;
}

.punto-ambar {
  color: var(--color-ambar);
}

.mono {
  font-family: var(--fuente-mono);
}

.texto-tenue {
  color: var(--color-hueso-tenue);
}

.contenido-angosto {
  max-width: 65ch;
}

/* Scroll-reveal — activado por assets/js/motion.js vía IntersectionObserver.
   Sin JS o con prefers-reduced-motion, el contenido queda visible de inmediato. */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.grid-fichas .reveal:nth-child(2),
.grid-series .reveal:nth-child(2) {
  transition-delay: 70ms;
}

.grid-fichas .reveal:nth-child(3),
.grid-series .reveal:nth-child(3) {
  transition-delay: 140ms;
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }
}
