:root {
  --bg: #faf8ff;
  --surface: #ffffff;
  --surface-soft: #f3f0ff;

  --text: #1e1b2e;
  --muted: #6b6280;

  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --primary-soft: #ede9fe;
  --primary-glow: rgba(124, 58, 237, 0.32);

  --accent: #a78bfa;
  --accent-bright: #c4b5fd;
  --accent-soft: #f3e8ff;

  --success: #059669;
  --border: #ddd6fe;

  --hero-bg: #f8f6ff;
  --hero-surface: rgba(255, 255, 255, 0.78);
  --hero-border: rgba(124, 58, 237, 0.12);
  --hero-text: #1e1b2e;
  --hero-muted: #6b6280;

  --code-bg: #1e1b2e;
  --code-text: #ede9fe;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 4px 24px rgba(91, 33, 182, 0.07);
  --shadow-lg: 0 16px 44px rgba(91, 33, 182, 0.12);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

.text-gradient {
  background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-narrow {
  max-width: 720px;
}

main {
  flex: 1;
}

/* Nav */
.site-nav {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo:hover {
  color: var(--primary);
}

.logo-img {
  display: block;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(124, 58, 237, 0.28));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.logo:hover .logo-img {
  transform: scale(1.04);
  filter: drop-shadow(0 4px 12px rgba(124, 58, 237, 0.38));
}

.logo-text em {
  font-style: normal;
  color: var(--primary);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
}

.nav-menu {
  position: relative;
}

.nav-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  list-style: none;
  transition: background 0.15s, border-color 0.15s;
}

.nav-menu-toggle:hover {
  background: var(--surface-soft);
  border-color: var(--accent);
}

.nav-menu-toggle::-webkit-details-marker {
  display: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.925rem;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--surface-soft);
}

@media (max-width: 767px) {
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    min-width: 12rem;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
  }

  .nav-menu[open] .nav-links {
    display: flex;
  }

  .nav-links a,
  .nav-links .btn {
    display: block;
    width: 100%;
    text-align: left;
  }

  .nav-links .btn {
    justify-content: flex-start;
  }

  .nav-links form {
    display: block;
    width: 100%;
  }
}

@media (min-width: 768px) {
  .nav-menu-toggle {
    display: none;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--font);
  font-size: 0.925rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 55%, #7c3aed 100%);
  color: white;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 55%, #6d28d9 100%);
  color: white;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.btn-glow {
  position: relative;
}

.btn-glow::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  z-index: -1;
  opacity: 0;
  filter: blur(12px);
  transition: opacity 0.25s ease;
}

.btn-glow:hover::after {
  opacity: 0.45;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: #3b0764;
  box-shadow: 0 4px 16px rgba(167, 139, 250, 0.35);
}

.btn-accent:hover {
  background: linear-gradient(135deg, #ddd6fe, #a78bfa);
  color: #3b0764;
}

.btn-outline-light {
  background: var(--hero-surface);
  color: var(--hero-text);
  border: 1.5px solid var(--hero-border);
  backdrop-filter: blur(8px);
}

.btn-outline-light:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.btn-sm {
  padding: 0.4rem 0.875rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-soft {
  background: var(--surface-soft);
  border: none;
}

/* Hero */
.hero {
  padding: 5rem 0 4.5rem;
  position: relative;
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-text);
}

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
}

.hero-orb-1 {
  width: 520px;
  height: 520px;
  top: -25%;
  right: -8%;
  background: radial-gradient(circle, #ddd6fe 0%, transparent 70%);
}

.hero-orb-2 {
  width: 420px;
  height: 420px;
  bottom: -20%;
  left: -5%;
  background: radial-gradient(circle, #ede9fe 0%, transparent 70%);
  opacity: 0.8;
}

.hero-orb-3 {
  width: 300px;
  height: 300px;
  top: 40%;
  left: 35%;
  background: radial-gradient(circle, #c4b5fd 0%, transparent 70%);
  opacity: 0.35;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(124, 58, 237, 0.06) 1px, transparent 0);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 35%, black 15%, transparent 80%);
  opacity: 0.6;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--hero-surface);
  color: var(--hero-muted);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  border: 1px solid var(--hero-border);
  backdrop-filter: blur(8px);
  letter-spacing: 0.01em;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.45);
  animation: pulse-dot 2s ease-in-out infinite;
}

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

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  max-width: 16ch;
  margin-bottom: 1.25rem;
  font-weight: 700;
  line-height: 1.08;
  color: var(--hero-text);
}

