/* ============================================================
   Cody – Design System
   Deep dark developer tool aesthetic (Vercel / Linear inspired)
   ============================================================ */

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

/* ---------- Design Tokens ---------- */
:root {
  /* Colors */
  --blue:        #52c4f7;
  --blue-dim:    #3aa8d8;
  --blue-glow:   rgba(82, 196, 247, 0.18);
  --blue-subtle: rgba(82, 196, 247, 0.08);

  --green:   #4ade80;
  --purple:  #a78bfa;
  --yellow:  #fbbf24;
  --red:     #f87171;

  --bg-0:    #050810;
  --bg-1:    #0a0e1a;
  --bg-2:    #0f1422;
  --bg-3:    #141929;
  --bg-card: #111827;
  --bg-code: #0d1117;

  --border:       rgba(255, 255, 255, 0.07);
  --border-hover: rgba(82, 196, 247, 0.3);

  --text-primary:   #f0f6fc;
  --text-secondary: #8b949e;
  --text-muted:     #484f58;
  --text-code:      #79c0ff;

  /* Typography */
  --font-sans: 'Sora', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  /* Spacing & Sizing */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Transitions */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur:  0.22s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg-1);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- Selection ---------- */
::selection { background: var(--blue-glow); color: var(--blue); }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.3rem); }
h4 { font-size: 1rem; }

p { color: var(--text-secondary); line-height: 1.75; }
a { color: var(--blue); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--text-primary); }
code { font-family: var(--font-mono); }

/* ---------- Layout ---------- */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 96px 0; }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), backdrop-filter var(--dur) var(--ease);
}

.navbar.scrolled {
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom-color: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-logo svg { width: 28px; height: 28px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--dur) var(--ease);
}

.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--blue); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue);
  color: #050810;
}
.btn-primary:hover {
  background: #6dcef9;
  color: #050810;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(82, 196, 247, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--blue-subtle);
}

.btn-outline {
  background: transparent;
  color: var(--blue);
  border: 1px solid rgba(82, 196, 247, 0.35);
}
.btn-outline:hover {
  background: var(--blue-subtle);
  border-color: var(--blue);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 12px 28px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border: none;
  background: transparent;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--dur) var(--ease);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 80px 0 64px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(82, 196, 247, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 60%, rgba(167, 139, 250, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--blue-subtle);
  border: 1px solid rgba(82, 196, 247, 0.2);
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--blue);
  margin-bottom: 24px;
}

.hero-badge .dot {
  width: 6px; height: 6px;
  background: var(--blue);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  margin-bottom: 20px;
  color: var(--text-primary);
}

.hero-title .accent {
  background: linear-gradient(135deg, var(--blue) 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.hero-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Terminal */
.terminal-wrap {
  position: relative;
}

.terminal {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.terminal-dot.red   { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green  { background: #28c840; }

.terminal-title {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.terminal-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: #c9d1d9;
  white-space: pre;
  max-height: 380px;
  overflow: auto;
  min-height: 200px;
}

.t-prompt { color: var(--green); }
.t-cmd    { color: var(--text-primary); }
.t-comment { color: var(--text-muted); }
.t-output { color: var(--text-secondary); }
.t-blue   { color: var(--blue); }
.t-yellow { color: var(--yellow); }
.t-green  { color: var(--green); }
.t-purple { color: var(--purple); }
.t-dim    { color: var(--text-muted); }
.t-cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--blue);
  vertical-align: text-bottom;
  animation: blink 1.1s step-start infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Section Headers ---------- */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 16px;
}

.section-title {
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 56px;
}

/* ---------- Features ---------- */
.features { background: var(--bg-0); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--blue-subtle), transparent);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

/* Lift on hover – high specificity to avoid .anim.visible override */
.feature-card:hover,
.features-grid .feature-card:hover {
  transform: translateY(-4px) !important;
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px rgba(82, 196, 247, 0.12);
}

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

.feature-icon {
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-subtle);
  border: 1px solid rgba(82, 196, 247, 0.15);
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ---------- Install Section ---------- */
.install { background: var(--bg-1); }

.install-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
  width: fit-content;
}

.tab-btn {
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--dur) var(--ease);
  font-family: var(--font-sans);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.code-block {
  position: relative;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.code-block pre {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.75;
  color: #c9d1d9;
  overflow-x: auto;
  white-space: pre;
}

.code-block .copy-btn {
  position: absolute;
  top: 12px; right: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  transition: all var(--dur) var(--ease);
  font-family: var(--font-sans);
}

.code-block .copy-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--blue-subtle);
}

