/* ═══════════════════════════════════════════════════════════════
   VELLUM MARKETS — Course pages (extends the v2 design system)
   ═══════════════════════════════════════════════════════════════ */

@import url('/style.css');

/* ── Course hero ─────────────────────────────────────────────── */

.course-hero {
  position: relative;
  z-index: 1;
  min-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 150px 24px 60px;
}
.course-hero-content {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.course-hero .hero-badge { animation: heroRise 1s var(--ease) both; }

.course-hero h1 {
  font-family: var(--font-d);
  font-size: clamp(48px, 9vw, 96px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 18px;
  animation: heroRise 1.1s var(--ease) 0.1s both;
}
.course-hero p {
  font-size: clamp(15px, 1.8vw, 18px);
  color: var(--ink-2);
  line-height: 1.7;
  max-width: 540px;
  margin: 0 auto 32px;
  animation: heroRise 1.1s var(--ease) 0.22s both;
}

.course-switcher {
  display: flex;
  gap: 9px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
  animation: heroRise 1.1s var(--ease) 0.34s both;
}
.cs-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 19px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink-3);
  transition: all 0.25s var(--ease);
}
.cs-btn:hover {
  border-color: var(--line-2);
  background: var(--glass-2);
  color: var(--ink);
  transform: translateY(-2px);
}
.cs-btn.active {
  border-color: transparent;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 22px rgba(217, 70, 239, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.course-hero .btn-primary { animation: heroRise 1.1s var(--ease) 0.46s both; }

.course-stats {
  display: flex;
  justify-content: center;
  gap: clamp(28px, 6vw, 64px);
  margin-top: 44px;
  animation: heroRise 1.1s var(--ease) 0.58s both;
}
.course-stats .stat:not(:last-child)::after {
  content: '';
  position: absolute;
  right: calc(clamp(28px, 6vw, 64px) / -2);
  top: 50%;
  transform: translateY(-50%);
  height: 30px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line-2), transparent);
}

/* ── Module accordion ────────────────────────────────────────── */

.module-list {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.module-card {
  position: relative;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(139, 92, 246, 0.045), rgba(10, 6, 20, 0.45));
  backdrop-filter: blur(8px);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s var(--ease);
}
.module-card:hover {
  border-color: var(--line-2);
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -16px rgba(91, 33, 182, 0.3);
}
.module-card.open {
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 20px 44px -16px rgba(91, 33, 182, 0.4);
  transform: none;
}
.module-card.open::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad);
}

.module-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 26px;
}
.module-num {
  font-family: var(--font-d);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  min-width: 52px;
  background: linear-gradient(135deg, var(--violet), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0.85;
}
.module-info { flex: 1; }
.module-info h3 { font-family: var(--font-d); font-size: 17.5px; font-weight: 700; letter-spacing: -0.01em; }
.module-info p { font-size: 13px; color: var(--ink-3); margin-top: 3px; line-height: 1.5; }
.module-arrow {
  font-size: 18px;
  color: var(--ink-4);
  transition: transform 0.35s var(--ease), color 0.35s;
}
.module-card.open .module-arrow { transform: rotate(90deg); color: var(--purple); }

.module-body { display: none; border-top: 1px solid var(--line); }
.module-body.open { display: block; animation: moduleOpen 0.45s var(--ease) both; }
@keyframes moduleOpen {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

.lesson {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 26px 15px 44px;
  cursor: pointer;
  border-bottom: 1px solid rgba(167, 139, 250, 0.06);
  transition: background 0.2s, padding-left 0.25s var(--ease);
}
.lesson:last-child { border-bottom: none; }
.lesson:hover { background: rgba(139, 92, 246, 0.07); padding-left: 50px; }
.lesson-num {
  font-family: var(--font-m);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--purple);
  min-width: 38px;
  opacity: 0.8;
}
.lesson div { flex: 1; }
.lesson strong { font-size: 14px; font-weight: 600; display: block; color: var(--ink); }
.lesson span:not(.lesson-num):not(.lesson-read) { font-size: 11.5px; color: var(--ink-4); }
.lesson-read {
  font-size: 12px;
  font-weight: 600;
  color: var(--purple);
  opacity: 0;
  transform: translateX(-6px);
  transition: all 0.25s var(--ease);
}
.lesson:hover .lesson-read { opacity: 1; transform: none; }
.lesson.coming-soon { cursor: default; opacity: 0.4; justify-content: center; padding-left: 26px; }
.lesson.coming-soon:hover { background: none; padding-left: 26px; }

/* ── Lesson reader modal ─────────────────────────────────────── */

.lesson-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 2, 8, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}
.lesson-overlay.active { opacity: 1; visibility: visible; }

