@layer base {
  /* Box sizing rules & smooth scrolling */
  *, *::before, *::after {
    box-sizing: border-box;
  }

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

  body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-body);
    letter-spacing: 0.015em;
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    font-feature-settings: 'ss01' on, 'tnum' on;
  }

  ::selection {
    background-color: var(--color-accent);
    color: #fff9ee;
  }

  body {
    scrollbar-color: var(--color-text-muted) var(--color-bg);
    scrollbar-width: thin;
  }

  :focus {
    outline: none; /* Fallback for legacy browsers */
  }

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

  /* Headings whisper: regular weight, tight leading, warm ink */
  h1, h2, h3, h4, h5, h6 {
    margin-block-start: 0;
    margin-block-end: 0;
    font-family: var(--font-heading);
    color: var(--color-text-primary);
    line-height: var(--line-height-heading);
    font-weight: var(--font-weight-regular);
    letter-spacing: 0.009em;
    text-wrap: balance;
  }

  p {
    margin-block-start: 0;
    margin-block-end: var(--spacing-md);
    text-wrap: pretty;
  }

  p:last-child {
    margin-block-end: 0;
  }

  ul, ol {
    margin-block-start: 0;
    margin-block-end: 0;
    padding-inline-start: 0;
    list-style: none;
  }

  a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color var(--transition-fast), background-color var(--transition-fast);
  }

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

  button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
  }

  img, svg, video {
    display: block;
    max-inline-size: 100%;
    block-size: auto;
  }

  /* Content images take the soft 15px radius; heroes stay square via .full-bleed */
  main img:not(.full-bleed):not(.client-logo-img):not(.tech-icon) {
    border-radius: var(--radius-xl);
  }

  hr {
    border: none;
    border-top: 1px solid var(--color-surface-border);
    margin-block: var(--spacing-lg);
  }

  @media (forced-colors: active) {
    :focus-visible {
      outline: 2px solid Highlight;
      outline-offset: 4px;
    }

    a {
      color: LinkText;
      text-decoration: underline;
    }

    button {
      border: 1px solid ButtonText;
    }
  }

  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
