/* Reset and base styles. No scroll-behavior: smooth on html, it fights Lenis
   (see the smooth scroll rule in the Cement standards). */

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

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

  img {
    height: auto;
  }

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

  table {
    border-collapse: collapse;
  }

  [hidden] {
    display: none !important;
  }

  ul[role='list'],
  ol[role='list'] {
    list-style: none;
  }

  /* Lenis's own classes (lenis.css of lenis 1.1) */
  html.lenis,
  html.lenis body {
    height: auto;
  }

  .lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
  }

  .lenis.lenis-stopped {
    overflow: clip;
  }

  .lenis.lenis-smooth iframe {
    pointer-events: none;
  }
}

@layer base {
  :root {
    scrollbar-color: var(--theme-color-primary) var(--theme-color-background);
    scrollbar-width: thin;
  }

  ::selection {
    background: var(--theme-color-accent);
    color: var(--theme-color-text);
  }

  body {
    font-family: var(--theme-font-body);
    font-size: var(--theme-text-md);
    font-weight: var(--theme-weight-regular);
    line-height: var(--theme-leading-body);
    color: var(--theme-color-text);
    background: var(--theme-color-background);
    -webkit-font-smoothing: antialiased;
  }

  h1,
  h2,
  h3,
  h4 {
    font-family: var(--theme-font-heading);
    font-weight: var(--theme-weight-semibold);
    line-height: var(--theme-leading-tight);
    text-wrap: balance;
  }

  p,
  li,
  dd {
    text-wrap: pretty;
  }

  a {
    color: inherit;
    text-decoration-thickness: var(--theme-border-width);
    text-underline-offset: 0.2em;
  }

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

  [id] {
    scroll-margin-top: var(--theme-space-sm);
  }

  .skip-link {
    position: absolute;
    top: var(--theme-space-2xs);
    left: var(--theme-space-2xs);
    z-index: 100;
    padding: var(--theme-space-2xs) var(--theme-space-xs);
    background: var(--theme-color-dark);
    color: var(--theme-color-on-dark);
    transform: translateY(-200%);
  }

  .skip-link:focus {
    transform: none;
  }

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

  .container {
    width: min(100% - 2 * var(--theme-gutter), var(--theme-width-content));
    margin-inline: auto;
  }
}