.code-block .copy-btn.copied {
  color: var(--green);
  border-color: rgba(74, 222, 128, 0.3);
}

/* Syntax highlight tokens */
.kw  { color: #ff7b72; }
.fn  { color: #d2a8ff; }
.str { color: #a5d6ff; }
.cm  { color: #8b949e; font-style: italic; }
.nb  { color: #ffa657; }
.op  { color: #79c0ff; }

/* ---------- Models Grid ---------- */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.model-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--dur) var(--ease);
}

.model-badge:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-3);
}

.model-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------- CTA ---------- */
.cta-section {
  background: var(--bg-0);
  text-align: center;
}

.cta-box {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 72px 40px;
  position: relative;
  overflow: hidden;
}

.cta-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(82, 196, 247, 0.06), transparent);
  pointer-events: none;
}

.cta-box h2 { margin-bottom: 16px; }
.cta-box p  { max-width: 480px; margin: 0 auto 36px; font-size: 1.05rem; }

.cta-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- Footer ---------- */
footer {
  background: var(--bg-0);
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.65;
  max-width: 260px;
}

.footer-group h4 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-group ul { list-style: none; }

.footer-group ul li { margin-bottom: 10px; }

.footer-group ul a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color var(--dur) var(--ease);
}
.footer-group ul a:hover { color: var(--text-primary); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--text-secondary); }

/* ---------- Docs Layout ---------- */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  min-height: calc(100vh - 60px);
  margin-top: 60px;
}

.docs-sidebar {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 32px 0;
  border-right: 1px solid var(--border);
  background: var(--bg-0);
  flex-shrink: 0;
}

.sidebar-section { margin-bottom: 28px; }

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 24px;
  margin-bottom: 8px;
}

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

.sidebar-nav a {
  display: block;
  padding: 7px 24px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all var(--dur) var(--ease);
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover {
  color: var(--text-primary);
  background: var(--blue-subtle);
}

.sidebar-nav a.active {
  color: var(--blue);
  border-left-color: var(--blue);
  background: var(--blue-subtle);
}

.docs-content {
  padding: 48px 64px;
  max-width: 860px;
}

.docs-content h1 { margin-bottom: 12px; }
.docs-content h2 {
  margin: 56px 0 20px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 1.5rem;
}
.docs-content h2:first-of-type { border-top: none; margin-top: 24px; }
.docs-content h3 { margin: 36px 0 14px; font-size: 1.1rem; }
.docs-content p  { margin-bottom: 16px; }
.docs-content ul, .docs-content ol {
  color: var(--text-secondary);
  padding-left: 24px;
  margin-bottom: 16px;
  line-height: 1.75;
}

.docs-content li { margin-bottom: 6px; }

.docs-content code {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.85em;
  color: var(--text-code);
}

.docs-content .code-block { margin: 24px 0; }
.docs-content .code-block pre { padding: 20px 24px; }

.docs-hero {
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.docs-hero p { font-size: 1.05rem; }

/* Param table */
.param-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.875rem;
}

.param-table th {
  text-align: left;
  padding: 10px 16px;
  background: var(--bg-3);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
}

.param-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text-secondary);
}

.param-table td:first-child {
  font-family: var(--font-mono);
  color: var(--text-code);
  font-size: 0.82rem;
}

.param-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Callout */
.callout {
  padding: 16px 20px;
  border-radius: var(--radius);
  border-left: 3px solid;
  margin: 24px 0;
  font-size: 0.9rem;
}

.callout-info {
  background: rgba(82, 196, 247, 0.06);
  border-color: var(--blue);
  color: #b0d9ee;
}

.callout-tip {
  background: rgba(74, 222, 128, 0.06);
  border-color: var(--green);
  color: #a7d9b5;
}

.callout-warn {
  background: rgba(251, 191, 36, 0.06);
  border-color: var(--yellow);
  color: #d9c080;
}

/* Badge / tag */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge-blue   { background: rgba(82, 196, 247, 0.12); color: var(--blue); }
.badge-green  { background: rgba(74, 222, 128, 0.12); color: var(--green); }
.badge-purple { background: rgba(167, 139, 250, 0.12); color: var(--purple); }
.badge-yellow { background: rgba(251, 191, 36, 0.12); color: var(--yellow); }

