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

  html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 1.5rem);
  }

  [hidden] {
    display: none !important;
  }

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

  body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

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

  img {
    height: auto;
  }

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

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

  ul[class],
  ol[class] {
    padding: 0;
    list-style: none;
  }

  a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
  }
}

@layer base {
  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }

  [inert],
  [inert] * {
    opacity: 0.5;
    cursor: default;
    user-select: none;
  }

  .visually-hidden:where(:not(:focus-within, :active)) {
    position: absolute !important;
    clip-path: inset(50%) !important;
    overflow: hidden !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: nowrap !important;
  }

  .skip-link:focus-visible {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1000;
    padding: 0.75rem 1.25rem;
    background: var(--bg-ink);
    color: var(--text-on-dark);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  /* Typography Primitives */
  .t-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
  }

  .t-eyebrow::before {
    content: "";
    display: inline-block;
    width: 1.75rem;
    height: 1px;
    background-color: var(--accent);
    flex-shrink: 0;
  }

  .section-dark .t-eyebrow {
    color: var(--text-on-dark-muted);
  }

  .section-dark .t-eyebrow::before {
    background-color: var(--accent-on-dark);
  }

  .t-display {
    font-family: var(--font-sans);
    font-size: var(--text-display);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.035em;
    text-wrap: balance;
    hyphens: none;
  }

  .t-h1 {
    font-family: var(--font-sans);
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1.09;
    letter-spacing: -0.03em;
    text-wrap: balance;
    hyphens: none;
  }

  .t-h2 {
    font-family: var(--font-sans);
    font-size: var(--text-2xl);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    text-wrap: balance;
  }

  .t-h3 {
    font-family: var(--font-sans);
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.015em;
  }

  .t-serif-italic {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.01em;
  }

  .t-lead {
    font-size: clamp(0.98rem, 0.94rem + 0.25vw, 1.15rem);
    line-height: 1.56;
    color: var(--text-secondary);
    text-wrap: pretty;
  }

  .section-dark .t-lead {
    color: var(--text-on-dark-muted);
  }

  .t-mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
  }

  .t-tabular {
    font-variant-numeric: tabular-nums;
  }
}
