/* ═══════════════════════════════════════════════════════════════════
   TinyOffice Course Platform — courses.css
   Extracted from demo.html and adapted for server-rendered pages.
   Used by: catalog.html, lesson.html
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ─── Design Tokens ──────────────────────────────────────────────── */
:root {
  --teal: rgba(76, 144, 148, 1);
  --teal-dim: rgba(76, 144, 148, 0.15);
  --teal-border: rgba(76, 144, 148, 0.3);
  --teal-glow: rgba(76, 144, 148, 0.08);
  /* Dark (catalog) */
  --dark-bg: #08080a;
  --dark-card: #101012;
  --dark-elevated: #18181b;
  --dark-border: #27272a;
  --dark-border-hover: #3f3f46;
  --dark-text: #f4f4f5;
  --dark-muted: #71717a;
  --dark-subtle: #52525b;
  /* Light (lesson) */
  --light-bg: #ffffff;
  --light-sidebar: #fafafa;
  --light-border: #e4e4e7;
  --light-text: #18181b;
  --light-muted: #71717a;
  --light-subtle: #a1a1aa;
}

/* ─── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
.dark-scroll::-webkit-scrollbar-thumb { background: #27272a; }
.dark-scroll::-webkit-scrollbar-thumb:hover { background: #3f3f46; }
.light-scroll::-webkit-scrollbar-thumb { background: #e4e4e7; }
.light-scroll::-webkit-scrollbar-thumb:hover { background: #d4d4d8; }

/* ─── Animations ─────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
.anim-fadeup  { animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
.anim-fadein  { animation: fadeIn 0.5s ease both; }
.anim-slidein { animation: slideInLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }
.delay-5 { animation-delay: 0.40s; }

/* ─── Pulse dot ──────────────────────────────────────────────────── */
@keyframes pulse-slow { 0%,100%{opacity:1;} 50%{opacity:0.4;} }
.pulse-slow { animation: pulse-slow 2.5s ease-in-out infinite; }

/* ═══════════════════════════════════════════════════════════════════
   CATALOG PAGE (dark background)
   ═══════════════════════════════════════════════════════════════════ */

.page-catalog {
  background: var(--dark-bg);
  min-height: 100vh;
  color: var(--dark-text);
}

/* Nav */
.catalog-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8,8,10,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--dark-border);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  justify-content: space-between;
}
.catalog-nav-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--dark-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.catalog-nav-crumb span { color: var(--dark-subtle); }
.catalog-nav-back {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.catalog-nav-back:hover { color: var(--dark-muted); }

/* Hero */
.catalog-hero {
  padding: 80px 32px 60px;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}
.catalog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 800px 400px at 60% 0%, rgba(76,144,148,0.04) 0%, transparent 70%);
  pointer-events: none;
}
.catalog-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.catalog-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: var(--teal);
}
.catalog-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--dark-text);
  max-width: 720px;
  margin-bottom: 20px;
  font-weight: 400;
}
.catalog-title em { font-style: italic; color: var(--dark-muted); }
.catalog-desc {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--dark-muted);
  max-width: 560px;
  font-weight: 300;
}

/* Course Card */
.catalog-card-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px 80px;
}
.course-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border);
  border-radius: 2px;
  overflow: hidden;
  transition: border-color 0.25s;
}
.course-card:hover { border-color: var(--teal-border); }
.course-card-header {
  padding: 36px 40px 28px;
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.course-card-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-dim);
  border: 1px solid var(--teal-border);
  padding: 3px 8px;
  border-radius: 2px;
  display: inline-block;
  margin-bottom: 14px;
}
.course-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--dark-text);
  margin-bottom: 8px;
}
.course-card-subtitle {
  font-size: 0.875rem;
  color: var(--dark-muted);
  font-weight: 300;
  line-height: 1.6;
  max-width: 480px;
}
.course-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.meta-stat { text-align: right; }
.meta-stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--dark-text);
  line-height: 1;
}
.meta-stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark-muted);
  margin-top: 3px;
}
.course-card-body {
  padding: 28px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.card-section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dark-subtle);
  margin-bottom: 14px;
}
.module-list { display: flex; flex-direction: column; gap: 6px; }
.module-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 2px;
  transition: background 0.15s;
}
.module-item:hover { background: var(--dark-elevated); }
.module-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--dark-subtle);
  width: 22px;
  flex-shrink: 0;
}
.module-name {
  font-size: 0.8rem;
  color: var(--dark-muted);
  flex: 1;
}
.module-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
}
.badge-free {
  color: var(--teal);
  background: var(--teal-dim);
  border: 1px solid var(--teal-border);
}
.badge-locked {
  color: var(--dark-subtle);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--dark-border);
}
.artifact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.artifact-card {
  background: var(--dark-elevated);
  border: 1px solid var(--dark-border);
  border-radius: 2px;
  padding: 14px;
}
.artifact-icon { color: var(--teal); margin-bottom: 8px; }
.artifact-name {
  font-size: 0.75rem;
  color: var(--dark-text);
  font-weight: 500;
  margin-bottom: 4px;
  line-height: 1.3;
}
.artifact-desc { font-size: 0.7rem; color: var(--dark-muted); line-height: 1.5; }
.course-card-footer {
  padding: 20px 40px;
  border-top: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.course-meta-pills { display: flex; align-items: center; gap: 16px; }
.meta-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--dark-muted);
}
.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--teal);
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 24px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.btn-start:hover { background: rgba(76,144,148,0.85); transform: translateY(-1px); }
.btn-start:active { transform: translateY(0); }
.bg-grid-dark {
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Coming soon card */
.coming-soon-card {
  margin-top: 16px;
  padding: 20px 24px;
  border: 1px dashed var(--dark-border);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.coming-soon-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3f3f46;
  margin-bottom: 6px;
}
.coming-soon-title { font-size: 0.9rem; color: #52525b; }
.coming-soon-eta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: #3f3f46;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════════════
   LESSON PAGE (light background)
   ═══════════════════════════════════════════════════════════════════ */

.page-lesson {
  background: var(--light-bg);
  min-height: 100vh;
  color: var(--light-text);
}

/* Reading progress bar */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--teal);
  z-index: 200;
  transition: width 0.1s linear;
  transform-origin: left;
  width: 0%;
}

