*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0b;
  --bg-card: #111113;
  --bg-code: #161618;
  --border: #1e1e22;
  --border-bright: #2a2a30;
  --text: #e4e4e7;
  --text-dim: #8b8b94;
  --text-muted: #5a5a63;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --accent-2: #818cf8;
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.1);
  --orange: #f59e0b;
  --orange-dim: rgba(245, 158, 11, 0.1);
  --red: #ef4444;
  --cyan: #06b6d4;
  --cyan-dim: rgba(6, 182, 212, 0.08);
}

html { scroll-behavior: smooth; }

/* ===== CUSTOM SCROLLBAR — WATER FLOW ===== */
@keyframes waterFlow {
  0% { background-position: 0% 0%; }
  100% { background-position: 0% 300%; }
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: linear-gradient(
    180deg,
    rgba(6, 182, 212, 0.03) 0%,
    rgba(99, 102, 241, 0.06) 25%,
    rgba(6, 182, 212, 0.03) 50%,
    rgba(99, 102, 241, 0.06) 75%,
    rgba(6, 182, 212, 0.03) 100%
  );
  background-size: 100% 300%;
  animation: waterFlow 4s linear infinite;
  border-left: 1px solid var(--border);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    #06b6d4 0%,
    #6366f1 40%,
    #818cf8 60%,
    #06b6d4 100%
  );
  background-size: 100% 200%;
  animation: waterFlow 3s ease-in-out infinite;
  border-radius: 5px;
  border: 2px solid var(--bg);
  min-height: 40px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    #22d3ee 0%,
    #818cf8 40%,
    #a78bfa 60%,
    #22d3ee 100%
  );
  background-size: 100% 200%;
  animation: waterFlow 2s ease-in-out infinite;
}
::-webkit-scrollbar-thumb:active {
  background: linear-gradient(
    180deg,
    #67e8f9 0%,
    #a78bfa 50%,
    #67e8f9 100%
  );
  background-size: 100% 200%;
  animation: waterFlow 1.5s ease-in-out infinite;
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #6366f1 rgba(6, 182, 212, 0.05);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ===== ANIMATED DOT GRID BACKGROUND ===== */
.dot-grid {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.dot-grid canvas {
  width: 100%; height: 100%;
}
nav, .hero, section, .container, footer, .page-header {
  position: relative;
  z-index: 1;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; }

.container { max-width: 860px; margin: 0 auto; padding: 0 24px; }

/* ===== NAV ===== */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  background: rgba(10, 10, 11, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  padding: 0 24px;
}
nav .nav-inner {
  max-width: 860px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
nav .logo {
  font-weight: 700; font-size: 15px;
  color: var(--text); display: flex; align-items: center; gap: 8px;
}
nav .logo a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 8px; }
nav .nav-links { display: flex; gap: 20px; align-items: center; }
nav .nav-links a {
  font-size: 13px; color: var(--text-dim);
  font-weight: 500; transition: color 0.2s;
}
nav .nav-links a:hover { color: var(--text); text-decoration: none; }
nav .nav-links a.active { color: var(--accent-2); }
.gh-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-card); border: 1px solid var(--border-bright);
  padding: 6px 14px; border-radius: 8px; font-size: 13px;
  color: var(--text); font-weight: 500; transition: all 0.2s;
}
.gh-btn:hover { border-color: var(--text-muted); text-decoration: none; }
.gh-btn svg { width: 16px; height: 16px; }

