:root {
  --fg: #18181b;
  --muted: #52525b;
  --line: #e4e4e7;
  --bg: #fafafa;
  --accent: #0284c7;
  --code-bg: #18181b;
  --code-fg: #e4e4e7;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(6px);
}
.brand { font-weight: 700; color: var(--fg); }
.top nav { display: flex; gap: 18px; }

/* Guide pages: sidebar + article. Landing: centered column. */
body:has(.sidebar) { display: grid; grid-template-columns: 260px minmax(0, 1fr); grid-template-rows: auto 1fr; }
body:has(.sidebar) .top { grid-column: 1 / -1; }
.sidebar { position: sticky; top: 57px; align-self: start; max-height: calc(100vh - 57px); overflow: auto; padding: 20px 16px; border-right: 1px solid var(--line); }
.sidebar nav { display: grid; gap: 2px; }
.sidebar a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--muted); }
.sidebar a[aria-current='page'] { background: #e0f2fe; color: var(--fg); font-weight: 600; }
.sidebar .edit { margin-top: 16px; font-size: 13px; }
.content { max-width: 920px; margin: 0 auto; padding: 24px 32px 64px; min-width: 0; }

h1, h2, h3, h4 { line-height: 1.25; scroll-margin-top: 72px; }
h1 { font-size: 32px; }
h2 { margin-top: 2em; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.anchor { margin-left: -0.9em; padding-right: 0.2em; color: var(--line); visibility: hidden; text-decoration: none; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { visibility: visible; }

code { padding: 1px 5px; border-radius: 4px; background: #f1f1f4; font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; }
pre { overflow: auto; padding: 14px 16px; border-radius: 8px; background: var(--code-bg); color: var(--code-fg); line-height: 1.5; }
pre code { padding: 0; background: none; color: inherit; font-size: 13px; }
table { display: block; overflow: auto; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
th, td { padding: 6px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f4f4f5; }
blockquote { margin: 16px 0; padding: 4px 16px; border-left: 4px solid var(--accent); background: #f0f9ff; color: var(--muted); }

.hero { padding: 24px 0 8px; }
.hero h1 { margin: 0 0 8px; font-size: 40px; }
.lead { max-width: 720px; color: var(--muted); font-size: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button { display: inline-block; padding: 8px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--fg); font-weight: 600; }
.button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.hero-player { margin-top: 24px; border-radius: 10px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.card { min-width: 0; padding: 4px 16px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.card pre { font-size: 12px; }
.note { color: var(--muted); font-size: 14px; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px 24px; padding-left: 20px; }
.guide-list { columns: 2; }
.footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

@media (max-width: 760px) {
  body:has(.sidebar) { display: block; }
  .sidebar { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .content { padding: 16px; }
  .top { padding: 10px 16px; }
  .top nav { gap: 12px; }
  .guide-list { columns: 1; }
}
