/* ============================================================
   HARDWARE DESIGN MASTERCLASS - MAIN STYLES
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap');

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background var(--transition-speed), color var(--transition-speed);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  color: var(--text-heading);
  line-height: 1.2;
}
code, pre, .mono {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

a { color: var(--accent-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-secondary); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { opacity: 0.8; }

/* ---- NAVBAR ---- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  transition: all 0.3s;
}
.navbar.scrolled {
  box-shadow: var(--shadow-md);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-heading);
  font-family: 'Space Grotesk', sans-serif;
}
.nav-brand .brand-icon {
  width: 36px; height: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--bg-card);
  color: var(--accent-primary);
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all 0.25s;
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--glow-primary);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--glow-primary);
}
.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}
.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-icon {
  width: 40px; height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-icon:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-card-hover);
}

/* ---- CARDS ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s;
}
.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.card-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
}
.card-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}
.card-clickable {
  cursor: pointer;
}
.card-clickable:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}

/* ---- HERO SECTION ---- */
.hero {
  background: var(--gradient-hero);
  padding: 120px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(59,130,246,0.08) 0%, transparent 50%),
              radial-gradient(circle at 80% 50%, rgba(139,92,246,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }
.hero h1 {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 16px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero .subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 48px;
}
.hero-stat .stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-primary);
  font-family: 'Space Grotesk', sans-serif;
}
.hero-stat .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---- SECTIONS ---- */
.section {
  padding: 60px 24px;
  max-width: 1400px;
  margin: 0 auto;
}
.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.section-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 40px;
}
.section-label {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

/* ---- GRIDS ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ---- TRACK CARDS ---- */
.track-card {
  position: relative;
  overflow: hidden;
}
.track-card .track-number {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 3rem;
  font-weight: 900;
  opacity: 0.08;
  color: var(--text-primary);
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1;
}
.track-card .track-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 12px;
}
.track-card .track-tag.beginner { background: rgba(16,185,129,0.15); color: var(--accent-success); }
.track-card .track-tag.intermediate { background: rgba(245,158,11,0.15); color: var(--accent-warning); }
.track-card .track-tag.advanced { background: rgba(239,68,68,0.15); color: var(--accent-danger); }
.track-card .track-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 12px;
}
.track-card .track-topics span {
  padding: 2px 8px;
  background: var(--bg-secondary);
  border-radius: 10px;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.track-progress {
  margin-top: 16px;
  height: 4px;
  background: var(--bg-secondary);
  border-radius: 2px;
  overflow: hidden;
}
.track-progress .progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 0.5s;
}

/* ---- PROGRESS TRACKER ---- */
.progress-overview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}
.progress-circle {
  width: 80px; height: 80px;
  position: relative;
  flex-shrink: 0;
}
.progress-circle svg { transform: rotate(-90deg); }
.progress-circle .progress-text {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-primary);
}
.progress-details h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}
.progress-details p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ---- MODULE PAGE LAYOUT ---- */
.module-page {
  padding-top: 64px;
  min-height: 100vh;
}
.module-hero {
  padding: 60px 24px 40px;
  background: var(--gradient-hero);
  border-bottom: 1px solid var(--border-color);
}
.module-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
}
.module-hero .module-meta {
  display: flex;
  gap: 20px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}
.module-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}
.module-sidebar {
  position: sticky;
  top: 84px;
}

/* ---- TABS ---- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab {
  padding: 12px 20px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* ---- SIMULATION CONTAINERS ---- */
