/* Fuentes autoalojadas (SIL Open Font License 1.1). Nombres versionados con hash. */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-var.f2ea9c12.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-400.7ced5342.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-500.6e618344.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;

  --font-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype",
    Palatino, Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  /* Hoja de apuntes */
  --bg: #f7f3e8;
  --surface: #fffdf4;
  --text: #1e1c17;
  --text-muted: #5b564a;
  --accent: #96331f;
  --border: #d8cfba;
  --margin-line: #cfae9f;
  --overlay: rgb(8 10 8 / 78%);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.5rem, 2.4vw, 1.75rem);
  --text-2xl: clamp(2.1rem, 5vw, 3.1rem);
  --text-lead: clamp(1.25rem, 2.4vw, 1.55rem);
  --leading-tight: 1.18;
  --leading-body: 1.65;

  --measure: 68ch;
  --page-max: 76rem;
  --page-pad: clamp(1rem, 4vw, 3rem);
  --aside-width: clamp(18rem, 22vw, 22rem);
  --header-height: 3.75rem;
  --radius: 2px;
  --transition: 160ms ease;
}

/* Pizarra: no es el tema claro invertido. */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111814;
  --surface: #17201b;
  --text: #ece7d6;
  --text-muted: #a9ad9d;
  --accent: #e7c56b;
  --border: #2c3830;
  --margin-line: #4b4534;
  --overlay: rgb(0 0 0 / 82%);
}

/* Sin JavaScript el atributo no existe: seguir el sistema. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #111814;
    --surface: #17201b;
    --text: #ece7d6;
    --text-muted: #a9ad9d;
    --accent: #e7c56b;
    --border: #2c3830;
    --margin-line: #4b4534;
    --overlay: rgb(0 0 0 / 82%);
  }
}
