/* ============================================== */
/* Base — reset, body, tipografía, container      */
/* ============================================== */

@layer base {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  * {
    margin: 0;
  }

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

  body {
    font-family: var(--font-body);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    color: hsl(var(--ink));
    background: hsl(var(--bg));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100svh;
  }

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

  a {
    color: inherit;
    text-decoration: none;
  }

  a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  a:focus-visible,
  button:focus-visible {
    outline: 2px solid hsl(var(--dorado));
    outline-offset: 3px;
    border-radius: var(--radius-sm);
  }

  button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
  }

  h1,
  h2,
  h3,
  h4 {
    font-family: var(--font-display);
    font-weight: 900;
    line-height: var(--lh-heading);
    letter-spacing: var(--tracking-heading);
    color: hsl(var(--ink));
    text-wrap: balance;
  }

  h1 {
    font-size: var(--fs-display);
    line-height: var(--lh-display);
    letter-spacing: var(--tracking-display);
  }

  h2 {
    font-size: var(--fs-h1);
  }

  h3 {
    font-size: var(--fs-h2);
  }

  h4 {
    font-size: var(--fs-h3);
  }

  p {
    max-width: 60ch;
    text-wrap: pretty;
  }

  ul,
  ol {
    padding-left: var(--space-6);
  }

  ::selection {
    background: hsl(var(--dorado));
    color: hsl(var(--bg-deep));
  }

  @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;
    }
  }
}

@layer utilities {
  .container {
    width: 100%;
    max-width: var(--container-lg);
    margin-inline: auto;
    padding-inline: var(--space-6);
  }

  .container-reading {
    max-width: var(--container-reading);
  }

  .overline {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    letter-spacing: var(--tracking-overline);
    text-transform: uppercase;
    color: hsl(var(--ink-dim));
    font-weight: 500;
  }

  .muted {
    color: hsl(var(--ink-dim));
  }

  .faint {
    color: hsl(var(--ink-faint));
  }

  .dorado {
    color: hsl(var(--dorado));
  }

  .text-balance {
    text-wrap: balance;
  }

  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
