/*----------------------
# Global Variables
----------------------*/
:root {
  --color-bg: #ffffff;
  --color-surface: #f8fafc;
  --color-muted: #eef2f7;
  --color-text: #091931;
  --color-text-muted: #475569;
  --color-border: #e2e8f0;
  --color-accent: #1890ff;
  --color-accent-600: #0284c7;
  --color-success: #00b45f;

  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 64px;
  --shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.05);
  --shadow-md: 0 6px 16px rgba(2, 6, 23, 0.08);
}

.dark {
  --color-bg: #0b1220;
  --color-surface: #0f172a;
  --color-muted: #111827;
  --color-text: #f0f8ff;
  --color-text-muted: #586686;
  --color-border: #1f2937;
  --color-accent: #1890ff;
  --color-accent-600: #0ea5e9;
  --color-success: #00b45f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.35);
}

/*----------------------
# Base Styles
----------------------*/
* {
  margin: 0;
  padding: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Helvetica, Roboto;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  color: var(--color-text);
  background:
    radial-gradient(1200px 600px at 10% -20%, rgba(14,165,233,0.08), transparent 60%),
    radial-gradient(1000px 600px at 110% 0%, rgba(56,189,248,0.06), transparent 55%),
    var(--color-bg);
}
.bolt-spacer {
  height: 20px;
}

/*----------------------
# Typography
----------------------*/
.prose {
  max-width: 900px;
  margin: 0 auto;
}
.prose .lead {
  color: var(--color-text);
  font-size: 18px;
}
h1 {
  font-size: 36px;
  margin: 16px 0 8px;
}
h2 {
  font-size: 26px;
  margin-top: 32px;
  margin-bottom: 12px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
h3 {
  font-size: 20px;
  margin-top: 20px;
  margin-bottom: 8px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
p,
ul,
ol {
  line-height: 1.8;
}
ul, ol {
  padding: 10px 20px;
}

/*----------------------
# Links / Anchor Links
----------------------*/
.ahref {
  text-decoration: none;
  color: var(--color-accent);
}
.ahref:hover {
  text-decoration: underline;
}
.anchor-link {
  opacity: 0;
  margin-left: 6px;
  text-decoration: none;
  color: var(--color-text-muted);
}
h2:hover .anchor-link,
h3:hover .anchor-link {
  opacity: 1;
}

/*----------------------
# Buttons
----------------------*/
.button {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.button.primary {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-600));
  color: #fff;
  border-color: transparent;
}

/*----------------------
# Accessibility
----------------------*/
.skip-link {
  position: absolute;
  left: -9999px;
  top: -9999px;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  background: var(--color-accent);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/*----------------------
# Header
----------------------*/
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: color-mix(in oklab, var(--color-surface) 90%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
}
.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  width: 170px;
  height: auto;
}
.logo-dark,
html.dark .logo-light {
  display: none;
}
html.light .logo-light,
html.dark .logo-dark {
  display: block;
}

.search {
  flex: 1;
  max-width: 720px;
}
.search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 36px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  background-image: url('/assets/images/search_icon.svg');
  background-repeat: no-repeat;
  background-position: 12px center;
}
.search input:focus {
  outline: 2px solid color-mix(in oklab, var(--color-accent), transparent 60%);
  border-color: var(--color-accent);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  appearance: none;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.icon-btn:hover {
  border-color: color-mix(in oklab, var(--color-accent), transparent 70%);
}
.icon-btn:active {
  transform: translateY(1px);
}
.menu-toggle {
  display: none;
}

/*----------------------
# Sidebar
----------------------*/
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: 0;
  width: 280px;
  overflow: auto;
  border-right: 1px solid var(--color-border);
  background: linear-gradient(180deg, color-mix(in oklab, var(--color-surface), transparent 0%), color-mix(in oklab, var(--color-surface), transparent 12%)), var(--color-surface);
}
.sidebar-nav {
  padding: 16px;
}
.sidebar-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 16px 8px 8px;
}
.sidebar-section:first-child .sidebar-title {
  margin-top: 4px;
}
.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar li {
  margin: 2px 0;
}
.sidebar a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--color-text);
  text-decoration: none;
}
.sidebar a:hover,
.sidebar a.is-active {
  background: color-mix(in oklab, var(--color-accent), transparent 88%);
  color: var(--color-accent-600);
  font-weight: 600;
}

/*----------------------
# Overlay (Mobile)
----------------------*/
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.45);
  backdrop-filter: blur(2px);
  z-index: 40;
}

/*----------------------
# Grid Utilities
----------------------*/
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/*----------------------
# Content
----------------------*/
.content {
  margin-left: 280px;
  padding: 24px;
}
.bolt-img {
  width: 100%;
  height: auto;
  border: 3px solid var(--color-border);
  margin: 10px 0;
}
figcaption {
  text-align: center;
  margin-bottom: 20px;
}

/*----------------------
# FAQ
----------------------*/
details {
  padding: 10px;
  cursor: pointer;
}
summary {
    font-weight: 600;
    margin-bottom: 5px;
}

/*----------------------
# Troubleshooting
----------------------*/
.callout {
  margin: 20px 0 10px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.callout.info {
  border-left: 4px solid var(--color-accent);
}
.callout.warning {
  border-left: 4px solid #f59e0b;
}
.callout.success {
  border-left: 4px solid var(--color-success);
}
code {
  background: var(--color-muted);
  padding: 2px 6px;
  border-radius: 6px;
}

/*----------------------
# Badges
----------------------*/
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-muted);
  color: var(--color-text-muted);
  font-size: 12px;
  border: 1px solid var(--color-border);
}
.badge.success {
  background: color-mix(in oklab, #0ec88a, transparent 86%);
  color: var(--color-success);
  border-color: color-mix(in oklab, #0bcc8c, transparent 70%);
}

/*----------------------
# Footer
----------------------*/
.site-footer {
  border-top: 1px solid var(--color-border);
  text-align: center;
  padding: 16px 24px;
  color: var(--color-text-muted);
}

/*----------------------
# Responsive Styles
----------------------*/
@media (max-width: 1024px) {
  .menu-toggle {
    display: inline-grid;
  }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 220ms ease;
    width: 82vw;
    max-width: 320px;
    z-index: 45;
    top: var(--header-h);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  .content {
    margin-left: 0;
    padding: 16px;
  }
  .site-footer {
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .logo {
    width: 150px;
    height: auto;
  }
}

@media (max-width: 720px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .search,
  .header-actions .button {
    display: none;
  }
}

/*----------------------
# Print
----------------------*/
@media print {
  header.site-header,
  .sidebar,
  .site-footer,
  .overlay {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .content {
    margin: 0;
    padding: 0;
  }
}

/*----------------------
# User Preferences
----------------------*/
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
@media (prefers-color-scheme: dark) {
  .logo-light {
    display: none;
  }
  .logo-dark {
    display: inline;
  }
}