/* Top bar */
.lesson-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 52px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--light-border);
  display: flex;
  align-items: center;
}
.topbar-brand {
  width: 260px;
  flex-shrink: 0;
  padding: 0 20px;
  border-right: 1px solid var(--light-border);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-brand-link {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--light-text);
  text-decoration: none;
}
/* Override catalog-nav crumb colors for the light lesson topbar */
.topbar-brand .catalog-nav-back { color: var(--light-text); }
.topbar-brand .catalog-nav-back:hover { color: var(--light-muted); }
.topbar-brand .catalog-nav-crumb { color: var(--light-muted); }
.topbar-brand .catalog-nav-crumb span { color: var(--light-border); }
.topbar-middle {
  flex: 1;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-course-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--light-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.topbar-sep { color: var(--light-subtle); font-size: 12px; }
.topbar-lesson-title {
  font-size: 0.8rem;
  color: var(--light-text);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}
.topbar-right {
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
/* Account / Sign-in button in the topbar */
.topbar-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
/* Authenticated — subtle ghost, low visual weight */
.topbar-account-btn.is-authed {
  color: #71717a;
  background: none;
  padding: 5px 0;
  border: none;
}
.topbar-account-btn.is-authed:hover { color: var(--light-text); }
/* Guest — filled teal button, clearly actionable */
.topbar-account-btn.is-guest {
  color: #fff;
  background: var(--teal);
  padding: 6px 12px;
  border: 1px solid var(--teal);
}
.topbar-account-btn.is-guest:hover {
  background: #3d8f94;
  border-color: #3d8f94;
}
.topbar-progress-wrap { display: flex; align-items: center; gap: 10px; }
.topbar-progress-track {
  width: 100px;
  height: 3px;
  background: var(--light-border);
  border-radius: 99px;
  overflow: hidden;
}
.topbar-progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.topbar-progress-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--light-muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* Three-panel layout */
.lesson-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 52px;
}

/* Left Sidebar */
.lesson-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: fixed;
  top: 52px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  border-right: 1px solid var(--light-border);
  background: var(--light-sidebar);
  padding: 20px 0;
}
.sidebar-section-header {
  padding: 6px 16px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light-text);
}
.sidebar-module { margin-bottom: 2px; }
.sidebar-module-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-module-header:hover { background: rgba(0,0,0,0.03); }
.sidebar-module-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--light-subtle);
  width: 16px;
  flex-shrink: 0;
}
.sidebar-module-name {
  font-size: 0.75rem;
  color: var(--light-muted);
  flex: 1;
  line-height: 1.3;
  font-weight: 500;
}
.sidebar-module-name.active-module { color: var(--light-text); }
.sidebar-chevron {
  color: var(--light-subtle);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.sidebar-chevron.open { transform: rotate(90deg); }
.sidebar-lessons {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}
.sidebar-lessons.open { max-height: 600px; }
.sidebar-lesson-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 42px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  text-decoration: none;
}
.sidebar-lesson-item:hover { background: rgba(0,0,0,0.03); }
.sidebar-lesson-item.active { background: var(--teal-dim); }
.sidebar-lesson-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--teal);
}
.sidebar-lesson-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--light-border);
  flex-shrink: 0;
  transition: background 0.2s;
}
.sidebar-lesson-item.active .sidebar-lesson-dot { background: var(--teal); }
.sidebar-lesson-item.completed .sidebar-lesson-dot { background: #10b981; }
.sidebar-lesson-name {
  font-size: 0.72rem;
  color: var(--light-muted);
  line-height: 1.3;
}
.sidebar-lesson-item.active .sidebar-lesson-name { color: var(--light-text); }
.sidebar-free-badge {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-dim);
  padding: 2px 5px;
  border-radius: 2px;
}
.sidebar-cta {
  margin: 24px 12px 0;
  padding: 14px;
  background: #fafafa;
  border: 1px solid var(--light-border);
  border-radius: 2px;
}
.sidebar-cta-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a1a1aa;
  margin-bottom: 6px;
}
.sidebar-cta-desc { font-size: 0.72rem; color: var(--light-muted); line-height: 1.5; margin-bottom: 10px; }
.sidebar-cta-btn {
  width: 100%;
  background: #18181b;
  color: white;
  border: none;
  border-radius: 2px;
  padding: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-cta-btn:hover { background: #27272a; }

/* Main content column */
.lesson-content-wrap {
  flex: 1;
  margin-left: 260px;
  margin-right: 280px;
  min-height: calc(100vh - 52px);
}
.lesson-content-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 32px 120px;
}

/* Gated-lesson blurred teaser.
   Background: blurred body text, faded to white at the bottom so the
   page doesn't end on a hard edge while the paywall modal sits on top.
   The mask creates the fade; filter: blur creates the unreadable effect.
   pointer-events: none + user-select: none prevent any interaction (and
   prevent the text being copy-pasted via dev tools or accessibility APIs). */
.lesson-gated-preview {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
  position: relative;
  /* Fade-to-transparent from ~45% down — over the white page background
     this reads as a fade-to-white. -webkit-mask-image for Safari. */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 92%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 92%);
  /* Horizontal padding creates breathing room so the blur's outward-spreading
     pixels (~8px past each glyph) don't hit the mask boundary and produce a
     sharp vertical cut. Text wraps narrower than the container, blur fades
     into empty padding instead of a hard clip. */
  padding: 0 28px 140px;
  /* Keep overall footprint identical to before so column alignment is
     unchanged — extend the element slightly wider than its visible column
     via negative horizontal margin. */
  margin-left: -28px;
  margin-right: -28px;
}
.lesson-gated-preview h2,
.lesson-gated-preview h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 500;
  color: #0a0a0a;
  letter-spacing: -0.01em;
  margin: 2em 0 0.6em;
}
.lesson-gated-preview h2 { font-size: 1.6rem; }
.lesson-gated-preview h3 { font-size: 1.2rem; }
.lesson-gated-preview p {
  font-size: 1rem;
  line-height: 1.75;
  color: #3f3f46;
  margin: 0 0 1.1em;
}
.lesson-gated-preview ul {
  margin: 0 0 1.4em;
  padding-left: 1.4em;
}
.lesson-gated-preview li {
  font-size: 1rem;
  line-height: 1.7;
  color: #3f3f46;
  margin-bottom: 0.5em;
}
.lesson-gated-preview blockquote {
  margin: 1.5em 0;
  padding: 0 0 0 1.5em;
  border-left: 2px solid #d4d4d8;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: #18181b;
}

