:root {
  --ink: #eef0ff;
  --muted: #a6abc4;
  --faint: #747b9c;
  --canvas: #0c0f1b;
  --panel: #12172a;
  --panel-2: #171e35;
  --panel-3: #1d2642;
  --line: rgba(183, 191, 255, 0.13);
  --line-strong: rgba(183, 191, 255, 0.24);
  --brand: #7b72ff;
  --brand-2: #a9a3ff;
  --signal: #72e4cf;
  --signal-soft: rgba(114, 228, 207, 0.12);
  --warn: #ffc96b;
  --warn-soft: rgba(255, 201, 107, 0.11);
  --danger: #ff8d9b;
  --danger-soft: rgba(255, 141, 155, 0.11);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  --radius: 18px;
  --radius-sm: 11px;
  --header-h: 68px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --ink: #211b34;
  --muted: #645d78;
  --faint: #837c94;
  --canvas: #f3f2fb;
  --panel: #ffffff;
  --panel-2: #f8f7ff;
  --panel-3: #eeecfb;
  --line: rgba(52, 40, 90, 0.12);
  --line-strong: rgba(52, 40, 90, 0.22);
  --brand: #5b52e8;
  --brand-2: #4a42c4;
  --signal: #147b6b;
  --signal-soft: rgba(20, 123, 107, 0.09);
  --warn: #9c6200;
  --warn-soft: rgba(156, 98, 0, 0.09);
  --danger: #b83d50;
  --danger-soft: rgba(184, 61, 80, 0.08);
  --shadow: 0 24px 70px rgba(52, 40, 90, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--canvas);
  background-size: 48px 48px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 78% -10%, rgba(123, 114, 255, 0.18), transparent 34rem);
}

