@font-face {
  font-family: "Mulish Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/fonts/mulish-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Mulish Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url(/fonts/mulish-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --void: #0a0a0a;
  --surface: #111111;
  --panel: rgba(30, 30, 30, 0.6);
  --panel-hover: #252525;
  --violet: #9147ff;
  --accent: #c77dff;
  --text: #ffffff;
  --muted: #b8b8b8;
  --quiet: #777777;
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.045);
  --sun: inline;
  --moon: none;
}

/* Light tokens are declared twice: once for the system preference, once for the explicit toggle. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --void: #ffffff;
    --surface: #f7f7f8;
    --panel: #ffffff;
    --panel-hover: #f4f1fa;
    --violet: #7b2cbf;
    --accent: #7b2cbf;
    --text: #121212;
    --muted: #55555f;
    --quiet: #6e6e78;
    --line: rgba(0, 0, 0, 0.12);
    --line-soft: rgba(0, 0, 0, 0.06);
    --sun: none;
    --moon: inline;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --void: #ffffff;
  --surface: #f7f7f8;
  --panel: #ffffff;
  --panel-hover: #f4f1fa;
  --violet: #7b2cbf;
  --accent: #7b2cbf;
  --text: #121212;
  --muted: #55555f;
  --quiet: #6e6e78;
  --line: rgba(0, 0, 0, 0.12);
  --line-soft: rgba(0, 0, 0, 0.06);
  --sun: none;
  --moon: inline;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--void);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--void);
  color: var(--text);
  font-family: "Mulish Variable", Mulish, system-ui, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

.theme-toggle {
  position: fixed;
  z-index: 900;
  top: 18px;
  right: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background 160ms ease;
}

:root[data-js="on"] .theme-toggle {
  display: inline-flex;
}

.theme-toggle:hover {
  border-color: var(--violet);
  color: var(--text);
  background: var(--panel-hover);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
}

.icon-sun {
  display: var(--sun);
}

.icon-moon {
  display: var(--moon);
}

.page {
  width: min(100%, 47rem);
  margin: 0 auto;
  padding: 96px clamp(18px, 5vw, 24px) 96px;
}

.breadcrumb {
  margin-bottom: 2.25rem;
  font-size: 12px;
  font-weight: 700;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a::before {
  content: "← ";
}

.breadcrumb a:hover {
  color: var(--text);
  text-decoration: none;
}

.header {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2.5rem;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 46px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.lead {
  max-width: 34rem;
  margin: 0.875rem 0 0;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.6;
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 1.75rem 0 0;
}

.document-meta dt {
  color: var(--quiet);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.document-meta dd {
  margin: 0.25rem 0 0;
  color: var(--text);
  font-size: 13px;
}

.category {
  margin-bottom: 3.5rem;
}

.category-title {
  margin: 0 0 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.document-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 32px;
}

.document-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: color 160ms ease;
}

.document-link::after {
  content: "→";
  color: var(--accent);
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.document-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.document-link:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.prose h2 {
  margin: 3rem 0 1rem;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.prose h3 {
  margin: 2rem 0 0.75rem;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1.125rem;
}

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

.prose li {
  margin-bottom: 0.4rem;
}

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

.prose strong {
  color: var(--text);
  font-weight: 700;
}

.prose code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  font:
    0.84em ui-monospace,
    SFMono-Regular,
    Consolas,
    monospace;
}

.prose table {
  width: 100%;
  margin: 0 0 1.5rem;
  border-collapse: collapse;
  font-size: 14px;
}

.prose th,
.prose td {
  padding: 12px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--surface);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.prose tbody tr:hover {
  background: var(--line-soft);
}

.prose blockquote {
  margin: 0 0 1.125rem;
  padding: 14px 18px;
  border-left: 2px solid var(--violet);
  border-radius: 0 6px 6px 0;
  background: var(--surface);
  color: var(--muted);
}

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

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

@media (max-width: 560px) {
  .page {
    padding-top: 76px;
  }

  .document-grid {
    grid-template-columns: 1fr;
  }

  .prose table {
    display: block;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media print {
  :root {
    color-scheme: light;
    --void: #ffffff;
    --surface: #ffffff;
    --panel: #ffffff;
    --text: #000000;
    --muted: #333333;
    --quiet: #444444;
    --accent: #000000;
    --line: #cccccc;
  }

  .theme-toggle,
  .breadcrumb {
    display: none;
  }

  .page {
    width: auto;
    padding: 0;
  }

  a {
    text-decoration: underline;
  }
}
