/* Kit base: reset, type and layout primitives. Reads --kit-* tokens only. */

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

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  /* Page-to-page navigation cross-fades where the browser supports it. */
  @view-transition { navigation: auto; }
}

body {
  margin: 0;
  background: var(--kit-bg);
  color: var(--kit-text);
  font-family: var(--kit-font);
  font-size: var(--kit-text-md);
  font-weight: var(--kit-text-weight);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--kit-font-display);
  font-weight: var(--kit-display-weight);
  font-stretch: var(--kit-display-stretch);
  letter-spacing: var(--kit-display-tracking);
  line-height: 1.1;
  text-wrap: balance;
}
h1 { font-size: var(--kit-text-4xl); line-height: 1.02; }
h2 { font-size: var(--kit-text-3xl); }
h3 { font-size: var(--kit-text-xl); line-height: 1.2; }
h4 { font-size: var(--kit-text-md); line-height: 1.3; }

p { text-wrap: pretty; }

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

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

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

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

::selection { background: var(--kit-accent); color: var(--kit-on-accent); }

[hidden] { display: none !important; }

/* ---- type helpers ---- */
.kit-lede { font-size: var(--kit-text-lg); color: var(--kit-text-muted); max-width: var(--kit-measure); }
.kit-muted { color: var(--kit-text-muted); }
.kit-small { font-size: var(--kit-text-sm); }
.kit-num { font-variant-numeric: tabular-nums; }

/* ---- layout primitives ---- */
.kit-container {
  width: 100%;
  max-width: calc(var(--kit-container) + 2 * var(--kit-gutter));
  margin-inline: auto;
  padding-inline: var(--kit-gutter);
}

.kit-section { padding-block: clamp(3rem, 8vw, 6rem); }
.kit-section--ruled { border-top: 1px solid var(--kit-border); }
.kit-section--quiet { background: var(--kit-surface-quiet); }

/* Vertical rhythm. Set --gap to change the step. */
.kit-stack { display: flex; flex-direction: column; gap: var(--gap, var(--kit-space-4)); }
.kit-stack > * { min-width: 0; }

/* Things in a row that wrap. */
.kit-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--kit-space-3)); }

/* Equal columns that drop to fewer as space runs out. Set --min for the column floor. */
.kit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--min, 16rem), 100%), 1fr));
  gap: var(--gap, var(--kit-space-5));
}

/* Content beside a narrower aside; stacks on phones. */
.kit-split { display: grid; gap: var(--gap, var(--kit-space-6)); }
@media (min-width: 60rem) {
  .kit-split { grid-template-columns: minmax(0, 1fr) var(--aside, 22rem); align-items: start; }
}

.kit-rule { border: 0; border-top: 1px solid var(--kit-border); margin: 0; }

.kit-visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.kit-skip {
  position: absolute; left: var(--kit-space-3); top: var(--kit-space-3); z-index: 100;
  padding: var(--kit-space-2) var(--kit-space-4);
  background: var(--kit-accent); color: var(--kit-on-accent);
  border-radius: var(--kit-radius-touch);
  transform: translateY(-200%);
}
.kit-skip:focus { transform: none; }

/* ---- icons: <svg class="kit-icon"><use href="/assets/kit/icons.svg#name"/></svg> ---- */
.kit-icon {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: square; stroke-linejoin: miter;
}
.kit-icon--sm { width: 1em; height: 1em; }
.kit-icon--lg { width: 1.75em; height: 1.75em; }

/* The drawn logotype and symbol. Colour follows the text colour; never retype the name. */
.kit-logo { display: block; height: 1.125rem; width: auto; fill: currentColor; stroke: none; }
.kit-logo--symbol { height: 1.75rem; }
