/* === Reset & Base === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --brand: #FDEA2E;
  --brand-dark: #e6d429;
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --text: #1a1a2e;
  --text-muted: #555;
  --border: #e2e2e2;
  --link: #0066cc;
  --link-hover: #004999;
  --code-bg: #f5f5f5;
  --sidebar-w: 260px;
  --toc-w: 200px;
  --nav-h: 56px;
  --content-max: 780px;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

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

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

/* === Navbar === */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--text);
  color: #fff;
  height: var(--nav-h);
  border-bottom: 3px solid var(--brand);
}

.navbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.125rem;
}

.navbar-brand:hover {
  color: var(--brand);
  text-decoration: none;
}

.navbar-logo {
  height: 36px;
  width: auto;
}

.navbar-links {
  display: flex;
  gap: 1.5rem;
}

.navbar-links a {
  color: #ccc;
  font-size: 0.9rem;
}

.navbar-links a:hover {
  color: #fff;
  text-decoration: none;
}

/* === Hero (Landing) === */
.hero {
  text-align: center;
  padding: 8rem 1.5rem 6rem;
  background: var(--text);
  color: #fff;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.hero-tagline {
  font-size: 1.25rem;
  color: #aaa;
  margin-bottom: 2rem;
}

.hero-cta {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--brand);
  color: var(--text);
  font-weight: 700;
  border-radius: 6px;
  font-size: 1rem;
}

.hero-cta:hover {
  background: var(--brand-dark);
  text-decoration: none;
  color: var(--text);
}

/* === Hero Logo === */
.hero-logo {
  width: 320px;
  height: auto;
  margin-bottom: 2rem;
}

/* === Features === */
.features {
  background: var(--bg);
  padding: 4rem 1.5rem;
}

.features-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.feature {
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.feature p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === Docs Layout === */
.docs-layout {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 2rem;
  padding: 2rem 1.5rem;
  min-height: calc(100vh - var(--nav-h) - 60px);
}

/* === Sidebar === */
.sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - 2rem);
  overflow-y: auto;
  padding-right: 1rem;
  font-size: 0.875rem;
}

.sidebar-category {
  margin-bottom: 1.25rem;
}

.sidebar-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.sidebar-list {
  list-style: none;
}

.sidebar-list li {
  margin-bottom: 0.15rem;
}

.sidebar-list a {
  display: block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--text);
}

.sidebar-list a:hover {
  background: var(--bg-alt);
  text-decoration: none;
}

.sidebar-list a.active {
  background: var(--brand);
  color: var(--text);
  font-weight: 600;
}

/* === Docs Content === */
.docs-content {
  max-width: var(--content-max);
  min-width: 0;
}

.docs-content h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.docs-content h2 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.docs-content h3 {
  font-size: 1.2rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.docs-content h4 {
  font-size: 1.05rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.docs-content p {
  margin-bottom: 1rem;
}

.docs-content ul,
.docs-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.docs-content li {
  margin-bottom: 0.25rem;
}

.docs-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.docs-content blockquote {
  border-left: 4px solid var(--brand);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: var(--bg-alt);
  color: var(--text-muted);
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.docs-content th,
.docs-content td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.docs-content th {
  background: var(--bg-alt);
  font-weight: 600;
}

/* === Code === */
.docs-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

.docs-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
  line-height: 1.5;
}

.docs-content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

/* === TOC (Table of Contents) === */
.toc {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - 2rem);
  overflow-y: auto;
  font-size: 0.8rem;
}

.toc-spacer {
  /* placeholder when no TOC */
}

.toc-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.toc-list {
  list-style: none;
}

.toc-list li {
  margin-bottom: 0.2rem;
}

.toc-list a {
  color: var(--text-muted);
}

.toc-list a:hover {
  color: var(--text);
  text-decoration: none;
}

.toc-list ul {
  list-style: none;
  padding-left: 0.75rem;
  margin-top: 0.2rem;
}

/* === Footer === */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.footer a {
  color: var(--text-muted);
  text-decoration: underline;
}

/* === Responsive === */
@media (max-width: 1024px) {
  .docs-layout {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }

  .toc,
  .toc-spacer {
    display: none;
  }
}

@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .sidebar {
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    padding-right: 0;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero {
    padding: 4rem 1rem 3rem;
  }

  .features-inner {
    grid-template-columns: 1fr;
  }
}
