:root {
  --text: 0.9375rem;
  --width: min(56rem, calc(100vw - 2rem));
}

html[data-theme="light"] {
  color-scheme: only light;
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #5c5c5c;
  --border: #e0e0e0;
  --code-bg: #f4f4f4;
}

html[data-theme="dark"] {
  color-scheme: only dark;
  --bg: #0c0c0c;
  --fg: #ededed;
  --muted: #9a9a9a;
  --border: #2a2a2a;
  --code-bg: #161616;
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    color-scheme: only light;
    --bg: #ffffff;
    --fg: #1a1a1a;
    --muted: #5c5c5c;
    --border: #e0e0e0;
    --code-bg: #f4f4f4;
  }
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    color-scheme: only dark;
    --bg: #0c0c0c;
    --fg: #ededed;
    --muted: #9a9a9a;
    --border: #2a2a2a;
    --code-bg: #161616;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  font-size: calc(1rem - 1pt);
  background-color: var(--bg);
  color: var(--fg);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--text);
  font-weight: 400;
  line-height: 1.55;
  color: var(--fg);
  background-color: var(--bg);
  transition: background-color 0.15s ease, color 0.15s ease;
}

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

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--width);
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1rem 0;
}

.logo {
  font-size: var(--text);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: calc(var(--text) - 1pt);
}

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

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--fg);
  text-decoration: none;
}

.theme-toggle {
  font: inherit;
  font-size: calc(var(--text) - 1pt);
  font-weight: 400;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.3em 0.55em;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle:hover {
  color: var(--fg);
  border-color: var(--muted);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--muted);
  outline-offset: 2px;
}

main {
  flex: 1;
  max-width: var(--width);
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1rem 2.5rem;
}

.site-footer {
  max-width: var(--width);
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem 1.5rem;
  font-size: calc(var(--text) - 1pt);
  color: var(--muted);
}

.lead {
  font-size: var(--text);
  color: var(--muted);
  margin: 0.35rem 0 0;
}

.tool-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}

.tool-list li {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  transition: border-color 0.15s ease;
}

.tool-list li:last-child {
  border-bottom: 1px solid var(--border);
}

.tool-list a.tool-name {
  font-weight: 500;
  color: var(--fg);
}

.tool-list p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: calc(var(--text) - 1pt);
}

.tool-list .install {
  margin: 0.35rem 0 0;
  font-size: calc(var(--text) - 2pt);
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  color: var(--muted);
  line-height: 1.45;
}

h1 {
  font-size: calc(var(--text) + 5pt);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}

h2 {
  font-size: calc(var(--text) + 1pt);
  font-weight: 500;
  margin: 2rem 0 0.5rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--text);
  font-weight: 500;
  margin: 1.25rem 0 0.35rem;
}

p {
  margin: 0.6rem 0;
}

ul,
ol {
  margin: 0.6rem 0;
  padding-left: 1.25rem;
}

li {
  margin: 0.2rem 0;
}

code {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  font-size: calc(var(--text) - 1pt);
  background: var(--code-bg);
  padding: 0.1em 0.3em;
  border-radius: 2px;
  transition: background-color 0.15s ease;
}

pre {
  margin: 0.75rem 0;
  padding: 0.75rem 0.85rem;
  overflow-x: auto;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: calc(var(--text) - 2pt);
  line-height: 1.45;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: calc(var(--text) - 1pt);
  margin: 0.75rem 0;
}

th,
td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  text-align: left;
  vertical-align: top;
  transition: border-color 0.15s ease;
}

th {
  font-weight: 500;
}

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

.readme h1 {
  font-size: calc(var(--text) + 5pt);
  margin-bottom: 0.15rem;
}

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

.readme h2 {
  margin-top: 1.75rem;
  padding-top: 0;
  border: none;
}

.readme h2:not(:first-of-type) {
  margin-top: 2rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.readme hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.block {
  margin: 1.5rem 0 0;
  padding: 0;
}

.block pre {
  margin: 0.35rem 0 0;
  border: 1px solid var(--border);
  padding: 0.75rem 0.85rem;
  background: var(--code-bg);
}

.block-label {
  font-size: calc(var(--text) - 2pt);
  font-weight: 500;
  color: var(--muted);
  margin: 0;
}
