/* base.css — reset, type, links, focus and layout primitives. */

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

/* The hidden attribute always wins over component display rules. */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 650;
  text-wrap: balance;
}
h1 {
  font-size: var(--text-4xl);
}
h2 {
  font-size: var(--text-3xl);
}
h3 {
  font-size: var(--text-xl);
  letter-spacing: -0.015em;
}
h4 {
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
}
p {
  margin: 0;
  text-wrap: pretty;
}
p + p {
  margin-top: var(--space-4);
}
small {
  font-size: var(--text-sm);
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
[disabled] {
  cursor: not-allowed;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.icon {
  flex: none;
  vertical-align: middle;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-8) 0;
}

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

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

/* --- accessibility ----------------------------------------------------- */

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -4rem;
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-weight: 600;
}
.skip-link:focus {
  top: var(--space-4);
}

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

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

/* --- layout -------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow {
  max-width: calc(46rem + 2 * var(--gutter));
}
.container--mid {
  max-width: calc(62rem + 2 * var(--gutter));
}

.section {
  padding-block: var(--section-y);
}
.section--alt {
  background: var(--bg-alt);
}
.section--tight {
  padding-block: calc(var(--section-y) * 0.6);
}

.stack > * + * {
  margin-top: var(--stack, var(--space-4));
}
.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster, var(--space-3));
}
.grid {
  display: grid;
  gap: var(--grid-gap, var(--space-6));
}
@media (min-width: 48rem) {
  .grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 64rem) {
  .grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* --- section headings ------------------------------------------------------ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--link);
}
.eyebrow::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  background: var(--brand-amber);
}

.section-head {
  max-width: 44rem;
  margin-bottom: var(--space-6);
}
.section-head--center {
  margin-inline: auto;
  text-align: center;
}
.section-head h2 {
  margin-top: var(--space-2);
}
.section-head .lead {
  margin-top: var(--space-2);
}
.lead {
  font-size: var(--text-lg);
  color: var(--muted);
  line-height: 1.65;
}
.muted {
  color: var(--muted);
}
.text-sm {
  font-size: var(--text-sm);
}
.text-xs {
  font-size: var(--text-xs);
}
.center {
  text-align: center;
}
.nowrap {
  white-space: nowrap;
}
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