.sim-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 24px 0;
}
.sim-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}
.sim-toolbar label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.sim-toolbar input[type="range"] {
  width: 120px;
  accent-color: var(--accent-primary);
}
.sim-toolbar select, .sim-toolbar input[type="number"] {
  padding: 4px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.8rem;
  font-family: inherit;
}
.sim-canvas-wrap {
  padding: 16px;
  min-height: 300px;
  position: relative;
}
.sim-canvas-wrap canvas {
  width: 100%;
  display: block;
  border-radius: var(--radius);
}
.sim-info {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ---- QUIZ COMPONENTS ---- */
.quiz-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
}
.quiz-question {
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-heading);
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}
.quiz-option:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}
.quiz-option.correct {
  border-color: var(--accent-success);
  background: rgba(16,185,129,0.1);
}
.quiz-option.incorrect {
  border-color: var(--accent-danger);
  background: rgba(239,68,68,0.1);
}
.quiz-option input[type="radio"] {
  accent-color: var(--accent-primary);
}
.quiz-explanation {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent-info);
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: none;
}
.quiz-explanation.show { display: block; }

/* ---- GLOSSARY ---- */
.glossary-search {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 20px;
  font-family: inherit;
}
.glossary-search:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: var(--glow-primary);
}
.glossary-item {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}
.glossary-term {
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 4px;
}
.glossary-def {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ---- FORMULA DISPLAY ---- */
.formula-block {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--accent-primary);
  overflow-x: auto;
}
.formula-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-family: 'Inter', sans-serif;
}

/* ---- CHECKLIST ---- */
.checklist {
  list-style: none;
}
.checklist li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
}
.checklist li::before {
  content: '☐';
  color: var(--accent-primary);
  font-size: 1.1rem;
  flex-shrink: 0;
}
.checklist li.checked::before {
  content: '☑';
  color: var(--accent-success);
}

/* ---- ANIMATION CONTAINER ---- */
.anim-container {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 24px 0;
}
.anim-canvas {
  width: 100%;
  min-height: 300px;
  display: block;
}
.anim-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}
.anim-label {
  position: absolute;
  padding: 4px 10px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.75rem;
  border-radius: 4px;
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
}

/* ---- MODAL (Login/Register) ---- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
}
.modal-overlay.active {
  display: flex;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
}
.modal h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.modal .modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.form-group input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: var(--glow-primary);
}
.form-toggle {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.form-toggle a {
  color: var(--accent-primary);
  cursor: pointer;
  font-weight: 600;
}

/* ---- SIDEBAR NAV (Module pages) ---- */
.page-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  min-height: calc(100vh - 64px);
}
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 20px 0;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}
.sidebar-section {
  padding: 8px 16px;
}
.sidebar-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 8px 16px;
  font-weight: 600;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-radius: var(--radius);
  margin: 2px 8px;
  transition: all 0.2s;
}
.sidebar-link:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.sidebar-link.active {
  background: var(--bg-card);
  color: var(--accent-primary);
  font-weight: 600;
}
.sidebar-link .link-icon {
  width: 20px;
  text-align: center;
  font-size: 0.9rem;
}

/* ---- CONTENT SECTIONS ---- */
.content-section {
  margin-bottom: 48px;
}
.content-section h2 {
  font-size: 1.6rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.content-section h3 {
  font-size: 1.2rem;
  margin: 24px 0 12px;
}
.content-section p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}
.content-section ul, .content-section ol {
  color: var(--text-secondary);
  margin: 12px 0 16px 24px;
  line-height: 1.8;
}

/* ---- INFO BOXES ---- */
.info-box {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 16px 0;
  border-left: 4px solid;
}
.info-box.note {
  background: rgba(6,182,212,0.08);
  border-color: var(--accent-info);
}
.info-box.warning {
  background: rgba(245,158,11,0.08);
  border-color: var(--accent-warning);
}
.info-box.danger {
  background: rgba(239,68,68,0.08);
  border-color: var(--accent-danger);
}
.info-box.tip {
  background: rgba(16,185,129,0.08);
  border-color: var(--accent-success);
}
.info-box-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 4px;
  color: var(--text-heading);
}
.info-box p {
  font-size: 0.875rem;
  margin: 0;
}

/* ---- WAVEFORM DISPLAY ---- */
.waveform-display {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 8px;
  margin: 16px 0;
}
.waveform-display canvas {
  width: 100%;
  height: 200px;
}

