/* ==========================================================================
   SOLARIZED LIGHT THEME & MINIMALIST SLIDE DECK STYLING
   M408M Multivariable Calculus - Week 2: Calculus with Parametric Curves
   ========================================================================== */

:root {
  /* Solarized Palette Colors */
  --base03: #002b36;
  --base02: #073642;
  --base01: #586e75;
  --base00: #657b83;
  --base0: #839496;
  --base1: #93a1a1;
  --base2: #eee8d5;
  --base3: #fdf6e3;

  /* Solarized Accents */
  --yellow: #b58900;
  --orange: #cb4b16;
  --red: #dc322f;
  --magenta: #d33682;
  --violet: #6c71c4;
  --blue: #268bd2;
  --cyan: #2aa198;
  --green: #859900;

  /* Semantic UI Tokens */
  --bg-primary: var(--base3);
  --bg-surface: var(--base2);
  --bg-surface-elevated: #f4edd9;
  --bg-surface-translucent: rgba(238, 232, 213, 0.92);
  --border-subtle: #e4dcba;
  --border-focus: var(--blue);

  --text-primary: var(--base03);
  --text-secondary: var(--base01);
  --text-muted: var(--base00);

  --shadow-sm: 0 2px 6px rgba(0, 43, 54, 0.05);
  --shadow-md: 0 6px 18px rgba(0, 43, 54, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 43, 54, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, monospace;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   APP HEADER & PROGRESS BAR
   ========================================================================== */

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: var(--bg-surface-translucent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.course-badge {
  background: var(--base02);
  color: var(--base3);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.session-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.header-btn:hover {
  background: var(--bg-surface);
  color: var(--blue);
  border-color: var(--border-subtle);
}

.header-btn.active {
  background: var(--blue);
  color: var(--base3);
}

/* Top Progress Bar */
.progress-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(0, 43, 54, 0.06);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   SLIDE DECK CONTAINER & SLIDES
   ========================================================================== */

.slide-deck {
  position: fixed;
  top: 52px;
  bottom: 64px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 36px;
  overflow: hidden;
}

.slide {
  position: absolute;
  width: min(1200px, 94vw);
  height: min(740px, calc(100vh - 120px));
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateX(30px) scale(0.98);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.slide::-webkit-scrollbar {
  width: 6px;
}

.slide::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

.slide.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
  z-index: 10;
}

.slide.prev-slide {
  transform: translateX(-30px) scale(0.98);
}

/* Slide Header */
.slide-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.slide-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.slide-tag::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
}

.slide-number-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--base01);
  background: var(--bg-surface);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

.slide-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--base03);
  line-height: 1.25;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.slide-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: -6px;
  margin-bottom: 16px;
  font-weight: 400;
}

/* Slide Body / Content Layouts */
.slide-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: stretch;
}

.grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: stretch;
}

.curve-hero-box {
  background: #fdf6e3;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.curve-hero-tag {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  background: rgba(38, 139, 210, 0.1);
  border: 1px solid rgba(38, 139, 210, 0.25);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.curve-hero-math {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--base03);
}

.curve-hero-sub {
  font-size: 0.82rem;
  color: var(--base01);
  font-style: italic;
  white-space: nowrap;
}

/* Question Rows Layout (Slide 8) */
.questions-rows-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.question-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: grid;
  grid-template-columns: 160px 1fr auto;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.question-row:hover {
  border-color: #d4caa6;
  box-shadow: var(--shadow-md);
}

.question-row.row-blue {
  border-left: 5px solid var(--blue);
}

.question-row.row-violet {
  border-left: 5px solid var(--violet);
}

.question-row.row-green {
  border-left: 5px solid var(--green);
}

.question-row.row-orange {
  border-left: 5px solid var(--orange);
}

.q-row-badge-col {
  display: flex;
  align-items: center;
  gap: 10px;
}

.q-row-title {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--base02);
  white-space: nowrap;
}

.q-row-body {
  display: flex;
  flex-direction: column;
}

.q-row-prompt {
  font-size: 0.94rem;
  color: var(--base02);
  font-weight: 500;
  line-height: 1.45;
}

.q-row-pill {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ==========================================================================
   CARDS, CALLOUTS, & HIGHLIGHT BLOCKS
   ========================================================================== */

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  border-color: #d8ceaa;
}

.card-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--base02);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 0.85rem;
}

.card-primary {
  border-left: 4px solid var(--blue);
}

.card-primary .card-title {
  color: var(--blue);
}

.card-success {
  border-left: 4px solid var(--green);
}

.card-success .card-title {
  color: var(--green);
}

.card-warning {
  border-left: 4px solid var(--orange);
}

.card-warning .card-title {
  color: var(--orange);
}

.card-danger {
  border-left: 4px solid var(--red);
}

.card-danger .card-title {
  color: var(--red);
}

.card-violet {
  border-left: 4px solid var(--violet);
}

.card-violet .card-title {
  color: var(--violet);
}

.card-cyan {
  border-left: 4px solid var(--cyan);
}

.card-cyan .card-title {
  color: var(--cyan);
}

/* KaTeX Math Typography & Distinction */
.katex {
  font-weight: normal;
  text-rendering: auto;
}

.katex-display {
  margin: 8px 0 !important;
}

.formula-box .katex-display {
  margin: 0 !important;
}

/* Formula Box */
.formula-box {
  background: #f4edd9;
  border: 1px solid #e2d9b6;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin: 8px 0;
  text-align: center;
  font-size: 1.1rem;
  box-shadow: inset 0 1px 3px rgba(0, 43, 54, 0.03);
}

.formula-box.highlight {
  border-color: var(--blue);
  background: rgba(38, 139, 210, 0.08);
}

.formula-box.warning-highlight {
  border-color: var(--red);
  background: rgba(220, 50, 47, 0.08);
}

.formula-box.success-highlight {
  border-color: var(--green);
  background: rgba(133, 153, 0, 0.08);
}

/* Concept Checklist / Key Points */
.key-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.key-list li {
  position: relative;
  padding-left: 24px;
  color: var(--text-primary);
  font-size: 0.98rem;
  line-height: 1.48;
}

.key-list li::before {
  content: '→';
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  color: var(--cyan);
  font-size: 1.05rem;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--blue);
  color: var(--base3);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  margin-right: 8px;
}

/* ==========================================================================
   TITLE SLIDE
   ========================================================================== */

.title-slide {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 36px 48px;
  position: relative;
  overflow: hidden;
}

.title-slide::after {
  content: '';
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(38, 139, 210, 0.12) 0%, rgba(42, 161, 152, 0.04) 50%, transparent 70%);
  pointer-events: none;
}

.title-badge-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.title-badge {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.title-badge.accent {
  background: rgba(38, 139, 210, 0.1);
  color: var(--blue);
  border-color: rgba(38, 139, 210, 0.3);
}

.title-heading {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--base03);
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  max-width: 920px;
}

.title-heading span {
  color: var(--blue);
}

.title-description {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 820px;
  margin-bottom: 24px;
  line-height: 1.5;
}

.title-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: 100%;
}

.title-feature-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-feature-num {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(38, 139, 210, 0.15);
  color: var(--blue);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
}

.title-feature-text {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--base02);
  line-height: 1.25;
}

/* ==========================================================================
   INTERACTIVE VISUALIZER COMPONENT
   ========================================================================== */

.visualizer-container {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  height: calc(100% - 40px);
  min-height: 440px;
}

.canvas-wrapper {
  background: #fbf4df;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.canvas-wrapper canvas,
#paramCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-overlay-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(253, 246, 227, 0.94);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--base02);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 5;
}

.hud-val {
  font-weight: 700;
}

.hud-val.t-val {
  color: var(--cyan);
}

.hud-val.x-val {
  color: var(--blue);
}

.hud-val.y-val {
  color: var(--orange);
}

.hud-val.slope-val {
  color: var(--magenta);
}

.hud-val.concave-val {
  color: var(--violet);
}

.visualizer-controls {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  overflow-y: auto;
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ctrl-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--base02);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preset-select {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1.5px solid #d4caa6;
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--base02);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-select:focus {
  border-color: var(--blue);
}

.playback-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-ctrl {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  color: var(--base02);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-ctrl:hover {
  background: #e8e0c8;
  color: var(--blue);
  border-color: #d4caa6;
}

.btn-ctrl.btn-primary {
  background: var(--blue);
  color: var(--base3);
  border-color: var(--blue);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.solar-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #ded5b8;
  outline: none;
}

.solar-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  border: 2px solid var(--base3);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.solar-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-primary);
  cursor: pointer;
}

.solar-toggle-label input[type="checkbox"] {
  accent-color: var(--blue);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.math-preview-badge {
  background: #f5eedb;
  border: 1px solid #d4caa6;
  border-left: 3.5px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--base02);
  line-height: 1.4;
}

/* ==========================================================================
   EXERCISE / PRACTICE PROBLEMS COMPONENT
   ========================================================================== */

.exercise-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exercise-prompt {
  background: var(--bg-surface);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.98rem;
  box-shadow: var(--shadow-sm);
}

.exercise-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s ease;
}

.step-header {
  padding: 9px 14px;
  background: #e8e0c8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.step-header:hover {
  background: #ded5b8;
}

.step-title-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--base02);
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-toggle-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  color: var(--blue);
  cursor: pointer;
}

.step-content {
  padding: 12px 16px;
  display: none;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  animation: fadeIn 0.25s ease;
  font-size: 0.92rem;
  line-height: 1.5;
}

.step-card.revealed .step-content {
  display: block;
}

.step-card.revealed .step-toggle-btn {
  background: var(--blue);
  color: var(--base3);
  border-color: var(--blue);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 2-Column Split Layout for Exercises with Visualizations */
.exercise-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.exercise-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
  min-height: 0;
}

.exercise-right {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  min-height: 0;
}

.ex-canvas-box {
  flex: 1;
  background: #fbf4df;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  min-height: 220px;
}

.ex-canvas-box canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.ex-controls-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ex-legend-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ex-legend-chip {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ex-legend-chip.c1 {
  background: rgba(38, 139, 210, 0.12);
  color: var(--blue);
  border: 1px solid rgba(38, 139, 210, 0.3);
}

.ex-legend-chip.c2 {
  background: rgba(203, 75, 22, 0.12);
  color: var(--orange);
  border: 1px solid rgba(203, 75, 22, 0.3);
}

.ex-legend-chip.c3 {
  background: rgba(133, 153, 0, 0.12);
  color: var(--green);
  border: 1px solid rgba(133, 153, 0, 0.3);
}

.ex-legend-chip.diag {
  background: rgba(108, 113, 196, 0.12);
  color: var(--violet);
  border: 1px solid rgba(108, 113, 196, 0.3);
}

/* ==========================================================================
   APP FOOTER & NAVIGATION CONTROLS
   ========================================================================== */

.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--bg-surface-translucent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.slide-counter {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--base02);
}

.slide-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d4caa6;
  cursor: pointer;
  transition: all 0.2s ease;
}

.slide-dot:hover {
  background: var(--base01);
  transform: scale(1.2);
}

.slide-dot.active {
  background: var(--blue);
  width: 20px;
  border-radius: 4px;
}

.footer-center {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  color: var(--base02);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.nav-btn:hover:not(:disabled) {
  background: #f0e7cf;
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--base01);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--blue);
}

/* ==========================================================================
   MODALS (OVERVIEW & HELP)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 43, 54, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: min(1000px, 92vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open .modal-dialog {
  transform: scale(1);
}

.modal-header {
  padding: 16px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--base03);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: var(--base01);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--red);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.slide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.grid-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.grid-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.grid-card.active {
  border-color: var(--blue);
  background: rgba(38, 139, 210, 0.08);
}

.grid-card-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cyan);
}

.grid-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--base02);
  line-height: 1.3;
}

.shortcuts-table {
  width: 100%;
  border-collapse: collapse;
}

.shortcuts-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}

.kbd-badge {
  background: var(--bg-surface);
  border: 1px solid #d4caa6;
  border-bottom: 2px solid #b8ac84;
  border-radius: 4px;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--base02);
}

/* Formula Summary Grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-card-header {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--blue);
}

.summary-card .formula-box {
  margin: 4px 0;
  padding: 8px 12px;
  font-size: 1.05rem;
}

.summary-card-note {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Compact Geometric Derivation Card in Visualizers */
.geom-mini-card {
  background: #fdf6e3;
  border: 1px solid #d4caa6;
  border-left: 3.5px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--base01);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.geom-mini-card .mini-title {
  font-weight: 700;
  color: var(--base02);
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
}

.geom-mini-card .mini-formula {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--blue);
  font-size: 0.92rem;
  margin: 1px 0;
}

.geom-mini-card p {
  margin: 0;
}

.geom-mini-card.mini-cyan {
  border-left-color: var(--cyan);
}

.geom-mini-card.mini-cyan .mini-formula {
  color: var(--cyan);
}

.geom-mini-card.mini-violet {
  border-left-color: var(--violet);
}

.geom-mini-card.mini-violet .mini-formula {
  color: var(--violet);
}

.geom-mini-card.mini-magenta {
  border-left-color: var(--magenta);
}

.geom-mini-card.mini-magenta .mini-formula {
  color: var(--magenta);
}

/* Tangent Cases Diagram (Slide 2) */
.tangent-cases-box {
  background: #fdf6e3;
  border: 1px solid #d4caa6;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: inset 0 1px 3px rgba(0, 43, 54, 0.02);
  transition: border-color 0.2s ease;
}

.tangent-cases-box:hover {
  border-color: #c4b890;
}

.tangent-cases-svg {
  width: 100%;
  max-width: 500px;
  height: auto;
  display: block;
}

/* Parabola Figure Diagram (Slide 3) */
.parabola-figure-box {
  background: #fdf6e3;
  border: 1px solid #d4caa6;
  border-radius: var(--radius-md);
  padding: 6px 10px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: inset 0 1px 3px rgba(0, 43, 54, 0.02);
  transition: border-color 0.2s ease;
}

.parabola-figure-box:hover {
  border-color: #c4b890;
}

.parabola-figure-svg {
  width: 100%;
  max-width: 480px;
  height: auto;
  display: block;
}

/* Area Figure Diagram (Slide 4) */
.area-figure-box,
.ellipse-figure-box {
  background: #fdf6e3;
  border: 1px solid #d4caa6;
  border-radius: var(--radius-md);
  padding: 4px 8px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: inset 0 1px 3px rgba(0, 43, 54, 0.02);
  transition: border-color 0.2s ease;
}

.area-figure-box:hover,
.ellipse-figure-box:hover {
  border-color: #c4b890;
}

.area-figure-svg,
.ellipse-figure-svg {
  width: 100%;
  max-width: 440px;
  height: auto;
  display: block;
}

/* 3D Surface of Revolution Visualizer (Slide 7) */
.revolution-visualizer-box {
  background: #fdf6e3;
  border: 1px solid #d4caa6;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: inset 0 1px 3px rgba(0, 43, 54, 0.02);
}

.revolution-canvas-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  border-radius: var(--radius-sm);
  background: #fbf4df;
  border: 1px solid #ded5b8;
  overflow: hidden;
  cursor: grab;
}

.revolution-canvas-wrap:active {
  cursor: grabbing;
}

.revolution-canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.revolution-badge-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(253, 246, 227, 0.94);
  backdrop-filter: blur(4px);
  border: 1px solid #d4caa6;
  border-radius: 4px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--cyan);
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.revolution-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.revolution-caption {
  font-size: 0.78rem;
  color: var(--base01);
  line-height: 1.35;
}

/* Step-by-Step Derivation UI */
.step-nav-bar {
  display: flex;
  align-items: stretch;
  gap: 4px;
  background: #f8eed6;
  border: 1px solid #d4caa6;
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 8px;
}

.step-pill {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 6px 3px;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--base01);
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
}

.step-pill:hover {
  background: rgba(0, 43, 54, 0.06);
  color: var(--base02);
}

.step-pill.active {
  background: var(--blue);
  color: var(--base3);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.derivation-step-card {
  background: var(--bg-surface-elevated);
  border: 1px solid #d4caa6;
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.step-badge-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--base02);
  line-height: 1.3;
}

.step-math-box {
  background: #fdf6e3;
  border: 1px solid #ded5b8;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  text-align: center;
  font-size: 0.90rem;
  color: var(--blue);
  font-weight: 600;
  margin: 2px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.step-math-box .katex-display {
  margin: 3px 0 !important;
}

.step-explanation {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--base01);
  margin: 0;
  word-break: normal;
}

.step-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed #d4caa6;
}

.step-hint-badge {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--base01);
  background: rgba(0, 43, 54, 0.05);
  padding: 2px 6px;
  border-radius: 3px;
}

@media (max-width: 900px) {

  .grid-2col,
  .visualizer-container,
  .exercise-split,
  .title-features,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .slide {
    padding: 16px 20px;
  }
}