.hero-lead {
  font-family: var(--font);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--hero-muted);
  max-width: 52ch;
  margin-bottom: 2.25rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  margin-bottom: 3rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hero-border);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.hero-stat-value {
  font-family: var(--font);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -0.02em;
}

.hero-stat-label {
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--hero-muted);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.section-subtitle {
  color: var(--muted);
  margin-bottom: 2rem;
  max-width: 50ch;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent-bright));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: #c4b5fd;
}

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

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.15rem;
}

.feature-icon-purple {
  background: linear-gradient(135deg, var(--primary-soft), #f3e8ff);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.12);
}

.feature-icon-coral {
  background: linear-gradient(135deg, var(--accent-soft), #ede9fe);
  box-shadow: 0 4px 14px rgba(167, 139, 250, 0.12);
}

/* Selwyn banner */
.selwyn-banner {
  background: linear-gradient(135deg, #f3f0ff 0%, #ede9fe 45%, #e9e5ff 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  color: var(--text);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.selwyn-banner::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -5%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.selwyn-banner h3 {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.selwyn-banner p {
  color: var(--muted);
  margin: 0;
  max-width: 55ch;
  position: relative;
}

@media (max-width: 640px) {
  .selwyn-banner {
    grid-template-columns: 1fr;
  }
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font);
  font-size: 1rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-error {
  background: #fef2f2;
  color: #b91c1c;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid #fecaca;
}

.auth-card {
  max-width: 420px;
  margin: 3rem auto;
}

.auth-card h1 {
  font-size: 1.75rem;
  text-align: center;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* Dashboard */
.dashboard-header {
  padding: 2.5rem 0 1.5rem;
}

.dashboard-header h1 {
  font-size: 1.75rem;
}

.dashboard-greeting {
  color: var(--muted);
}

.course-progress-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.progress-bar {
  width: 100%;
  max-width: 320px;
  height: 8px;
  background: var(--surface-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.85rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-label {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.course-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success {
  background: #dcfce7;
  color: var(--success);
}

.badge-muted {
  background: var(--surface-soft);
  color: var(--muted);
}

.badge-preview {
  background: var(--accent-soft);
  color: #c2410c;
}

/* Course landing */
.course-hero {
  padding: 3rem 0 2rem;
}

.course-hero-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 800px) {
  .course-hero-grid {
    grid-template-columns: 1fr;
  }
}

.purchase-card {
  position: sticky;
  top: 5rem;
}

.price {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--text);
}

.price-note {
  font-size: 0.85rem;
  color: var(--muted);
}

.module-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.module-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
  background: var(--surface);
}

.module-header {
  padding: 1rem 1.25rem;
  background: var(--surface-soft);
  font-weight: 600;
}

.module-header small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.chapter-item + .chapter-item {
  border-top: 1px solid var(--border);
}

.chapter-header {
  padding: 0.75rem 1.25rem 0.5rem;
  font-weight: 600;
  font-size: 0.925rem;
}

.chapter-header small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.lesson-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lesson-list li {
  border-top: 1px solid var(--border);
}

.lesson-list a,
.lesson-list .lesson-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  color: var(--text);
  font-size: 0.925rem;
}

.lesson-list a:hover {
  background: var(--surface-soft);
  color: var(--primary);
}

.lesson-duration {
  color: var(--muted);
  font-size: 0.8rem;
}

/* Lesson viewer */
.lesson-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: calc(100vh - 60px);
}

@media (max-width: 900px) {
  .lesson-layout {
    grid-template-columns: 1fr;
  }

  .lesson-sidebar {
    display: none;
  }
}

.lesson-sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  overflow-y: auto;
}

.sidebar-title {
  padding: 0 1.25rem 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}

.sidebar-module {
  margin-bottom: 0.5rem;
}

.sidebar-module-name {
  padding: 0.5rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.sidebar-chapter {
  margin-bottom: 0.25rem;
}

.sidebar-chapter-name {
  padding: 0.35rem 1.25rem 0.15rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.sidebar-lesson {
  display: block;
  padding: 0.45rem 1.25rem 0.45rem 2rem;
  font-size: 0.875rem;
  color: var(--text);
  border-left: 3px solid transparent;
}

.sidebar-lesson:hover {
  background: var(--surface-soft);
  color: var(--primary);
}

.sidebar-lesson.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-left-color: var(--primary);
  font-weight: 600;
}

.sidebar-lesson.completed {
  color: var(--success);
}

.sidebar-lesson.locked {
  color: var(--muted);
  cursor: default;
}

.lesson-check {
  display: inline-block;
  width: 1rem;
  margin-right: 0.25rem;
  color: var(--success);
  font-weight: 700;
}

.lesson-main {
  padding: 2rem 2.5rem 4rem;
  max-width: 780px;
}

.lesson-main h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.lesson-meta {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.lesson-content {
  line-height: 1.75;
}

.lesson-content h3 {
  font-size: 1.15rem;
  margin-top: 1.75rem;
}

.lesson-content ul,
.lesson-content ol {
  padding-left: 1.25rem;
}

.lesson-content pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1rem 1.25rem;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}

.lesson-content code {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.9em;
}

.lesson-content p code {
  background: var(--surface-soft);
  color: var(--primary-dark);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.lesson-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin-bottom: 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow);
}

.lesson-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.code-block {
  position: relative;
  margin: 1.5rem 0;
}

.code-block pre {
  margin: 0;
  padding-top: 2.75rem;
}

.copy-code-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: var(--code-text);
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.copy-code-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.copy-code-btn.copied {
  background: rgba(22, 163, 74, 0.25);
  color: #86efac;
}

.lesson-resources {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--surface-soft);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.lesson-resources h2 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.resource-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.resource-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.resource-link:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  color: var(--primary-dark);
}

