/* ================================================
   TRANSFORMER EXPLAINED - Complete Stylesheet
   Dark AI-themed design system
   ================================================ */

/* === GOOGLE FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

/* === ROOT VARIABLES === */
:root {
  --bg-primary:    #080818;
  --bg-secondary:  #0f0f23;
  --bg-card:       #13132b;
  --bg-card-hover: #1a1a38;
  --accent-1:      #7c3aed;   /* purple */
  --accent-2:      #06b6d4;   /* cyan */
  --accent-3:      #ec4899;   /* pink */
  --accent-4:      #10b981;   /* green */
  --accent-5:      #f59e0b;   /* amber */
  --text-1:        #f1f5f9;
  --text-2:        #94a3b8;
  --text-3:        #64748b;
  --border:        rgba(124, 58, 237, 0.18);
  --border-light:  rgba(255,255,255,0.06);
  --glow:          rgba(124, 58, 237, 0.35);
  --gradient:      linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
  --gradient-text: linear-gradient(135deg, #a78bfa 0%, #38bdf8 100%);
  --sidebar-w:     270px;
  --header-h:      60px;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow:   0 0 40px rgba(124,58,237,0.2);
  --transition:    0.25s cubic-bezier(0.4,0,0.2,1);
  --font:          'Inter', system-ui, sans-serif;
  --font-mono:     'Fira Code', 'Consolas', monospace;
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-1);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { cursor: pointer; font-family: var(--font); }
ul, ol { list-style: none; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent-1); border-radius: 3px; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.5rem); }
h4 { font-size: 1.1rem; }
p { color: var(--text-2); }
code {
  font-family: var(--font-mono);
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}
.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ================================================
   LANDING PAGE (index.html)
   ================================================ */

/* --- Navbar --- */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2rem;
  background: rgba(8,8,24,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  z-index: 100;
}
.nav-logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1.1rem; font-weight: 700;
}
.nav-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--gradient);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a {
  color: var(--text-2);
  font-size: 0.9rem;
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text-1); }
.btn-start {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: opacity var(--transition), transform var(--transition);
}
.btn-start:hover { opacity: 0.85; transform: translateY(-1px); }

/* --- Hero Section --- */
.hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
  padding: calc(var(--header-h) + 2rem) 2rem 4rem;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 60% 40%, rgba(124,58,237,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 20% 70%, rgba(6,182,212,0.08) 0%, transparent 50%);
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(124,58,237,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 70% 70% at center, black 40%, transparent 100%);
}
.hero-content {
  max-width: 800px;
  text-align: center;
  position: relative;
  z-index: 2;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #a78bfa;
  margin-bottom: 1.5rem;
}
.hero h1 { margin-bottom: 1.25rem; }
.hero p {
  font-size: 1.15rem;
  color: var(--text-2);
  max-width: 600px;
  margin: 0 auto 2.5rem;
}
.hero-cta {
  display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;
  margin-bottom: 3rem;
}
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--gradient);
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(124,58,237,0.4); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--border);
  padding: 0.8rem 2rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  transition: border-color var(--transition), background var(--transition);
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--accent-1); background: rgba(124,58,237,0.08); }
.hero-stats {
  display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap;
}
.stat { text-align: center; }
.stat .num { font-size: 1.6rem; font-weight: 800; }
.stat .num.purple { color: #a78bfa; }
.stat .num.cyan { color: #38bdf8; }
.stat .num.green { color: #34d399; }
.stat .label { font-size: 0.8rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* --- Transformer Visual (hero animation) --- */
.transformer-visual {
  max-width: 600px;
  margin: 3rem auto 0;
  position: relative;
}
.tf-diagram {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.tf-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  text-align: center;
  font-weight: 500;
  transition: transform var(--transition);
}
.tf-block:hover { transform: translateY(-3px); }
.tf-block.encoder { background: rgba(124,58,237,0.15); border: 1px solid rgba(124,58,237,0.3); }
.tf-block.decoder { background: rgba(6,182,212,0.12); border: 1px solid rgba(6,182,212,0.3); }
.tf-block.attn { background: rgba(236,72,153,0.12); border: 1px solid rgba(236,72,153,0.25); }
.tf-block.ffn { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.25); }
.tf-block .icon { font-size: 1.5rem; }
.tf-arrow { display: flex; align-items: center; color: var(--text-3); font-size: 1.2rem; }

/* --- Modules Section --- */
.section { padding: 5rem 2rem; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header p { font-size: 1.05rem; max-width: 600px; margin: 0.75rem auto 0; }

.modules-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}
.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.module-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity var(--transition);
}
.module-card:hover { border-color: var(--border); transform: translateY(-4px); box-shadow: var(--shadow-glow); }
.module-card:hover::before { opacity: 1; }
.module-num {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
  margin-bottom: 1rem;
}
.module-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.module-card p { font-size: 0.85rem; margin-bottom: 1rem; }
.module-lessons { display: flex; flex-direction: column; gap: 0.3rem; }
.lesson-link {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-3);
  padding: 0.3rem 0;
  transition: color var(--transition);
}
.lesson-link:hover { color: var(--text-1); }
.lesson-link .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
  transition: background var(--transition);
}
.lesson-link:hover .dot { background: var(--accent-1); }
.lesson-link.done .dot { background: var(--accent-4); }
.lesson-link.done { color: var(--text-2); }

