@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --secondary: #6366f1;
  --secondary-light: #eef2ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;
  
  --border: #e2e8f0;
  --border-subtle: #edf2f7;
  --border-focus: #93c5fd;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 35px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100vw;
}

body {
  margin: 0;
  overflow-x: clip;
  max-width: 100vw;
  color: var(--text);
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.05) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(99, 102, 241, 0.05) 0px, transparent 50%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ── Reading Progress Bar ── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  z-index: 2500;
  transition: width 0.1s ease-out;
}

/* ── Topbar (Clean, Sticky, Right-Aligned Search) ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 2rem;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}

.menu-toggle:hover {
  background: var(--surface-alt);
  border-color: #cbd5e1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.brand h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand p {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── Topbar Right Controls (Language Switcher & Search) ── */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.lang-selector-wrap {
  position: relative;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.lang-btn:hover {
  background: var(--surface-alt);
  border-color: #cbd5e1;
  color: var(--text);
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem 0;
  z-index: 1700;
}

.lang-dropdown.open {
  display: block;
}

.lang-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.95rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-opt:hover {
  background: #eff6ff;
  color: var(--primary);
}

.lang-opt.active {
  font-weight: 700;
  color: var(--primary);
  background: #f0f7ff;
}

.lang-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 999px;
  font-weight: 700;
}

/* ── Smart Compact Search Bar ── */
.search-wrap {
  position: relative;
  width: 280px;
  max-width: 100%;
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--muted-light);
  pointer-events: none;
}

#docSearch {
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 0.5rem 4.5rem 0.5rem 2.35rem;
  font-family: inherit;
  font-size: 0.84rem;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#docSearch:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  width: 320px;
}

.search-kbd {
  position: absolute;
  right: 10px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.1rem 0.4rem;
  pointer-events: none;
  font-family: inherit;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: 92vw;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 2000;
}

.search-results-header {
  padding: 0.55rem 0.9rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid #f1f5f9;
  background: #fafcff;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.95rem;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.15s ease;
}

.search-result-item:hover {
  background: #f0f7ff;
}

.search-result-item .search-res-title {
  font-weight: 600;
  font-size: 0.86rem;
  color: #1e3a8a;
}

.search-result-item .search-res-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.08rem 0.4rem;
  border-radius: 4px;
  margin-bottom: 0.25rem;
}

.search-result-item .search-res-snippet {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

/* ── Layout & Sidebar ── */
.layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  min-height: calc(100vh - 65px);
  min-width: 0;
  max-width: 100vw;
}

