:root {
  --bg: #f3eee6;
  --paper: #faf7f2;
  --ink: #1c1916;
  --muted: #5c564e;
  --accent: #c45c26;
  --accent-soft: #f3e0d4;
  --accent-dark: #8d3c16;
  --sidebar: #1b2227;
  --sidebar-text: #e6dfd4;
  --sidebar-muted: #9aa3a8;
  --line: #d8d0c4;
  --code: #13202b;
  --shadow: 0 10px 30px rgba(28, 25, 22, 0.08);
  --radius: 14px;
  --sidebar-w: 280px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Source Serif 4", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 1.0625rem;
}
a { color: var(--accent-dark); }
a:hover { color: var(--accent); }
.skip {
  position: absolute; left: -999px; top: 0;
}
.skip:focus { left: 12px; background: #fff; padding: 8px 12px; z-index: 20; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 14px;
  height: 58px; padding: 0 16px 0 12px;
  background: var(--sidebar); color: var(--sidebar-text);
  border-bottom: 3px solid var(--accent);
}
.menu-btn {
  display: none;
  background: transparent; color: var(--sidebar-text);
  border: 1px solid #3a454c; border-radius: 8px;
  width: 42px; height: 36px; font-size: 1.1rem; cursor: pointer;
}
.brand { display: flex; flex-direction: column; line-height: 1.15; text-decoration: none; color: inherit; }
.brand small { font-family: "DM Sans", "Segoe UI", sans-serif; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.62rem; color: var(--sidebar-muted); }
.brand strong { font-family: "DM Sans", "Segoe UI", sans-serif; font-weight: 700; font-size: 1rem; }
.topbar .tag {
  margin-left: auto;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-size: 0.75rem; color: var(--sidebar-muted);
}
.shell { display: flex; min-height: calc(100vh - 58px); }
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar);
  color: var(--sidebar-text);
  padding: 22px 0 48px;
  overflow-y: auto;
}
.sidebar h2 {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sidebar-muted); margin: 22px 20px 8px; font-weight: 700;
}
.sidebar a {
  display: block; color: var(--sidebar-text); text-decoration: none;
  padding: 6px 20px; font-family: "DM Sans", "Segoe UI", sans-serif;
  font-size: 0.92rem; line-height: 1.35; border-left: 3px solid transparent;
}
.sidebar a:hover, .sidebar a[aria-current="page"] {
  background: rgba(255,255,255,0.05);
  border-left-color: var(--accent);
  color: #fff;
}
.sidebar a.l2 { padding-left: 32px; font-size: 0.86rem; color: #c9c3b8; }
.content {
  flex: 1; min-width: 0;
  padding: 36px 40px 80px;
}
article, .doc {
  max-width: 860px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 48px 56px;
  box-shadow: var(--shadow);
}
h1, h2, h3, h4 {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  line-height: 1.25;
  font-weight: 700;
}
h1 { font-size: 2.1rem; margin: 0 0 10px; letter-spacing: -0.02em; }
h2 { font-size: 1.45rem; margin: 2.2rem 0 0.7rem; padding-top: 0.4rem; border-top: 1px solid var(--line); }
h2:first-of-type { border-top: 0; padding-top: 0; }
h3 { font-size: 1.12rem; margin: 1.6rem 0 0.5rem; }
.lede { font-size: 1.2rem; color: var(--muted); margin: 0 0 1.5rem; }
.meta {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-size: 0.85rem; color: var(--muted); margin: 0 0 1.4rem;
}
.kicker {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-dark); font-weight: 700; margin: 0 0 8px;
}
figure { margin: 1.4rem 0 1.8rem; }
figure img, .hero img, .gallery img {
  display: block; width: 100%; height: auto;
  border-radius: 10px; border: 1px solid var(--line);
  background: #111;
}
figcaption {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-size: 0.86rem; color: var(--muted);
  margin-top: 0.55rem;
}
.gallery {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 1.2rem 0 1.8rem;
}
.gallery figure { margin: 0; }
ol.steps { padding-left: 1.2rem; }
ol.steps > li { margin: 0.55rem 0; }
.note, .warn {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 12px 16px; border-radius: 0 10px 10px 0;
  margin: 1.2rem 0;
}
.warn { border-left-color: #8a2f2f; background: #f6e8e4; }
.note p, .warn p { margin: 0.3rem 0; }
.note ul, .warn ul { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.note li, .warn li { margin: 0.25rem 0; }
table {
  width: 100%; border-collapse: collapse; margin: 1rem 0 1.4rem;
  font-size: 0.95rem;
}
th, td {
  text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px 8px 0;
}
th { font-family: "DM Sans", "Segoe UI", sans-serif; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
code, .ui {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  font-size: 0.88em; font-weight: 650;
  background: #ece6dc; padding: 0.05em 0.38em; border-radius: 5px;
}
pre {
  background: var(--code); color: #f2ebe3; padding: 14px 16px;
  border-radius: 10px; overflow-x: auto; font-size: 0.85rem;
}
pre code { background: none; color: inherit; padding: 0; font-weight: 400; }
.cards {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin: 1.4rem 0;
}
.card {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; transition: transform 0.15s ease, border-color 0.15s;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card h3 { margin: 0 0 6px; font-size: 1rem; color: var(--accent-dark); }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.pager {
  display: flex; justify-content: space-between; gap: 12px;
  margin: 28px auto 0; max-width: 860px;
  font-family: "DM Sans", "Segoe UI", sans-serif; font-size: 0.92rem;
}
.pager a {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 16px; text-decoration: none; color: var(--ink);
  flex: 1;
}
.pager a:hover { border-color: var(--accent); }
.pager .next { text-align: right; }
.hero-home img { border-radius: 14px; }
ul.check { list-style: none; padding: 0; }
ul.check li { padding: 0.2rem 0 0.2rem 1.4rem; position: relative; }
ul.check li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-dark); font-weight: 700; }
.home-wrap article, .home-wrap .doc { max-width: 980px; }
.backdrop { display: none; }
@media (max-width: 980px) {
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar {
    position: fixed; top: 58px; bottom: 0; left: 0; z-index: 12;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .backdrop {
    display: none; position: fixed; inset: 58px 0 0 0; background: rgba(0,0,0,0.4); z-index: 11;
  }
  body.nav-open .backdrop { display: block; }
  .content { padding: 20px 14px 64px; }
  article, .doc { padding: 24px 18px 36px; }
  h1 { font-size: 1.7rem; }
}

.topbar .home-link { margin-left: auto; color: var(--sidebar-muted); text-decoration: none; font-family: "DM Sans", "Segoe UI", sans-serif; font-size: 0.78rem; }
.topbar .home-link:hover { color: #fff; }
.topbar .home-link + .tag { margin-left: 18px; }
@media (max-width: 700px) { .topbar .tag { display: none; } }
