/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--color-text); background: var(--color-bg); line-height: 1.7; }

/* === CSS VARIABLES === */
:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #6b7280;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-light: #eff6ff;
  --color-border: #e5e7eb;
  --color-code-bg: #f8f8f8;
  --color-code-border: #e5e7eb;
  --color-yes: #16a34a;
  --color-no: #dc2626;
  --color-partial: #d97706;
  --color-nav-bg: #1e293b;
  --color-nav-text: #e2e8f0;
  --color-nav-hover: #ffffff;
  --color-sidebar-bg: #f9fafb;

  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, 'Courier New', monospace;

  --max-width-content: 860px;
  --max-width-wide: 1200px;
  --sidebar-width: 260px;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 { line-height: 1.3; }
h1 { font-size: 2.25rem; font-weight: 700; }
h2 { font-size: 1.6rem; font-weight: 600; border-bottom: 1px solid var(--color-border); padding-bottom: 0.4em; margin-top: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.2rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.75rem; }
h4 { font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 1.25rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; }
ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; }
blockquote { border-left: 4px solid var(--color-border); padding: 0.75rem 1.25rem; margin: 1.5rem 0; color: var(--color-text-muted); font-style: italic; }
strong { font-weight: 600; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); text-decoration: underline; }

/* === CODE === */
code { font-family: var(--font-mono); }
code:not([class*="language-"]) { background: var(--color-code-bg); padding: 2px 5px; border-radius: 3px; font-size: 0.875em; border: 1px solid var(--color-code-border); }
pre { background: var(--color-code-bg); border: 1px solid var(--color-code-border); border-radius: 6px; overflow-x: auto; padding: 1.25em; margin: 1.5rem 0; }
pre code { background: none; border: none; padding: 0; font-size: 0.875rem; }
pre[class*="language-"] { border-radius: 6px; font-family: var(--font-mono); font-size: 0.875rem; margin: 1.5rem 0; }

/* === NAVIGATION === */
.site-nav { background: var(--color-nav-bg); position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,0.25); }
.nav-inner { max-width: var(--max-width-wide); margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; height: 56px; }
.nav-logo { color: var(--color-nav-hover); font-family: var(--font-mono); font-weight: 600; font-size: 1rem; text-decoration: none; margin-right: 2.5rem; white-space: nowrap; flex-shrink: 0; }
.nav-logo:hover { color: #fff; text-decoration: none; }
.nav-links { list-style: none; display: flex; align-items: center; gap: 0; margin: 0; padding: 0; flex: 1; }
.nav-links > li > a { display: block; color: var(--color-nav-text); text-decoration: none; padding: 0 0.9rem; line-height: 56px; font-size: 0.9rem; white-space: nowrap; transition: color 0.15s; }
.nav-links > li > a:hover { color: var(--color-nav-hover); text-decoration: none; }
.nav-hamburger { display: none; background: none; border: none; color: var(--color-nav-text); font-size: 1.25rem; cursor: pointer; padding: 0.5rem; margin-left: auto; }

/* Dropdowns */
.has-dropdown { position: relative; }
.dropdown { display: none; position: absolute; top: 100%; left: 0; background: var(--color-nav-bg); min-width: 220px; border: 1px solid rgba(255,255,255,0.1); border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.35); list-style: none; padding: 0.5rem 0; margin: 0; z-index: 200; }
.has-dropdown:hover .dropdown { display: block; }
.dropdown li a { display: block; color: var(--color-nav-text); text-decoration: none; padding: 0.5rem 1rem; font-size: 0.875rem; transition: background 0.1s, color 0.1s; }
.dropdown li a:hover { background: rgba(255,255,255,0.1); color: var(--color-nav-hover); text-decoration: none; }

/* === LAYOUT === */
.page-content { max-width: var(--max-width-content); margin: 0 auto; padding: 2.5rem 1.5rem; }

/* Docs layout */
.docs-layout { max-width: var(--max-width-wide); margin: 0 auto; padding: 0 1.5rem; display: flex; gap: 2.5rem; align-items: flex-start; min-height: calc(100vh - 56px - 280px); }
.docs-sidebar { width: var(--sidebar-width); flex-shrink: 0; position: sticky; top: 76px; padding: 1.5rem 0; }
.docs-sidebar .sidebar-select { display: none; width: 100%; padding: 0.5rem; border: 1px solid var(--color-border); border-radius: 4px; font-size: 0.9rem; margin-bottom: 1rem; background: #fff; }
.docs-nav { list-style: none; padding: 0; margin: 0; }
.docs-nav .nav-section { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); padding: 1rem 0 0.4rem; }
.docs-nav li a { display: block; color: var(--color-text); text-decoration: none; padding: 0.3rem 0.75rem; border-radius: 4px; font-size: 0.875rem; transition: background 0.1s, color 0.1s; }
.docs-nav li a:hover { background: var(--color-accent-light); color: var(--color-accent); text-decoration: none; }
.docs-nav li a.active { background: var(--color-accent-light); color: var(--color-accent); font-weight: 600; }
.content-main { flex: 1; min-width: 0; padding: 2rem 0; }

