:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-soft: rgba(28, 27, 25, 0.035);
  --surface-strong: rgba(28, 27, 25, 0.06);
  --text: #1c1b19;
  --text-soft: #55534d;
  --muted: #8a877f;
  --line: rgba(28, 27, 25, 0.12);
  --line-strong: rgba(28, 27, 25, 0.22);
  --accent: #2f6f52;
  --accent-soft: rgba(47, 111, 82, 0.1);
  --shadow: 0 1px 2px rgba(28, 27, 25, 0.04);
  --header-bg: rgba(251, 250, 247, 0.92);
  --header-bg-scrolled: rgba(251, 250, 247, 0.98);
  --radius: 6px;
  --radius-sm: 4px;
  --max-width: 980px;
  --header-height: 68px;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* Dark palette mirrors css/note-content.css's dark tokens for consistency
   across the reading surface and the rest of the site. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #14171a;
    --bg-elevated: #1b1f23;
    --surface: #1b1f23;
    --surface-soft: rgba(255, 255, 255, 0.035);
    --surface-strong: rgba(255, 255, 255, 0.07);
    --text: #dde2e6;
    --text-soft: #b3bac0;
    --muted: #8b939b;
    --line: rgba(255, 255, 255, 0.13);
    --line-strong: rgba(255, 255, 255, 0.22);
    --accent: #5fd1a0;
    --accent-soft: rgba(95, 209, 160, 0.12);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --header-bg: rgba(20, 23, 26, 0.92);
    --header-bg-scrolled: rgba(20, 23, 26, 0.98);
  }
}

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

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

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

.skip-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 1000;
  padding: 10px 14px;
  color: var(--bg);
  background: var(--accent);
  border-radius: var(--radius-sm);
  transform: translateY(-140%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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