/* ========================================
   RAG Mastery — Design System
   ======================================== */
:root {
  --bg: #050816;
  --bg2: #0a1128;
  --bg3: #111827;
  --card: rgba(17, 24, 39, 0.7);
  --card-border: rgba(6, 182, 212, 0.15);
  --cyan: #06b6d4;
  --purple: #a855f7;
  --rose: #f43f5e;
  --green: #22c55e;
  --amber: #eab308;
  --indigo: #818cf8;
  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #64748b;
  --font-display: 'Chakra Petch', sans-serif;
  --font-heading: 'Syne', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Particle Canvas */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ========================================
   Typography
   ======================================== */
.gradient-text {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-alt {
  background: linear-gradient(135deg, var(--purple), var(--rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.section {
  position: relative;
  z-index: 1;
  padding: 120px 0;
}

.section-alt {
  background: var(--bg2);
}

.section-alt::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(168, 85, 247, 0.04) 0%, transparent 60%);
  pointer-events: none;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
}

.section-desc {
  font-size: 1.15rem;
  color: var(--text2);
  max-width: 640px;
  margin-bottom: 48px;
}

/* ========================================
   Navigation
   ======================================== */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background 0.3s, backdrop-filter 0.3s, padding 0.3s;
}

#nav.scrolled {
  background: rgba(5, 8, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 10px 0;
  border-bottom: 1px solid var(--card-border);
}

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

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

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: var(--text2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover { color: var(--cyan); }

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--cyan);
  transition: width 0.3s;
}

.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #fff;
  box-shadow: 0 4px 24px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(6, 182, 212, 0.45);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid rgba(255,255,255,0.15);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.06);
}

/* ========================================
   Hero
   ======================================== */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-content { max-width: 600px; }

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 6px 16px;
  border-radius: 100px;
  margin-bottom: 24px;
  background: rgba(6, 182, 212, 0.06);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 24px;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text2);
  margin-bottom: 36px;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 40px;
}

.stat { text-align: center; }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Robot Mascot */
.hero-mascot {
  position: relative;
  flex-shrink: 0;
}

.ragbot { filter: drop-shadow(0 0 30px rgba(6, 182, 212, 0.2)); }

.antenna-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

.eye-left, .eye-right {
  animation: blink 4s ease-in-out infinite;
}
.eye-right { animation-delay: 0.2s; }

.chest-light {
  animation: pulse-glow 1.5s ease-in-out infinite alternate;
}

.arm-left {
  animation: wave-left 3s ease-in-out infinite;
  transform-origin: right center;
}
.arm-right {
  animation: wave-right 3s ease-in-out infinite;
  transform-origin: left center;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; r: 5; }
  50% { opacity: 1; r: 7; }
}

@keyframes blink {
  0%, 42%, 44%, 100% { r: 6; }
  43% { r: 1; }
}

@keyframes wave-left {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-8deg); }
}

@keyframes wave-right {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(8deg); }
}

.mascot-bubble {
  position: absolute;
  top: -10px;
  right: -40px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px 16px 16px 4px;
  padding: 12px 18px;
  font-size: 0.85rem;
  color: var(--text);
  max-width: 200px;
  backdrop-filter: blur(8px);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.scroll-arrow {
  width: 24px;
  height: 40px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  position: relative;
}

.scroll-arrow::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--cyan);
  border-radius: 2px;
  animation: scroll-down 1.5s ease-in-out infinite;
}

@keyframes scroll-down {
  0% { opacity: 1; top: 8px; }
  100% { opacity: 0; top: 24px; }
}

/* ========================================
   Comparison Cards
   ======================================== */
.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 48px;
}

.compare-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 32px;
  backdrop-filter: blur(8px);
  transition: transform 0.3s, box-shadow 0.3s;
}

.compare-card:hover {
  transform: translateY(-4px);
}

.compare-without {
  border-color: rgba(244, 63, 94, 0.2);
}
.compare-without:hover {
  box-shadow: 0 8px 40px rgba(244, 63, 94, 0.1);
}

.compare-with {
  border-color: rgba(34, 197, 94, 0.2);
}
.compare-with:hover {
  box-shadow: 0 8px 40px rgba(34, 197, 94, 0.1);
}

