/* ============================================================
   MultasInfo — Base
   Fuentes self-hosted, reset mínimo, elementos base y
   utilidades de accesibilidad. Sin clases de componentes.
   ============================================================ */

@layer base {
  /* ---- Fuentes (subset latin, self-hosted) ---- */
  @font-face {
    font-family: "Instrument Sans";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/instrument-sans-latin-400-normal.woff2") format("woff2");
  }
  @font-face {
    font-family: "Instrument Sans";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/instrument-sans-latin-500-normal.woff2") format("woff2");
  }
  @font-face {
    font-family: "Instrument Sans";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/instrument-sans-latin-600-normal.woff2") format("woff2");
  }
  @font-face {
    font-family: "Instrument Sans";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/instrument-sans-latin-700-normal.woff2") format("woff2");
  }
  @font-face {
    font-family: "Spline Sans Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/spline-sans-mono-latin-500-normal.woff2") format("woff2");
  }

  /* ---- Reset mínimo ---- */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    margin: 0;
  }

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

  body {
    font-family: var(--font-ui);
    font-size: var(--text-body);
    line-height: var(--leading-body);
    color: var(--ink-950);
    background-color: var(--paper);
    -webkit-font-smoothing: antialiased;
  }

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

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

  /* ---- Tipografía base ---- */
  h1 {
    font-size: var(--text-display);
    font-weight: var(--weight-heading);
    line-height: var(--leading-display);
    letter-spacing: var(--tracking-display);
    text-wrap: balance;
  }

  h2 {
    font-size: var(--text-h2);
    font-weight: var(--weight-heading);
    line-height: var(--leading-heading);
    letter-spacing: var(--tracking-h2);
    text-wrap: balance;
  }

  h3 {
    font-size: var(--text-h3);
    font-weight: 600;
    line-height: var(--leading-h3);
    letter-spacing: var(--tracking-h3);
  }

  p {
    max-width: var(--measure);
  }

  a {
    color: var(--blue-600);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
  }

  strong {
    font-weight: 600;
  }

  ::selection {
    background-color: var(--sky-100);
  }

  /* ---- Foco visible, siempre (BB §12) ---- */
  :focus-visible {
    outline: 3px solid transparent;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-chip);
  }

  /* ---- Utilidades de accesibilidad ---- */
  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .skip-link {
    position: absolute;
    inset-block-start: var(--space-2);
    inset-inline-start: var(--space-2);
    z-index: var(--z-modal);
    padding: var(--space-2) var(--space-4);
    background-color: var(--paper);
    border-radius: var(--radius-button);
    box-shadow: var(--shadow-2);
    transform: translateY(-200%);
  }

  .skip-link:focus-visible {
    transform: translateY(0);
  }

  /* ---- Layout base ---- */
  .container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--gutter);
  }

  /* ---- Reveals (BB §11: fade + 12px, una vez) ---- */
  @media (prefers-reduced-motion: no-preference) {
    [data-reveal] {
      opacity: 0;
      translate: 0 12px;
      transition:
        opacity var(--duration-base) var(--ease),
        translate var(--duration-base) var(--ease);
    }

    [data-reveal].is-visible {
      opacity: 1;
      translate: 0 0;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
  }
}
