/* ─── Brand Tokens ──────────────────────────────────────────────── */
:root {
  --brand:        #4827EC;
  --brand-light:  #6B4FF5;
  --brand-dark:   #3318C4;
  --brand-subtle: #EDE9FD;
  --brand-border: #C4B5FB;

  --bg:           #FFFFFF;
  --bg-soft:      #F7F7FB;
  --bg-code:      #F4F2FF;

  --text:         #0F0B1E;
  --text-muted:   #5C5775;
  --text-light:   #9B96B0;

  --border:       #E8E6F0;
  --radius:       12px;
  --header-h:     64px;
}

/* ─── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-soft);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ─── Header ─────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 40px;
  gap: 32px;
  z-index: 100;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  transition: color 0.15s;
}

.header-logo:hover {
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.logo-text {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 34px;
  height: 34px;
  background: var(--brand);
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.header-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.header-nav a:hover { background: var(--brand-subtle); color: var(--brand); text-decoration: none; }

/* ─────────────────────────────────────────────────────────────────
   INDEX PAGE
───────────────────────────────────────────────────────────────── */

.index-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 40px 100px;
}

/* Hero */
.index-hero {
  margin-bottom: 56px;
}

.index-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-subtle);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.index-hero h1 {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 16px;
}

.index-hero h1 span {
  color: var(--brand);
}

.index-hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.7;
}

/* Section label */
.section-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 60px;
}

.doc-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  position: relative;
  overflow: hidden;
}

.doc-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--brand-subtle) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}

.doc-card:hover {
  border-color: var(--brand-border);
  box-shadow: 0 8px 32px rgba(72, 39, 236, 0.1);
  transform: translateY(-3px);
  text-decoration: none;
}

.doc-card:hover::before { opacity: 1; }

.card-icon {
  width: 44px;
  height: 44px;
  background: var(--brand-subtle);
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--brand);
  margin-bottom: 18px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: background 0.18s;
}

.doc-card:hover .card-icon {
  background: var(--brand);
  color: #fff;
}

.card-icon svg { width: 21px; height: 21px; stroke-width: 1.8; }

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  position: relative;
  z-index: 1;
}

.card-arrow {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.18s, transform 0.18s;
  position: relative;
  z-index: 1;
}

.doc-card:hover .card-arrow { opacity: 1; transform: translateX(0); }
.card-arrow svg { width: 14px; height: 14px; }

/* ─────────────────────────────────────────────────────────────────
   BLOG / DOC PAGE
───────────────────────────────────────────────────────────────── */

.blog-wrap {
  max-width: 720px;
  margin: 40px auto;
  padding: 48px 52px 88px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(15, 11, 30, 0.07);
}

.docs-layout {
  width: min(1180px, calc(100% - 56px));
  margin: 36px auto 80px;
  display: grid;
  grid-template-columns: 248px minmax(0, 800px);
  gap: 36px;
  align-items: start;
  justify-content: center;
}

.docs-layout .blog-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 14px 38px rgba(15, 11, 30, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.docs-sidebar-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 4px 8px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.docs-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.docs-sidebar-link {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 38px;
  padding: 9px 10px 9px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.docs-sidebar-link::before {
  content: '';
  position: absolute;
  left: 6px;
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: transparent;
}

.docs-sidebar-link:hover {
  background: var(--brand-subtle);
  color: var(--brand);
  text-decoration: none;
}

.docs-sidebar-link.is-active {
  background: #fff;
  color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand-border), 0 6px 16px rgba(72, 39, 236, 0.08);
}

.docs-sidebar-link.is-active::before {
  background: var(--brand);
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 34px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.back-link:hover {
  background: var(--brand-subtle);
  color: var(--brand);
  border-color: var(--brand-border);
  text-decoration: none;
}

.back-link svg { width: 15px; height: 15px; }

/* Post header */
.post-header { margin-bottom: 28px; }

.post-tag {
  display: inline-block;
  background: #fff;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--brand-border);
  margin-bottom: 16px;
}

.post-title {
  font-size: 2.7rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.83rem;
  color: var(--text-light);
}

.post-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-light);
}

.post-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0 36px;
}

/* Post body typography */
.post-body {
  font-size: 1rem;
  color: var(--text-muted);
}

.post-body > p:first-child {
  font-size: 1.08rem;
  line-height: 1.75;
  color: #48435F;
}

.post-body h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text);
  margin: 44px 0 14px;
  line-height: 1.25;
  padding-top: 4px;
}

.post-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 12px;
}

.post-body p { margin-bottom: 18px; }

.post-body ul, .post-body ol {
  padding-left: 22px;
  margin-bottom: 22px;
}