/* Lesson header */
.lesson-module-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lesson-module-label span { color: var(--light-muted); }
.lesson-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--light-text);
  margin-bottom: 16px;
}
.lesson-meta-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--light-border);
}

/* Welcome banner — rendered above lesson content when a lesson is flagged
   as the course's welcome lesson. Uses the teal accent system already
   established in the lesson chrome so it reads as native, not bolted-on. */
.lesson-welcome-banner {
  position: relative;
  margin: 0 0 56px;
  padding: 28px 32px 30px;
  border: 1px solid var(--light-border);
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, rgba(76,144,148,0.07) 0%, rgba(76,144,148,0) 70%),
    #fafafa;
  border-radius: 2px;
  text-align: center;
  overflow: hidden;
}
/* Corner ticks — small editorial register marks at all four corners. */
.lesson-welcome-banner::before,
.lesson-welcome-banner::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--teal);
  border-style: solid;
  opacity: 0.55;
}
.lesson-welcome-banner::before {
  top: 8px; left: 8px;
  border-width: 1px 0 0 1px;
}
.lesson-welcome-banner::after {
  bottom: 8px; right: 8px;
  border-width: 0 1px 1px 0;
}

/* ── Ornamental flourish ─────────────────────────────────────────────────
   A centered editorial mark — two gradient rules flanking a pulsing teal
   diamond between two micro-dots. Reads as the "title page" of the course. */
.lesson-welcome-flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 auto 18px;
  max-width: 360px;
}
.lwf-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(76,144,148,0) 0%,
    rgba(76,144,148,0.45) 50%,
    rgba(76,144,148,0) 100%
  );
}
.lwf-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.lwf-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--teal);
  opacity: 0.55;
}
.lwf-diamond {
  width: 9px;
  height: 9px;
  background: var(--teal);
  transform: rotate(45deg);
  box-shadow: 0 0 0 3px rgba(76,144,148,0.12);
  animation: lwf-pulse 3.6s ease-in-out infinite;
}
@keyframes lwf-pulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(76,144,148,0.12);
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 0 6px rgba(76,144,148,0.04);
    opacity: 0.85;
  }
}
@media (prefers-reduced-motion: reduce) {
  .lwf-diamond { animation: none; }
}

.lesson-welcome-banner-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}
.lesson-welcome-banner-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--light-text);
  margin: 0 auto 12px;
  max-width: 32ch;
}
.lesson-welcome-banner-body {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--light-muted);
  max-width: 56ch;
  margin: 0 auto;
}
.lesson-welcome-banner-body p { margin: 0 0 8px; }
.lesson-welcome-banner-body p:last-child { margin-bottom: 0; }
.lesson-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--light-muted);
  letter-spacing: 0.05em;
}

