/* Guide landing page (/docs/) — crisp technical walkthrough & reference */

body.guide {
  --bg: #fafbfd;
  --surface: #ffffff;
  --surface-subtle: #f3f5fa;
  --ink: #0f172a;
  --ink-secondary: #334155;
  --muted: #526074;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #4f5bd5;
  --accent-hover: #3f4bc4;
  --accent-ink: #3730a3;
  --accent-soft: rgba(79, 91, 213, 0.08);
  --code-bg: #eef2f8;
  --bar-bg: rgba(250, 251, 253, 0.88);
  --container: 1000px;

  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    'Geist Variable',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: dark) {
  body.guide {
    --bg: #0b0d13;
    --surface: #12151f;
    --surface-subtle: #171b27;
    --ink: #f1f5f9;
    --ink-secondary: #cbd5e1;
    --muted: #94a3b8;
    --line: #212736;
    --line-strong: #323b50;
    --accent: #7c89ff;
    --accent-hover: #96a1ff;
    --accent-ink: #a5b4fc;
    --accent-soft: rgba(124, 137, 255, 0.14);
    --code-bg: #1c2233;
    --bar-bg: rgba(11, 13, 19, 0.88);
  }
}

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

body.guide :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Header */
body.guide header.site-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  max-width: none;
  margin: 0;
  padding: 14px max(24px, calc((100% - var(--container)) / 2));
  background: var(--bar-bg);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 28px;
}

body.guide header.site-bar .brand {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--ink);
  text-decoration: none;
}

body.guide header.site-bar nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-right: auto;
}

body.guide header.site-bar nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.14s ease;
}

body.guide header.site-bar nav a[href='/docs/'] {
  color: var(--ink);
  font-weight: 600;
}

body.guide header.site-bar nav a:hover {
  color: var(--ink);
}

body.guide header.site-bar a.open {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 15px;
  border-radius: 8px;
  background: #4f5bd5;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 560;
  text-decoration: none;
  transition: background 0.14s ease;
}

body.guide header.site-bar a.open:hover {
  background: #3f4bc4;
}

/* Main container */
body.guide main {
  max-width: var(--container);
  margin: 0 auto;
  padding: 48px 24px 72px;
}

/* Header block */
body.guide .guide-header {
  margin-bottom: 40px;
}

body.guide .guide-header h1 {
  margin: 0 0 10px;
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
}

body.guide .guide-lead {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 64ch;
}

/* Section headings */
body.guide section h2 {
  margin: 0 0 16px;
  font-size: 0.8125rem;
  font-weight: 640;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Quick start steps */
body.guide .walkthrough {
  margin-bottom: 52px;
}

body.guide .step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

body.guide .step-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

body.guide .step-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-ink);
}

body.guide .step-body h3 {
  margin: 0 0 5px;
  font-size: 1.025rem;
  font-weight: 630;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
}

body.guide .step-body p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-secondary);
  max-width: 72ch;
}

body.guide .step-body strong,
body.guide .feature-card strong {
  color: var(--ink);
  font-weight: 600;
}

body.guide code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  color: var(--ink);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Layers & notes spotlight */
body.guide .spotlight {
  margin-bottom: 56px;
}

body.guide .spotlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

body.guide .feature-card {
  display: flex;
  flex-direction: column;
  padding: 24px 26px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 10px;
}

body.guide .feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 670;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
}

body.guide .feature-summary {
  margin: 0 0 16px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--muted);
}

body.guide .feature-points {
  margin: 0 0 20px;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.9125rem;
  line-height: 1.55;
  color: var(--ink-secondary);
}

body.guide .feature-points li {
  margin: 0;
}

body.guide .feature-points li::marker {
  color: var(--accent);
}

body.guide .feature-link {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 4px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-ink);
  text-decoration: none;
}

body.guide .feature-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Reference directory */
body.guide .reference {
  margin-bottom: 44px;
}

body.guide .ref-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 32px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

body.guide .ref-col h3 {
  margin: 0 0 12px;
  font-size: 0.9375rem;
  font-weight: 640;
  color: var(--ink);
  letter-spacing: -0.01em;
}

body.guide .ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.guide .ref-list li {
  margin: 0;
}

body.guide .ref-list a {
  display: block;
  text-decoration: none;
  padding: 2px 0;
}

body.guide .ref-title {
  display: block;
  font-size: 0.9375rem;
  font-weight: 560;
  line-height: 1.35;
  color: var(--accent-ink);
}

body.guide .ref-list a:hover .ref-title {
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.guide .ref-desc {
  display: block;
  margin-top: 2px;
  font-size: 0.84375rem;
  line-height: 1.45;
  color: var(--muted);
}

/* Compact bottom links */
body.guide .also {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}

body.guide .also-label {
  font-weight: 600;
  color: var(--ink);
}

body.guide .also a {
  display: inline-block;
  padding: 3px 0;
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 500;
}

body.guide .also a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Footer */
body.guide footer.site-footer {
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px 24px 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

body.guide footer.site-footer p {
  margin: 0 0 8px;
  max-width: none;
}

body.guide footer.site-footer p:last-child {
  margin-bottom: 0;
}

body.guide footer.site-footer .site-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-top: 6px;
}

body.guide footer.site-footer a {
  display: inline-block;
  padding: 4px 0;
  color: var(--muted);
  text-decoration: none;
}

body.guide footer.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Responsive */
@media (max-width: 820px) {
  body.guide .spotlight-grid {
    grid-template-columns: 1fr;
  }

  body.guide .ref-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body.guide header.site-bar {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 12px 18px;
  }

  body.guide header.site-bar .brand {
    margin-right: auto;
  }

  body.guide header.site-bar nav {
    order: 3;
    flex: 1 0 100%;
    gap: 18px;
    flex-wrap: wrap;
  }

  body.guide main {
    padding: 32px 18px 52px;
  }

  body.guide .step-row {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
  }

  body.guide .feature-card {
    padding: 20px 20px 18px;
  }

  body.guide .ref-columns {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  body.guide footer.site-footer {
    padding: 24px 18px 36px;
  }
}