/* --- Concepts Section --- */
.concepts-section { background: var(--bg-secondary); }
.concepts-grid {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.concept-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  display: flex; align-items: flex-start; gap: 0.75rem;
  transition: border-color var(--transition);
}
.concept-card:hover { border-color: var(--border); }
.concept-icon { font-size: 1.5rem; flex-shrink: 0; }
.concept-card h4 { font-size: 0.9rem; margin-bottom: 0.25rem; }
.concept-card p { font-size: 0.8rem; }

/* --- Footer --- */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 2rem;
  text-align: center;
  color: var(--text-3);
  font-size: 0.85rem;
}
footer a { color: var(--accent-2); }

/* ================================================
   LESSON PAGES (lessons/*.html)
   ================================================ */

/* --- Layout: Sidebar + Content --- */
.lesson-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-light);
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 50;
  display: flex; flex-direction: column;
  transition: transform var(--transition);
}
.sidebar-header {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  position: sticky; top: 0;
  background: var(--bg-secondary);
  z-index: 1;
}
.sidebar-header .logo-icon {
  width: 28px; height: 28px;
  background: var(--gradient);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.sidebar-home {
  padding: 0.75rem 1.25rem;
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--text-3);
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border-light);
  transition: color var(--transition);
}
.sidebar-home:hover { color: var(--text-1); }
.sidebar-modules { padding: 0.5rem 0; flex: 1; }
.sidebar-module-title {
  padding: 0.6rem 1.25rem 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}
.sidebar-lesson {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.55rem 1.25rem;
  font-size: 0.82rem;
  color: var(--text-2);
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.sidebar-lesson:hover { background: rgba(124,58,237,0.08); color: var(--text-1); }
.sidebar-lesson.active {
  background: rgba(124,58,237,0.15);
  color: #a78bfa;
  font-weight: 600;
}
.sidebar-lesson.active::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent-1);
  border-radius: 0 2px 2px 0;
}
.sidebar-lesson.completed .lesson-check { color: var(--accent-4); }
.lesson-num {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-lesson.active .lesson-num { background: rgba(124,58,237,0.3); border-color: var(--accent-1); }
.sidebar-lesson.completed .lesson-num { background: rgba(16,185,129,0.2); border-color: var(--accent-4); color: var(--accent-4); }
.lesson-check { display: none; font-size: 0.7rem; margin-left: auto; color: var(--text-3); }
.sidebar-lesson.completed .lesson-check { display: block; }

/* --- Main Content --- */
.lesson-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  max-width: calc(100% - var(--sidebar-w));
}

