@layer base {
  @font-face {
    font-family: "Fraunces Variable";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/fraunces-latin-wght-normal.woff2") format("woff2");
  }

  @font-face {
    font-family: "Manrope Variable";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2");
  }

  /* Reset moderno */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    margin: 0;
  }

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

  body {
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: var(--leading-body);
    -webkit-font-smoothing: antialiased;
    /* `anywhere` (y no `break-word`) también deja encoger las columnas: con el texto ampliado
       una palabra larga se parte en vez de ensanchar la página. */
    overflow-wrap: anywhere;
  }

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

  img {
    height: auto;
  }

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

  ul[class],
  ol[class] {
    padding: 0;
    list-style: none;
  }

  /* Tipografía */
  h1,
  h2,
  h3,
  h4 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: -0.01em;
    text-wrap: balance;
    /* Con el texto ampliado una palabra larga no cabe en una línea: se parte en vez de salirse
       o recortarse. Sin `hyphens: auto`, que partía títulos que sí cabían. */
    overflow-wrap: anywhere;
  }

  h1 {
    font-size: var(--text-3xl);
  }

  h2 {
    font-size: var(--text-2xl);
  }

  h3 {
    font-size: var(--text-xl);
  }

  h4 {
    font-size: var(--text-lg);
  }

  p,
  li {
    text-wrap: pretty;
  }

  strong {
    font-weight: 700;
  }

  a {
    color: var(--color-link);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.2em;
    transition: color var(--duration-fast) var(--ease-soft);
  }

  a:hover {
    color: var(--color-link-hover);
  }

  :focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
    /* Halo fino entre el elemento y el anillo: no invade el texto vecino. */
    box-shadow: 0 0 0 2px var(--color-focus-halo);
    border-radius: var(--radius-sm);
  }

  ::selection {
    background-color: var(--leaf-300);
    color: var(--leaf-900);
  }

  .icon {
    flex: none;
  }

  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

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

    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
}