/* ---------- Scroll Animations ----------
   Only hide elements when JS is present (html.js class added by inline script).
   Without JS, .anim elements remain fully visible.
   ---------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .anim {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
  }
  html.js .anim.visible {
    opacity: 1;
    transform: translateY(0);
  }
  html.js .anim-delay-1 { transition-delay: 0.07s; }
  html.js .anim-delay-2 { transition-delay: 0.14s; }
  html.js .anim-delay-3 { transition-delay: 0.21s; }
  html.js .anim-delay-4 { transition-delay: 0.28s; }
  html.js .anim-delay-5 { transition-delay: 0.35s; }
}

@media (prefers-reduced-motion: reduce) {
  html.js .anim { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .terminal-wrap { max-width: 560px; margin: 0 auto; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  section { padding: 72px 0; }

  .nav-links, .nav-actions { display: none; }
  .hamburger { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: fixed;
    top: 60px; left: 0; right: 0;
    background: rgba(10, 14, 26, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0 20px;
    z-index: 99;
  }

  .nav-links.open li a {
    display: block;
    padding: 11px 24px;
    font-size: 0.95rem;
  }

  /* Mobile: nav-actions hidden (key links are in nav-links) */
  .nav-actions { display: none !important; }

  .features-grid { grid-template-columns: 1fr; }
  .footer-inner  { grid-template-columns: 1fr; gap: 32px; }
  .hero-stats    { flex-wrap: wrap; gap: 20px; }

  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
  }
  .docs-content { padding: 32px 20px; }

  .cta-box { padding: 48px 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .btn-lg { width: 100%; justify-content: center; }
  .models-grid { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 2rem; }
}

/* ============================================================
   Documentation Hub  (docs.html)
   ============================================================ */

.docs-hub-hero {
  margin-top: 60px;
  padding: 72px 0 56px;
  text-align: center;
  background: var(--bg-0);
  border-bottom: 1px solid var(--border);
}

.docs-hub-hero h1 { margin-bottom: 16px; }

.docs-hub-hero p {
  font-size: 1.1rem;
  max-width: 480px;
  margin: 0 auto 24px;
}

.docs-hub-body {
  background: var(--bg-1);
  padding: 64px 0 96px;
}

.doc-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

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

.doc-category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--blue-subtle), transparent);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.doc-category-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px rgba(82, 196, 247, 0.12);
  color: inherit;
}

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

.doc-category-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.doc-category-card .feature-icon { margin-bottom: 16px; }

.doc-category-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.doc-category-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
}

.doc-category-card .card-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.doc-category-card .card-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.doc-category-card .card-cta {
  font-size: 0.78rem;
  color: var(--blue);
  font-weight: 500;
}

/* ============================================================
   SDK Tutorial Index  (sdk.html)
   ============================================================ */

.sdk-hero {
  margin-top: 60px;
  padding: 72px 0 56px;
  background: var(--bg-0);
  border-bottom: 1px solid var(--border);
}

.sdk-content {
  background: var(--bg-1);
  padding: 64px 0 96px;
}

.tutorial-group { margin-bottom: 56px; }

.tutorial-group-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.tutorial-group-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.tutorial-group-header .group-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tutorial-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tutorial-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.tutorial-card:hover {
  transform: translateX(4px);
  border-color: var(--border-hover);
  box-shadow: 4px 0 20px rgba(82, 196, 247, 0.08);
}

.tutorial-card-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blue);
  opacity: 0.6;
  min-width: 26px;
}

.tutorial-card-body { flex: 1; }

.tutorial-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tutorial-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tutorial-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.reading-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.tutorial-card-arrow {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.tutorial-card:hover .tutorial-card-arrow {
  color: var(--blue);
  transform: translateX(4px);
}

/* ============================================================
   Tutorial Article Pages  (sdk/*.html)
   ============================================================ */

.tutorial-back-link {
  padding: 0 24px 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.tutorial-back-link a {
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: color var(--dur) var(--ease);
}

.tutorial-back-link a:hover { color: var(--blue); }

.article-breadcrumb {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.article-breadcrumb a { color: var(--text-muted); }
.article-breadcrumb a:hover { color: var(--blue); }

.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.article-prev-next {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

.prev-next-btn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--dur) var(--ease);
  min-width: 200px;
  max-width: 48%;
}

.prev-next-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-2);
  color: inherit;
}

.prev-next-btn .direction {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.prev-next-btn .pn-title {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.prev-next-btn.next { text-align: right; margin-left: auto; }

/* Responsive additions */
@media (max-width: 1100px) {
  .doc-categories { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .doc-categories { grid-template-columns: 1fr; }
  .article-prev-next { flex-direction: column; }
  .prev-next-btn { min-width: unset; max-width: 100%; }
  .prev-next-btn.next { text-align: left; margin-left: 0; }
}