/* Guide layout */
.guide-layout { max-width: var(--max-width-wide); margin: 0 auto; padding: 0 1.5rem; display: flex; gap: 2.5rem; align-items: flex-start; }
.guide-content { flex: 1; min-width: 0; max-width: 720px; padding: 2rem 0; }
.toc-sidebar { width: 240px; flex-shrink: 0; position: sticky; top: 76px; padding: 2rem 0; }

/* === HOMEPAGE === */
.hero { background: var(--color-nav-bg); color: #fff; padding: 5rem 1.5rem 4rem; text-align: center; }
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero h1 { font-size: 2.5rem; font-weight: 700; color: #fff; margin-bottom: 1rem; border: none; }
.hero .tagline { font-size: 1.15rem; color: #cbd5e1; margin-bottom: 2rem; line-height: 1.6; }
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.feature-section { background: #fff; border-bottom: 1px solid var(--color-border); }
.feature-grid { max-width: var(--max-width-wide); margin: 0 auto; padding: 3.5rem 1.5rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.feature-card { background: var(--color-sidebar-bg); border: 1px solid var(--color-border); border-radius: 8px; padding: 1.75rem; }
.feature-card .feature-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; margin-top: 0; border: none; }
.feature-card p { color: var(--color-text-muted); font-size: 0.9rem; margin: 0; }

.quickstart-block { background: var(--color-nav-bg); padding: 3rem 1.5rem; }
.quickstart-block .quickstart-inner { max-width: var(--max-width-content); margin: 0 auto; }
.quickstart-block h2 { color: #fff; border-color: rgba(255,255,255,0.2); }
.quickstart-block p { color: #94a3b8; }
.quickstart-step { margin-bottom: 1.5rem; }
.quickstart-step .step-label { display: inline-block; background: var(--color-accent); color: #fff; width: 1.5rem; height: 1.5rem; border-radius: 50%; text-align: center; line-height: 1.5rem; font-size: 0.8rem; font-weight: 700; margin-right: 0.5rem; vertical-align: middle; }
.quickstart-step h3 { display: inline; color: #e2e8f0; font-size: 1rem; font-weight: 600; vertical-align: middle; }
.quickstart-block pre { background: #0f172a; border-color: rgba(255,255,255,0.1); }
.quickstart-block code { color: #e2e8f0; }

.comparison-teaser { max-width: var(--max-width-content); margin: 3rem auto; padding: 2rem 1.5rem; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-accent-light); }
.comparison-teaser h3 { margin-top: 0; color: var(--color-accent); font-size: 1.15rem; border: none; }
.comparison-teaser p { margin-bottom: 0.75rem; }

/* === COMPARISON TABLES === */
.comparison-table-wrap { overflow-x: auto; margin: 2rem 0; border: 1px solid var(--color-border); border-radius: 8px; }
.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.comparison-table th { background: var(--color-nav-bg); color: var(--color-nav-text); padding: 0.75rem 1rem; text-align: left; white-space: nowrap; }
.comparison-table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr:nth-child(even) td { background: #fafafa; }
.comparison-table th.winner, .comparison-table td.winner { border-left: 3px solid var(--color-accent); }
span.yes { color: var(--color-yes); font-weight: 500; }
span.no { color: var(--color-no); font-weight: 500; }
span.partial { color: var(--color-partial); font-weight: 500; }

/* Verdict box */
.verdict-box { border-left: 4px solid var(--color-accent); background: var(--color-accent-light); padding: 1.5rem; border-radius: 0 8px 8px 0; margin: 2rem 0; }
.verdict-box strong { display: block; margin-bottom: 0.5rem; font-size: 1rem; color: var(--color-accent); }

/* Breadcrumb */
.breadcrumb { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--color-text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb .sep { margin: 0 0.4rem; }

/* Jump nav */
.jump-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem; padding: 0.75rem; background: var(--color-sidebar-bg); border: 1px solid var(--color-border); border-radius: 6px; font-size: 0.85rem; align-items: center; }
.jump-nav span { color: var(--color-text-muted); font-size: 0.8rem; }
.jump-nav a { color: var(--color-accent); text-decoration: none; padding: 0.25rem 0.5rem; border-radius: 3px; transition: background 0.1s; }
.jump-nav a:hover { background: var(--color-accent-light); text-decoration: none; }

/* === TOC === */
#toc-container { margin-bottom: 1rem; }
.toc { background: var(--color-sidebar-bg); border: 1px solid var(--color-border); border-radius: 6px; padding: 1.25rem; }
.toc-title { display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); margin-bottom: 0.75rem; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: 0.25rem; }
.toc-h3 { padding-left: 1rem; }
.toc a { display: block; color: var(--color-text-muted); text-decoration: none; font-size: 0.8rem; padding: 0.2rem 0.4rem; border-radius: 3px; transition: color 0.1s, background 0.1s; line-height: 1.4; }
.toc a:hover { color: var(--color-accent); text-decoration: none; background: var(--color-accent-light); }
.toc a.active { color: var(--color-accent); font-weight: 600; background: var(--color-accent-light); }

/* === FOOTER === */
.site-footer { background: var(--color-nav-bg); color: var(--color-nav-text); margin-top: 4rem; padding: 3rem 1.5rem 0; }
.footer-inner { max-width: var(--max-width-wide); margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.5rem; }
.footer-col strong { display: block; font-size: 0.9rem; font-weight: 600; color: #fff; margin-bottom: 0.75rem; }
.footer-col p { font-size: 0.85rem; color: #94a3b8; margin-bottom: 1rem; line-height: 1.6; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: 0.4rem; }
.footer-col ul li a { color: #94a3b8; text-decoration: none; font-size: 0.85rem; transition: color 0.15s; }
.footer-col ul li a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 1.25rem 0; }
.footer-bottom p { max-width: var(--max-width-wide); margin: 0 auto; font-size: 0.8rem; color: #64748b; }
.footer-bottom a { color: #94a3b8; text-decoration: none; }
.footer-bottom a:hover { color: #fff; }

/* === BUTTONS === */
.btn { display: inline-block; padding: 0.6rem 1.25rem; border-radius: 6px; font-weight: 600; font-size: 0.9rem; text-decoration: none; transition: background 0.15s, color 0.15s; cursor: pointer; border: none; }
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); color: #fff; text-decoration: none; }
.btn-secondary { background: transparent; color: #e2e8f0; border: 1px solid rgba(255,255,255,0.3); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; }
.btn-sm { display: inline-block; padding: 0.35rem 0.75rem; border-radius: 4px; font-size: 0.8rem; font-weight: 600; background: rgba(255,255,255,0.1); color: #e2e8f0; text-decoration: none; transition: background 0.15s; }
.btn-sm:hover { background: rgba(255,255,255,0.2); color: #fff; text-decoration: none; }

/* Simple page */
.simple-content { max-width: 800px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.simple-content h1 { margin-bottom: 1.5rem; }

/* Quick-answer box */
.quick-answer { background: var(--color-accent-light); border: 1px solid #bfdbfe; border-radius: 6px; padding: 1.25rem 1.5rem; margin: 1.5rem 0 2rem; }
.quick-answer strong { color: var(--color-accent); display: block; margin-bottom: 0.35rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-hamburger { display: block; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: var(--color-nav-bg); border-top: 1px solid rgba(255,255,255,0.1); padding: 0.5rem 0; z-index: 999; }
  .nav-links.nav-open { display: flex; }
  .nav-links > li > a { line-height: 1; padding: 0.75rem 1.25rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
  .dropdown { display: none; position: static; box-shadow: none; border: none; padding: 0; border-radius: 0; min-width: unset; background: rgba(0,0,0,0.2); }
  .has-dropdown.open .dropdown { display: block; }
  .dropdown li a { padding: 0.5rem 2rem; }
  .site-nav { position: relative; }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
  .hero h1 { font-size: 2rem; }
  .hero { padding: 3rem 1.25rem; }
  .feature-grid { grid-template-columns: 1fr; padding: 2rem 1.25rem; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }

  .docs-layout { flex-direction: column; padding: 0 1rem; }
  .docs-sidebar { width: 100%; position: static; padding: 1rem 0; }
  .docs-sidebar .sidebar-select { display: block; }
  .docs-nav { display: none; }
  .guide-layout { flex-direction: column; }
  .toc-sidebar { width: 100%; position: static; }

  .comparison-table-wrap { border-radius: 0; margin-left: -1rem; margin-right: -1rem; }

  .hero-buttons { flex-direction: column; align-items: center; }
  .hero-buttons .btn { width: 100%; max-width: 280px; text-align: center; }
}

@media (max-width: 480px) {
  .page-content { padding: 1.5rem 1rem; }
  .simple-content { padding: 1.5rem 1rem; }
}
