/* ============================================================
   S·GONZÁLEZ — Base Styles (Light Theme)
   Reset, typography, global element styles
   ============================================================ */

@layer reset, base;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }

  html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    hanging-punctuation: first last;
  }

  body {
    min-block-size: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-inline-size: 100%;
  }

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

  button {
    cursor: pointer;
    border: none;
    background: transparent;
  }

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

  ul,
  ol {
    list-style: none;
  }
}

@layer base {
  body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-surface);
    overflow-x: hidden;
  }

  /* ---------- Typography ---------- */

  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.1;
    text-wrap: balance;
    letter-spacing: 0.02em;
    color: var(--color-text-primary);
  }

  h1 { font-size: var(--text-hero); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }
  h4 { font-size: var(--text-xl); }

  p {
    text-wrap: pretty;
    max-inline-size: 68ch;
  }

  ::selection {
    background: var(--color-primary);
    color: var(--color-white);
  }

  :focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
  }

  /* ---------- Scrollbar ---------- */

  :root {
    scrollbar-color: var(--color-neutral-300) transparent;
    scrollbar-width: thin;
  }

  /* ---------- Accessibility ---------- */

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