.post-body li {
  margin-bottom: 9px;
  padding-left: 4px;
}

.post-body strong { color: var(--text); font-weight: 700; }

.post-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

.post-body code {
  background: var(--bg-code);
  color: var(--brand-dark);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.875em;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.post-body pre {
  background: var(--bg-code);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  padding: 22px;
  overflow-x: auto;
  margin: 24px 0;
}

.post-body pre code {
  background: none;
  padding: 0;
  font-size: 0.9em;
}

/* Callout */
.callout {
  display: flex;
  gap: 13px;
  padding: 16px 18px;
  border-radius: 12px;
  margin: 28px 0;
  font-size: 0.92rem;
  border: 1px solid #DED7FF;
  background: #F5F2FF;
  color: var(--brand-dark);
  line-height: 1.6;
}

.callout svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; color: var(--brand); }

/* Image */
.post-image {
  margin: 30px 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #fff;
  cursor: zoom-in;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.post-image:hover {
  border-color: var(--brand-border);
  box-shadow: 0 14px 34px rgba(72, 39, 236, 0.12);
  transform: translateY(-2px);
}

.post-image img {
  width: 100%;
  display: block;
  background: #fff;
}

.post-image-caption {
  font-size: 0.78rem;
  color: var(--text-light);
  text-align: center;
  padding: 11px 16px;
  background: #fff;
  border-top: 1px solid var(--border);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(15, 11, 30, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.lightbox.is-open { display: flex; }

.lightbox-panel {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 0;
  background: rgba(15, 11, 30, 0.96);
}

.lightbox-image-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 72px 84px 24px;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-caption {
  padding: 16px 72px 22px;
  min-height: 52px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  text-align: center;
  background: rgba(15, 11, 30, 0.72);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.lightbox-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
  transform: scale(1.04);
}

.lightbox-btn svg {
  width: 20px;
  height: 20px;
}

.lightbox-close { top: 22px; right: 24px; }

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev:hover,
.lightbox-next:hover {
  transform: translateY(-50%) scale(1.04);
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.lightbox-btn[hidden] { display: none; }

/* Video */
.post-video {
  margin: 32px 0;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
}

.post-video iframe { width: 100%; height: 100%; display: block; }

/* Coming soon state */
.coming-soon-wrap {
  text-align: center;
  padding: 80px 0 40px;
}

.coming-icon {
  width: 64px;
  height: 64px;
  background: var(--brand-subtle);
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--brand);
  margin: 0 auto 24px;
}

.coming-icon svg { width: 28px; height: 28px; }

.coming-soon-wrap h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.coming-soon-wrap p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 380px;
  margin: 0 auto 32px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--brand);
  color: #fff !important;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 9px;
  transition: background 0.15s, transform 0.15s;
  text-decoration: none !important;
}

.back-btn:hover { background: var(--brand-dark); text-decoration: none !important; transform: translateY(-1px); }
.back-btn svg { width: 15px; height: 15px; }

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 980px) {
  .docs-layout {
    width: 100%;
    margin: 0;
    padding: 24px 20px 80px;
    display: block;
  }
  .docs-layout .blog-wrap {
    margin-top: 20px;
    max-width: none;
  }
  .docs-sidebar {
    position: static;
    padding: 12px;
    border-radius: 14px;
  }
  .docs-sidebar-title {
    padding-bottom: 10px;
  }
  .docs-sidebar-list {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .docs-sidebar-link {
    flex: 0 0 auto;
    min-height: 36px;
    white-space: nowrap;
    font-size: 0.84rem;
    padding: 8px 12px;
  }
  .docs-sidebar-link::before { display: none; }
}

@media (max-width: 768px) {
  .site-header { padding: 0 20px; }
  .index-wrap { padding: 48px 20px 80px; }
  .blog-wrap {
    padding: 34px 20px 72px;
    border-radius: 16px;
  }
  .index-hero h1 { font-size: 2.1rem; }
  .post-header { margin-bottom: 24px; }
  .post-title {
    font-size: 2rem;
    line-height: 1.18;
  }
  .post-divider { margin: 24px 0 30px; }
  .post-body { font-size: 0.96rem; }
  .post-body > p:first-child { font-size: 1rem; }
  .post-body h2 {
    font-size: 1.2rem;
    margin-top: 36px;
  }
  .post-image {
    margin: 24px 0;
    border-radius: 12px;
  }
  .card-grid { grid-template-columns: 1fr; }
  .lightbox-image-wrap { padding: 64px 16px 18px; }
  .lightbox-caption { padding: 12px 48px; font-size: 0.82rem; }
  .lightbox-btn { width: 36px; height: 36px; }
  .lightbox-close { top: 14px; right: 14px; }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}