/* Nav auth links */
.nav-auth { display: inline-flex; gap: 18px; align-items: center; margin-left: 4px; }
.nav-auth a { text-decoration: none; font-size: 13px; font-weight: 600; cursor: pointer; }
/* Hello — static gradient text */
.nav-hello {
  background: linear-gradient(135deg, #6366f1, #818cf8, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity 0.2s;
}
.nav-hello:hover { opacity: 0.8; text-decoration: none; }
/* Login — shimmer sweep animation like doc titles */
.nav-login {
  background: linear-gradient(90deg, #fff 0%, #fff 40%, var(--cyan) 48%, var(--accent-2) 50%, var(--cyan) 52%, #fff 60%, #fff 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sweepShimmer 6s ease-in-out infinite;
}
.nav-login:hover { text-decoration: none; }
/* Logged-in: Hello {Name} — gradient text, acts as logout */
.nav-user {
  background: linear-gradient(135deg, #22c55e, #4ade80);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity 0.2s;
}
.nav-user:hover { opacity: 0.8; text-decoration: none; }

/* ===== PAGE HEADER ===== */
.page-header {
  padding: 120px 0 48px;
}
.page-header h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
/* Page titles — sweep shimmer with unique colors per page */
.page-header h1.shimmer-title {
  font-size: 52px;
  color: #fff;
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sweepShimmer 6s ease-in-out infinite;
}
/* Docs — cyan/indigo */
.page-header h1.shimmer-docs {
  background-image: linear-gradient(90deg, #fff 0%, #fff 40%, var(--cyan) 48%, var(--accent-2) 50%, var(--cyan) 52%, #fff 60%, #fff 100%);
}
/* About — emerald/teal */
.page-header h1.shimmer-about {
  background-image: linear-gradient(90deg, #fff 0%, #fff 40%, #10b981 48%, #14b8a6 50%, #10b981 52%, #fff 60%, #fff 100%);
}
/* Contact — amber/orange */
.page-header h1.shimmer-contact {
  background-image: linear-gradient(90deg, #fff 0%, #fff 40%, #f59e0b 48%, #f97316 50%, #f59e0b 52%, #fff 60%, #fff 100%);
}
/* Practices — rose/pink */
.page-header h1.shimmer-practices {
  background-image: linear-gradient(90deg, #fff 0%, #fff 40%, #f43f5e 48%, #ec4899 50%, #f43f5e 52%, #fff 60%, #fff 100%);
}
/* Agent Guide — violet/purple */
.page-header h1.shimmer-agent {
  background-image: linear-gradient(90deg, #fff 0%, #fff 40%, #8b5cf6 48%, #a855f7 50%, #8b5cf6 52%, #fff 60%, #fff 100%);
}
/* Context Architecture — sky/blue */
.page-header h1.shimmer-context {
  background-image: linear-gradient(90deg, #fff 0%, #fff 40%, #0ea5e9 48%, #3b82f6 50%, #0ea5e9 52%, #fff 60%, #fff 100%);
}
/* Integration — lime/green */
.page-header h1.shimmer-integration {
  background-image: linear-gradient(90deg, #fff 0%, #fff 40%, #84cc16 48%, #22c55e 50%, #84cc16 52%, #fff 60%, #fff 100%);
}
/* Playground — coral/red */
.page-header h1.shimmer-playground {
  background-image: linear-gradient(90deg, #fff 0%, #fff 40%, #ef4444 48%, #f97316 50%, #ef4444 52%, #fff 60%, #fff 100%);
}
@keyframes sweepShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.page-header .subtitle {
  font-size: 17px;
  color: var(--text-dim);
  max-width: 560px;
  line-height: 1.7;
}

/* ===== TERMINAL PAGE ===== */
/* ===== REACT-DOCTOR STYLE TERMINAL ===== */
.terminal-page {
  position: relative;
  z-index: 2;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 120px;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 15px;
  line-height: 1.7;
  color: #a1a1a1;
}
.term-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 1.7em;
}
.term-prompt {
  color: #737373;
  user-select: none;
  flex-shrink: 0;
}
.term-typed {
  color: var(--text);
}
.term-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.15em;
  background: var(--text);
  margin-left: 1px;
  vertical-align: middle;
  animation: cursorBlink 1s step-end infinite;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
/* Each output line fades in */
.t-line {
  opacity: 0;
  transform: translateY(3px);
  animation: tLineFade 0.2s ease-out forwards;
}
@keyframes tLineFade {
  to { opacity: 1; transform: translateY(0); }
}
.t-line .hl-cmd { color: var(--cyan); }
.t-line .hl-green { color: var(--green); }
.t-line .hl-orange { color: var(--orange); }
.t-line .hl-red { color: #f87171; }
.t-line .hl-accent { color: var(--accent-2); }
.t-line .hl-dim { color: #525252; }
.t-line .hl-white { color: #d4d4d4; }
.t-line .hl-muted { color: #737373; }
.t-line .hl-yellow { color: #edb200; }
/* Command echo line */
.t-cmd {
  color: #d4d4d4;
}
.t-cmd .t-prompt {
  color: #737373;
  user-select: none;
}
/* Section spacing */
.t-gap { height: 0.6em; }
.t-gap-lg { height: 1.4em; }
/* Divider */
.t-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin: 1.2em 0;
}

/* ===== HERO FIXED ===== */
.hero-fixed {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 100px 24px 48px;
  max-width: 760px;
  margin: 0 auto;
}
.hero-fixed h1 {
  font-size: clamp(36px, 5.5vw, 60px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
  color: #fff;
  background: linear-gradient(90deg, #fff 0%, #fff 35%, #6366f1 42%, #ec4899 46%, #f59e0b 50%, #22c55e 54%, #06b6d4 58%, #fff 65%, #fff 100%);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: sweepShimmer 7s ease-in-out infinite;
}
.hero-sub {
  font-size: 16px;
  color: var(--text-dim);
  margin-bottom: 32px;
  line-height: 1.6;
}

/* OS TABS */
.os-tabs {
  display: inline-flex;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 20px;
}
.os-tab {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 20px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}
.os-tab:hover { color: var(--text-dim); }
.os-tab.active {
  background: var(--bg-code);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* OS PANELS */
.os-panels {
  text-align: left;
  max-width: 620px;
  margin: 0 auto;
}
.os-panel {
  display: none;
}
.os-panel.active {
  display: block;
}

/* INSTALL COMMAND ROWS */
.install-cmd-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.install-cmd-row:last-child { border-bottom: none; }
.install-cmd-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  min-width: 90px;
  flex-shrink: 0;
  text-align: right;
}
.install-cmd-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  transition: border-color 0.2s;
}
.install-cmd-box:hover {
  border-color: var(--border-bright);
}
.install-cmd-box code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.install-cmd-box .copy-btn {
  flex-shrink: 0;
  opacity: 0.35;
  transition: opacity 0.2s;
}
.install-cmd-box:hover .copy-btn { opacity: 1; }

@media (max-width: 640px) {
  .os-tab { padding: 6px 12px; font-size: 12px; }
  .install-cmd-label { min-width: 60px; font-size: 10px; }
  .install-cmd-box code { font-size: 11px; }
  .install-cmd-row { gap: 8px; }
}

/* ===== HERO (kept for other pages) ===== */
.hero {
  padding: 140px 0 80px;
  text-align: center;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-glow);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 5px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  color: var(--accent-2); margin-bottom: 24px;
  letter-spacing: 0.02em;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800; line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.hero h1 .gradient {
  background: linear-gradient(135deg, var(--accent-2), var(--cyan));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .subtitle {
  font-size: 17px; color: var(--text-dim);
  max-width: 560px; margin: 0 auto 36px;
  line-height: 1.7;
}

/* ===== INSTALL BOX ===== */
.install-box {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--bg-code); border: 1px solid var(--border-bright);
  padding: 14px 20px; border-radius: 12px;
  font-size: 15px; margin-bottom: 12px;
  position: relative;
}
.install-box .prompt { color: var(--green); font-weight: 500; }
.install-box code { color: var(--text); }
.copy-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 4px; border-radius: 4px;
  transition: color 0.2s;
}
.copy-btn:hover { color: var(--text); }
.copy-btn svg { width: 16px; height: 16px; }
.install-alt {
  font-size: 13px; color: var(--text-muted); margin-top: 8px;
}
.install-alt code {
  background: var(--bg-code); padding: 2px 8px;
  border-radius: 4px; font-size: 12px; color: var(--text-dim);
}

/* ===== SECTION ===== */
section { padding: 60px 0; }
section + section { border-top: 1px solid var(--border); }
.section-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent-2); margin-bottom: 8px;
}
.section-title {
  font-size: 28px; font-weight: 700;
  letter-spacing: -0.02em; margin-bottom: 8px;
}
.section-desc {
  font-size: 15px; color: var(--text-dim);
  margin-bottom: 32px; max-width: 540px;
}

/* ===== FEATURE GRID ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s;
}
.feature-card:hover { border-color: var(--border-bright); }
.feature-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 14px;
}
.feature-card h3 {
  font-size: 15px; font-weight: 600;
  margin-bottom: 6px;
}
.feature-card p {
  font-size: 13px; color: var(--text-dim);
  line-height: 1.6;
}

/* ===== COMMANDS TABLE ===== */
.commands-table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
.commands-table th {
  text-align: left; font-weight: 600;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.commands-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.commands-table tr:last-child td { border-bottom: none; }
.commands-table tr:hover { background: var(--bg-code); }
.cmd-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--cyan);
  white-space: nowrap;
}
.cmd-desc { color: var(--text-dim); font-size: 13px; }
.cmd-model {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; padding: 2px 8px;
  border-radius: 4px; white-space: nowrap;
  font-weight: 500;
}
.model-opus { background: rgba(239, 68, 68, 0.1); color: #f87171; }
.model-sonnet { background: var(--orange-dim); color: var(--orange); }
.model-haiku { background: var(--green-dim); color: var(--green); }

/* ===== CODE BLOCKS ===== */
.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted); font-weight: 500;
}
.code-dots {
  display: flex; gap: 6px;
}
.code-dots span {
  width: 10px; height: 10px; border-radius: 50%;
}
.code-dots span:nth-child(1) { background: #ef4444; }
.code-dots span:nth-child(2) { background: #f59e0b; }
.code-dots span:nth-child(3) { background: #22c55e; }
.code-body {
  padding: 16px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; line-height: 1.8;
  overflow-x: auto;
}
.code-body .comment { color: var(--text-muted); }
.code-body .cmd { color: var(--green); }
.code-body .flag { color: var(--orange); }
.code-body .string { color: var(--cyan); }
.code-body .prompt-char { color: var(--text-muted); user-select: none; }

/* ===== STEPS ===== */
.steps { display: flex; flex-direction: column; gap: 24px; }
.step {
  display: flex; gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
}
.step-num {
  width: 32px; height: 32px; min-width: 32px;
  border-radius: 8px;
  background: var(--accent-glow);
  border: 1px solid rgba(99, 102, 241, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--accent-2);
}
.step h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.step p { font-size: 13px; color: var(--text-dim); line-height: 1.6; }

/* ===== MODEL CARDS ===== */
.model-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
  text-align: center;
}
.model-card .model-name {
  font-size: 18px; font-weight: 700; margin-bottom: 4px;
}
.model-card .model-tier {
  font-size: 12px; font-weight: 600;
  padding: 2px 10px; border-radius: 999px;
  display: inline-block; margin-bottom: 12px;
}
.model-card .model-uses {
  font-size: 13px; color: var(--text-dim); line-height: 1.7;
}

/* ===== FILE TREE ===== */
.file-tree {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; line-height: 2;
}
.file-tree .dir { color: var(--accent-2); }
.file-tree .file { color: var(--text-dim); }
.file-tree .desc { color: var(--text-muted); font-size: 12px; }

/* ===== CONTENT SECTIONS (docs, about) ===== */
.content { padding: 0 0 60px; }
.content h2 {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.02em;
  margin: 48px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.content h2:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.content h3 {
  font-size: 17px; font-weight: 600;
  margin: 28px 0 10px;
  color: var(--text);
}
.content p {
  font-size: 15px; color: var(--text-dim);
  margin-bottom: 16px; line-height: 1.7;
  max-width: 680px;
}
.content ul, .content ol {
  padding-left: 24px;
  margin-bottom: 16px;
}
.content li {
  font-size: 14px; color: var(--text-dim);
  margin-bottom: 8px; line-height: 1.6;
}
.content li code {
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--cyan);
}
.content strong { color: var(--text); font-weight: 600; }

/* ===== CONTACT CARDS ===== */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s;
}
.contact-card:hover { border-color: var(--border-bright); }
.contact-card .icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.contact-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.contact-card p { font-size: 13px; color: var(--text-dim); margin: 0; }
.contact-card a { color: var(--accent-2); font-size: 13px; }

/* ===== DOCS SIDEBAR ===== */
.docs-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  padding: 0 0 60px;
}
.docs-sidebar {
  position: sticky; top: 80px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-bright) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.docs-sidebar a {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 0;
  border-left: 2px solid transparent;
  padding-left: 12px;
  transition: all 0.2s;
}
.docs-sidebar a:hover { color: var(--text); text-decoration: none; }
.docs-sidebar a.active {
  color: var(--accent-2);
  border-left-color: var(--accent-2);
  font-weight: 500;
  transition: color 0.2s, border-left-color 0.2s;
}
.docs-sidebar .sidebar-group {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: var(--text-muted);
  margin: 16px 0 6px;
  padding-left: 12px;
}
.docs-sidebar .sidebar-group:first-child { margin-top: 0; }
.docs-sidebar .sidebar-group:nth-of-type(1) { background: linear-gradient(135deg, #22c55e, #06b6d4); -webkit-background-clip: text; background-clip: text; }
.docs-sidebar .sidebar-group:nth-of-type(2) { background: linear-gradient(135deg, #6366f1, #a855f7); -webkit-background-clip: text; background-clip: text; }
.docs-sidebar .sidebar-group:nth-of-type(3) { background: linear-gradient(135deg, #f59e0b, #ef4444); -webkit-background-clip: text; background-clip: text; }
.docs-sidebar .sidebar-group:nth-of-type(4) { background: linear-gradient(135deg, #ec4899, #f43f5e); -webkit-background-clip: text; background-clip: text; }
.docs-sidebar .sidebar-group:nth-of-type(5) { background: linear-gradient(135deg, #06b6d4, #3b82f6); -webkit-background-clip: text; background-clip: text; }
.docs-sidebar .sidebar-group:nth-of-type(6) { background: linear-gradient(135deg, #a855f7, #6366f1); -webkit-background-clip: text; background-clip: text; }
.docs-sidebar .sidebar-group:nth-of-type(7) { background: linear-gradient(135deg, #22c55e, #10b981); -webkit-background-clip: text; background-clip: text; }

/* ===== SKILL CARDS ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.skill-card {
  position: relative;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
}
.skill-card:hover {
  border-color: var(--border-bright);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}
.skill-featured {
  grid-column: 1 / -1;
  border-color: rgba(99, 102, 241, 0.3);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(6, 182, 212, 0.04));
}
.skill-featured:hover {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 8px 40px rgba(99, 102, 241, 0.15);
}
.skill-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.skill-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.skill-card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
}
.skill-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0;
}
.skill-tag {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}
.tag-featured {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
}
.tag-free {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.tag-paid {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.skill-card-desc {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 16px;
}
.skill-card-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}
.skill-card-meta span::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-right: 6px;
  vertical-align: middle;
}
.skill-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.skill-card-links a {
  font-size: 12px;
  color: var(--accent-2);
  padding: 4px 12px;
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 6px;
  transition: background 0.2s, border-color 0.2s;
}
.skill-card-links a:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.5);
  text-decoration: none;
}
/* Locked skill overlay */
.skill-locked {
  opacity: 0.7;
}
.skill-locked:hover {
  opacity: 0.85;
}
.skill-lock-overlay {
  position: absolute;
  top: 16px;
  right: 16px;
  color: #f59e0b;
  z-index: 2;
}

/* ===== FOOTER ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
}
footer p { font-size: 13px; color: var(--text-muted); }
footer a { color: var(--text-dim); }
footer a:hover { color: var(--text); }
.footer-links {
  display: flex; justify-content: center; gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ===== SCROLL REVEAL ANIMATIONS ===== */
/* GPU-accelerated: only transform + opacity */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.40s; }

/* Staggered grid children */
.features-grid .feature-card:nth-child(1) { transition-delay: 0s; }
.features-grid .feature-card:nth-child(2) { transition-delay: 0.06s; }
.features-grid .feature-card:nth-child(3) { transition-delay: 0.12s; }
.features-grid .feature-card:nth-child(4) { transition-delay: 0.18s; }
.features-grid .feature-card:nth-child(5) { transition-delay: 0.24s; }
.features-grid .feature-card:nth-child(6) { transition-delay: 0.30s; }

/* ===== HERO GLOW EFFECT ===== */
.hero-glow {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.12) 0%, rgba(6, 182, 212, 0.06) 40%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* ===== ENHANCED CARD HOVER ===== */
.feature-card {
  transition: border-color 0.3s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
}
.feature-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.contact-card {
  transition: border-color 0.3s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
}
.contact-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.model-card {
  transition: border-color 0.3s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
}
.model-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.step {
  transition: border-color 0.3s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.step:hover {
  border-color: var(--border-bright);
  transform: translateX(4px);
}

/* ===== SMOOTH NAV TRANSITION ===== */
nav {
  transition: background 0.3s, box-shadow 0.3s;
}
nav.scrolled {
  background: rgba(10, 10, 11, 0.95);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

/* ===== CODE BLOCK HOVER ===== */
.code-block {
  transition: border-color 0.3s, box-shadow 0.3s;
}
.code-block:hover {
  border-color: var(--border-bright);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

/* ===== BADGE PULSE ===== */
.badge::before {
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

/* ===== GRADIENT TEXT SHIMMER ===== */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.hero h1 .gradient {
  background: linear-gradient(90deg, var(--accent-2), var(--cyan), var(--accent-2));
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s linear infinite;
}

/* ===== INSTALL BOX GLOW ON HOVER ===== */
.install-box {
  transition: border-color 0.3s, box-shadow 0.3s;
}
.install-box:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

/* ===== TABLE ROW FADE IN ===== */
.commands-table tbody tr {
  transition: background 0.2s;
}

/* ===== FILE TREE TYPING EFFECT ===== */
.file-tree {
  transition: border-color 0.3s;
}
.file-tree:hover {
  border-color: var(--border-bright);
}

/* ===== AUTH FORMS ===== */
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}
.auth-field {
  margin-bottom: 16px;
}
.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.auth-field input:focus {
  border-color: var(--accent);
}
.auth-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.auth-btn:hover { background: var(--accent-2); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== PLAYGROUND ===== */
.pg-toolbar {
  position: fixed;
  top: 56px;
  left: 0; right: 0;
  z-index: 99;
  background: rgba(10, 10, 11, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 8px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pg-toolbar-left { display: flex; align-items: center; gap: 12px; }
.pg-toolbar-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pg-label { font-weight: 700; font-size: 14px; }
.pg-user { font-size: 12px; color: var(--text-muted); }

.pg-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.pg-btn-primary { background: var(--accent); color: #fff; }
.pg-btn-primary:hover { background: var(--accent-2); }
.pg-btn-green { background: var(--green); color: #fff; }
.pg-btn-green:hover { background: #16a34a; }
.pg-btn-accent { background: var(--cyan); color: #000; }
.pg-btn-accent:hover { background: #22d3ee; }
.pg-btn-outline { background: var(--bg-code); color: var(--text-dim); border: 1px solid var(--border); }
.pg-btn-outline:hover { border-color: var(--border-bright); color: var(--text); }
.pg-btn-dim { background: transparent; color: var(--text-muted); }
.pg-btn-dim:hover { color: var(--text); }

.pg-btn-sm {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-code);
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.pg-btn-sm:hover { border-color: var(--border-bright); color: var(--text); }
.pg-btn-sm-red { color: #f87171; }
.pg-btn-sm-red:hover { background: rgba(239,68,68,0.1); border-color: #f87171; }

.pg-setup, .pg-pages-panel, .pg-editor-panel {
  padding: 16px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  margin-top: 100px;
}
.pg-editor-panel {
  padding: 0;
  display: flex;
  flex-direction: column;
}
.pg-editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}
.pg-editor-bar span { font-size: 13px; font-weight: 600; }
.pg-html-editor {
  width: 100%;
  height: 260px;
  background: #0a0a0a;
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.7;
  border: none;
  outline: none;
  padding: 16px 20px;
  resize: vertical;
  box-sizing: border-box;
  tab-size: 2;
}
.pg-steps { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.pg-step {
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 10px;
}
.pg-step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 1px solid rgba(99,102,241,0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-2);
  flex-shrink: 0;
}

.pg-canvas-wrap {
  margin-top: 100px;
  padding: 0;
  min-height: calc(100vh - 160px);
}
.pg-canvas {
  width: 100%;
  min-height: calc(100vh - 160px);
  border: none;
  background: #fff;
  display: block;
}

.pg-page-card {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 200px;
  transition: border-color 0.2s;
}
.pg-page-card:hover { border-color: var(--border-bright); }

.pg-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
}
.pg-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  width: 400px;
  max-width: 90%;
}

/* ===== REDUCE MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
  .badge::before { animation: none; }
  .hero h1 .gradient { animation: none; }
  .hero-fixed h1 { animation: none; }
  .page-header h1.shimmer-title { animation: none; }
  .feature-card, .contact-card, .model-card, .step { transition: none; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; display: flex; flex-wrap: wrap; gap: 4px 16px; border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 24px; }
  .docs-sidebar a { padding: 4px 8px; border-left: none; }
  .docs-sidebar .sidebar-group { width: 100%; padding-left: 8px; }
}
@media (max-width: 640px) {
  .model-cards { grid-template-columns: 1fr; }
  .step { flex-direction: column; gap: 12px; }
  nav .nav-links a:not(.gh-btn) { display: none; }
  .install-box { flex-wrap: wrap; font-size: 13px; }
  .commands-table { font-size: 12px; }
  .commands-table .cmd-model { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
}