/* --- Top Bar (lesson page) --- */
.lesson-topbar {
  position: sticky; top: 0;
  background: rgba(8,8,24,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  padding: 0 2rem;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  z-index: 40;
}
.topbar-lesson-info { display: flex; align-items: center; gap: 0.75rem; }
.topbar-module-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-m1 { background: rgba(124,58,237,0.2); color: #a78bfa; border: 1px solid rgba(124,58,237,0.3); }
.badge-m2 { background: rgba(6,182,212,0.15); color: #38bdf8; border: 1px solid rgba(6,182,212,0.3); }
.badge-m3 { background: rgba(236,72,153,0.15); color: #f472b6; border: 1px solid rgba(236,72,153,0.3); }
.badge-m4 { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.topbar-title { font-size: 0.9rem; font-weight: 600; }
.topbar-nav { display: flex; gap: 0.5rem; }
.topbar-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-2);
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  transition: all var(--transition);
}
.topbar-btn:hover { border-color: var(--accent-1); color: var(--text-1); }
.topbar-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- Lesson Body --- */
.lesson-body { padding: 2.5rem 2rem 4rem; max-width: 860px; }

/* Lesson Header */
.lesson-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-light);
}
.lesson-header .module-tag {
  font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  display: block;
}
.lesson-header h1 { margin-bottom: 0.75rem; }
.lesson-header .desc { font-size: 1.05rem; color: var(--text-2); margin-bottom: 1.25rem; }
.lesson-meta { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.meta-item {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.82rem; color: var(--text-3);
}

/* --- Slideshow === */
.slideshow-container {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2.5rem;
  position: relative;
}
.slides-wrapper {
  position: relative;
  min-height: 360px;
}
.slide {
  display: none;
  padding: 2.5rem 2.5rem 1.5rem;
  animation: slideIn 0.4s ease;
}
.slide.active { display: block; }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.slide-num {
  font-size: 0.75rem;
  color: var(--text-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}
.slide h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.slide p { margin-bottom: 0.75rem; }

/* Slide specific layouts */
.slide-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 600px) { .slide-two-col { grid-template-columns: 1fr; } }

.slide-visual {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.slide-visual .visual-label { font-size: 0.75rem; color: var(--text-3); }

/* Animated boxes in slides */
.anim-flow {
  display: flex; align-items: center; gap: 0.5rem;
  flex-wrap: wrap; justify-content: center;
  margin: 1rem 0;
}
.anim-box {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  animation: fadeInUp 0.5s ease both;
}
.anim-box.purple { background: rgba(124,58,237,0.2); border: 1px solid rgba(124,58,237,0.4); color: #a78bfa; }
.anim-box.cyan   { background: rgba(6,182,212,0.15); border: 1px solid rgba(6,182,212,0.35); color: #38bdf8; }
.anim-box.pink   { background: rgba(236,72,153,0.15); border: 1px solid rgba(236,72,153,0.35); color: #f472b6; }
.anim-box.green  { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.35); color: #34d399; }
.anim-box.amber  { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.35); color: #fbbf24; }
.anim-box.gray   { background: rgba(100,116,139,0.2); border: 1px solid rgba(100,116,139,0.3); color: var(--text-2); }
.anim-arrow { color: var(--text-3); font-size: 1rem; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

.highlight-box {
  background: rgba(124,58,237,0.1);
  border-left: 3px solid var(--accent-1);
  padding: 0.85rem 1rem;
  border-radius: 0 8px 8px 0;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.highlight-box.cyan   { background: rgba(6,182,212,0.08); border-left-color: var(--accent-2); }
.highlight-box.green  { background: rgba(16,185,129,0.08); border-left-color: var(--accent-4); }
.highlight-box.amber  { background: rgba(245,158,11,0.08); border-left-color: var(--accent-5); }
.highlight-box.pink   { background: rgba(236,72,153,0.08); border-left-color: var(--accent-3); }

.math-formula {
  font-family: var(--font-mono);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 1.05rem;
  color: #a78bfa;
  margin: 1.25rem 0;
  letter-spacing: 0.02em;
}

.step-list { display: flex; flex-direction: column; gap: 0.75rem; margin: 1rem 0; }
.step-item {
  display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  font-size: 0.88rem;
}
.step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700;
  flex-shrink: 0; margin-top: 0.1rem;
}

/* Word token visualization in slides */
.token-row {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin: 0.75rem 0;
}
.token {
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: default;
}
.token.t1 { background: rgba(124,58,237,0.2); color: #a78bfa; border: 1px solid rgba(124,58,237,0.3); }
.token.t2 { background: rgba(6,182,212,0.15); color: #38bdf8; border: 1px solid rgba(6,182,212,0.3); }
.token.t3 { background: rgba(236,72,153,0.15); color: #f472b6; border: 1px solid rgba(236,72,153,0.3); }
.token.t4 { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }
.token.t5 { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.3); }
.token.t6 { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }

/* Slideshow Controls */
.slideshow-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem 1.25rem;
  border-top: 1px solid var(--border-light);
}
.slide-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-2);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  transition: all var(--transition);
}
.slide-btn:hover { border-color: var(--accent-1); color: var(--text-1); background: rgba(124,58,237,0.1); }
.slide-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.slide-dots {
  display: flex; gap: 0.4rem; align-items: center;
}
.slide-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-3);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}
.slide-dot.active { background: var(--accent-1); width: 20px; border-radius: 4px; }
.slide-counter { font-size: 0.78rem; color: var(--text-3); }

/* --- Visualization Section --- */
.viz-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2.5rem;
}
.viz-title {
  font-size: 1rem; font-weight: 700;
  margin-bottom: 0.4rem;
}
.viz-desc {
  font-size: 0.85rem;
  color: var(--text-3);
  margin-bottom: 1.5rem;
}
.viz-canvas-wrap {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
}
canvas {
  display: block;
  max-width: 100%;
}
/* Interactive demo elements */
.demo-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-1);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color var(--transition);
  margin-bottom: 0.75rem;
  resize: vertical;
}
.demo-input:focus { outline: none; border-color: var(--accent-1); }
.demo-btn {
  background: rgba(124,58,237,0.2);
  border: 1px solid rgba(124,58,237,0.3);
  color: #a78bfa;
  padding: 0.55rem 1.25rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--transition);
}
.demo-btn:hover { background: rgba(124,58,237,0.35); }
.demo-output {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  font-size: 0.85rem;
  min-height: 60px;
}
.demo-output .token-row { margin: 0; }