/* Body typography */
.lesson-body { color: #3f3f46; line-height: 1.72; font-size: 1.0625rem; font-weight: 400; }
.lesson-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  color: var(--light-text);
  margin: 45px 0 20px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 500;
}
.lesson-body h3 {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--light-text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 32px 0 12px;
}
.lesson-body p { margin-bottom: 22px; }
.lesson-body strong { color: var(--light-text); font-weight: 600; }
.lesson-body em { font-style: italic; }

/* Pull quote */
.pull-quote {
  margin: 40px 0;
  padding: 24px 28px;
  border-left: 3px solid var(--teal);
  background: rgba(76,144,148,0.04);
}
.pull-quote p {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--light-text);
  font-style: italic;
  margin: 0;
}

/* ── Lead paragraph (first paragraph of a lesson) ──────────────────────────── */
.lesson-body .lead-paragraph {
  font-family: 'Playfair Display', serif;
  font-size: 1.375rem;
  line-height: 1.5;
  color: var(--light-text);
  font-weight: 400;
  font-style: italic;
  margin-top: 8px;
  margin-bottom: 32px;
  letter-spacing: -0.005em;
}

/* ── Opener wrapper — quiet eyebrow "Start Here" + lead + drop-capped first para ─ */
.lesson-body .lesson-opener {
  margin-bottom: 35px;
}
.lesson-body .lesson-opener > h2:first-child,
.lesson-body .lesson-opener > h3:first-child {
  font-family: 'JetBrains Mono', monospace !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase !important;
  color: var(--teal) !important;
  margin: 0 0 14px !important;
  line-height: 1 !important;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lesson-body .lesson-opener > h2:first-child::after,
.lesson-body .lesson-opener > h3:first-child::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--light-border);
  opacity: 0.6;
}

/* ── Drop cap on the first real paragraph of the lesson ─────────────────────── */
.lesson-body .has-drop-cap {
  /* Contain the float so it can't bleed into a following element */
  display: flow-root;
}
.lesson-body .has-drop-cap::first-letter {
  font-family: 'Playfair Display', serif;
  font-size: 3.6rem;
  line-height: 0.86;
  float: left;
  margin: 4px 6px 0 -2px;
  padding: 0;
  color: var(--light-text);
  font-weight: 500;
  letter-spacing: -0.04em;
}
/* Safety — any paragraph directly after clears any residual float */
.lesson-body .has-drop-cap + p {
  clear: left;
}

/* ── Punch-line paragraph: short rhetorical drops, set apart ────────────────── */
.lesson-body .punch-line {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--light-text);
  font-style: italic;
  margin: 28px 0 32px;
  padding-left: 20px;
  border-left: 2px solid var(--teal);
  font-weight: 400;
}

/* ── Definition-list for "Who Should Stop Here" pattern ─────────────────────── */
.lesson-body .stop-list {
  margin: 28px 0 36px;
}
.lesson-body .stop-list dt {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--light-text);
  margin-top: 24px;
  padding-left: 14px;
  border-left: 2px solid var(--teal);
  line-height: 1.4;
  letter-spacing: -0.005em;
}
.lesson-body .stop-list dt:first-child { margin-top: 0; }
.lesson-body .stop-list dd {
  margin: 8px 0 0 16px;
  color: #3f3f46;
  line-height: 1.72;
}

/* ── Numbered walk-away list — elevated editorial counters ──────────────────── */
/* ── Example list — parallel "before : after" comparisons ──────────────────── */
.lesson-body ul.example-list {
  margin: 24px 0 28px;
  padding-left: 0;
  list-style: none;
  border-left: 1px solid var(--teal-border);
  padding: 4px 0 4px 22px;
}
.lesson-body ul.example-list li {
  position: relative;
  padding-left: 0;
  margin-bottom: 14px;
  line-height: 1.65;
  color: #3f3f46;
}
.lesson-body ul.example-list li:last-child {
  margin-bottom: 0;
}
.lesson-body ul.example-list li::before {
  display: none;
}

.lesson-body ol.walk-away-list {
  margin: 28px 0 32px;
  padding-left: 0;
  list-style: none;
  counter-reset: walk-counter;
}
.lesson-body ol.walk-away-list li {
  position: relative;
  padding-left: 56px;
  margin-bottom: 22px;
  line-height: 1.72;
  counter-increment: walk-counter;
  min-height: 36px;
}
.lesson-body ol.walk-away-list li::before {
  content: counter(walk-counter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--teal);
  padding-right: 12px;
  border-right: 1px solid var(--teal-border);
  line-height: 1.4;
  width: 42px;
  text-align: left;
}

/* ── Key insight (entirely bolded paragraph promoted to a callout) ─────────── */
.key-insight {
  margin: 40px 0;
  padding: 26px 32px;
  background: linear-gradient(180deg, rgba(76,144,148,0.06) 0%, rgba(76,144,148,0.02) 100%);
  border: 1px solid var(--teal-border);
  border-left: 3px solid var(--teal);
  border-radius: 2px;
  position: relative;
}
.key-insight::before {
  content: 'Key Insight';
  position: absolute;
  top: -15px;
  left: -5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  background: #fff;
  padding: 0 10px;
  line-height: 1;
}
.key-insight p {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--light-text);
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.005em;
}