.resource-icon {
  font-size: 1.1rem;
}

.resource-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.resource-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.resource-size {
  font-size: 0.8rem;
  color: var(--muted);
}

.lesson-complete-btn {
  margin-top: 2rem;
}

.lesson-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-copy {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Utilities */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-sm { gap: 0.5rem; }

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
}

.empty-state h3 {
  color: var(--text);
}

/* HTMX loading indicator */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-request.htmx-indicator {
  display: inline-block;
}

.purchase-success {
  text-align: center;
  padding: 1rem 0;
}

.purchase-success .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Lesson discussion */
.lesson-comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.comments-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.comments-header h2 {
  font-size: 1.35rem;
  margin: 0;
}

.comments-count {
  font-size: 0.85rem;
  color: var(--muted);
}

.comments-login-prompt,
.comments-empty {
  color: var(--muted);
  font-size: 0.925rem;
  margin: 0 0 1.5rem;
}

.comment-form {
  margin-bottom: 2rem;
}

.comment-textarea {
  resize: vertical;
  min-height: 4.5rem;
  font-family: var(--font);
  line-height: 1.5;
}

.comment-form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.comment-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
}

.comment-author {
  font-weight: 600;
  font-size: 0.9rem;
}

.comment-time {
  font-size: 0.8rem;
  color: var(--muted);
}

.comment-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  word-break: break-word;
}

.comment-body.markdown > :first-child {
  margin-top: 0;
}

.comment-body.markdown > :last-child {
  margin-bottom: 0;
}

.comment-body.markdown p {
  margin: 0 0 0.75rem;
}

.comment-body.markdown h1,
.comment-body.markdown h2,
.comment-body.markdown h3,
.comment-body.markdown h4 {
  margin: 0.75rem 0 0.35rem;
  font-size: 1rem;
  line-height: 1.35;
}

.comment-body.markdown ul,
.comment-body.markdown ol {
  margin: 0 0 0.75rem;
  padding-left: 1.25rem;
}

.comment-body.markdown li + li {
  margin-top: 0.25rem;
}

.comment-body.markdown blockquote {
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.75rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
}

.comment-body.markdown code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85em;
  background: var(--surface-soft);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.comment-body.markdown pre {
  margin: 0 0 0.75rem;
  padding: 0.75rem;
  overflow-x: auto;
  background: var(--surface-soft);
  border-radius: var(--radius);
}

.comment-body.markdown pre code {
  padding: 0;
  background: none;
}

.comment-body.markdown a {
  color: var(--primary);
  text-decoration: underline;
}

.comment-editor-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.comment-editor .EasyMDEContainer {
  margin-top: 0.35rem;
}

.comment-editor .EasyMDEContainer .CodeMirror {
  border: 1px solid var(--border);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
}

.comment-editor .editor-toolbar {
  border: 1px solid var(--border);
  border-bottom: none;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
  background: var(--surface-soft);
}

.comment-editor .editor-toolbar button {
  color: var(--text);
}

.comment-editor .editor-toolbar button:hover,
.comment-editor .editor-toolbar button.active {
  background: var(--primary-soft);
  border-color: transparent;
}

.comment-editor .editor-preview,
.comment-editor .editor-preview-side {
  background: var(--surface);
}

.reply-toggle {
  margin-top: 0.75rem;
}

