:root {
  --bg: #fbfbf9;
  --surface: #ffffff;
  --text: #1c1f23;
  --muted: #5b6168;
  --border: #e4e4df;
  --accent: #0f766e;
  --accent-strong: #0b5f58;
  --accent-soft: #e7f3f1;
  --radius: 10px;
  --measure: 46rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111416;
    --surface: #181c1f;
    --text: #e8eaec;
    --muted: #a0a7ae;
    --border: #2a3035;
    --accent: #3cc2b3;
    --accent-strong: #6fd6ca;
    --accent-soft: #15302d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111416; --surface: #181c1f; --text: #e8eaec; --muted: #a0a7ae;
  --border: #2a3035; --accent: #3cc2b3; --accent-strong: #6fd6ca; --accent-soft: #15302d;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 16px; }

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 10; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 20px; padding-top: 14px; padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.site-header nav, .site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.95rem; }
.site-header nav a, .site-footer nav a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .site-footer nav a:hover { color: var(--text); }
nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

/* Content */
main { padding-top: 40px; padding-bottom: 56px; }
.prose h1 { font-size: clamp(1.8rem, 4.5vw, 2.4rem); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.6em; }
.prose h2 { font-size: 1.35rem; line-height: 1.3; margin: 2.2em 0 0.6em; letter-spacing: -0.01em; }
.prose h3 { font-size: 1.08rem; margin: 1.6em 0 0.4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.35em; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }
.prose blockquote {
  margin: 1.5em 0; padding: 12px 16px; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0;
}
.prose blockquote p { margin: 0; }
.prose em { color: var(--muted); }
.prose strong em, .prose em strong { color: inherit; }

.table-wrap { overflow-x: auto; margin: 1em 0 1.5em; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.prose tr:last-child td { border-bottom: 0; }
.prose th { font-weight: 600; background: var(--accent-soft); }
.prose thead th:empty { display: none; }
.prose table:has(thead th:empty) thead { display: none; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .prose table { font-size: 0.88rem; }
  .prose th, .prose td { padding: 8px 10px; }
  main { padding-top: 28px; }
}

/* Home */
.home .prose h1 { font-size: clamp(2rem, 5.5vw, 2.9rem); max-width: 22ch; }
.home .prose > h1 + p { font-size: 1.15rem; color: var(--muted); }
.home .prose > h1 + p + p a {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  padding: 10px 18px; border-radius: 999px; font-weight: 600;
}
.home .prose > h1 + p + p a:hover { background: var(--accent-strong); }
.home .prose > ol { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 12px; }
.home .prose > ol > li {
  counter-increment: step; margin: 0; padding: 14px 16px 14px 56px; position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.home .prose > ol > li::before {
  content: counter(step); position: absolute; left: 16px; top: 14px;
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 0.9rem; display: grid; place-items: center;
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { padding-top: 20px; padding-bottom: 28px; }
.site-footer p { margin: 0 0 8px; }
