/* Reset + base typography. Semantic tokens only. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-atmosphere);
  background-repeat: no-repeat;
  background-attachment: scroll;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4,h5,h6 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--space-4); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* A link sitting inline in a run of prose needs more than colour to be told apart from the text around it
   (WCAG 1.4.1 / axe's link-in-text-block) — underline it wherever it can appear mid-sentence, unless it's
   actually a button/nav-styled link that happens to be nested there. Card/nav/button links elsewhere are
   unaffected since they aren't matched by these selectors. */
p a:not([class*="btn"]), figcaption a:not([class*="btn"]), blockquote a, .check a, label a, .alert-body a:not([class*="btn"]) {
  text-decoration: underline;
  text-underline-offset: 2px;
}
img, svg, video { max-width: 100%; }
img { display: block; height: auto; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--divider); margin: var(--space-6) 0; }
code, kbd, pre { font-family: var(--font-mono); font-size: .92em; }
code { background: var(--surface-3); padding: .1em .4em; border-radius: var(--radius-xs); }
small { font-size: var(--fs-sm); }
::selection { background: var(--primary); color: var(--on-primary); }

/* Visible focus for everything interactive (WCAG 2.4.7 / 2.4.11) */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 2px; box-shadow: var(--ring); border-radius: var(--radius-xs); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; left: var(--space-4); z-index: 999;
  background: var(--primary); color: var(--on-primary); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { top: var(--space-3); }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--space-4); }
@media (min-width: 640px) { .container { padding-inline: var(--space-6); } }
@media (min-width: 1024px) { .container { padding-inline: var(--space-8); } }

.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--link); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: var(--font-mono); }
.w-full { width: 100%; }
.hidden, [hidden] { display: none !important; }
.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.stack-lg > * + * { margin-top: var(--space-8); }
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
.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)}
.mb-2{margin-bottom:var(--space-2)} .mb-4{margin-bottom:var(--space-4)} .mb-6{margin-bottom:var(--space-6)}

.ic { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.22em; }
.ic-fill { fill: currentColor; stroke: none; }

/* Prevent flash of unstyled theme transitions on first paint */
.no-anim * { transition: none !important; animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media (max-width: 640px) { .hide-sm { display: none !important; } }
