@layer reset, base;

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

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

  body,
  h1,
  h2,
  h3,
  h4,
  p,
  ul,
  ol,
  blockquote,
  figure {
    margin: 0;
  }

  ul,
  ol {
    padding: 0;
  }

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

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

@layer base {
  html:focus-within {
    scroll-behavior: smooth;
  }

  body {
    min-height: 100vh;
    background:
      radial-gradient(
        circle at top left,
        rgba(15, 93, 115, 0.16),
        transparent 32%
      ),
      radial-gradient(
        circle at 85% 15%,
        rgba(196, 123, 42, 0.12),
        transparent 22%
      ),
      linear-gradient(
        180deg,
        #f8f4ec 0%,
        var(--color-surface-base) 42%,
        #ece5d6 100%
      );
    background-attachment: fixed;
    color: var(--color-text);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: 1.65;
  }

  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
      linear-gradient(135deg, rgba(255, 255, 255, 0.32), transparent 45%),
      repeating-linear-gradient(
        90deg,
        rgba(15, 93, 115, 0.04) 0,
        rgba(15, 93, 115, 0.04) 1px,
        transparent 1px,
        transparent 56px
      ),
      repeating-linear-gradient(
        0deg,
        rgba(15, 93, 115, 0.035) 0,
        rgba(15, 93, 115, 0.035) 1px,
        transparent 1px,
        transparent 56px
      );
    opacity: 0.46;
  }

  ::selection {
    background: rgba(15, 93, 115, 0.2);
    color: var(--color-primary-dark);
  }

  a {
    color: var(--color-primary-dark);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
    transition:
      color var(--transition-fast),
      opacity var(--transition-fast);
  }

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

  ::-webkit-scrollbar {
    width: 0.8rem;
    height: 0.8rem;
  }

  ::-webkit-scrollbar-track {
    background: rgba(9, 56, 74, 0.08);
  }

  ::-webkit-scrollbar-thumb {
    background: rgba(9, 56, 74, 0.28);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    background-clip: padding-box;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: rgba(9, 56, 74, 0.42);
    background-clip: padding-box;
  }

  @media (prefers-reduced-motion: reduce) {
    html:focus-within {
      scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      scroll-behavior: auto !important;
      transition-duration: 0.01ms !important;
    }
  }
}
