/* Tokens · noche de concreto, tinta clara y una retícula de un píxel. Sin acento de color. */

@font-face {
  font-family: "Instrument Serif";
  src: url("../assets/fonts/instrument-serif-400-normal-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../assets/fonts/instrument-serif-400-italic-latin.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Cabinet Grotesk";
  src: url("../assets/fonts/cabinet-grotesk-800.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Cabinet Grotesk";
  src: url("../assets/fonts/cabinet-grotesk-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("../assets/fonts/general-sans-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
/* Tokens · noche de concreto, tinta clara y una retícula de un píxel. Sin acento de color. */

@font-face {
  font-family: "Instrument Serif";
  src: url("../assets/fonts/instrument-serif-400-normal-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../assets/fonts/instrument-serif-400-italic-latin.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Cabinet Grotesk";
  src: url("../assets/fonts/cabinet-grotesk-800.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Cabinet Grotesk";
  src: url("../assets/fonts/cabinet-grotesk-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("../assets/fonts/general-sans-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "General Sans";
  src: url("../assets/fonts/general-sans-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  /* Color: modo noche. «papel» es el fondo y «tinta» lo que se dibuja encima. */
  --papel: #0B0B0C;
  --papel-2: #121211;        /* superficies elevadas: tarjetas y ficha */
  --tinta: #F2F0EA;
  --gris: #77776F;           /* líneas, marcas y texto grande */
  --gris-texto: #A3A39C;     /* metadatos en tamaño pequeño (7,9:1 sobre el fondo, AA) */
  --linea: #171716;          /* retícula */
  --linea-media: #2C2C2A;    /* cajas wireframe */

  /* Tipografía */
  --f-display: "Cabinet Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --f-titular: "General Sans", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "General Sans", "Helvetica Neue", Arial, sans-serif;

  --t-display: clamp(4.5rem, min(13vw, 21svh), 17rem);
  --t-titulo: clamp(3rem, 8vw, 8rem);
  --t-sub: clamp(1.375rem, 2vw, 1.875rem);
  --t-frase: clamp(1.375rem, 2.6vw, 2.5rem);
  --t-cuerpo: 1.0625rem;
  --t-meta-g: 0.75rem;
  --t-meta: 0.6875rem;      /* 11 px */
  --t-mono: 0.8125rem;      /* 13 px */

  /* Retícula */
  --cols: 12;
  --margen: clamp(16px, 2.8vw, 40px);
  --medianil: clamp(12px, 1.6vw, 24px);
  --cab-alto: 56px;

  /* Ritmo */
  --u: 8px;
  --sala-pad: clamp(96px, 14vh, 176px);

  /* Movimiento */
  --ease: cubic-bezier(.2, .7, .1, 1);
}

@media (max-width: 760px) {
  :root { --cols: 4; --t-display: 25vw; --t-titulo: clamp(3rem, 15vw, 4.5rem); }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--papel);
  color: var(--tinta);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--cab-alto) + 16px);
}
html[data-movimiento="reducido"] { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--papel);
  font-family: var(--f-titular);
  font-size: var(--t-cuerpo);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--tinta); color: var(--papel); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

:focus-visible {
  outline: 2px solid var(--tinta);
  outline-offset: 3px;
}

img { max-width: 100%; height: auto; display: block; }

.saltar {
  position: fixed; left: var(--margen); top: 8px; z-index: 100;
  padding: 8px 12px; background: var(--tinta); color: var(--papel);
  font-family: var(--f-mono); font-size: var(--t-mono); text-decoration: none;
  transform: translateY(-200%);
}
.saltar:focus { transform: none; }

.visualmente-oculto {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Capas ------------------------------------------------------- */
#nube {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none; display: block;
}

.reticula {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  padding: 0 var(--margen);
  display: grid; grid-template-columns: repeat(var(--cols), 1fr);
  column-gap: var(--medianil);
}
.reticula span { border-left: 1px solid var(--linea); }
.reticula span:last-child { border-right: 1px solid var(--linea); }
.reticula span:nth-child(n + 5) { display: var(--col-extra, block); }
@media (max-width: 760px) {
  .reticula { --col-extra: none; }
  .reticula span:nth-child(4) { border-right: 1px solid var(--linea); }
}