/* Attention matrix viz */
.attention-controls {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.attn-word-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.82rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-2);
  transition: all var(--transition);
}
.attn-word-btn:hover,
.attn-word-btn.active { background: rgba(124,58,237,0.2); border-color: var(--accent-1); color: #a78bfa; }

/* Embedding viz controls */
.embed-controls { display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.embed-controls select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-1);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.85rem;
}

/* --- Key Concepts === */
.concepts-section-lesson { margin-bottom: 2.5rem; }
.concepts-section-lesson h2 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}
.key-concepts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.key-concept {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  transition: border-color var(--transition), transform var(--transition);
}
.key-concept:hover { border-color: var(--border); transform: translateY(-2px); }
.kc-icon { font-size: 1.6rem; margin-bottom: 0.6rem; }
.kc-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.4rem; }
.kc-desc { font-size: 0.82rem; color: var(--text-2); }

/* --- Analogy Box --- */
.analogy-box {
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin: 1.25rem 0;
  display: flex; gap: 0.75rem; align-items: flex-start;
}
.analogy-icon { font-size: 1.5rem; flex-shrink: 0; }
.analogy-box h4 { font-size: 0.88rem; color: #fbbf24; margin-bottom: 0.3rem; }
.analogy-box p { font-size: 0.85rem; }

/* --- Quiz === */
.quiz-section { margin-bottom: 2.5rem; }
.quiz-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}
.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.quiz-question { font-size: 1rem; font-weight: 600; margin-bottom: 1.25rem; color: var(--text-1); }
.quiz-options { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 1.25rem; }
.quiz-option {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.9rem;
}
.quiz-option:hover { border-color: var(--border); background: var(--bg-card-hover); }
.quiz-option.selected { border-color: var(--accent-1); background: rgba(124,58,237,0.12); }
.quiz-option.correct { border-color: var(--accent-4); background: rgba(16,185,129,0.12); color: #34d399; }
.quiz-option.wrong { border-color: #ef4444; background: rgba(239,68,68,0.1); color: #f87171; }
.option-letter {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  flex-shrink: 0;
}
.quiz-option.correct .option-letter { background: rgba(16,185,129,0.2); border-color: var(--accent-4); color: #34d399; }
.quiz-option.wrong .option-letter { background: rgba(239,68,68,0.15); border-color: #ef4444; color: #f87171; }
.quiz-btn {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.25rem;
  transition: opacity var(--transition), transform var(--transition);
}
.quiz-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.quiz-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.quiz-feedback {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: none;
}
.quiz-feedback.show { display: block; animation: fadeInUp 0.3s ease; }
.quiz-feedback.correct-fb { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
.quiz-feedback.wrong-fb { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); color: #f87171; }

/* --- Lesson Navigation --- */
.lesson-nav-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}
.nav-prev, .nav-next {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.88rem;
  transition: all var(--transition);
  flex: 1;
  max-width: 280px;
}
.nav-prev:hover, .nav-next:hover { border-color: var(--accent-1); color: var(--text-1); }
.nav-prev { justify-content: flex-start; }
.nav-next { justify-content: flex-end; margin-left: auto; }
.nav-label { font-size: 0.72rem; color: var(--text-3); display: block; }
.nav-title { font-weight: 600; }

/* --- Progress bar at top --- */
.lesson-progress-bar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0;
  height: 3px;
  background: var(--bg-secondary);
  z-index: 60;
}
.lesson-progress-fill {
  height: 100%;
  background: var(--gradient);
  transition: width 0.3s ease;
}

/* --- Sidebar toggle (mobile) --- */
.sidebar-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  border: none;
  color: white;
  font-size: 1.25rem;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(124,58,237,0.5);
  align-items: center; justify-content: center;
}

/* ================================================
   UTILITY & ANIMATIONS
   ================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.pulse { animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.spin { animation: spin 2s linear infinite; }
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.float { animation: float 3s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Glow border animation */
@keyframes borderGlow {
  0%, 100% { border-color: rgba(124,58,237,0.3); box-shadow: 0 0 10px rgba(124,58,237,0.1); }
  50% { border-color: rgba(124,58,237,0.7); box-shadow: 0 0 20px rgba(124,58,237,0.3); }
}
.glow-border { animation: borderGlow 2.5s ease-in-out infinite; }

/* Typing cursor */
.typing::after {
  content: '|';
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Tag cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.tag {
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-2);
}

/* Comparison table */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 1rem 0;
}
.compare-table th {
  background: var(--bg-secondary);
  padding: 0.65rem 0.85rem;
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
}
.compare-table td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-2);
}
.compare-table tr:hover td { background: rgba(255,255,255,0.02); }
.compare-table .good { color: var(--accent-4); }
.compare-table .bad  { color: #f87171; }

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar {
    transform: translateX(-270px);
    width: 270px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,0.6); }
  .lesson-content { margin-left: 0; max-width: 100%; }
  .lesson-progress-bar { left: 0; }
  .sidebar-toggle { display: flex; }
  .lesson-topbar { padding: 0 1rem; }
  .topbar-title { display: none; }
}
@media (max-width: 640px) {
  .lesson-body { padding: 1.5rem 1rem 3rem; }
  .slide { padding: 1.5rem 1.25rem 1rem; }
  .slideshow-controls { padding: 0.75rem 1.25rem 1rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero-cta { flex-direction: column; align-items: center; }
  .hero-stats { gap: 1.5rem; }
  .lesson-nav-footer { flex-direction: column; }
  .nav-prev, .nav-next { max-width: 100%; }
}

/* ================================================
   TTS AUDIO PLAYER
   ================================================ */
.tts-bar {
  position: fixed;
  bottom: 0; left: var(--sidebar-w); right: 0;
  background: rgba(10,10,28,0.96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  z-index: 100;
  padding: 0.6rem 1.5rem;
  transition: transform 0.3s ease;
}
.tts-bar.hidden { transform: translateY(100%); }
.tts-inner {
  display: flex; align-items: center; gap: 0.85rem;
  max-width: 820px; margin: 0 auto;
}
.tts-icon { font-size: 1rem; color: var(--accent-1); flex-shrink: 0; }
.tts-text {
  flex: 1;
  font-size: 0.76rem;
  color: var(--text-2);
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tts-controls { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.tts-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-2);
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
}
.tts-btn:hover { border-color: var(--accent-1); color: var(--accent-1); }
.tts-btn.active { background: rgba(124,58,237,0.2); border-color: var(--accent-1); color: #a78bfa; }
.tts-speed {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-2);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--font);
  cursor: pointer;
}
.tts-toggle {
  background: none; border: none;
  color: var(--text-3); font-size: 0.7rem;
  cursor: pointer; padding: 0.25rem;
  flex-shrink: 0;
  transition: color var(--transition);
}
.tts-toggle:hover { color: var(--text-1); }
.tts-reopen {
  position: fixed; bottom: 1rem; right: 1rem;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(124,58,237,0.25);
  border: 1px solid var(--border);
  color: #a78bfa; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 101;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(124,58,237,0.3);
}
.tts-reopen:hover { background: rgba(124,58,237,0.4); }
@media (max-width: 900px) { .tts-bar { left: 0; } }
@media (max-width: 640px) { .tts-text { display: none; } .tts-bar { padding: 0.6rem 1rem; } }