/* ── "What's Next" block (appears at end of each lesson) ───────────────────── */
.lesson-body .whats-next {
  margin: 56px 0 24px;
  padding: 18px 22px 20px;
  background: #fafafa;
  border: 1px solid var(--light-border);
  border-radius: 2px;
  position: relative;
}
.lesson-body .whats-next-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--light-muted);
  margin-bottom: 10px;
}
.lesson-body .whats-next-label-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
}
.lesson-body .whats-next p {
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--light-muted);
  margin: 0 0 10px;
  font-weight: 300;
}
.lesson-body .whats-next p:last-child { margin-bottom: 0; }
.lesson-body .whats-next strong {
  color: var(--light-text);
  font-weight: 500;
}
.lesson-body .whats-next em {
  color: var(--light-muted);
}
.lesson-body .whats-next ul {
  margin: 6px 0 0;
}
.lesson-body .whats-next ul li {
  font-size: 0.82rem;
  color: var(--light-muted);
  line-height: 1.6;
  margin-bottom: 5px;
  padding-left: 18px;
}
.lesson-body .whats-next ul li::before {
  top: 11px;
  width: 4px;
  height: 4px;
}

/* ── Field label — quiet inline subsection marker ────────────────────────
   For label-like paragraphs that introduce a list or an example block
   (e.g. "What goes in it:"). No border, no weight — just a small teal
   mono label signaling a shift in content mode. Lighter than .time-stamp. */
.lesson-body .field-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 22px 0 10px;
  line-height: 1.3;
}

/* ── Time-stamp subsection marker ──────────────────────────────────────────
   For narrative walk-throughs with time-based structure (e.g. "day in the
   life" lessons). A quiet teal mono eyebrow with a hairline above — reads
   as a timeline beat without the weight of a heading. */
.lesson-body .time-stamp {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 36px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--light-border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.lesson-body .time-stamp::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--light-border);
  opacity: 0.35;
}

/* ── Module completion badge (end-of-module marker) ────────────────────────── */
.lesson-body h2.module-complete {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  margin: 24px 0 0;
  padding: 16px 20px;
  background: linear-gradient(180deg, rgba(76,144,148,0.08) 0%, rgba(76,144,148,0.02) 100%);
  border: 1px solid var(--teal-border);
  border-radius: 2px;
  text-align: center;
  line-height: 1.4;
}

/* ── Styled section heading (### Title + *italic subtitle*) ─────────────────── */
.section-heading {
  margin: 48px 0 20px;
  padding-top: 4px;
  border-top: 1px solid var(--light-border);
  padding-top: 24px;
}
.section-heading h3 {
  font-family: 'Playfair Display', serif !important;
  font-size: 1.15rem !important;
  color: var(--light-text) !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  margin: 0 0 4px !important;
  line-height: 1.3 !important;
}
.section-heading-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--teal);
  font-style: italic;
  letter-spacing: 0.01em;
}

/* ── Section divider (between major --- breaks in markdown) ────────────────── */
.section-divider {
  display: block;
  text-align: center;
  margin: 20px auto;
  height: 14px;
  line-height: 14px;
}
.section-divider::before {
  content: '·  ·  ·';
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.6em;
  color: var(--light-subtle);
  opacity: 0.6;
}

/* ── ASCII diagram (code fences) ────────────────────────────────────────────── */
.lesson-body pre.ascii-diagram {
  margin: 32px 0;
  padding: 20px 22px;
  background: #fafafa;
  border: 1px solid var(--light-border);
  border-radius: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--light-text);
  white-space: pre;
  overflow-x: auto;
  text-align: left;
  /* Scrollbar styling when overflow */
  scrollbar-width: thin;
  scrollbar-color: var(--light-border) transparent;
}
.lesson-body pre.ascii-diagram::-webkit-scrollbar { height: 5px; }
.lesson-body pre.ascii-diagram::-webkit-scrollbar-track { background: transparent; }
.lesson-body pre.ascii-diagram::-webkit-scrollbar-thumb { background: var(--light-border); border-radius: 99px; }

/* ── Inline label paragraphs (e.g., "What they own:") ──────────────────────── */
.lesson-body p > strong:first-child {
  color: var(--light-text);
  font-weight: 600;
  letter-spacing: -0.005em;
}

/* ── Lists: richer styling ──────────────────────────────────────────────────── */
.lesson-body ul {
  margin: 20px 0 28px;
  padding-left: 0;
  list-style: none;
}
.lesson-body ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  line-height: 1.7;
}
.lesson-body ul li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 14px;
  width: 5px;
  height: 5px;
  background: var(--teal);
  border-radius: 50%;
  opacity: 0.8;
}
.lesson-body ol {
  margin: 20px 0 28px;
  padding-left: 0;
  list-style: none;
  counter-reset: ol-counter;
}
.lesson-body ol li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 12px;
  line-height: 1.7;
  counter-increment: ol-counter;
}
.lesson-body ol li::before {
  content: counter(ol-counter);
  position: absolute;
  left: 0;
  top: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  color: var(--teal);
  background: var(--teal-dim);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  margin-top: 3px;
}

