/* Base: reset, typography, links, focus, forms baseline, utilities. Components live in components.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + var(--s-4) + var(--safe-top)); scroll-padding-bottom: calc(96px + var(--safe-bottom)); }
body {
  margin: 0;
  /* Notched devices: the notch, the rounded corners and the home indicator sit over the page, so the canvas
     is inset. Padding on the body (border-box) extends the document, which is what keeps the last row of
     content above the home indicator at the foot of the scroll. */
  padding-top: var(--safe-top);
  padding-right: var(--safe-right);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-md);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video, canvas { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
[hidden] { display: none !important; }

h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--text); font-weight: 600; letter-spacing: -0.012em; }
h1 { font-size: var(--fs-display); line-height: var(--lh-display); font-weight: 650; letter-spacing: -0.024em; }
h2 { font-size: var(--fs-xl); line-height: var(--lh-xl); }
h3 { font-size: var(--fs-lg); line-height: var(--lh-lg); }
h4 { font-size: var(--fs-md); line-height: var(--lh-md); }
p { margin: 0; }
p + p { margin-top: var(--s-3); }
ul, ol { margin: 0; padding-left: var(--s-5); }
li + li { margin-top: var(--s-1); }
strong, b { font-weight: 600; }
small { font-size: var(--fs-sm); }
code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.9em; }
pre {
  margin: 0;
  padding: var(--s-3) var(--s-4);
  overflow: auto;
  border: 1px solid var(--line-subtle);
  border-radius: var(--r-sm);
  background: var(--sunken);
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: var(--lh-sm);
}
kbd {
  display: inline-flex;
  align-items: center;
  min-width: 1.5em;
  height: 1.5em;
  padding: 0 0.4em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  background: var(--raised);
  color: var(--text-2);
  font-size: var(--fs-xs);
  line-height: 1;
}
hr { height: 1px; margin: var(--s-6) 0; border: 0; background: var(--line-subtle); }
dl, dd { margin: 0; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
abbr[title] { text-decoration: underline dotted; cursor: help; }

a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); text-decoration: underline; }
::selection { background: var(--accent-soft); color: var(--text); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.visually-hidden, .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;
}

/* Scrollbars: quiet, theme-aware. */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: var(--r-full); background: var(--line-strong) padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* Skip link: off-screen until focused. */
.skip-link {
  position: fixed;
  top: calc(var(--s-3) + var(--safe-top));
  left: calc(var(--s-3) + var(--safe-left));
  z-index: var(--z-toast);
  display: inline-flex;
  align-items: center;
  min-height: var(--ui-control-h, 44px);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--t-short) var(--ease-enter);
}
.skip-link:focus-visible { transform: none; color: var(--accent-ink); text-decoration: none; }

@media (forced-colors: active) {
  :focus-visible { outline: 2px solid CanvasText; }
}
@media print {
  :root { color-scheme: light; }
}