.reply-toggle-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  list-style: none;
}

.reply-toggle-label::-webkit-details-marker {
  display: none;
}

.reply-toggle[open] .reply-toggle-label {
  margin-bottom: 0.65rem;
}

.comment-form-reply {
  margin-bottom: 0;
}

.comment-replies {
  margin-top: 1rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-reply {
  background: var(--surface-soft);
  border-color: transparent;
  padding: 0.85rem 1rem;
}

.comment-reply .comment-avatar {
  width: 1.65rem;
  height: 1.65rem;
  font-size: 0.65rem;
}

.comment-staff {
  border-color: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

.comment-pinned {
  border-color: #d4a574;
  background: linear-gradient(to right, rgba(212, 165, 116, 0.08), transparent 40%);
}

.comment-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}

.comment-badge-instructor {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.comment-badge-moderator {
  background: #e8f4ea;
  color: #2d6a3f;
}

.comment-badge-pinned {
  background: #fdf3e7;
  color: #9a6b2f;
}

.comment-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 0.75rem;
}

.comment-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.comment-reactions-readonly {
  gap: 0.65rem;
}

.reaction-form {
  display: inline;
  margin: 0;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.reaction-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.reaction-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.reaction-count {
  font-size: 0.75rem;
  font-weight: 600;
}

.reaction-stat {
  font-size: 0.8rem;
  color: var(--muted);
}

.comment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.comment-action-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.comment-action-link:hover {
  text-decoration: underline;
}

.comment-action-danger {
  color: #b33;
}

.delete-form,
.pin-form {
  display: inline;
  margin: 0;
}

.edit-toggle {
  display: inline;
}

.edit-toggle summary {
  list-style: none;
}

.edit-toggle summary::-webkit-details-marker {
  display: none;
}

.comment-form-edit {
  width: 100%;
  margin-top: 0.65rem;
  margin-bottom: 0;
}

.admin-preview-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.25rem;
  background: #fef3c7;
  border-bottom: 1px solid #fcd34d;
  color: #92400e;
  font-size: 0.925rem;
}

.admin-preview-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preference-group {
  border: none;
  margin: 0;
  padding: 0;
}

.preference-legend {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding: 0;
}

.preference-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  cursor: pointer;
}

.preference-item input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.preference-hint {
  display: block;
  font-size: 0.875rem;
  margin-top: 0.2rem;
}

.badge-quiz {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.lesson-quiz-marker {
  display: inline-block;
  width: 1rem;
  margin-right: 0.25rem;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
}

.lesson-quiz {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.quiz-header h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.quiz-meta,
.quiz-last-attempt,
.quiz-login-prompt,
.quiz-empty {
  color: var(--muted);
  font-size: 0.95rem;
}

.quiz-last-attempt {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface-soft);
  border-radius: var(--radius);
}

.quiz-question-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.quiz-question-prompt {
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.quiz-question-number {
  color: var(--primary);
  margin-right: 0.35rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quiz-options-inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface-soft);
}

.quiz-option:hover {
  border-color: var(--primary);
}

.quiz-option input {
  margin-top: 0.15rem;
}

.quiz-text-input {
  max-width: 420px;
}

.quiz-submit-row {
  margin-top: 1.5rem;
}

.quiz-results {
  margin-top: 1rem;
}

.quiz-score-card {
  text-align: center;
  padding: 1.5rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.quiz-results-passed .quiz-score-card {
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
}

.quiz-results-failed .quiz-score-card {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.quiz-score-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.quiz-score-value {
  margin: 0.25rem 0;
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.quiz-score-detail {
  margin: 0;
  color: var(--muted);
}

.quiz-pass-message {
  margin: 0.75rem 0 0;
  color: var(--success);
  font-weight: 600;
}

.quiz-fail-message {
  margin: 0.75rem 0 0;
  color: #b91c1c;
}

.quiz-review h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.quiz-review-item {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
}

.quiz-review-correct {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.quiz-review-incorrect {
  background: #fff7ed;
  border-color: #fed7aa;
}

.quiz-review-prompt {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.quiz-review-status {
  margin-right: 0.35rem;
}

.quiz-review-answer,
.quiz-review-correct-answer,
.quiz-ai-feedback {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
}

.quiz-ai-feedback {
  padding: 0.75rem 1rem;
  background: var(--primary-soft);
  border-radius: var(--radius);
  color: var(--primary-dark);
}

.quiz-ai-label {
  font-weight: 600;
  margin-right: 0.35rem;
}

.quiz-retry-btn {
  margin-top: 1rem;
}