/* ---- TABLE ---- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.875rem;
}
.data-table th {
  padding: 10px 16px;
  background: var(--bg-secondary);
  color: var(--text-heading);
  font-weight: 600;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
}
.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.data-table tr:hover td {
  background: var(--bg-card-hover);
}

/* ---- BADGE ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-success { background: rgba(16,185,129,0.15); color: var(--accent-success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--accent-warning); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--accent-danger); }
.badge-info { background: rgba(6,182,212,0.15); color: var(--accent-info); }

/* ---- TOOL CALCULATOR ---- */
.calculator-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
}
.calc-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.calc-row label {
  min-width: 140px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.calc-row input, .calc-row select {
  flex: 1;
  min-width: 100px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: 'JetBrains Mono', monospace;
}
.calc-result {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  margin-top: 16px;
  font-family: 'JetBrains Mono', monospace;
}
.calc-result .result-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
}
.calc-result .result-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- FOOTER ---- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
  margin-top: 60px;
}
.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer h4 {
  font-size: 0.85rem;
  color: var(--text-heading);
  margin-bottom: 16px;
}
.footer a {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 4px 0;
}
.footer a:hover { color: var(--accent-primary); }
.footer-bottom {
  max-width: 1400px;
  margin: 24px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---- SEARCH ---- */
.search-bar {
  position: relative;
}
.search-bar input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--accent-primary);
}
.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-content { grid-template-columns: 1fr 1fr; }
  .page-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .nav-links { display: none; }
  .footer-content { grid-template-columns: 1fr; }
  .section { padding: 40px 16px; }
}

/* ---- ANIMATIONS ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes slideIn {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.animate-in {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* ---- SVG CIRCUIT DECORATION ---- */
.circuit-line {
  stroke: var(--accent-primary);
  stroke-width: 1;
  opacity: 0.15;
  fill: none;
}
.circuit-dot {
  fill: var(--accent-primary);
  opacity: 0.3;
}

/* Case study cards */
.case-study-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 16px 0;
  border-left: 4px solid var(--accent-danger);
}
.case-study-card h4 {
  color: var(--text-heading);
  margin-bottom: 8px;
}
.case-study-card .case-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(239,68,68,0.15);
  color: var(--accent-danger);
  margin-bottom: 12px;
}
.case-study-card .case-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.case-study-card .case-section {
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}
.case-study-card .case-section h5 {
  font-size: 0.8rem;
  color: var(--accent-primary);
  margin-bottom: 4px;
}

/* Collapsible sections */
.collapsible {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin: 8px 0;
  overflow: hidden;
}
.collapsible-header {
  padding: 12px 16px;
  background: var(--bg-secondary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-heading);
  user-select: none;
}
.collapsible-header:hover {
  background: var(--bg-card-hover);
}
.collapsible-header .arrow {
  transition: transform 0.3s;
}
.collapsible.open .collapsible-header .arrow {
  transform: rotate(180deg);
}
.collapsible-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.collapsible.open .collapsible-body {
  max-height: 2000px;
}
.collapsible-body-inner {
  padding: 16px;
}

/* Interactive compare: good vs bad */
.compare-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}
.compare-good, .compare-bad {
  border-radius: var(--radius);
  padding: 16px;
  border: 2px solid;
}
.compare-good {
  border-color: var(--accent-success);
  background: rgba(16,185,129,0.05);
}
.compare-bad {
  border-color: var(--accent-danger);
  background: rgba(239,68,68,0.05);
}
.compare-label {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.compare-good .compare-label {
  background: rgba(16,185,129,0.2);
  color: var(--accent-success);
}
.compare-bad .compare-label {
  background: rgba(239,68,68,0.2);
  color: var(--accent-danger);
}

/* Toolbar value display */
.value-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent-primary);
  min-width: 50px;
  text-align: right;
}

/* ---- KEY PAGES (Home, About, Courses, Contact, Blog, Payment) ---- */

