/* BeHive design system: reset and base elements. */

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

  * {
    margin: 0;
  }

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

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

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

  button {
    cursor: pointer;
  }

  table {
    border-collapse: collapse;
  }

  [hidden] {
    display: none !important;
  }
}

@layer base {
  html {
    font-family: var(--bh-font);
    font-size: 100%;
    line-height: var(--bh-leading);
    background: var(--bh-ground);
    color: var(--bh-text);
    accent-color: var(--bh-accent);
    caret-color: var(--bh-accent);
    scrollbar-color: var(--bh-border-strong) transparent;
  }

  body {
    min-height: 100dvh;
    font-size: var(--bh-text-base);
    background: var(--bh-ground);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01';
    font-variant-numeric: tabular-nums;
  }

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

  h1,
  h2,
  h3,
  h4 {
    font-weight: 600;
    line-height: var(--bh-leading-tight);
    letter-spacing: -0.01em;
    text-wrap: balance;
  }

  h1 {
    font-family: var(--bh-font-display);
    font-size: var(--bh-text-2xl);
    font-weight: 700;
    letter-spacing: -0.025em;
  }

  h2 {
    font-size: var(--bh-text-lg);
  }

  h3 {
    font-size: var(--bh-text-md);
  }

  h4 {
    font-size: var(--bh-text-base);
  }

  p {
    text-wrap: pretty;
  }

  a {
    color: var(--bh-accent-text);
    text-decoration: none;
  }

  a:hover {
    text-decoration: underline;
    text-decoration-color: var(--bh-link-underline);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2em;
  }

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

  code,
  kbd,
  samp {
    font-family: var(--bh-font-mono);
    font-size: 0.92em;
  }

  kbd {
    padding: 0.1em 0.45em;
    border-radius: var(--bh-radius-sm);
    background: var(--bh-control-fill);
    font-family: var(--bh-font);
    font-weight: 500;
  }

  hr {
    border: 0;
    border-top: 1px solid var(--bh-border);
  }

  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      transition-duration: 0.01ms !important;
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
  }
}