.compare-icon { margin-bottom: 16px; }

.compare-card h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.compare-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.flow-step {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text2);
}

.flow-step.warn {
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--rose);
}

.flow-step.good {
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--green);
}

.flow-arrow {
  color: var(--text3);
  font-size: 0.9rem;
}

.flow-arrow.good { color: var(--green); }

.compare-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compare-list li {
  font-size: 0.9rem;
  padding-left: 24px;
  position: relative;
  color: var(--text2);
}

.compare-list li::before {
  position: absolute;
  left: 0;
  font-size: 0.85rem;
}

.compare-list .con::before { content: '✗'; color: var(--rose); }
.compare-list .pro::before { content: '✓'; color: var(--green); }

/* Key Points */
.key-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.key-point {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 28px;
  backdrop-filter: blur(8px);
  transition: transform 0.3s, border-color 0.3s;
}

.key-point:hover {
  transform: translateY(-3px);
  border-color: rgba(6, 182, 212, 0.35);
}

.kp-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.key-point h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.key-point p {
  font-size: 0.9rem;
  color: var(--text2);
  line-height: 1.6;
}

/* ========================================
   Pipeline
   ======================================== */
.pipeline {
  margin-top: 16px;
}

.pipeline-track {
  position: relative;
  margin-bottom: 32px;
}

.pipeline-line {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  transform: translateY(-50%);
}

.pipeline-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-radius: 2px;
  transition: width 0.4s ease;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.pipeline-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
}

.pipe-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  transition: color 0.3s;
  padding: 0;
}

.pipe-step:hover { color: var(--text); }
.pipe-step.active { color: var(--cyan); }
.pipe-step.completed { color: var(--text2); }

.pipe-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  background: var(--bg);
  transition: all 0.3s;
  position: relative;
}

.pipe-step.active .pipe-dot {
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.5);
}

.pipe-step.completed .pipe-dot {
  border-color: var(--purple);
  background: var(--purple);
}

.pipeline-detail {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 36px;
  backdrop-filter: blur(8px);
  min-height: 200px;
  transition: opacity 0.3s;
}

.pipeline-detail h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.pipeline-detail p {
  color: var(--text2);
  margin-bottom: 16px;
  line-height: 1.7;
}

.pipeline-detail .detail-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
}

.pipeline-detail code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: rgba(6, 182, 212, 0.1);
  color: var(--cyan);
  padding: 3px 8px;
  border-radius: 6px;
}

.detail-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.detail-tags span {
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 100px;
  background: rgba(168, 85, 247, 0.12);
  color: var(--purple);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

/* ========================================
   Chunking Demo
   ======================================== */
.chunking-demo {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 32px;
  backdrop-filter: blur(8px);
}

.chunk-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.chunk-btn {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.chunk-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.chunk-btn.active {
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--cyan);
  color: var(--cyan);
}

.chunk-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 20px;
}

.chunk-content h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text2);
}

.chunk-count {
  font-size: 0.8rem;
  color: var(--cyan);
  font-family: var(--font-mono);
}

.chunk-text {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 20px;
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.7;
  max-height: 300px;
  overflow-y: auto;
}

.chunk-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.chunk-item {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px;
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.6;
  position: relative;
  transition: border-color 0.2s;
}

.chunk-item:hover {
  border-color: rgba(6, 182, 212, 0.3);
}

.chunk-item .chunk-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--cyan);
  display: block;
  margin-bottom: 6px;
}

.chunk-info {
  background: rgba(6, 182, 212, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.15);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.6;
}

.chunk-info strong {
  color: var(--cyan);
}

/* ========================================
   Embeddings
   ======================================== */
.embed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

.embed-visual h4,
.embed-info h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.vector-space {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

#vectorCanvas {
  display: block;
  width: 100%;
  height: auto;
}

.embed-caption {
  font-size: 0.82rem;
  color: var(--text3);
  margin-top: 10px;
}

.embed-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}

.embed-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.e-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.e-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.e-step strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.e-step p {
  font-size: 0.82rem;
  color: var(--text3);
  margin: 0;
}

.embed-models {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
}

