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

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

body {
  margin: 0;
  font-family: var(--jrm-font-body);
  color: var(--jrm-color-text);
  font-size: var(--jrm-font-base-size);
  line-height: var(--jrm-line-height-base);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--jrm-color-surface-alt) 45%, #fff 55%), #fff 220px),
    var(--jrm-color-surface);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
}

/* ── Links ───────────────────────────────────────────── */
a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--jrm-color-primary-strong) 55%, transparent);
  text-underline-offset: 0.15em;
  transition: text-decoration-color var(--jrm-transition-base);
}

a:hover,
a:focus-visible {
  text-decoration-color: var(--jrm-color-primary-strong);
}

/* ── Focus rings ─────────────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--jrm-color-primary-strong) 72%, #111 28%);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ── Images ──────────────────────────────────────────── */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ── Headings ────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--jrm-font-heading);
  line-height: 1.1;
  margin: 0 0 0.5em;
  font-weight: 800;
  color: color-mix(in srgb, var(--jrm-color-secondary) 85%, #000 15%);
}

/* Negative tracking on large display type */
h1 {
  letter-spacing: -0.025em;
}

h2 {
  letter-spacing: -0.018em;
}

h3 {
  letter-spacing: -0.01em;
}

/* ── Paragraphs ──────────────────────────────────────── */
p {
  margin: 0 0 1rem;
}

/* ── Accessibility ───────────────────────────────────── */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal;
}

.menu-toggle .screen-reader-text {
  width: 1px;
  height: 1px;
  background: transparent;
}

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

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