:root {
  color-scheme: light;
  --bg: #f7f5f2;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #0f172a;
  --accent-soft: #e2e8f0;
  --link: #1d4ed8;
  --code-bg: #0b1220;
  --code-text: #e2e8f0;
  --shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter Tight", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

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

.docs-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 30;
}

.docs-sidebar {
  width: 300px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 20px 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.docs-logo {
  font-family: "Domine", serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--text);
}

.docs-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.docs-search {
  margin-bottom: 20px;
}

.docs-search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fdfcfb;
  font-size: 14px;
}

.search-results {
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
  display: none;
}

.search-results.active {
  display: block;
}

.search-results button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
}

.search-results button:last-child {
  border-bottom: none;
}

.search-results span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.docs-nav details {
  border-radius: 12px;
  padding: 6px 6px 4px;
}

.docs-nav summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  padding: 6px 8px;
}

.docs-nav summary::-webkit-details-marker {
  display: none;
}

.docs-nav .nav-list {
  margin: 6px 0 4px 0;
  padding-left: 8px;
  display: grid;
  gap: 4px;
}

.docs-nav a {
  display: block;
  padding: 6px 8px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
}

.docs-nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.docs-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.docs-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.docs-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-button {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

.breadcrumbs {
  font-size: 13px;
  color: var(--muted);
}

.docs-header-right {
  display: flex;
  gap: 12px;
}

.docs-link {
  font-size: 13px;
  color: var(--muted);
}

.docs-body {
  padding: 0;
}

.docs-content-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 32px;
  padding: 28px 32px 64px;
}

.docs-content {
  background: var(--surface);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.docs-content h1 {
  font-family: "Domine", serif;
  font-size: 32px;
  margin-top: 0;
}

.docs-content h2 {
  font-size: 22px;
  margin-top: 28px;
}

.docs-content h3 {
  font-size: 18px;
  margin-top: 22px;
}

.docs-content p,
.docs-content li {
  font-size: 15px;
  line-height: 1.7;
  color: #374151;
}

.docs-content ul,
.docs-content ol {
  padding-left: 20px;
}

.docs-content code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 13px;
}

.docs-content pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
}

.docs-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.docs-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
  background: #f8fafc;
  color: var(--muted);
}

figure.screenshot {
  margin: 20px 0;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 16px;
}

figure.screenshot img {
  max-width: 100%;
  border-radius: 12px;
  display: block;
}

figure.screenshot figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.docs-toc {
  position: sticky;
  top: 110px;
  align-self: start;
  font-size: 13px;
  color: var(--muted);
}

.docs-toc strong {
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
}

.docs-toc a {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.noscript {
  background: #fff7ed;
  color: #92400e;
  padding: 12px 16px;
  text-align: center;
  font-size: 14px;
}

@media (max-width: 980px) {
  .docs-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .docs-shell.sidebar-open .docs-sidebar {
    transform: translateX(0);
  }

  .docs-shell.sidebar-open .docs-overlay {
    display: block;
  }

  .docs-content-wrap {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .docs-content {
    padding: 24px;
  }

  .docs-header-right {
    display: none;
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 640px) {
  .docs-header {
    padding: 14px 16px;
  }

  .docs-content h1 {
    font-size: 26px;
  }
}

@media (min-width: 981px) {
  .menu-button {
    display: none;
  }
}
