/*
 * Estilos de los elementos HTML sin clase: documento, tipografía base, enlaces y foco.
 */
@layer base {
  html {
    /* Deja libre el alto de la cabecera fija al saltar a una sección. */
    scroll-padding-top: calc(var(--header-height) + var(--space-s));
  }

  @media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }
  }

  body {
    background-color: var(--color-desk);
    color: var(--color-ink);
    font-family: var(--font-brand);
    font-size: var(--step-0);
    font-weight: var(--weight-regular);
    line-height: var(--leading-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  h1,
  h2,
  h3 {
    font-family: var(--font-display);
    font-stretch: var(--width-display);
    font-weight: var(--weight-strong);
    letter-spacing: var(--tracking-display);
    text-wrap: balance;
  }

  h1 {
    font-size: var(--step-5);
    line-height: var(--leading-display);
  }

  h2 {
    font-size: var(--step-4);
    line-height: 1.06;
  }

  h3 {
    font-size: var(--step-2);
    line-height: var(--leading-heading);
  }

  p {
    text-wrap: pretty;
  }

  strong {
    font-weight: var(--weight-strong);
  }

  a {
    color: var(--color-accent-text);
    text-decoration-line: underline;
    text-decoration-thickness: 0.075em;
    text-underline-offset: 0.2em;
  }

  a:hover {
    text-decoration-thickness: 0.14em;
  }

  /* Un único anillo de foco para todo lo interactivo. */
  :focus-visible {
    outline: 0.1875rem solid var(--color-focus);
    outline-offset: 0.1875rem;
    border-radius: var(--radius-mark);
  }

  /* Seleccionar texto se ve como pasarle el resaltador. */
  ::selection {
    background-color: var(--color-highlight);
    /* Texto impreso: oscuro en los dos temas, porque el resaltador siempre es claro. */
    color: var(--color-print);
  }
}
