/* Skip link — off-screen until focused */
.skip-link {
  position: absolute;
  top: -999px;
  left: var(--space-4, 1rem);
  padding: 0.5rem 1rem;
  background: #FFD500;
  color: #000;
  font-weight: 700;
  border-radius: 8px;
  z-index: 9999;
  text-decoration: none;
}
.skip-link:focus { top: 0.5rem; }

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { text-decoration-thickness: 2px; }

/* Strip underline for UI-element links (nav, cards, buttons) */
.nav-logo,
.nav-links a,
.start-card,
.lo-link,
.toc-list a,
.btn {
  text-decoration: none;
}
.nav-links a:hover,
.toc-list a:hover,
.lo-link:hover {
  text-decoration: none;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-primary);
}

code, kbd, .mono {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
}

ul, ol { list-style: none; }

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

button {
  cursor: pointer;
  font: inherit;
  border: none;
  background: none;
}

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

::selection {
  background: var(--accent);
  color: #000;
}

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