.model-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 100px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  margin: 4px;
  font-size: 0.82rem;
  transition: border-color 0.2s;
}

.model-tag:hover { border-color: var(--cyan); }

.model-tag small {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

/* ========================================
   Vector Database Cards
   ======================================== */
.db-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.db-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 28px;
  backdrop-filter: blur(8px);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.db-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(6, 182, 212, 0.3);
}

.db-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.db-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c);
  flex-shrink: 0;
}

.db-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.db-type {
  font-size: 0.75rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.db-card > p {
  font-size: 0.88rem;
  color: var(--text2);
  margin-bottom: 16px;
  line-height: 1.6;
}

.db-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.feat {
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 100px;
  background: rgba(6, 182, 212, 0.08);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.15);
}

.db-meta {
  font-size: 0.82rem;
  color: var(--text3);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.db-meta strong {
  color: var(--text2);
}

/* ========================================
   LLM Models
   ======================================== */
.llm-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.llm-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 28px;
  backdrop-filter: blur(8px);
  transition: transform 0.3s, box-shadow 0.3s;
}

.llm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}

.llm-logo {
  --lc: var(--cyan);
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(6, 182, 212, 0.1);
  border: 1.5px solid var(--lc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--lc);
  margin-bottom: 16px;
}

.llm-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.llm-card > p {
  font-size: 0.88rem;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 16px;
}

.llm-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.llm-specs > div {
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  padding: 10px 14px;
}

.llm-specs span {
  display: block;
  font-size: 0.72rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.llm-specs strong {
  font-size: 0.88rem;
  color: var(--text);
}

/* ========================================
   Patterns Tabs
   ======================================== */
.patterns-tabs {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 32px;
  backdrop-filter: blur(8px);
}

.tab-buttons {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  padding: 4px;
}

.tab-btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text3);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  background: rgba(6, 182, 212, 0.12);
  color: var(--cyan);
}

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

.pattern-diagram {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px;
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  flex-wrap: wrap;
  justify-content: center;
}

.p-node {
  padding: 10px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.p-node.accent {
  border-color: rgba(6, 182, 212, 0.3);
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.06);
}

.p-node.accent2 {
  border-color: rgba(168, 85, 247, 0.3);
  color: var(--purple);
  background: rgba(168, 85, 247, 0.06);
}

.p-node.accent3 {
  border-color: rgba(234, 179, 8, 0.3);
  color: var(--amber);
  background: rgba(234, 179, 8, 0.06);
}

.p-arrow {
  color: var(--text3);
  font-size: 1.2rem;
}

.pattern-content h4 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.pattern-content > p {
  color: var(--text2);
  margin-bottom: 20px;
  line-height: 1.7;
}

.pattern-pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.pros, .cons {
  background: rgba(0,0,0,0.2);
  border-radius: 12px;
  padding: 20px;
}

.pros h5 { color: var(--green); margin-bottom: 10px; }
.cons h5 { color: var(--rose); margin-bottom: 10px; }

.pros ul, .cons ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pros li, .cons li {
  font-size: 0.85rem;
  color: var(--text2);
  padding-left: 18px;
  position: relative;
}

.pros li::before { content: '+'; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.cons li::before { content: '−'; position: absolute; left: 0; color: var(--rose); font-weight: 700; }

/* ========================================
   Roadmap
   ======================================== */
.roadmap {
  position: relative;
  padding-left: 40px;
}

.roadmap-line {
  position: absolute;
  left: 19px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--purple), var(--rose));
  opacity: 0.3;
}

.rm-item {
  position: relative;
  margin-bottom: 32px;
}

.rm-marker {
  position: absolute;
  left: -40px;
  top: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg2);
  border: 2.5px solid var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--cyan);
  z-index: 2;
  transition: all 0.3s;
}

.rm-item:nth-child(even) .rm-marker { border-color: var(--purple); color: var(--purple); }
.rm-item:last-child .rm-marker { border-color: var(--rose); color: var(--rose); }

.rm-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.rm-card:hover {
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.rm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
}

.rm-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.rm-time {
  font-size: 0.8rem;
  color: var(--cyan);
  font-family: var(--font-mono);
  background: rgba(6, 182, 212, 0.08);
  padding: 4px 12px;
  border-radius: 100px;
}