/* Callout block */
.callout {
  margin: 36px 0;
  padding: 20px 24px;
  background: #f4f4f5;
  border-left: 3px solid var(--teal);
  border-radius: 0 2px 2px 0;
}
.callout-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 8px;
}
.callout p { font-size: 0.875rem; color: var(--light-text); margin: 0; line-height: 1.65; }

/* Comparison table */
.comp-table-wrap {
  margin: 36px 0;
  overflow-x: auto;
  border: 1px solid var(--light-border);
  border-radius: 2px;
}
.comp-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.comp-table thead tr { background: #f4f4f5; border-bottom: 1px solid var(--light-border); }
.comp-table th {
  padding: 10px 14px;
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light-muted);
  font-weight: 400;
}
.comp-table th:first-child { color: var(--light-subtle); }
.comp-table th.highlight-col { color: var(--teal); background: rgba(76,144,148,0.06); }
.comp-table tbody tr { border-bottom: 1px solid var(--light-border); transition: background 0.12s; }
.comp-table tbody tr:last-child { border-bottom: none; }
.comp-table tbody tr:hover { background: rgba(0,0,0,0.02); }
.comp-table td { padding: 10px 14px; color: var(--light-muted); vertical-align: top; line-height: 1.5; }
.comp-table td:first-child { color: var(--light-text); font-weight: 500; font-size: 0.75rem; }
.comp-table td.highlight-col { color: var(--light-text); background: rgba(76,144,148,0.04); font-weight: 500; }

/* Archetype grid */
.archetype-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 32px 0; }
.archetype-card {
  border: 1px solid var(--light-border);
  border-radius: 2px;
  padding: 16px;
  transition: border-color 0.2s, background 0.2s;
}
.archetype-card:hover { border-color: var(--teal-border); background: rgba(76,144,148,0.02); }
.archetype-icon { color: var(--teal); margin-bottom: 10px; }
.archetype-name { font-size: 0.82rem; font-weight: 600; color: var(--light-text); margin-bottom: 4px; }
.archetype-replaces { font-size: 0.7rem; color: var(--light-muted); line-height: 1.5; }

/* Artifact block */
.artifact-block { margin: 36px 0; border: 1px solid var(--light-border); border-radius: 2px; overflow: hidden; }
.artifact-block-header {
  background: #f4f4f5;
  border-bottom: 1px solid var(--light-border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.artifact-block-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
}
.artifact-block-body {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.artifact-block-text { flex: 1; }
.artifact-block-name { font-size: 0.875rem; font-weight: 500; color: var(--light-text); margin-bottom: 4px; }
.artifact-block-desc { font-size: 0.775rem; color: var(--light-muted); line-height: 1.5; }
.btn-artifact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--light-border);
  background: white;
  color: var(--light-text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.btn-artifact:hover { border-color: var(--teal-border); background: var(--teal-dim); }

/* Lesson bottom nav */
.lesson-nav-bar {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--light-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lesson-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--light-border);
  background: white;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-decoration: none;
}
.lesson-nav-btn:hover { border-color: #a1a1aa; background: #fafafa; }
.lesson-nav-btn.primary { background: var(--light-text); border-color: var(--light-text); color: white; }
.lesson-nav-btn.primary:hover { background: #27272a; border-color: #27272a; }
.nav-btn-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light-subtle);
  margin-bottom: 2px;
}
.lesson-nav-btn.primary .nav-btn-label { color: rgba(255,255,255,0.6); }
.nav-btn-title { font-size: 0.78rem; color: var(--light-text); }
.lesson-nav-btn.primary .nav-btn-title { color: white; }

/* Right progress panel */
.lesson-progress-panel {
  width: 280px;
  flex-shrink: 0;
  position: fixed;
  top: 52px;
  right: 0;
  bottom: 0;
  overflow-y: auto;
  border-left: 1px solid var(--light-border);
  background: var(--light-sidebar);
  padding: 24px 20px;
}
.progress-panel-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light-text);
  margin-bottom: 16px;
}
.overall-progress-bar-wrap { margin-bottom: 24px; }
.overall-progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.overall-progress-label { font-size: 0.75rem; color: var(--light-text); font-weight: 500; }
.overall-progress-pct { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--teal); }
.overall-progress-track { height: 4px; background: var(--light-border); border-radius: 99px; overflow: hidden; }
.overall-progress-fill { height: 100%; background: var(--teal); border-radius: 99px; transition: width 0.4s ease; }
.progress-module-list { display: flex; flex-direction: column; gap: 4px; }
.progress-module-item { padding: 8px 10px; border-radius: 2px; }
.progress-module-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.progress-module-check {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--light-border);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 7px; color: transparent;
}
.progress-module-check.done { background: #10b981; border-color: #10b981; color: white; }
.progress-module-check.active { border-color: var(--teal); }
.progress-module-name { font-size: 0.72rem; color: var(--light-muted); flex: 1; line-height: 1.3; }
.progress-module-name.current { color: var(--light-text); font-weight: 500; }
.progress-lesson-dots { display: flex; gap: 4px; padding-left: 22px; }
.progress-lesson-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--light-border); }
.progress-lesson-dot.done { background: #10b981; }
.progress-lesson-dot.active { background: var(--teal); }

/* Up next card */
.up-next-card {
  margin-top: 24px;
  padding: 14px;
  background: white;
  border: 1px solid var(--light-border);
  border-radius: 2px;
}
.up-next-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light-subtle);
  margin-bottom: 8px;
}
.up-next-title { font-size: 0.78rem; color: var(--light-text); font-weight: 500; line-height: 1.4; margin-bottom: 8px; }
.btn-next-lesson {
  display: flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--teal); background: none; border: none;
  padding: 0; cursor: pointer; text-decoration: none;
  transition: gap 0.15s;
}
.btn-next-lesson:hover { gap: 10px; }

/* Gate modal */
.gate-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gate-modal-backdrop.hidden { display: none; }

/* Paywall override — the paid gate deliberately has NO backdrop. The intent
   is for the buyer to see the blurred lesson preview fading behind/around
   the card: stronger "you're missing real content" signal, better conversion.
   We set pointer-events: none on the fixed backdrop so clicks/scrolls pass
   through to the page, then re-enable events on the card itself. */
#paywall-modal.gate-modal-backdrop {
  background: transparent;
  backdrop-filter: none;
  pointer-events: none;
}

/* ── Dark paywall theme ──────────────────────────────────────────────────────
   Swaps the shared (light) gate-card chrome for a dark variant. Card-level
   only: the freemium email gate still uses the light theme.

   Layer stack, back → front:
     1. .gate-card-inner       — solid #0a0a0a base + border + outer shadow
     2. .gate-card-inner::before — blurred horizon image + dark fade gradient
                                   (positioned absolute, inset past the card
                                    edges so the blur doesn't leave a halo
                                    where it's clipped)
     3. direct children        — title, price, form, button — explicitly
                                  promoted to z-index:1 so they sit above
                                  the blurred pseudo-element.
*/
#paywall-modal .gate-card-inner {
  position: relative;
  /* overflow:hidden clips the oversized ::before to the card's rounded
     corners so the blurred image stays inside the card. */
  overflow: hidden;
  pointer-events: auto;
  background-color: #0a0a0a;
  background-image: none;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.55),
    0 4px 16px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#paywall-modal .gate-card-inner::before {
  content: '';
  position: absolute;
  /* Oversize by 16px on all sides. The blur radius bleeds pixels outward;
     if the pseudo were exactly card-sized, the clipped edge would show a
     dim halo. Inset -16px pushes the clip line into fully-blurred content. */
  inset: -16px;
  background-image:
    linear-gradient(
      to bottom,
      rgba(10, 10, 10, 0)   0%,
      rgba(10, 10, 10, 0.35) 35%,
      rgba(10, 10, 10, 0.85) 60%,
      #0a0a0a 80%
    ),
    url('/public/images/paywall-horizon.jpg');
  background-repeat: no-repeat, no-repeat;
  background-size: 100% 100%, 100% auto;
  background-position: top center, top center;
  filter: blur(10px);
  z-index: 0;
  pointer-events: none;
}

/* Promote card content above the blurred pseudo. Applies to every direct
   child of the card (title, description, price block, both forms, Cancel
   button) without needing to touch markup. */
#paywall-modal .gate-card-inner > * {
  position: relative;
  z-index: 1;
}
#paywall-modal .gate-icon      { color: #679e9e; }
#paywall-modal .gate-title     { color: #f4f4f5; }
#paywall-modal .gate-desc      { color: #a1a1aa; }

/* Email input */
#paywall-modal .gate-input {
  background: #18181b;
  /* Lighter gray border so the field reads as clearly interactive against
     the near-black card. ~zinc-600 equivalent at full opacity. */
  border-color: rgba(255, 255, 255, 0.22);
  color: #f4f4f5;
  transition: border-color .15s, background .15s;
}
#paywall-modal .gate-input::placeholder { color: #71717a; }
#paywall-modal .gate-input:focus {
  border-color: rgba(103, 158, 158, 0.55);
  background: #1c1c1f;
  outline: none;
}

/* Primary CTA — inverted: light pill on dark card draws the eye. */
#paywall-modal .btn-gate {
  background: #f4f4f5;
  color: #0a0a0a;
  border: none;
  transition: background .15s;
}
#paywall-modal .btn-gate:hover:not([disabled]) { background: #ffffff; }
#paywall-modal .btn-gate[disabled] { opacity: .5; cursor: default; }

/* Error text stays red, just slightly desaturated for the dark bg */
#paywall-modal .gate-error.visible { color: #fca5a5; }

/* Cancel / change link */
#paywall-modal .gate-close-btn {
  color: #71717a;
  background: transparent;
  border: none;
}
#paywall-modal .gate-close-btn:hover { color: #f4f4f5; }
.gate-card-inner {
  background: white;
  border: 1px solid var(--light-border);
  border-radius: 2px;
  padding: 32px 36px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.15);
}
.gate-icon { color: var(--teal); margin-bottom: 14px; }
.gate-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--light-text);
  margin-bottom: 8px;
}
.gate-desc { font-size: 0.8rem; color: var(--light-muted); line-height: 1.6; margin-bottom: 20px; }
.gate-form { display: flex; flex-direction: column; gap: 10px; }
.gate-input {
  border: 1px solid var(--light-border);
  border-radius: 2px;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  color: var(--light-text);
  outline: none;
  transition: border-color 0.15s;
}
.gate-input:focus { border-color: var(--teal); }
.btn-gate {
  background: var(--light-text);
  color: white;
  border: none;
  border-radius: 2px;
  padding: 11px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-gate:hover { background: #27272a; }
.gate-error {
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: -4px;
  display: none;
}
.gate-error.visible { display: block; }
.gate-close-btn {
  margin-top: 14px;
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--light-subtle);
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  display: block;
  width: 100%;
}

/* Equation block */
.equation-block {
  margin: 32px 0;
  padding: 20px 24px;
  background: #f9f9f9;
  border: 1px solid var(--light-border);
  border-radius: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--light-text);
  text-align: center;
}
.equation-block span { color: var(--teal); }

/* Sidebar mobile toggle */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--light-border);
  border-radius: 2px;
  cursor: pointer;
  color: var(--light-text);
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .lesson-progress-panel { display: none; }
  .lesson-content-wrap { margin-right: 0; }
}
@media (max-width: 768px) {
  .lesson-sidebar { display: none; }
  .lesson-sidebar.mobile-open { display: block; z-index: 150; }
  .lesson-content-wrap { margin-left: 0; }
  .lesson-content-inner { padding: 32px 20px 80px; }
  .course-card-body { grid-template-columns: 1fr; }
  .archetype-grid { grid-template-columns: 1fr; }
  .artifact-grid { grid-template-columns: 1fr 1fr; }
  .topbar-brand { width: auto; justify-content: space-between; }
  .topbar-lesson-title { display: none; }
  .sidebar-toggle { display: flex; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Lesson topbar — DARK THEME
   ═══════════════════════════════════════════════════════════════════════════
   Scoped override for the lesson-page header only. The lesson body below it
   stays on the light theme. To revert: delete this block.

   Color palette (zinc):
     bg          #0a0a0a  (matches page-lesson backdrop when sidebars retract)
     border      rgba(255,255,255,0.08)
     text        #f4f4f5  (zinc-100)
     muted       #a1a1aa  (zinc-400)
     subtle      #52525b  (zinc-600)
     accent      #679e9e  (brand teal — progress bar + hover)
*/
.lesson-topbar {
  background: rgba(10, 10, 10, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.lesson-topbar .topbar-brand {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.lesson-topbar .topbar-brand-link       { color: #f4f4f5; }
.lesson-topbar .topbar-brand .catalog-nav-back       { color: #f4f4f5; }
.lesson-topbar .topbar-brand .catalog-nav-back:hover { color: #a1a1aa; }
.lesson-topbar .topbar-brand .catalog-nav-crumb      { color: #a1a1aa; }
.lesson-topbar .topbar-brand .catalog-nav-crumb span { color: #3f3f46; }

.lesson-topbar .topbar-course-title { color: #a1a1aa; }
.lesson-topbar .topbar-sep          { color: #3f3f46; }
.lesson-topbar .topbar-lesson-title { color: #f4f4f5; }

.lesson-topbar .topbar-progress-track {
  background: rgba(255, 255, 255, 0.08);
}
/* Progress fill stays teal — defined globally, still reads on dark bg. */
.lesson-topbar .topbar-progress-label { color: #a1a1aa; }

/* The two top-right icon links (catalog + account) use inline color:#71717a.
   That reads OK on dark, but the hover wants to go lighter, not darker. */
.lesson-topbar .topbar-right a:hover { color: #f4f4f5 !important; }

/* Mobile sidebar toggle — match the dark border + light glyph. */
.lesson-topbar .sidebar-toggle {
  border-color: rgba(255, 255, 255, 0.10);
  color: #a1a1aa;
}
.lesson-topbar .sidebar-toggle:hover { color: #f4f4f5; }

/* ═══════════════════════════════════════════════════════════════════════════
   Welcome Confirmation Dialog — shown once after first-ever enrollment
   ═══════════════════════════════════════════════════════════════════════════
   Inherits the light .gate-card-inner shell but adds a branded teal accent
   row for the check icon and a bulleted confirmation list.
*/

/* The welcome card sits at a slightly higher z-index so it layers above the
   email gate modal (z:1000) which is dimming in the background. */
#welcome-modal.gate-modal-backdrop {
  z-index: 1010;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
}

.welcome-card {
  max-width: 420px;
  text-align: left;
}

.welcome-check-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.welcome-list {
  list-style: none;
  margin: 16px 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.welcome-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.83rem;
  color: var(--light-text);
  line-height: 1.5;
}

.welcome-list-icon {
  color: #679e9e;
  flex-shrink: 0;
  margin-top: 2px;
}

.welcome-list strong {
  color: var(--light-text);
  font-weight: 600;
}

/* "Start Reading" button — full width with teal accent on hover */
#welcome-modal .btn-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
