@layer reset, base;

@layer reset {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }

  html,
  body {
    min-height: 100%;
  }

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

  img,
  picture,
  video {
    height: auto;
  }

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

  textarea {
    resize: vertical;
  }

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

  ul,
  ol {
    list-style: none;
  }

  table {
    border-collapse: collapse;
  }
}

@layer base {
  html {
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + var(--space-6));
  }

  body {
    font-family: var(--font-sans);
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: clip;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--motion-base) ease, color var(--motion-base) ease;
  }

  h1, h2, h3, h4 {
    line-height: var(--line-height-heading);
    letter-spacing: -0.025em;
    font-weight: 600;
    color: var(--text-primary);
  }

  h1 { font-size: var(--font-size-h1); font-weight: 700; }
  h2 { font-size: var(--font-size-h2); }
  h3 { font-size: var(--font-size-h3); }

  p {
    color: var(--text-secondary);
  }

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

  :focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
  }

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