a { color: var(--brand-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
img { max-width: 100%; }
code, kbd, .eyebrow, .depth-label, .sidebar-label, .tab-key, .breadcrumb, .meta {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
code {
  padding: 0.12em 0.38em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-3);
  color: var(--ink);
  font-size: 0.88em;
}
kbd {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 0.82em;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: blur(18px);
}
.header-inner {
  width: min(1240px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand-docs {
  margin-left: 2px;
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-weight: 600;
}
.top-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.top-nav a { color: var(--muted); font-size: 14px; font-weight: 650; text-decoration: none; }
.top-nav a[aria-current="page"], .top-nav a:hover { color: var(--ink); }
.header-tools { display: flex; align-items: center; gap: 8px; }
.lang-switch, .icon-button, .sidebar-toggle {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 999px;
  font: inherit;
}
.lang-switch {
  display: inline-flex;
  padding: 3px;
  text-decoration: none;
}
.lang-switch span {
  min-width: 38px;
  padding: 4px 9px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-weight: 750;
}
.lang-switch .active { background: var(--brand); color: #fff; }
.icon-button, .sidebar-toggle {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.icon-button:hover, .sidebar-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.sidebar-toggle { display: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--signal) 65%, transparent); outline-offset: 3px; }

.docs-shell {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 238px minmax(0, 760px) 180px;
  gap: 40px;
  align-items: start;
}
.docs-sidebar, .on-this-page {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  max-height: calc(100vh - var(--header-h) - 50px);
  overflow: auto;
  padding-bottom: 24px;
}
.docs-sidebar { padding-top: 42px; }
.sidebar-label, .on-this-page h2 {
  margin: 0 0 11px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.docs-sidebar nav { display: grid; gap: 4px; }
.docs-sidebar a {
  padding: 8px 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}
.docs-sidebar a:hover { color: var(--ink); background: var(--panel); }
.docs-sidebar a[aria-current="page"] {
  background: var(--signal-soft);
  color: var(--signal);
  box-shadow: inset 2px 0 var(--signal);
}
.sidebar-group + .sidebar-group { margin-top: 24px; }
.on-this-page { padding-top: 48px; }
.on-this-page a {
  display: block;
  padding: 5px 0 5px 12px;
  border-left: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
}
.on-this-page a:hover { color: var(--ink); border-color: var(--brand); }

.doc-main { min-width: 0; padding: 46px 0 96px; }
.breadcrumb { color: var(--faint); font-size: 12px; letter-spacing: 0.03em; }
.doc-hero { padding: 18px 0 34px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--signal); font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
h1, h2, h3 {
  font-family: ui-rounded, "Avenir Next", Inter, ui-sans-serif, sans-serif;
  color: var(--ink);
  letter-spacing: -0.035em;
}
h1 { margin: 12px 0 16px; font-size: clamp(38px, 6vw, 64px); line-height: 1.02; }
.doc-page h1 { font-size: clamp(36px, 5vw, 54px); }
.lede { max-width: 680px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.65; }
.meta { margin-top: 18px; color: var(--faint); font-size: 12px; }
.walkthrough-card {
  margin-top: 30px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
  box-shadow: var(--shadow);
}
.walkthrough-copy { padding: 24px 26px 22px; }
.walkthrough-copy h2 { max-width: 660px; margin: 8px 0 10px; font-size: 28px; line-height: 1.16; }
.walkthrough-copy p { max-width: 680px; margin: 0; color: var(--muted); font-size: 15px; }
.walkthrough-player { border-block: 1px solid var(--line); background: #070912; }
.walkthrough-player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #070912; }
.walkthrough-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding: 15px 18px;
}
.walkthrough-meta { color: var(--faint); font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; font-weight: 500; }
.doc-section { padding: 38px 0 8px; }
.doc-section h2 { margin: 0 0 14px; font-size: 29px; line-height: 1.2; }
.doc-section h3 { margin: 30px 0 8px; font-size: 20px; }
.doc-section p { margin: 0 0 18px; color: var(--muted); }
.doc-section li { color: var(--muted); }
.doc-section strong { color: var(--ink); }
.doc-section ul, .doc-section ol { padding-left: 22px; }
.doc-section li + li { margin-top: 8px; }

.path-grid, .card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.path-card, .card {
  position: relative;
  min-height: 180px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--panel), var(--panel-2));
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.08);
}
.path-card { display: flex; flex-direction: column; color: inherit; text-decoration: none; transition: transform 0.18s ease, border-color 0.18s ease; }
.path-card:hover { transform: translateY(-3px); border-color: var(--line-strong); color: inherit; }
.path-card h2, .card h3 { margin: 12px 0 8px; font-size: 21px; }
.path-card p, .card p { margin: 0; color: var(--muted); font-size: 14px; }
.path-card .arrow { margin-top: auto; padding-top: 18px; color: var(--signal); font-weight: 750; }
.tab-key { color: var(--brand-2); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }

.settings-map {
  margin: 26px 0 4px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.setting-node { min-width: 0; padding: 15px 9px 13px; border-radius: 10px; background: var(--panel-2); text-align: center; }
.setting-node strong { display: block; color: var(--ink); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setting-node span { display: block; margin-top: 5px; color: var(--faint); font-size: 10px; line-height: 1.3; }
.setting-node.everyday { box-shadow: inset 0 -3px var(--signal); }
.setting-node.sometimes { box-shadow: inset 0 -3px var(--brand); }
.setting-node.expert { box-shadow: inset 0 -3px var(--warn); }
.depth-legend { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 12px; color: var(--faint); font-size: 11px; }
.depth-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--signal); }
.depth-legend .sometimes::before { background: var(--brand); }
.depth-legend .expert::before { background: var(--warn); }

.callout {
  margin: 24px 0;
  padding: 18px 20px;
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout.tip { border-left-color: var(--signal); background: var(--signal-soft); }
.callout.warning { border-left-color: var(--warn); background: var(--warn-soft); }
.callout.danger { border-left-color: var(--danger); background: var(--danger-soft); }
.callout-title { display: block; margin-bottom: 5px; color: var(--ink); font-size: 14px; }

.shot {
  margin: 28px 0 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #10131f;
  box-shadow: var(--shadow);
}
.shot a { display: block; line-height: 0; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; line-height: 1.5; }

.step-list { counter-reset: steps; list-style: none; padding: 0 !important; margin: 24px 0; }
.step-list li { counter-increment: steps; position: relative; padding: 0 0 26px 48px; }
.step-list li::before {
  content: counter(steps, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: -2px;
  color: var(--signal);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
}
.step-list li::after { content: ""; position: absolute; left: 15px; top: 23px; bottom: 5px; width: 1px; background: var(--line); }
.step-list li:last-child::after { display: none; }

.table-wrap { margin: 22px 0 30px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--faint); font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
td { color: var(--muted); font-size: 14px; }
tr:last-child td { border-bottom: 0; }

.mode-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.mode { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.mode strong { display: block; margin-bottom: 5px; }
.mode span { display: block; color: var(--faint); font-size: 13px; }
.mode.ask { border-top: 3px solid var(--signal); }
.mode.act { border-top: 3px solid var(--brand); }
.mode.dev { border-top: 3px solid var(--warn); }

.next-links { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.next-links a { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); color: var(--ink); font-weight: 700; text-decoration: none; }
.next-links a span { display: block; color: var(--faint); font-size: 11px; font-weight: 500; }
.site-footer { border-top: 1px solid var(--line); background: var(--canvas); }
.footer-inner { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 28px 0; display: flex; justify-content: space-between; gap: 20px; color: var(--faint); font-size: 12px; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--faint); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 700; }
.skip-link:focus { top: 10px; }

@media (max-width: 1080px) {
  .docs-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .on-this-page { display: none; }
}
@media (max-width: 780px) {
  :root { --header-h: 60px; }
  .header-inner, .docs-shell, .footer-inner { width: min(100% - 28px, 760px); }
  .top-nav { display: none; }
  .header-tools { margin-left: auto; }
  .sidebar-toggle { display: inline-grid; }
  .docs-shell { display: block; }
  .docs-sidebar {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    z-index: 40;
    display: none;
    max-height: calc(100vh - var(--header-h));
    padding: 24px 20px 32px;
    border-bottom: 1px solid var(--line);
    background: var(--canvas);
    box-shadow: var(--shadow);
  }
  body.sidebar-open .docs-sidebar { display: block; }
  .doc-main { padding-top: 34px; }
  .settings-map { grid-template-columns: repeat(3, 1fr); }
  .mode-strip { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .brand-docs { display: none; }
  .path-grid, .card-grid, .next-links { grid-template-columns: 1fr; }
  .path-card { min-height: 150px; }
  .settings-map { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: column; }
  h1 { font-size: 39px; }
  .lede { font-size: 16px; }
  .walkthrough-copy { padding: 20px; }
  .walkthrough-copy h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
