:root {
  --bg: #fff;
  --bg-soft: #f7f7f5;
  --ink: #0f0f0f;
  --muted: #737373;
  --line: #ececec;
  --accent: #f54e00;
  --sidebar-w: 280px;
  --toc-w: 180px;
  --top: 56px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--ink);
  text-underline-offset: 0.15em;
}
a:hover { color: var(--accent); }

img, svg { display: block; max-width: 100%; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.08em 0.32em;
}

.shell { display: flex; min-height: 100vh; }

/* Light sidebar — Cursor docs style */
.sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: var(--sidebar-w);
  height: 100vh;
  overflow-y: auto;
  background: #f7f7f5;
  color: #0f0f0f;
  border-right: 1px solid var(--line);
  padding: 0.85rem 0.75rem 2rem;
  flex-shrink: 0;
  z-index: 30;
}

.sidebar-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.35rem 1rem;
  text-decoration: none;
  color: var(--ink);
}
.sidebar-brand:hover { color: var(--ink); }

.logo-mark {
  position: relative;
  display: inline-block;
  width: 5.5rem;
  height: 5.5rem;
  flex-shrink: 0;
  overflow: visible;
}
.logo-mark img {
  width: 100%;
  height: auto;
  display: block;
}
.logo-mark-sm {
  width: 2.5rem;
  height: 2.5rem;
}

.logo-drip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  color: #111;
}
.logo-drip .drip {
  fill: none;
  stroke: currentColor;
  stroke-width: 13;
  stroke-linejoin: round;
  transform-box: view-box;
  transform-origin: 799px 708px;
  animation: drip 2.8s ease-in-out infinite;
}

@keyframes drip {
  0%, 60% { transform: translateY(0); opacity: 1; }
  74% { transform: translateY(10px); opacity: 1; }
  88% { transform: translateY(28px); opacity: 0; }
  89% { transform: translateY(0); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.sidebar-brand > span:last-child {
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.sidebar-section { margin-top: 0.85rem; }
.sidebar-section-title {
  margin: 0 0 0.25rem;
  padding: 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #a3a3a3;
}

.sidebar nav a {
  display: block;
  padding: 0.38rem 0.5rem;
  border-radius: 6px;
  color: #404040;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.sidebar nav a:hover {
  background: var(--bg-soft);
  color: var(--ink);
}
.sidebar nav a[aria-current="page"] {
  color: var(--accent);
  background: transparent;
}

.sidebar-foot {
  margin-top: 1.75rem;
  padding: 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.sidebar-foot a {
  color: var(--muted);
  text-decoration: none;
}
.sidebar-foot a:hover { color: var(--ink); }

.main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--top);
  height: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1.5rem;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-brand {
  display: none;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 650;
  font-size: 0.95rem;
  min-width: 0;
}
.topbar-brand:hover { color: var(--ink); }

.topnav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.topnav a {
  text-decoration: none;
  color: var(--muted);
}
.topnav a:hover,
.topnav a[aria-current="page"] { color: var(--accent); }

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  color: var(--ink);
}

.content-row {
  display: flex;
  flex: 1;
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  gap: 2.25rem;
}

main {
  flex: 1;
  min-width: 0;
  padding-top: 2.1rem;
  max-width: 44rem;
}

.toc {
  width: var(--toc-w);
  flex-shrink: 0;
  padding-top: 2.4rem;
  position: sticky;
  top: calc(var(--top) + 0.4rem);
  align-self: flex-start;
  font-size: 0.8rem;
}
.toc-title {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.7rem;
}
.toc nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-left: 1px solid var(--line);
  padding-left: 0.75rem;
}
.toc a {
  text-decoration: none;
  color: var(--muted);
}
.toc a:hover { color: var(--ink); }

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.8rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.038em;
  line-height: 1.15;
}

.lede {
  margin: 0 0 1.6rem;
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 40rem;
}

h2 {
  margin: 2.1rem 0 0.7rem;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  scroll-margin-top: 5rem;
}

h3 {
  margin: 1.4rem 0 0.45rem;
  font-size: 1.02rem;
  font-weight: 650;
}

main p { margin: 0 0 0.95rem; color: #404040; }
main ul, main ol { margin: 0 0 1rem; padding-left: 1.2rem; color: #404040; }
main li + li { margin-top: 0.32rem; }

.note {
  margin: 1.2rem 0;
  padding: 0.85rem 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: #404040;
  font-size: 0.92rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.7rem;
  margin: 0.9rem 0 0.4rem;
}

.card {
  display: block;
  padding: 1rem 1.05rem;
  background: var(--bg-soft);
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease;
}
.card:hover {
  border-color: #ddd;
  color: inherit;
}
.card-title {
  display: block;
  font-weight: 650;
  font-size: 0.95rem;
  margin-bottom: 0.22rem;
  letter-spacing: -0.01em;
}
.card-desc {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.link-list {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.link-list li { border-bottom: 1px solid var(--line); }
.link-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0.1rem;
  text-decoration: none;
}
.link-list a:hover .link-title { color: var(--accent); }
.link-title { font-weight: 650; letter-spacing: -0.01em; }
.link-meta { color: var(--muted); font-size: 0.88rem; margin-top: 0.12rem; }
.link-arrow { color: var(--muted); flex-shrink: 0; }

.faq-list details {
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 0;
}
.faq-list summary {
  cursor: pointer;
  font-weight: 650;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::before {
  content: "+";
  display: inline-block;
  width: 1.1rem;
  color: var(--accent);
  font-weight: 500;
}
.faq-list details[open] summary::before { content: "–"; }
.faq-list details p { margin: 0.55rem 0 0.15rem 1.1rem; }

.site-footer {
  margin-top: 2.75rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.1rem;
  margin-top: 0.45rem;
}

.sidebar-overlay { display: none; }
body.sidebar-open { overflow: hidden; }

@media (max-width: 960px) {
  .toc { display: none; }
}

@media (max-width: 820px) {
  .menu-btn {
    display: inline-flex;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.15rem;
  }
  .topbar-brand { display: inline-flex; flex: 1; }
  .topbar-brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(20rem, 88vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: none;
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 25;
  }
  body.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  .content-row { padding-inline: 1rem; }
  .topbar { padding-inline: 0.75rem; }
  .topnav { gap: 0.85rem; }
  .topnav a { padding: 0.45rem 0; }
  .sidebar nav a {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
  }
  .card-grid { grid-template-columns: 1fr; }
  .logo-mark:not(.logo-mark-sm) {
    width: 4.75rem;
    height: 4.75rem;
  }
}

@media (max-width: 480px) {
  body { font-size: 15px; }
  h1 { font-size: 1.7rem; }
  .lede { font-size: 0.98rem; }
}
