@layer reset, base;

/* ==========================================
   RESET
========================================== */

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

  * {
    margin: 0;
    padding: 0;
  }

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

  body {
    min-height: 100vh;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

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

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

  ul,
  ol {
    padding-left: 1.5rem;
  }

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

/* ==========================================
   BASE
========================================== */

@layer base {
  html {
    font-size: 18px;

    height: 100%;
  }

  body {
    background: var(--color-bg);

    color: var(--color-text);

    font-family: var(--font-body);

    font-size: var(--text-body);

    font-weight: var(--weight-regular);

    line-height: 1.85;

    letter-spacing: -0.01em;

    transition:
      background-color var(--duration-normal),
      color var(--duration-normal);

    min-height: 100vh;

    display: flex;

    flex-direction: column;
  }

  main {
    flex: 1;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: var(--color-text);

    font-family: var(--font-heading);

    font-weight: var(--weight-semibold);

    line-height: 1.15;

    letter-spacing: -0.03em;

    text-wrap: balance;
  }

  h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);

    line-height: 1.05;
  }

  h2 {
    font-size: clamp(2.25rem, 3vw, 3rem);

    line-height: 1.15;
  }

  h3 {
    font-size: 1.6rem;

    line-height: 1.3;
  }

  h4 {
    font-size: 1.3rem;

    line-height: 1.4;
  }

  p {
    max-width: 68ch;

    color: var(--color-text-soft);

    line-height: 1.85;
  }

  p + p {
    margin-top: 1.5rem;
  }

  ul,
  ol {
    margin-block: 1.5rem;

    padding-left: 1.5rem;
  }

  li {
    line-height: 1.85;
  }

  li + li {
    margin-top: 0.6rem;
  }

  a {
    transition: color var(--duration-fast);
  }

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

  strong,
  b {
    font-weight: var(--weight-semibold);
  }

  small {
    font-size: 0.9rem;
  }

  hr {
    margin-block: 5rem;

    border: 0;

    border-top: 1px solid var(--color-border);
  }

  code,
  pre {
    font-family: var(--font-mono);
  }

  pre {
    overflow-x: auto;
  }

  img {
    height: auto;
  }

  ::selection {
    background: var(--color-accent);

    color: #fff;
  }

  :focus-visible {
    outline: 2px solid var(--color-accent);

    outline-offset: 4px;
  }
}
