:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --on-brand: #ffffff;
  --accent: #2563eb;

  --bg: #ffffff;
  --fg: #1c1f24;
  --muted: #5e6672;
  --border: #dde2e8;
  --surface: #f4f6f9;

  --radius: 0;
  --max-width: 64rem;
  --measure: 42rem;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #1e4fc4;
    --brand-dark: #1a44a8;
    --bg: #0f1115;
    --fg: #e8eaee;
    --muted: #9aa3ae;
    --border: #2a2f37;
    --surface: #171a20;
    --accent: #60a5fa;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--brand);
  color: var(--on-brand);
}

a:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--bg);
  color: var(--fg);
}

/* Buttons */

.button {
  display: inline-block;
  padding: 0.4rem 1rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

/* Header */

.site-header {
  background: var(--brand);
  color: var(--on-brand);
}

.site-header a:focus-visible {
  outline-color: var(--on-brand);
}

.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--on-brand);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
}

.logo-mark {
  width: auto;
  height: 2.25rem;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-nav .button {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--on-brand);
}

.site-nav .button:hover {
  background: var(--brand-dark);
  border-color: var(--on-brand);
}

.site-nav .button[aria-current] {
  background: var(--on-brand);
  border-color: var(--on-brand);
  color: var(--brand);
}

.hero {
  padding-top: clamp(1rem, 3vw, 2rem);
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.tagline {
  max-width: 20ch;
  margin: 0;
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

/* Main content */

.site-main {
  flex: 1;
  padding-top: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: 4rem;
}

.prose {
  max-width: var(--measure);
}

.prose > :first-child {
  margin-top: 0;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.prose h1 {
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  margin: 0 0 1rem;
}

.prose h2 {
  font-size: 1.5rem;
  margin: 2.75rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.prose h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.5rem;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre,
.prose table {
  margin: 0 0 1.25rem;
}

.prose ul,
.prose ol {
  padding-left: 1.4rem;
}

.prose li + li {
  margin-top: 0.3rem;
}

.prose li::marker {
  color: var(--muted);
}

.prose a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.prose a:hover {
  text-decoration-thickness: 2px;
}

.prose blockquote {
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--brand);
  color: var(--muted);
}

.prose blockquote > :last-child {
  margin-bottom: 0;
}

.prose hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.prose code {
  padding: 0.1em 0.35em;
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.875em;
}

.prose pre {
  overflow-x: auto;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  line-height: 1.5;
}

.prose pre code {
  padding: 0;
  background: none;
}

.prose table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.prose th,
.prose td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose th {
  font-weight: 600;
  border-bottom-width: 2px;
}

.prose img {
  max-width: 100%;
  height: auto;
}

.lead {
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1.5;
}

/* Collection */

.breadcrumb {
  margin: 0 0 0.5rem;
  font-size: 0.9375rem;
}

.breadcrumb a::after {
  content: " /";
  color: var(--muted);
}

.prose .subcollections {
  padding: 0;
  list-style: none;
}

.prose .subcollections li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.prose .subcollections li + li {
  margin-top: 0;
}

.prose .subcollections a {
  font-size: 1.2rem;
  font-weight: 600;
}

.prose .subcollections p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.prose .references {
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}

.prose .reference {
  padding: 1.25rem 0;
  border-top: 1px solid var(--border);
}

.prose .reference + .reference {
  margin-top: 0;
}

.citation {
  margin: 0 0 0.5rem;
}

.citation .year,
.citation .source {
  color: var(--muted);
}

.citation .ref-title {
  display: block;
  font-style: normal;
  font-weight: 600;
}

.citation .source {
  display: block;
  font-size: 0.9375rem;
  font-style: italic;
}

.annotation > :last-child {
  margin-bottom: 0;
}

.abstract {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
}

.abstract summary {
  color: var(--muted);
  cursor: pointer;
}

.abstract p {
  margin: 0.5rem 0 0;
}

.empty {
  color: var(--muted);
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.footer-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-note a {
  color: inherit;
  text-underline-offset: 0.2em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.875rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
