:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f3f9;
  --text: #172033;
  --muted: #65718a;
  --line: #dfe5ef;
  --accent: #3959d9;
  --accent-2: #e8edff;
  --code: #111827;
  --code-text: #e5eaf5;
  --green: #167d60;
  --shadow: 0 14px 40px rgba(25, 42, 84, .07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }
button { cursor: pointer; }
.skip-link { position: absolute; top: -60px; left: 1rem; padding: .7rem 1rem; background: var(--text); color: white; border-radius: 9px; z-index: 50; }
.skip-link:focus { top: 1rem; }
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1280px; margin: auto; min-height: 76px; padding: 0 28px; display: flex; align-items: center; gap: 30px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); font-weight: 800; letter-spacing: -.04em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: white; background: linear-gradient(140deg, #4e67e8, #744fe5); border-radius: 12px; font: 800 17px/1 ui-monospace, monospace; box-shadow: 0 6px 15px rgba(57,89,217,.25); }
.brand-name { font-size: 18px; }
.brand-name span { 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; }
.top-nav a:hover, .top-nav a[aria-current="page"] { color: var(--accent); text-decoration: none; }
.search-wrap { width: min(270px, 25vw); position: relative; }
.search-input { width: 100%; padding: 10px 14px 10px 38px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); outline: none; color: var(--text); font-size: 13px; }
.search-input:focus { border-color: #8ea0f3; box-shadow: 0 0 0 3px rgba(57,89,217,.1); }
.search-icon { position: absolute; left: 13px; top: 8px; color: var(--muted); font-size: 17px; pointer-events: none; }
.search-results { display: none; position: absolute; top: calc(100% + 9px); right: 0; width: min(390px, 90vw); padding: 8px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); max-height: 390px; overflow: auto; }
.search-results.is-open { display: block; }
.search-result { display: block; padding: 11px 12px; border-radius: 9px; color: var(--text); }
.search-result:hover { background: var(--surface-2); text-decoration: none; }
.search-result strong { display: block; font-size: 14px; }
.search-result small { display: block; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.search-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.mobile-menu { display: none; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 10px; color: var(--text); }
.layout { max-width: 1280px; padding: 36px 28px 70px; margin: auto; display: grid; grid-template-columns: 245px minmax(0, 1fr); gap: 36px; align-items: start; }
.sidebar { position: sticky; top: 108px; padding: 20px 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.sidebar-label { margin: 0 12px 12px; color: #8a94a8; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 800; }
.side-link { display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin: 3px 0; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 650; }
.side-link:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.side-link[aria-current="page"] { background: var(--accent-2); color: var(--accent); }
.side-icon { display: inline-grid; place-items: center; width: 25px; height: 25px; background: var(--surface-2); border-radius: 7px; font-size: 12px; color: var(--text); font-weight: 800; }
.side-link[aria-current="page"] .side-icon { background: white; color: var(--accent); }
.sidebar-note { margin: 20px 5px 2px; padding: 14px; border-radius: 12px; background: #f8f9fc; border: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.55; }
.sidebar-note strong { color: var(--text); display: block; margin-bottom: 4px; }
main { min-width: 0; }
.breadcrumb { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; margin: 0 0 15px; }
.breadcrumb span { color: #a5adbc; }
.hero { padding: 9px 0 28px; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; color: var(--accent); text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.eyebrow::before { content: ""; width: 19px; height: 2px; background: var(--accent); border-radius: 2px; }
h1 { font-size: clamp(34px, 4.5vw, 54px); letter-spacing: -.055em; line-height: 1.08; margin: 13px 0 16px; }
.hero p { margin: 0; max-width: 760px; color: var(--muted); font-size: 17px; line-height: 1.75; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.pill { display: inline-flex; align-items: center; padding: 5px 10px; color: #536078; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; font-weight: 700; }
.section-heading { margin: 34px 0 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
h2 { font-size: 23px; letter-spacing: -.035em; line-height: 1.25; margin: 0; }
h3 { font-size: 17px; letter-spacing: -.02em; margin: 0 0 10px; }
.section-heading p { color: var(--muted); margin: 0; font-size: 13px; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.topic-card { display: block; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); padding: 21px; color: var(--text); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.topic-card:hover { text-decoration: none; transform: translateY(-2px); border-color: #c4cdf3; box-shadow: var(--shadow); }
.topic-card .topic-icon { display: grid; place-items: center; width: 39px; height: 39px; margin-bottom: 16px; border-radius: 12px; background: var(--accent-2); color: var(--accent); font: 800 13px ui-monospace, monospace; }
.topic-card h3 { margin-bottom: 7px; }
.topic-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.topic-footer { margin-top: 18px; color: var(--accent); font-size: 12px; font-weight: 800; }
.callout { display: flex; gap: 14px; margin: 22px 0; border: 1px solid #d7defd; border-radius: 14px; padding: 17px 18px; background: #f4f6ff; }
.callout-mark { flex: 0 0 30px; display: grid; place-items: center; height: 30px; background: white; color: var(--accent); border-radius: 9px; font-weight: 900; }
.callout p { margin: 0; color: #4d5a7a; font-size: 13px; }
.callout strong { color: #283a92; }
.content-section { margin: 29px 0 36px; scroll-margin-top: 100px; }
.content-section > p { color: #49556b; }
.content-section ul, .content-section ol { padding-left: 24px; color: #49556b; }
.content-section li { padding: 3px 0; }
.prose-table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); font-size: 13px; }
.prose-table th, .prose-table td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose-table th { background: #f7f8fc; color: #606c82; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.prose-table tr:last-child td { border-bottom: 0; }
.prose-table td { color: #445067; }
code:not(pre code) { padding: .14em .38em; border: 1px solid #e1e5ef; border-radius: 5px; background: #f0f2f8; color: #3445a3; font-size: .88em; }
.code-card { overflow: hidden; margin: 17px 0 20px; border-radius: 15px; background: var(--code); box-shadow: 0 8px 24px rgba(17,24,39,.1); }
.code-top { display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 15px; background: #1a2232; border-bottom: 1px solid #2b3444; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #5d6678; }
.code-label { margin-left: 7px; color: #aab3c4; font-size: 11px; font-weight: 650; }
.copy-btn { margin-left: auto; padding: 5px 9px; border: 1px solid #3a4559; border-radius: 7px; background: #242e40; color: #dbe3f1; font-size: 11px; }
.copy-btn:hover { background: #334158; }
pre { margin: 0; padding: 18px 20px 21px; overflow: auto; color: var(--code-text); font: 12.5px/1.75 "SFMono-Regular", Consolas, "Liberation Mono", monospace; tab-size: 2; }
.token-comment { color: #8a96aa; }
.token-key { color: #b6a1ff; }
.token-string { color: #a9e1bd; }
.token-fn { color: #90c8ff; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.info-panel { padding: 19px; border: 1px solid var(--line); background: var(--surface); border-radius: 15px; }
.info-panel p { color: var(--muted); font-size: 13px; margin: 0; }
.info-panel h3 { font-size: 15px; }
.toc { padding: 20px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.toc strong { display: block; margin-bottom: 8px; font-size: 13px; }
.toc ul { margin: 0; padding-left: 18px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px 25px; font-size: 13px; }
.footer { max-width: 1280px; margin: 0 auto; padding: 23px 28px 35px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 12px; }
.footer strong { color: var(--text); }
@media (max-width: 1000px) {
  .header-inner { gap: 16px; padding: 0 20px; }
  .top-nav { gap: 12px; }
  .layout { grid-template-columns: 215px minmax(0,1fr); gap: 23px; padding: 27px 20px 55px; }
  .sidebar { padding: 15px 9px; }
  .side-link { padding: 9px; }
}
@media (max-width: 760px) {
  .header-inner { min-height: 68px; flex-wrap: wrap; padding: 13px 17px; gap: 12px; }
  .brand { margin-right: auto; }
  .mobile-menu { display: inline-block; }
  .top-nav { display: none; order: 3; width: 100%; padding-top: 10px; margin: 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
  .top-nav.is-open { display: flex; }
  .search-wrap { order: 2; width: 100%; }
  .search-input { padding-top: 9px; padding-bottom: 9px; }
  .search-icon { top: 6px; }
  .layout { display: block; padding: 25px 17px 45px; }
  .sidebar { position: static; display: none; margin-bottom: 23px; }
  .sidebar.is-open { display: block; }
  .sidebar-note { display: none; }
  .hero { padding-top: 4px; }
  h1 { font-size: 39px; }
  .hero p { font-size: 15px; }
  .card-grid, .two-col { grid-template-columns: 1fr; }
  .topic-card { padding: 18px; }
  .toc ul { grid-template-columns: 1fr; }
  .footer { padding: 20px 17px 28px; flex-direction: column; }
  .prose-table { display: block; overflow-x: auto; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; } }