/* Pricing Cards */
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  transition: all 0.3s;
  position: relative;
}
.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.pricing-card.featured {
  border-color: var(--accent-primary);
  box-shadow: var(--glow-primary);
}
.pricing-card.featured::before {
  content: 'Most Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.pricing-price {
  font-size: 3rem;
  font-weight: 900;
  color: var(--text-heading);
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1;
  margin: 16px 0 4px;
}
.pricing-price .currency { font-size: 1.5rem; vertical-align: super; }
.pricing-price .period { font-size: 0.9rem; color: var(--text-muted); font-weight: 400; }
.pricing-features {
  list-style: none;
  margin: 24px 0;
  text-align: left;
}
.pricing-features li {
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.pricing-features li::before {
  content: '\2713';
  color: var(--accent-success);
  font-weight: 700;
  flex-shrink: 0;
}
.pricing-features li.disabled {
  opacity: 0.4;
}
.pricing-features li.disabled::before {
  content: '\2717';
  color: var(--text-muted);
}

/* Blog Cards */
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s;
}
.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}
.blog-card-img {
  height: 200px;
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}
.blog-card-img::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, var(--bg-card));
}
.blog-card-body {
  padding: 20px 24px 24px;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.blog-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 8px;
  line-height: 1.4;
}
.blog-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}
.blog-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(59,130,246,0.12);
  color: var(--accent-primary);
  margin-right: 4px;
}

/* Contact Form */
.contact-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.contact-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.contact-form textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 120px;
  transition: border-color 0.2s;
}
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: var(--glow-primary);
}
.contact-form select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
}

/* Team / About */
.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: all 0.3s;
}
.team-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.team-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  margin: 0 auto 16px;
}
.team-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 4px;
}
.team-role {
  font-size: 0.8rem;
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: 12px;
}
.team-bio {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Stat Counter */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}
.stat-card .stat-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}
.stat-card .stat-num {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent-primary);
  font-family: 'Space Grotesk', sans-serif;
}
.stat-card .stat-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 32px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}
.timeline-item {
  position: relative;
  margin-bottom: 32px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--bg-primary);
}
.timeline-date {
  font-size: 0.75rem;
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: 4px;
}
.timeline-content h4 {
  font-size: 1rem;
  color: var(--text-heading);
  margin-bottom: 4px;
}
.timeline-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Course catalog card */
.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s;
}
.course-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
}
.course-card-banner {
  height: 8px;
  background: var(--gradient-primary);
}
.course-card-body {
  padding: 24px;
}
.course-card-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}
.course-duration {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Payment checkout */
.checkout-summary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: sticky;
  top: 84px;
}
.checkout-line {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}
.checkout-line.total {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-heading);
  border-bottom: none;
  padding-top: 16px;
}
.payment-methods {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.payment-method {
  flex: 1;
  padding: 12px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.payment-method:hover, .payment-method.active {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-card-hover);
}

/* Testimonial */
.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
}
.testimonial-card::before {
  content: '\201C';
  font-size: 4rem;
  color: var(--accent-primary);
  opacity: 0.15;
  position: absolute;
  top: 8px;
  left: 16px;
  font-family: Georgia, serif;
  line-height: 1;
}
.testimonial-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 16px;
  padding-top: 16px;
}
.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}
.testimonial-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-heading);
}
.testimonial-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* FAQ */
.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-question {
  padding: 16px 20px;
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-heading);
  transition: background 0.2s;
}
.faq-question:hover { background: var(--bg-card-hover); }
.faq-question .faq-toggle {
  transition: transform 0.3s;
  font-size: 1.2rem;
  color: var(--text-muted);
}
.faq-item.open .faq-question .faq-toggle {
  transform: rotate(45deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq-item.open .faq-answer {
  max-height: 500px;
}
.faq-answer-inner {
  padding: 0 20px 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

@media (max-width: 768px) {
  .contact-form .form-row { grid-template-columns: 1fr; }
  .payment-methods { flex-direction: column; }
}