.sidebar {
  position: sticky;
  top: 65px;
  align-self: start;
  height: calc(100vh - 65px);
  overflow-y: auto;
  padding: 1.25rem 1rem 3rem;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.sidebar h2 {
  margin: 1.4rem 0 0.5rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar h2:first-of-type {
  margin-top: 0.2rem;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.52rem 0.75rem;
  margin-bottom: 0.2rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background: var(--surface-alt);
  color: var(--primary);
  transform: translateX(2px);
}

.nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* ── Sidebar Nested Module Accordion ── */
.sidebar-module-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.54rem 0.75rem;
  margin-top: 0.25rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.sidebar-module-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.sidebar-module-btn .arrow-icon {
  width: 14px;
  height: 14px;
  font-size: 0.45rem;
  color: #64748b;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.18s ease;
}

.sidebar-module-btn:hover .arrow-icon {
  color: var(--text);
}

.sidebar-module-btn[aria-expanded="true"] {
  background: var(--primary-light);
  border-color: #bfdbfe;
  color: #1e40af;
}

.sidebar-module-btn[aria-expanded="true"] .arrow-icon {
  transform: rotate(90deg);
  color: var(--primary);
}

.sidebar-sub-menu {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, transform 0.2s ease, padding 0.2s ease;
  padding: 0 0 0 0.85rem;
  margin-left: 0.65rem;
  border-left: 2px solid #e2e8f0;
}

.sidebar-sub-menu.open {
  max-height: 900px;
  opacity: 1;
  transform: translateY(0);
  padding: 0.35rem 0 0.35rem 0.85rem;
}

.sidebar-sub-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.38rem 0.65rem;
  font-size: 0.83rem;
  color: #475569;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s ease;
  font-weight: 450;
}

.sidebar-sub-link:hover {
  color: var(--primary);
  background: #f1f5f9;
  transform: translateX(2px);
}

.sidebar-sub-link.active {
  color: var(--primary);
  font-weight: 600;
  background: #eff6ff;
}

/* ── Content Area & Sections ── */
.content {
  padding: 2rem 2.5rem 6rem;
  max-width: 1100px;
  min-width: 0;
  width: 100%;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.doc-section {
  margin-bottom: 2.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  scroll-margin-top: 85px;
}

.doc-sub-item {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid #f1f5f9;
  scroll-margin-top: 90px;
}

h2 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0f172a;
  margin: 0 0 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

h3 {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #1e293b;
  margin: 1.25rem 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

h4 {
  font-size: 0.98rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0.85rem 0 0.4rem;
}

p {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

ul, ol {
  margin: 0 0 1.5rem;
  padding-left: 1.3rem;
  color: var(--text-secondary);
}

.doc-section ul:not(.accordion-sub) > li,
.doc-section ol > li {
  margin-bottom: 0.45rem;
  padding: 0.65rem 0.5rem 0.65rem 0.25rem;
  line-height: 1.65;
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.15s ease, padding-left 0.15s ease;
  border-radius: 4px;
}

.doc-section ul:not(.accordion-sub) > li:hover,
.doc-section ol > li:hover {
  background-color: rgba(241, 245, 249, 0.7);
  padding-left: 0.5rem;
}

.doc-section ul:not(.accordion-sub) > li:last-child,
.doc-section ol > li:last-child {
  border-bottom: none;
}

li {
  margin-bottom: 0.45rem;
  line-height: 1.6;
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84em;
  background: #f1f5f9;
  color: #0f172a;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
}

pre {
  background: #0f172a;
  color: #f8fafc;
  padding: 1.1rem 1.35rem;
  border-radius: var(--radius);
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.84rem;
  line-height: 1.6;
  margin: 1rem 0;
  box-shadow: var(--shadow-md);
  border: 1px solid #1e293b;
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
}

/* ── Hero Card ── */
.hero-card {
  background: linear-gradient(135deg, #f0f7ff 0%, #f5f3ff 100%);
  border: 1px solid #dbeafe;
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.hero-grid article {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-sm);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.hero-grid h3 {
  font-size: 0.98rem;
  margin: 0 0 0.35rem;
}

.hero-grid p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

/* ── Two Column Cards Grid ── */
.cards-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.card h3, .card h4 {
  margin-top: 0;
}

/* ── Callout Banners ── */
.callout {
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  background: var(--primary-light);
}

.callout h4 {
  margin: 0 0 0.3rem;
  color: #1e3a8a;
}

.callout p {
  margin: 0;
  font-size: 0.92rem;
  color: #1e293b;
}

.callout.warning {
  border-color: var(--warning);
  background: var(--warning-light);
}
.callout.warning h4 { color: #92400e; }
.callout.warning p { color: #78350f; }

.callout.success {
  border-color: var(--success);
  background: var(--success-light);
}
.callout.success h4 { color: #065f46; }
.callout.success p { color: #064e3b; }

.callout.info {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ── Timeline / Quick Steps ── */
.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.timeline > div {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.timeline span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 0.65rem;
}

.timeline h4 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.timeline p {
  font-size: 0.83rem;
  color: var(--muted);
  margin: 0;
}

/* ── Screenshots with macOS Style Header ── */
.doc-screenshot-frame {
  margin: 1.5rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  background: #ffffff;
}

.doc-screenshot-frame::before {
  content: "";
  display: block;
  height: 28px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
  background-image: radial-gradient(circle at 18px 14px, #ff5f56 5px, transparent 6px),
                    radial-gradient(circle at 34px 14px, #ffbd2e 5px, transparent 6px),
                    radial-gradient(circle at 50px 14px, #27c93f 5px, transparent 6px);
  background-repeat: no-repeat;
}

.doc-screenshot {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.doc-screenshot:hover {
  transform: scale(1.004);
}

.doc-screenshot-frame figcaption {
  padding: 0.65rem 1.15rem;
  font-size: 0.83rem;
  color: var(--muted);
  background: #fafcff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
}

.doc-screenshot-frame figcaption::before {
  content: "📸";
}

/* ── Badges ── */
.badge-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
  line-height: 1.2;
}

.badge-pro { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-new { background: #e0f2fe; color: #0284c7; border: 1px solid #bae6fd; }
.badge-fire { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.badge-cart { background: #d1fae5; color: #059669; border: 1px solid #a7f3d0; }
.badge-magic { background: #ede9fe; color: #7c3aed; border: 1px solid #ddd6fe; }
.badge-writer { background: #fef3c7; color: #d97706; border: 1px solid #fde68a; }

/* ── Hot Items Spotlight ── */
.hot-spotlight {
  background: radial-gradient(circle at 100% 0%, #1e1b4b 0%, #0f172a 75%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  margin: 2rem 0;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  scroll-margin-top: 85px;
}

.hot-spotlight h2 {
  color: #ffffff;
  margin-top: 0;
}

.hot-spotlight p.lead {
  color: #cbd5e1;
  font-size: 1.05rem;
  max-width: 860px;
  margin-bottom: 1.75rem;
  line-height: 1.6;
}

.hot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.hot-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 1.4rem;
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.hot-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(255, 255, 255, 0.07);
}

.hot-card h3 {
  color: #ffffff;
  margin: 0.65rem 0 0.45rem;
  font-size: 1.12rem;
}

.hot-card p {
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0 0 1.2rem;
  flex: 1;
}

.hot-card a.hot-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

.hot-card a.hot-btn:hover {
  background: var(--primary);
  color: #ffffff;
}

/* ── 1-2 Minute Micro-Video Cards ── */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.35rem;
  margin: 1.5rem 0;
}

.video-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.video-thumb-wrap {
  position: relative;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  padding-top: 50%;
  overflow: hidden;
}

.video-placeholder-banner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-align: center;
  padding: 1rem;
}

.play-btn-mock {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid #ffffff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  backdrop-filter: blur(4px);
  transition: transform 0.2s ease, background 0.2s ease;
}

.video-card:hover .play-btn-mock {
  transform: scale(1.1);
  background: var(--primary);
}

.video-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.video-duration {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.video-body h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.video-body p {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 0.85rem;
  flex: 1;
}

.video-timestamps {
  list-style: none;
  padding: 0.65rem 0.85rem;
  margin: 0;
  font-size: 0.82rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.video-timestamps li {
  margin-bottom: 0.3rem;
  color: #475569;
}

.video-timestamps li:last-child {
  margin-bottom: 0;
}

.video-timestamps strong {
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

/* ── Lightbox Modal ── */
.lightbox-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

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

.lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 84vh;
  border-radius: var(--radius);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.lightbox-caption {
  color: #f1f5f9;
  margin-top: 0.85rem;
  font-size: 0.92rem;
  text-align: center;
  font-weight: 500;
}

.lightbox-close {
  position: absolute;
  top: -42px;
  right: 0;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2.2rem;
  cursor: pointer;
  line-height: 1;
  transition: opacity 0.15s ease;
}

.lightbox-close:hover {
  opacity: 0.8;
}

/* ── Video Demo Modal (YouTube Player) ── */
.video-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2600;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.video-modal.open {
  display: flex;
  opacity: 1;
}

.video-modal-container {
  position: relative;
  width: 100%;
  max-width: 860px;
  background: #000000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.video-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: #0f172a;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.video-modal-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.video-modal-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.video-modal-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.video-modal-body {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
}

.video-modal-body iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Mobile Responsive Drawer & Header ── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1550;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

.sidebar-mobile-header {
  display: none;
}

/* ── Hero CTA Banner (High-Converting Header) ── */
.doc-hero-cta {
  background: linear-gradient(135deg, #090d16 0%, #111827 50%, #1e1b4b 100%);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.25rem 2rem;
  color: #ffffff;
  margin-bottom: 2.25rem;
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}

.doc-hero-cta::before {
  content: "";
  position: absolute;
  top: -60%;
  right: -20%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.35) 0%, rgba(99, 102, 241, 0.15) 50%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.cta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(37, 99, 235, 0.25);
  color: #93c5fd;
  border: 1px solid rgba(147, 197, 253, 0.35);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.doc-hero-cta h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.85rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.doc-hero-cta p.cta-desc {
  color: #cbd5e1;
  font-size: 0.98rem;
  max-width: 760px;
  line-height: 1.65;
  margin: 0 0 1.75rem;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 1.45rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  white-space: nowrap;
}

.cta-btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.6);
}

.cta-btn-pro {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-btn-pro:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.6);
}

.cta-btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9 !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cta-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff !important;
}

.cta-guarantees {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}

.cta-guarantees span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Mobile Bottom Quick Navigation Bar ── */
.mobile-bottom-bar {
  display: none;
}

@media (max-width: 960px) {
  .topbar {
    padding: 0.65rem 0.85rem;
    flex-wrap: wrap;
    gap: 0.65rem;
  }

  .topbar-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    min-width: 0;
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
  }

  .brand-badge {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  .brand h1 {
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand p {
    display: none;
  }

  .menu-toggle {
    display: none !important;
  }

  .topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
  }

  .lang-selector-wrap {
    order: 2;
  }

  .lang-btn {
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
  }

  .search-wrap {
    order: 1;
    flex: 1;
    width: auto;
    margin-left: 0;
  }

  #docSearch {
    font-size: 0.85rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  #docSearch:focus {
    width: 100%;
  }

  .search-results {
    right: 0;
    left: 0;
    width: 100%;
  }

  .layout {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    bottom: 0;
    width: 310px;
    max-width: 86vw;
    height: 100vh;
    z-index: 1600;
    background: #ffffff;
    box-shadow: 4px 0 25px rgba(15, 23, 42, 0.15);
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 1rem 4.5rem;
    overflow-y: auto;
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0 0.8rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.85rem;
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 10;
  }

  .sidebar-mobile-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .sidebar-close-btn {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--muted);
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s ease;
  }

  .sidebar-close-btn:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
  }

  .content {
    padding: 1.25rem 1rem 5.5rem !important;
    min-width: 0;
    max-width: 100%;
  }

  .hero-grid,
  .cards-2,
  .hot-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .hot-spotlight {
    padding: 1.25rem;
  }

  .doc-hero-cta {
    padding: 1.5rem 1.25rem;
  }

  .doc-hero-cta h2 {
    font-size: 1.45rem;
  }

  .cta-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cta-btn {
    width: 100%;
  }

  /* ── Mobile Bottom Quick Navigation Bar ── */
  .mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1550;
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
    padding: 0 0.25rem;
  }

  .mobile-bottom-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    height: 100%;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bottom-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.2;
    fill: none;
  }

  .mobile-bottom-btn:hover,
  .mobile-bottom-btn:active,
  .mobile-bottom-btn.active {
    color: var(--primary);
  }
}