.rm-body {
  padding: 0 24px 24px;
  display: none;
}

.rm-item.open .rm-body { display: block; }

.rm-body p {
  color: var(--text2);
  margin-bottom: 16px;
  font-size: 0.92rem;
}

.rm-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.rm-body li {
  font-size: 0.88rem;
  color: var(--text2);
  padding-left: 20px;
  position: relative;
}

.rm-body li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--cyan);
}

.rm-resources {
  font-size: 0.82rem;
  color: var(--text3);
  background: rgba(0,0,0,0.2);
  padding: 12px 16px;
  border-radius: 10px;
  line-height: 1.6;
}

.rm-resources span {
  color: var(--purple);
  font-weight: 600;
}

/* ========================================
   Quiz
   ======================================== */
.quiz-container {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 36px;
  backdrop-filter: blur(8px);
  max-width: 720px;
  margin: 0 auto;
}

.quiz-progress {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  margin-bottom: 32px;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-radius: 2px;
  transition: width 0.4s;
  width: 0%;
}

.quiz-question {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
  line-height: 1.4;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.quiz-option {
  padding: 16px 20px;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text2);
  transition: all 0.2s;
  background: transparent;
  text-align: left;
  font-family: var(--font-body);
}

.quiz-option:hover {
  border-color: var(--cyan);
  color: var(--text);
  background: rgba(6, 182, 212, 0.04);
}

.quiz-option.selected {
  border-color: var(--cyan);
  background: rgba(6, 182, 212, 0.1);
  color: var(--text);
}

.quiz-option.correct {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.1);
  color: var(--green);
}

.quiz-option.wrong {
  border-color: var(--rose);
  background: rgba(244, 63, 94, 0.1);
  color: var(--rose);
}

.quiz-feedback {
  min-height: 40px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--text2);
  line-height: 1.5;
  padding: 12px 16px;
  border-radius: 10px;
  display: none;
}

.quiz-feedback.show {
  display: block;
}

.quiz-feedback.correct-fb {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--green);
}

.quiz-feedback.wrong-fb {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: var(--rose);
}

.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-counter {
  font-size: 0.85rem;
  color: var(--text3);
  font-family: var(--font-mono);
}

.quiz-result {
  text-align: center;
  padding: 20px 0;
}

.result-score {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.quiz-result p {
  color: var(--text2);
  margin-bottom: 24px;
  font-size: 1.1rem;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--card-border);
  padding: 48px 0;
  background: var(--bg);
}

.footer-inner {
  text-align: center;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.footer-text {
  color: var(--text3);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.footer-links a {
  color: var(--text3);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--cyan); }

/* ========================================
   Animations
   ======================================== */
.anim-fade-up {
  opacity: 0;
  transform: translateY(24px);
  animation: fadeUp 0.7s ease forwards;
  animation-delay: var(--d, 0s);
}

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.anim-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.anim-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: 100px;
  }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-mascot { order: -1; }
  .mascot-bubble { right: -20px; }

  .comparison-grid { grid-template-columns: 1fr; }
  .key-points { grid-template-columns: 1fr; }
  .db-grid { grid-template-columns: 1fr; }
  .llm-grid { grid-template-columns: 1fr; }
  .embed-grid { grid-template-columns: 1fr; }
  .chunk-content { grid-template-columns: 1fr; }
  .pattern-pros-cons { grid-template-columns: 1fr; }

  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(5, 8, 22, 0.95);
    backdrop-filter: blur(16px);
    padding: 16px 24px;
    gap: 12px;
    border-bottom: 1px solid var(--card-border);
  }

  .tab-buttons { flex-wrap: wrap; }
  .tab-btn { flex: none; }

  .pipeline-steps { gap: 4px; }
  .pipe-step span { font-size: 0.65rem; }
}

@media (max-width: 600px) {
  .section { padding: 80px 0; }
  .hero-title { font-size: 2.2rem; }
  .pipeline-detail { padding: 24px; }
  .quiz-container { padding: 24px; }
  .patterns-tabs { padding: 20px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