.lesson-modal {
  position: relative;
  width: 100%;
  max-width: 760px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 52px 48px 44px;
  border-radius: 26px;
  border: 1px solid transparent;
  background:
    linear-gradient(170deg, rgba(22, 14, 38, 0.98), rgba(9, 5, 17, 0.98)) padding-box,
    linear-gradient(165deg, rgba(139, 92, 246, 0.5), rgba(236, 72, 153, 0.25) 60%, rgba(139, 92, 246, 0.1)) border-box;
  box-shadow: var(--shadow-lg);
  transform: translateY(22px) scale(0.97);
  transition: transform 0.4s var(--ease);
}
.lesson-overlay.active .lesson-modal { transform: none; }

.lesson-modal::-webkit-scrollbar { width: 6px; }
.lesson-modal::-webkit-scrollbar-track { background: transparent; }
.lesson-modal::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.3); border-radius: 99px; }

.lesson-close {
  position: sticky;
  top: 0;
  float: right;
  margin: -36px -32px 0 0;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(14, 9, 25, 0.9);
  color: var(--ink-3);
  font-size: 15px;
  transition: all 0.25s;
  z-index: 5;
}
.lesson-close:hover { color: var(--ink); border-color: var(--line-2); transform: rotate(90deg); }

#lesson-content h2 {
  font-family: var(--font-d);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 10px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(100deg, #fff 30%, var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
#lesson-content h3 {
  font-family: var(--font-d);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 30px 0 12px;
  color: var(--ink);
}
#lesson-content h3::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 2px;
  margin-right: 10px;
  vertical-align: middle;
  background: var(--grad);
  border-radius: 2px;
}
#lesson-content p { font-size: 15px; line-height: 1.85; color: var(--ink-2); margin: 16px 0; }
#lesson-content ul, #lesson-content ol { margin: 14px 0 18px 22px; }
#lesson-content li { font-size: 15px; line-height: 1.85; color: var(--ink-2); margin-bottom: 8px; }
#lesson-content li::marker { color: var(--purple); }
#lesson-content strong { color: var(--ink); font-weight: 600; }
#lesson-content table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  font-size: 13.5px;
}
#lesson-content th, #lesson-content td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid var(--line);
  color: var(--ink-2);
}
#lesson-content th { background: rgba(139, 92, 246, 0.1); color: var(--ink); font-weight: 600; }
#lesson-content code {
  font-family: var(--font-m);
  font-size: 0.9em;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(139, 92, 246, 0.12);
  color: var(--purple);
}

.lesson-fig {
  margin: 22px 0 26px;
}
.lesson-fig .fig-svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--r-md);
  box-shadow: 0 14px 34px -16px rgba(91, 33, 182, 0.35);
}
.lesson-fig .fig-svg text { font-family: 'Inter', sans-serif; }
.lesson-fig figcaption {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
  font-style: italic;
}

.chart-img {
  width: 100%;
  max-width: 660px;
  border-radius: var(--r-md);
  margin: 20px 0 8px;
  cursor: pointer;
  border: 1px solid var(--line);
  transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}
.chart-img:hover { border-color: var(--line-2); box-shadow: 0 14px 34px -14px rgba(91, 33, 182, 0.4); }
.chart-img.expanded { max-width: 100%; cursor: zoom-out; }
.chart-caption {
  font-size: 12px;
  color: var(--ink-3);
  text-align: center;
  margin-bottom: 20px;
  font-style: italic;
}

/* ── Course page responsive ──────────────────────────────────── */

@media (max-width: 600px) {
  .course-hero { padding-top: 130px; }
  .module-header { padding: 18px 18px; gap: 14px; }
  .module-num { font-size: 21px; min-width: 40px; }
  .lesson { padding: 13px 18px 13px 28px; }
  .lesson:hover { padding-left: 32px; }
  .lesson-modal { padding: 40px 22px 32px; }
  .lesson-close { margin: -26px -8px 0 0; }
  .course-stats { gap: 26px; }
}
