/* base.css — tipografías, colores y piezas comunes a la web y a la plataforma */
@font-face { font-family: 'CMU Serif'; src: url('/fonts/cmu-serif-500-roman.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'CMU Serif'; src: url('/fonts/cmu-serif-500-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'CMU Serif'; src: url('/fonts/cmu-serif-700-roman.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'CMU Serif'; src: url('/fonts/cmu-serif-700-italic.woff2') format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/fonts/ibm-plex-sans-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('/fonts/caveat-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  /* pizarrón */
  --pizarron: #17342d;
  --pizarron-hondo: #0f2620;
  --pizarron-claro: #1f4238;
  --tiza: #f4f0e6;
  --tiza-70: rgba(244, 240, 230, .72);
  --tiza-45: rgba(244, 240, 230, .45);
  --tiza-15: rgba(244, 240, 230, .15);
  --amarillo: #f6d95b;
  --coral: #f1896f;
  --celeste: #9fd2ee;
  /* cuaderno */
  --papel: #f7f3e9;
  --papel-hondo: #efe9da;
  --blanco: #fffdf8;
  --cuadro: #cfdbe8;
  --tinta: #1c3fae;
  --tinta-suave: #5670c4;
  --grafito: #1d2125;
  --grafito-70: rgba(29, 33, 37, .72);
  --grafito-45: rgba(29, 33, 37, .5);
  --grafito-12: rgba(29, 33, 37, .12);
  --rojo: #d2452f;
  --verde: #1f7a55;
  /* letras */
  --serif: 'CMU Serif', 'Latin Modern Roman', 'Times New Roman', serif;
  --sans: 'Plex', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --mano: 'Caveat', 'Bradley Hand', cursive;
  --radio: 14px;
  --margen: clamp(20px, 6.5vw, 100px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); font-size: 17px; line-height: 1.5; color: var(--grafito); background: var(--papel); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, canvas, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
h1, h2, h3, h4, p, figure, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* botones */
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 54px; padding: 0 26px; border-radius: 999px; font-weight: 600; font-size: 17px; text-decoration: none; white-space: nowrap; transition: transform .18s cubic-bezier(.2, .8, .2, 1), background-color .18s, box-shadow .18s, color .18s; }
.boton:active { transform: translateY(1px) scale(.985); }
.boton--amarillo { background: var(--amarillo); color: #1b1a12; box-shadow: 0 1px 0 rgba(255, 255, 255, .5) inset, 0 10px 28px -12px rgba(246, 217, 91, .7); }
.boton--amarillo:hover { background: #ffe56f; transform: translateY(-2px); }
.boton--tiza { color: var(--tiza); box-shadow: 0 0 0 1.5px var(--tiza-45) inset; }
.boton--tiza:hover { box-shadow: 0 0 0 1.5px var(--tiza) inset; background: rgba(244, 240, 230, .08); }
.boton--tinta { background: var(--tinta); color: #fff; box-shadow: 0 12px 26px -14px rgba(28, 63, 174, .8); }
.boton--tinta:hover { background: #17358f; transform: translateY(-2px); }
.boton--linea { color: var(--grafito); box-shadow: 0 0 0 1.5px var(--grafito-45) inset; }
.boton--linea:hover { box-shadow: 0 0 0 1.5px var(--grafito) inset; background: rgba(29, 33, 37, .04); }
.boton--chico { min-height: 42px; padding: 0 18px; font-size: 15px; gap: 8px; }
.boton .flecha { width: 18px; height: 18px; flex: none; transition: transform .18s; }
.boton:hover .flecha { transform: translateX(3px); }

/* hoja cuadriculada */
.cuadriculado { background-color: var(--papel); background-image: linear-gradient(var(--cuadro) 1px, transparent 1px), linear-gradient(90deg, var(--cuadro) 1px, transparent 1px); background-size: 24px 24px; background-position: -1px -1px; }

.katex { font-size: 1.08em; }
.katex svg { max-width: none; } /* si no, las flechas de vectores quedan sin ancho */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
