/* Modern reset + base typography. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light dark;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-0);
  line-height: var(--lh-normal);
  color: var(--fg);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt";
  transition: background-color var(--transition), color var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background-color: var(--selection-bg);
  color: var(--fg-strong);
}

img, svg, video, canvas, audio, iframe, embed, object {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 0.2em;
  transition: color var(--transition);
}
a:hover { color: var(--link-hover); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--fg-strong);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  margin: 0;
  font-weight: 650;
}

h1 { font-size: var(--fs-3); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-2); letter-spacing: -0.015em; }
h3 { font-size: var(--fs-1); }
h4 { font-size: var(--fs-0); font-weight: 600; }

p { margin: 0; }

ul, ol { margin: 0; padding-left: var(--s-5); }

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

small, .muted { color: var(--muted); font-size: var(--fs--1); }

kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--kbd-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.05em 0.4em;
  box-shadow: 0 1px 0 var(--border-strong);
}

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

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-pill); border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }
