/* ============================================================
   Red Nucleus AI Academy
   "Clinical Authority" Design System — Training Edition
   Mirrors red-nucleus-intel.pages.dev visual language.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-primary: #f4f5f7;
  --bg-card: #ffffff;
  --bg-elevated: #f0f1f4;
  --bg-header: #0a1628;
  --bg-deep: #0f1b2d;

  /* Borders */
  --border: #d8dbe2;
  --border-subtle: #e8eaef;
  --border-red: rgba(185, 28, 28, 0.2);

  /* Brand red */
  --red-primary: #c42b2b;
  --red-dark: #9b1c1c;
  --red-light: #e8a0a0;
  --red-glow: rgba(185, 28, 28, 0.1);
  --red-bg: rgba(185, 28, 28, 0.06);

  /* Navy */
  --blue-primary: #0f1b2d;
  --blue-mid: #1a2d4a;
  --blue-light: #2a4066;
  --blue-accent: #3b6cb5;

  /* Text */
  --text-primary: #0f1b2d;
  --text-secondary: #2d3748;
  --text-muted: #5a6577;
  --text-dim: #8892a2;
  --text-dimmer: #b0b7c3;

  /* Status / accent */
  --accent-gold: #b8942e;
  --yellow: #c48a1a;
  --yellow-bg: rgba(196, 138, 26, 0.08);
  --green: #1a8a4a;
  --green-bg: rgba(26, 138, 74, 0.08);

  /* Track color map */
  --track-ld: #c42b2b;
  --track-medcomms: #3b5bb5;
  --track-access: #0d9488;
  --track-scientific: #b8942e;
  --track-commercial: #a23b8a;
  --track-copilot: #0f1b2d;

  /* Fonts */
  --font-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Layout */
  --topnav-height: 64px;
  --max-width: 1180px;
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h1 { font-size: 38px; }
h2 { font-size: 26px; }
h3 {
  font-family: var(--font);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  letter-spacing: -0.005em;
}
h4 {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

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

/* ── Top Navigation ─────────────────────────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--bg-header);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 0 rgba(185, 28, 28, 0.15), 0 2px 10px rgba(0, 0, 0, 0.2);
  height: var(--topnav-height);
}
.topnav-inner {
  max-width: var(--max-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.4), 0 0 14px rgba(185, 28, 28, 0.25);
}
.brand-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.brand-title span {
  color: var(--red-light);
  font-weight: 500;
}
.brand-sub {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.topnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 16px;
}
.topnav-links a {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  border-radius: 2px;
  transition: all 0.15s ease-out;
  position: relative;
  letter-spacing: 0.01em;
}
.topnav-links a:hover {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}
.topnav-links a.active {
  color: #fff;
  background: rgba(185, 28, 28, 0.14);
}
.topnav-links a.active::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 3px;
  height: 1px;
  background: var(--red-primary);
  box-shadow: 0 0 4px rgba(185, 28, 28, 0.5);
}
.topnav-meta { margin-left: auto; }
.progress-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.4px;
}
.progress-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-primary);
  box-shadow: 0 0 4px rgba(185, 28, 28, 0.4);
  animation: pulseDot 3s ease-in-out infinite;
}
.progress-pill b { color: #fff; font-weight: 600; }
@keyframes pulseDot {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

/* ── Container ──────────────────────────────────────────────── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 28px 96px;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, var(--bg-deep) 0%, var(--blue-mid) 100%);
  color: #fff;
  padding: 80px 28px 72px;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--red-primary);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(185, 28, 28, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(59, 108, 181, 0.14) 0%, transparent 55%);
  pointer-events: none;
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}
.hero-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--red-light);
  text-transform: uppercase;
  padding: 5px 12px;
  border: 1px solid rgba(232, 160, 160, 0.25);
  border-radius: 2px;
  background: rgba(185, 28, 28, 0.08);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: 52px;
  color: #fff;
  max-width: 820px;
  line-height: 1.1;
  margin-bottom: 20px;
  font-weight: 500;
}
.hero h1 .accent {
  color: var(--red-light);
  font-style: italic;
  font-weight: 400;
}
.hero-lead {
  font-size: 17px;
  max-width: 720px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.65;
  margin-bottom: 32px;
}
.hero-cta {
  display: flex;
  gap: 12px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  max-width: 720px;
  overflow: hidden;
}
.hero-stats > div {
  padding: 20px 20px 18px;
  background: rgba(15, 27, 45, 0.7);
}
.hero-stats b {
  display: block;
  font-family: var(--font-display);
  font-size: 32px;
  color: #fff;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 4px;
}
.hero-stats span {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.5px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s ease-out;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.35), 0 2px 8px rgba(185, 28, 28, 0.2);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.5), 0 4px 14px rgba(185, 28, 28, 0.3);
  text-decoration: none;
  color: #fff;
}
.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.88);
  border-color: rgba(255, 255, 255, 0.18);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}
.container .btn-ghost,
.lesson-detail .btn-ghost,
.module-section .btn-ghost {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
}
.container .btn-ghost:hover,
.lesson-detail .btn-ghost:hover,
.module-section .btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--red-dark);
}
.btn-complete {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-complete.done {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(26, 138, 74, 0.3);
}

/* ── Section Title ──────────────────────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  padding-top: 12px;
}
.section-title + .section-sub {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 720px;
  margin-bottom: 32px;
}

/* ── Track Grid ─────────────────────────────────────────────── */
.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 64px;
}
.track-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 26px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.2s ease-out;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.track-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--red-primary);
  opacity: 0.5;
  transition: opacity 0.2s;
}
.track-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-red);
  box-shadow: 0 8px 28px rgba(15, 27, 45, 0.08);
  text-decoration: none;
  color: inherit;
}
.track-card:hover::before { opacity: 1; }
.track-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 3px;
  background: var(--red-bg);
  color: var(--red-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-red);
}
.track-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.track-card p {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
  flex: 1;
}
.track-card-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-dim);
  align-items: center;
}
.track-card-meta b {
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.track-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  margin-left: auto;
  font-weight: 500;
}
.track-status.live { background: var(--green-bg); color: var(--green); border: 1px solid rgba(26, 138, 74, 0.3); }
.track-status.preview { background: var(--yellow-bg); color: var(--yellow); border: 1px solid rgba(196, 138, 26, 0.3); }
.track-status.coming { background: var(--bg-elevated); color: var(--text-dim); border: 1px solid var(--border); }

.track-card[data-trackid="ld"]::before { background: var(--track-ld); }
.track-card[data-trackid="medcomms"]::before { background: var(--track-medcomms); }
.track-card[data-trackid="market-access"]::before { background: var(--track-access); }
.track-card[data-trackid="scientific"]::before { background: var(--track-scientific); }
.track-card[data-trackid="commercial"]::before { background: var(--track-commercial); }
.track-card[data-trackid="copilot"]::before { background: var(--track-copilot); }
.track-card[data-trackid="medcomms"] .track-card-icon { background: rgba(59, 91, 181, 0.08); color: var(--track-medcomms); border-color: rgba(59, 91, 181, 0.2); }
.track-card[data-trackid="market-access"] .track-card-icon { background: rgba(13, 148, 136, 0.08); color: var(--track-access); border-color: rgba(13, 148, 136, 0.2); }
.track-card[data-trackid="scientific"] .track-card-icon { background: rgba(184, 148, 46, 0.1); color: var(--track-scientific); border-color: rgba(184, 148, 46, 0.25); }
.track-card[data-trackid="commercial"] .track-card-icon { background: rgba(162, 59, 138, 0.08); color: var(--track-commercial); border-color: rgba(162, 59, 138, 0.2); }
.track-card[data-trackid="copilot"] .track-card-icon { background: var(--blue-primary); color: #fff; border-color: var(--blue-mid); }

/* ── How Grid ───────────────────────────────────────────────── */
.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 36px 0 48px;
}
.how-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 28px 22px 20px;
  position: relative;
}
.how-num {
  position: absolute;
  top: -12px;
  left: 22px;
  width: 28px;
  height: 28px;
  border-radius: 2px;
  background: var(--blue-primary);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blue-mid);
}
.how-card h3 { font-size: 15px; margin: 6px 0 8px; }
.how-card p { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

/* ── Callouts ───────────────────────────────────────────────── */
.callout {
  display: flex;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 3px;
  margin: 28px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left-width: 3px;
}
.callout h3 { font-size: 14px; margin-bottom: 6px; color: var(--text-primary); }
.callout p { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; margin: 0; }
.callout-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-mono);
}
.callout-warn { border-left-color: var(--yellow); background: var(--yellow-bg); }
.callout-warn .callout-icon { background: var(--yellow); color: #fff; }
.callout-info { border-left-color: var(--blue-accent); background: rgba(59, 108, 181, 0.05); }
.callout-info .callout-icon { background: var(--blue-accent); color: #fff; }
.callout-danger { border-left-color: var(--red-primary); background: var(--red-bg); }
.callout-danger .callout-icon { background: var(--red-primary); color: #fff; }

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  padding: 16px 0 32px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 36px;
}
.page-header h1 { font-size: 38px; margin-bottom: 10px; }
.page-lead { font-size: 16px; color: var(--text-muted); max-width: 760px; }
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.breadcrumb a { color: var(--text-dim); transition: color 0.15s; }
.breadcrumb a:hover { color: var(--red-primary); text-decoration: none; }

/* ── Track Detail Hero ──────────────────────────────────────── */
.track-hero {
  background: linear-gradient(165deg, var(--bg-deep) 0%, var(--blue-mid) 100%);
  color: #fff;
  padding: 60px 28px 52px;
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--red-primary);
}
.track-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(185, 28, 28, 0.12) 0%, transparent 55%);
  pointer-events: none;
}
.track-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  position: relative;
}
.track-hero .breadcrumb { color: rgba(255, 255, 255, 0.5); margin-bottom: 16px; }
.track-hero .breadcrumb a { color: rgba(255, 255, 255, 0.5); }
.track-hero .breadcrumb a:hover { color: var(--red-light); }
.track-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--red-light);
  margin-bottom: 18px;
}
.track-hero h1 {
  font-size: 46px;
  color: #fff;
  margin-bottom: 12px;
  font-weight: 500;
}
.track-hero p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.75);
  max-width: 640px;
  line-height: 1.65;
  margin-bottom: 20px;
}
.track-meta-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  padding: 22px 22px 18px;
  height: fit-content;
}
.track-meta-card h4 {
  color: rgba(255, 255, 255, 0.55);
  font-size: 10.5px;
  letter-spacing: 2px;
  margin-bottom: 14px;
}
.track-meta-card ul { list-style: none; }
.track-meta-card li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 13px;
}
.track-meta-card li:last-child { border-bottom: none; }
.track-meta-card li span { color: rgba(255, 255, 255, 0.55); }
.track-meta-card li b {
  color: #fff;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* ── Modules ────────────────────────────────────────────────── */
.module-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 28px 96px;
}
.module {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-bottom: 16px;
  overflow: hidden;
}
.module-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
}
.module-num {
  width: 34px;
  height: 34px;
  border-radius: 3px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.module-head-text { flex: 1; }
.module-head-text h3 { font-size: 16px; margin-bottom: 3px; }
.module-summary { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.module-head-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
}

.lesson-list { list-style: none; }
.lesson-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.15s;
}
.lesson-row:last-child { border-bottom: none; }
.lesson-row:hover { background: var(--bg-elevated); text-decoration: none; }
.lesson-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  position: relative;
}
.lesson-check.done { background: var(--green); border-color: var(--green); }
.lesson-check.done::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.lesson-title { flex: 1; font-size: 14px; font-weight: 500; }
.lesson-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.3px;
}
.lesson-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 2px;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.lesson-tag.prompt { background: var(--red-bg); color: var(--red-dark); border-color: var(--border-red); }
.lesson-tag.lab { background: rgba(59, 108, 181, 0.08); color: var(--blue-accent); border-color: rgba(59, 108, 181, 0.25); }

/* ── Lesson Detail ──────────────────────────────────────────── */
.lesson-detail {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 28px 96px;
}
.lesson-detail h1 {
  font-size: 40px;
  line-height: 1.15;
  margin: 8px 0 16px;
}
.lesson-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.lesson-content {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text-secondary);
}
.lesson-content h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 36px 0 14px;
  color: var(--text-primary);
}
.lesson-content h3 {
  font-size: 16px;
  margin: 26px 0 10px;
  color: var(--text-primary);
}
.lesson-content p { margin-bottom: 14px; }
.lesson-content ul, .lesson-content ol { margin: 0 0 18px 20px; }
.lesson-content li { margin-bottom: 6px; padding-left: 4px; }
.lesson-content b, .lesson-content strong { color: var(--text-primary); font-weight: 600; }
.lesson-content blockquote {
  border-left: 3px solid var(--red-primary);
  margin: 20px 0;
  padding: 6px 20px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
  color: var(--text-primary);
  background: var(--red-bg);
  border-radius: 0 2px 2px 0;
}
.lesson-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 13.5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.lesson-content th {
  background: var(--bg-elevated);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.4px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}
.lesson-content td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}
.lesson-content tr:last-child td { border-bottom: none; }

.prompt-block {
  position: relative;
  background: var(--blue-primary);
  color: rgba(255, 255, 255, 0.92);
  padding: 36px 96px 22px 24px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  margin: 20px 0;
  white-space: pre-wrap;
  overflow-x: auto;
  border: 1px solid var(--blue-mid);
  box-shadow: 0 1px 0 rgba(185, 28, 28, 0.2), 0 3px 12px rgba(15, 27, 45, 0.15);
}
.prompt-block::before {
  content: 'PROMPT';
  position: absolute;
  top: 10px;
  left: 24px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--red-light);
  opacity: 0.55;
}
.copy-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 2px;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  font-weight: 600;
}
.copy-btn:hover {
  background: var(--red-primary);
  color: #fff;
  border-color: var(--red-primary);
}
.copy-btn.copied {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.lesson-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
  gap: 12px;
}
.lesson-actions > div { flex: 1; }
.lesson-actions > div:last-child { text-align: right; }

/* ── Library Toolbar ────────────────────────────────────────── */
.library-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
}
.library-toolbar input {
  flex: 1;
  min-width: 240px;
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 13.5px;
  border: 1px solid var(--border);
  border-radius: 2px;
  outline: none;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.library-toolbar input:focus {
  border-color: var(--red-primary);
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.1);
}
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 7px 13px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 2px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.01em;
}
.chip:hover { border-color: var(--border-red); color: var(--text-primary); }
.chip.active {
  background: var(--red-primary);
  border-color: var(--red-dark);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.3);
}

/* ── Prompt Grid ────────────────────────────────────────────── */
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.prompt-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s;
  position: relative;
}
.prompt-card:hover {
  border-color: var(--border-red);
  box-shadow: 0 4px 16px rgba(15, 27, 45, 0.06);
  transform: translateY(-1px);
}
.prompt-card-head h3 { font-size: 15px; line-height: 1.3; }
.prompt-card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.6px;
  padding: 2.5px 8px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  font-weight: 500;
  text-transform: uppercase;
}
.prompt-card .desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}
.prompt-card .preview {
  background: var(--bg-elevated);
  padding: 10px 12px;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-muted);
  white-space: pre-wrap;
  max-height: 80px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-subtle);
}
.prompt-card .preview::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 24px;
  background: linear-gradient(180deg, transparent, var(--bg-elevated));
}
.prompt-card-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}
.copy-prompt-btn {
  padding: 7px 14px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  background: var(--blue-primary);
  color: #fff;
  border: 1px solid var(--blue-mid);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.3px;
}
.copy-prompt-btn:hover {
  background: var(--red-primary);
  border-color: var(--red-dark);
}
.copy-prompt-btn.copied {
  background: var(--green);
  border-color: var(--green);
}

/* ── Tools Grid ─────────────────────────────────────────────── */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 20px 22px 18px;
  transition: all 0.2s;
}
.tool-card:hover {
  border-color: var(--border-red);
  box-shadow: 0 4px 16px rgba(15, 27, 45, 0.06);
}
.tool-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 12px;
}
.tool-card-head h3 { font-size: 16px; margin-bottom: 2px; }
.tool-vendor {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}
.verdict {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.2px;
  padding: 3px 9px;
  border-radius: 2px;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}
.verdict.adopt { background: var(--green-bg); color: var(--green); border: 1px solid rgba(26, 138, 74, 0.3); }
.verdict.pilot { background: var(--yellow-bg); color: var(--yellow); border: 1px solid rgba(196, 138, 26, 0.3); }
.verdict.watch { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }
.verdict.avoid { background: var(--red-bg); color: var(--red-dark); border: 1px solid var(--border-red); }
.tool-card .desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}
.pharma-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}
.pharma-row b { color: var(--text-primary); font-weight: 600; }

/* ── Pitfalls ───────────────────────────────────────────────── */
.pitfall-list { display: flex; flex-direction: column; gap: 14px; }
.pitfall {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 3px;
  padding: 22px 24px 20px;
}
.pitfall.severity-high { border-left-color: var(--red-primary); }
.pitfall.severity-medium { border-left-color: var(--yellow); }
.pitfall.severity-low { border-left-color: var(--blue-accent); }
.pitfall-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.pitfall-head h3 {
  font-family: var(--font-display);
  font-size: 19px;
  flex: 1;
  letter-spacing: -0.01em;
}
.severity-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.2px;
  padding: 3px 9px;
  border-radius: 2px;
  text-transform: uppercase;
  font-weight: 600;
}
.severity-tag.high { background: var(--red-bg); color: var(--red-dark); border: 1px solid var(--border-red); }
.severity-tag.medium { background: var(--yellow-bg); color: var(--yellow); border: 1px solid rgba(196, 138, 26, 0.3); }
.severity-tag.low { background: rgba(59, 108, 181, 0.06); color: var(--blue-accent); border: 1px solid rgba(59, 108, 181, 0.25); }
.pitfall p { color: var(--text-secondary); font-size: 13.5px; line-height: 1.7; margin-bottom: 16px; }
.do-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dont, .do {
  padding: 12px 14px;
  border-radius: 2px;
  font-size: 13px;
  line-height: 1.55;
}
.dont { background: var(--red-bg); border: 1px solid var(--border-red); color: var(--text-secondary); }
.do { background: var(--green-bg); border: 1px solid rgba(26, 138, 74, 0.25); color: var(--text-secondary); }
.dont b, .do b {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.dont b { color: var(--red-dark); }
.do b { color: var(--green); }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-header);
  color: rgba(255, 255, 255, 0.55);
  padding: 36px 0 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 -1px 0 rgba(185, 28, 28, 0.12);
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
}
.footer-sub { font-size: 12px; color: rgba(255, 255, 255, 0.4); }
.footer-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.3px;
  text-align: right;
}
.footer-meta > div { margin-bottom: 3px; }
.footer-meta a { color: var(--red-light); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { padding: 48px 24px 40px; }
  .hero h1 { font-size: 36px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .track-hero-inner { grid-template-columns: 1fr; }
  .track-meta-card { order: -1; }
  .topnav-inner { gap: 16px; padding: 0 16px; }
  .brand-sub { display: none; }
  .topnav-links { gap: 0; overflow-x: auto; }
  .topnav-links a { padding: 6px 10px; font-size: 12.5px; }
  .progress-pill { display: none; }
  .do-row { grid-template-columns: 1fr; }
  .container { padding: 32px 20px 64px; }
  .module-section { padding: 32px 20px 64px; }
  .lesson-detail { padding: 32px 20px 64px; }
  .lesson-detail h1 { font-size: 30px; }
  .track-hero h1 { font-size: 34px; }
  .page-header h1 { font-size: 30px; }
  .lesson-actions { flex-direction: column; align-items: stretch; }
  .lesson-actions > div:last-child { text-align: left; }
}
