/*
 * NSC1501 Bioscience - MAIN STYLESHEET
 * "Living Taxonomy" Design System
 * Self-contained: includes reset, variables, and all component styles
 * for pages that load only this file (e.g., week pages)
 */

/* ============================================
   FONTS
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,700&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,500;0,8..60,600;0,8..60,700;1,8..60,400;1,8..60,500&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background: #f5f0e8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Source Serif 4', 'Georgia', serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #2c2416;
  background: #f5f0e8;
  min-height: 100vh;
  margin: 0;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(212, 168, 83, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(196, 93, 62, 0.02) 0%, transparent 50%);
}

::selection {
  background: #e8c97a;
  color: #2c2416;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  --forest: #1a3a2a;
  --forest-deep: #0f2219;
  --forest-light: #2a5a3e;
  --ivory: #f5f0e8;
  --ivory-warm: #ede6d8;
  --ivory-cool: #f8f5f0;
  --parchment: #e8dfd0;
  --terracotta: #c45d3e;
  --terracotta-light: #d4785e;
  --terracotta-dark: #a04a2e;
  --gold: #d4a853;
  --gold-light: #e8c97a;
  --gold-muted: #b89a5a;
  --ink: #2a4858;
  --ink-light: #3a6878;
  --ink-dark: #1a3040;
  --moss: #5a7a5e;
  --moss-light: #7a9a7e;
  --sage: #8aaa8e;

  --text-primary: #2c2416;
  --text-secondary: #5a4e3a;
  --text-muted: #8a7e6a;
  --text-inverse: #f5f0e8;
  --bg-primary: var(--ivory);
  --bg-secondary: var(--ivory-warm);
  --bg-surface: var(--ivory-cool);
  --bg-dark: var(--forest);
  --accent-primary: var(--terracotta);
  --accent-secondary: var(--gold);
  --success: #3a7a4a;
  --success-bg: #e8f2ea;
  --error: #a83232;
  --error-bg: #f5e8e8;

  --border-color: #c8bfa8;
  --border-color-strong: #9a8e78;
  --border-width: 1px;
  --border-accent: 2px;
  --shadow-sm: 0 1px 3px rgba(42, 36, 22, 0.06), 0 1px 2px rgba(42, 36, 22, 0.04);
  --shadow-md: 0 4px 12px rgba(42, 36, 22, 0.08), 0 2px 4px rgba(42, 36, 22, 0.04);
  --shadow-lg: 0 8px 24px rgba(42, 36, 22, 0.1), 0 4px 8px rgba(42, 36, 22, 0.06);
  --shadow-xl: 0 16px 48px rgba(42, 36, 22, 0.12), 0 8px 16px rgba(42, 36, 22, 0.06);

  --font-heading: 'Playfair Display', 'Georgia', 'Times New Roman', serif;
  --font-body: 'Source Serif 4', 'Georgia', serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;
  --line-height: 1.7;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --container-max: 1280px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: var(--space-md);
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.125rem, 2.5vw, 1.5rem); font-weight: 600; }
h4 { font-size: 1.0625rem; font-weight: 600; }

p {
  margin-bottom: var(--space-md);
  max-width: 72ch;
  line-height: var(--line-height);
}

a {
  color: var(--terracotta);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--terracotta-dark);
  background: transparent;
}

strong {
  font-weight: 700;
  color: inherit;
}

code {
  font-family: var(--font-mono);
  background: var(--forest-deep);
  color: var(--gold-light);
  padding: 2px 8px;
  font-size: 0.875em;
  border-radius: var(--radius-sm);
}

pre {
  background: var(--forest-deep);
  color: var(--gold-light);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
  border: var(--border-width) solid var(--border-color);
  overflow-x: auto;
  margin-bottom: var(--space-md);
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

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

.section {
  padding: var(--space-3xl) 0;
  position: relative;
}

.section + .section {
  border-top: var(--border-width) solid var(--border-color);
}

.section-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-sm);
  border-bottom: var(--border-accent) solid var(--terracotta);
  display: inline-block;
}

/* ============================================
   HEADER (index/dashboard/exam/glossary pages)
   ============================================ */
.header {
  background: var(--forest);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(15, 34, 25, 0.2);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  max-width: var(--container-max);
  margin: 0 auto;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ivory);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  transition: color var(--duration-fast) var(--ease-out);
}

.logo:hover {
  color: var(--gold-light);
  background: transparent;
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--sage);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  transition: color var(--duration-fast) var(--ease-out),
              background var(--duration-fast) var(--ease-out);
}

.nav-link:hover {
  color: var(--ivory);
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

.nav-link.active {
  color: var(--gold-light);
  background: rgba(212, 168, 83, 0.12);
}

/* Mobile Menu */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-sm);
  background: transparent;
  border: var(--border-width) solid var(--sage);
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  align-items: center;
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ivory);
  border-radius: 1px;
  transition: transform var(--duration-normal) var(--ease-out),
              opacity var(--duration-normal) var(--ease-out);
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--forest);
    border-top: var(--border-width) solid rgba(255, 255, 255, 0.1);
    padding: var(--space-sm) 0;
    box-shadow: 0 8px 24px rgba(15, 34, 25, 0.3);
    gap: 0;
  }

  .nav.open {
    display: flex;
  }

  .nav-link {
    padding: var(--space-md) var(--space-lg);
    border-radius: 0;
    width: 100%;
  }
}

/* ============================================
   HERO
   ============================================ */
.hero {
  background: var(--forest);
  color: var(--ivory);
  padding: var(--space-3xl) var(--space-lg);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 10% 90%, rgba(212, 168, 83, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 10%, rgba(196, 93, 62, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--ivory);
  margin-bottom: var(--space-lg);
  position: relative;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  color: var(--sage);
  max-width: 55ch;
  margin-bottom: var(--space-lg);
  position: relative;
  line-height: var(--line-height);
  border-left: var(--border-accent) solid var(--gold-muted);
  padding-left: var(--space-lg);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  position: relative;
}

.hero-meta-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gold-light);
  background: rgba(212, 168, 83, 0.1);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  border: var(--border-width) solid rgba(212, 168, 83, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-meta-item svg {
  width: 16px;
  height: 16px;
}

/* Hero CTA */
.hero-cta {
  margin-top: var(--space-xl);
  text-align: center;
}

.hero-cta .btn-lg {
  font-size: 1.125rem;
  padding: 1rem 2rem;
}

.hero-cta-alt {
  margin-top: var(--space-md);
  font-size: 0.875rem;
  color: var(--text-muted);
  font-family: var(--font-body);
}

.hero-cta-alt a {
  color: var(--terracotta);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--terracotta-light);
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.hero-cta-alt a:hover {
  color: var(--terracotta-dark);
}

/* ============================================
   PROGRESS SECTION
   ============================================ */
.progress-overview {
  background: var(--bg-surface);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

@media (max-width: 768px) {
  .progress-stats {
    grid-template-columns: 1fr;
  }
}

.progress-stat {
  text-align: center;
  padding: var(--space-lg);
  background: var(--forest);
  color: var(--ivory);
  border-radius: var(--radius-md);
}

.progress-stat-value {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gold-light);
  margin-bottom: var(--space-xs);
  line-height: 1;
}

.progress-stat-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sage);
}

.progress-bar-large {
  height: 10px;
  background: var(--parchment);
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-large-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--forest-light), var(--moss));
  border-radius: 5px;
  transition: width var(--duration-slow) var(--ease-out);
}

/* ============================================
   CARD GRID
   ============================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-lg);
}

.card {
  background: var(--bg-surface);
  text-decoration: none;
  color: var(--text-primary);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0;
  position: relative;
  display: block;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-color-strong);
  background: var(--bg-surface);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--forest);
  color: var(--ivory);
}

.card-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-light);
}

.card-badge {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--ivory);
  background: var(--terracotta);
  padding: 3px var(--space-sm);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  margin: var(--space-lg) var(--space-lg) var(--space-sm);
  line-height: 1.3;
  color: var(--text-primary);
}

.card:hover .card-title {
  color: var(--terracotta-dark);
}

.card-description {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 var(--space-lg) var(--space-md);
  line-height: 1.6;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: 0 var(--space-lg) var(--space-lg);
}

.card-meta span {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--parchment);
  padding: 3px var(--space-sm);
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.card-progress {
  height: 4px;
  background: var(--parchment);
}

.card-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--forest-light), var(--moss));
  transition: width var(--duration-slow) var(--ease-out);
}

.card.completed { position: relative; }

.card.completed::after {
  content: '✓';
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 26px;
  height: 26px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  z-index: 2;
}

.card.in-progress { border-color: var(--ink-light); }
.card.in-progress .card-header { background: var(--ink); }

/* ============================================
   CONTENT BLOCK
   ============================================ */
.content-block {
  background: var(--bg-surface);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.content-block h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
  padding-bottom: var(--space-sm);
  border-bottom: var(--border-width) solid var(--border-color);
}

.content-block h3:first-child {
  margin-top: 0;
}

.content-block ul {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.content-block li {
  margin-bottom: var(--space-sm);
  font-family: var(--font-body);
  line-height: 1.6;
}

.content-block li::marker {
  color: var(--terracotta);
}

/* ============================================
   WEEK PAGE HEADER
   ============================================ */
.site-header {
  background: var(--forest);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(15, 34, 25, 0.2);
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-md) var(--space-lg);
}

.week-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.week-nav .nav-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--sage);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
}

.week-nav .nav-link:hover {
  color: var(--ivory);
  background: rgba(255, 255, 255, 0.08);
}

.week-nav .nav-link.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.current-week {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--forest-deep);
  background: var(--gold-light);
  padding: var(--space-sm) var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-sm);
}

.week-content {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

/* ============================================
   LEARNING OBJECTIVES
   ============================================ */
.learning-objectives {
  background: var(--forest);
  color: var(--ivory);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-md);
}

.learning-objectives h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: var(--space-md);
}

.learning-objectives ul {
  padding-left: var(--space-lg);
}

.learning-objectives li {
  margin-bottom: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--sage);
}

.learning-objectives li::marker {
  color: var(--gold-muted);
}

/* ============================================
   TOGGLE BUTTONS
   ============================================ */
.explanation-toggle {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-xl);
  border: var(--border-width) solid var(--border-color-strong);
  border-radius: var(--radius-md);
  width: fit-content;
  overflow: hidden;
  background: var(--parchment);
}

.toggle-btn {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: transparent;
  color: var(--text-secondary);
  min-height: 44px;
  transition: all var(--duration-fast) var(--ease-out);
  border-right: var(--border-width) solid var(--border-color-strong);
}

.toggle-btn:last-child {
  border-right: none;
}

.toggle-btn.active {
  background: var(--forest);
  color: var(--ivory);
}

.toggle-btn:hover:not(.active) {
  background: var(--ivory-warm);
  color: var(--text-primary);
}

/* ============================================
   EXPLANATION SECTIONS
   ============================================ */
.explanation {
  background: var(--bg-surface);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.explanation.hidden {
  display: none;
}

.explanation h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
  padding-bottom: var(--space-sm);
  border-bottom: var(--border-accent) solid var(--terracotta);
}

.explanation h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.explanation p {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

/* Content sections (like homeostasis-essentials) */
.content-section {
  margin-bottom: var(--space-xl);
}

.content-section h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}

/* ============================================
   VIDEO SECTION
   ============================================ */
.video-section {
  margin-bottom: var(--space-2xl);
}

.video-section h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
  padding-bottom: var(--space-sm);
  border-bottom: var(--border-accent) solid var(--ink);
}

.video-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

@media (max-width: 1024px) {
  .video-container {
    grid-template-columns: 1fr;
  }
}

.video-list {
  display: flex;
  flex-direction: column;
  border-right: var(--border-width) solid var(--border-color);
  max-height: 600px;
  overflow-y: auto;
  background: var(--bg-surface);
}

.video-item {
  border-bottom: var(--border-width) solid var(--border-color);
}

.video-item:last-child {
  border-bottom: none;
}

.video-btn {
  text-align: left;
  padding: var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.video-btn:hover {
  background: var(--parchment);
  color: var(--text-primary);
}

.video-btn.active {
  background: var(--forest);
  color: var(--gold-light);
}

.video-btn .expand-icon {
  font-size: 0.75rem;
  transition: transform var(--duration-normal) var(--ease-out);
  color: var(--text-muted);
}

.video-btn.expanded .expand-icon {
  transform: rotate(90deg);
}

.video-topics {
  display: none;
  background: var(--forest-deep);
  border-top: var(--border-width) solid rgba(255, 255, 255, 0.08);
}

.video-topics.expanded {
  display: block;
}

.video-topics ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.video-topics li {
  padding: 0.6rem var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--sage);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}

.video-topics li:last-child {
  border-bottom: none;
}

.video-topics li:hover {
  background: rgba(212, 168, 83, 0.15);
  color: var(--gold-light);
}

.video-topics li::before {
  content: '› ';
  color: var(--terracotta-light);
}

.video-player-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--forest-deep);
}

#main-video-player {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-md);
  border: var(--border-width) solid rgba(255, 255, 255, 0.1);
}

.video-info {
  padding: var(--space-md);
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: var(--border-width) solid rgba(255, 255, 255, 0.08);
}

.video-info h3 {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.video-info p {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--sage);
  margin: 0;
}

/* Current topic display */
.current-topic-display {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: rgba(212, 168, 83, 0.1);
  border: var(--border-width) solid rgba(212, 168, 83, 0.2);
  border-radius: var(--radius-md);
}

.current-topic-display h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: var(--space-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.current-topic-display p {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--ivory);
  margin: 0;
}

/* Topic detail panel */
.topic-detail-panel {
  margin-top: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-surface);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  display: none;
  box-shadow: var(--shadow-md);
}

.topic-detail-panel.active {
  display: block;
}

.topic-detail-panel h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: var(--border-accent) solid var(--moss);
}

.topic-detail-panel p {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.topic-detail-panel .close-btn {
  float: right;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: var(--space-xs) var(--space-sm);
  background: var(--parchment);
  color: var(--text-secondary);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-transform: uppercase;
  transition: all var(--duration-fast) var(--ease-out);
}

.topic-detail-panel .close-btn:hover {
  background: var(--terracotta);
  color: white;
  border-color: var(--terracotta);
}

/* ============================================
   KEY TERMS GRID
   ============================================ */
.key-terms h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
  padding-bottom: var(--space-sm);
  border-bottom: var(--border-accent) solid var(--moss);
}

.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.term-card {
  background: var(--bg-surface);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  position: relative;
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              border-color var(--duration-normal) var(--ease-out);
  box-shadow: var(--shadow-sm);
}

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

.term-card h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 0.6rem;
}

.term-card p {
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* Term card hover hint */
.term-card::after {
  content: 'Click for details';
  position: absolute;
  bottom: var(--space-sm);
  right: var(--space-sm);
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-out);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.term-card:hover::after {
  opacity: 1;
}

/* ============================================
   GAME & TEST SECTIONS
   ============================================ */
.game-section,
.test-section {
  margin-top: var(--space-2xl);
  background: var(--bg-surface);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.game-section h2,
.test-section h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
  padding-bottom: var(--space-sm);
  border-bottom: var(--border-accent) solid var(--ink);
}

.game-container iframe {
  width: 100%;
  min-height: 500px;
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  background: white;
}

/* ============================================
   BUTTONS (standalone style.css duplicates)
   ============================================ */
.btn {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.75rem 1.5rem;
  border: var(--border-accent) solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 44px;
  transition: all var(--duration-fast) var(--ease-out);
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--terracotta);
  color: white;
  border-color: var(--terracotta);
}

.btn-primary:hover {
  background: var(--terracotta-dark);
  border-color: var(--terracotta-dark);
  color: white;
  box-shadow: 0 4px 12px rgba(196, 93, 62, 0.3);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color-strong);
}

.btn-secondary:hover {
  background: var(--parchment);
}

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.btn-danger {
  background: var(--error);
  color: white;
  border-color: var(--error);
}

/* ============================================
   FOOTER (standalone)
   ============================================ */
.footer {
  background: var(--forest-deep);
  color: var(--ivory);
  padding: var(--space-3xl) var(--space-lg) var(--space-xl);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-xl);
  max-width: var(--container-max);
  margin: 0 auto var(--space-xl);
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }
}

.footer-section h4 {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: var(--space-md);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer-link {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--sage);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-link:hover {
  color: var(--ivory);
  background: transparent;
  text-decoration: underline;
}

.footer-bottom {
  padding-top: var(--space-xl);
  border-top: var(--border-width) solid rgba(255, 255, 255, 0.1);
  max-width: var(--container-max);
  margin: 0 auto;
}

.footer-copyright {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.site-footer {
  background: var(--forest-deep);
  color: var(--ivory);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.footer-nav a {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gold-light);
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.05em;
}

.footer-nav a:hover {
  color: var(--ivory);
  background: transparent;
}

.site-footer p {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin: 0;
}

/* ============================================
   LOGIN GATE
   ============================================ */
.login-page {
  min-height: 100vh;
}

.login-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.login-shell {
  width: 100%;
}

.login-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.login-card-header {
  background: var(--forest);
  padding: var(--space-xl);
}

.login-card-header h1 {
  color: var(--ivory);
  margin-bottom: var(--space-sm);
}

.login-card-header p {
  color: var(--sage);
  margin: 0;
  max-width: none;
}

.login-card-body {
  padding: var(--space-xl);
}

.login-form {
  display: grid;
  gap: var(--space-md);
}

.login-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.login-input {
  width: 100%;
  min-height: 48px;
  padding: 0.875rem 1rem;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: var(--border-width) solid var(--border-color-strong);
  border-radius: var(--radius-md);
}

.login-input:focus {
  outline: none;
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(196, 93, 62, 0.15);
}

.login-message {
  margin: 0;
  min-height: 1.5rem;
  font-size: 0.875rem;
}

.login-message-error {
  color: var(--error);
}

.login-note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .login-main {
    padding: var(--space-md);
  }

  .login-card-header,
  .login-card-body {
    padding: var(--space-lg);
  }
}

/* ============================================
   UTILITIES
   ============================================ */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

/* ============================================
   TEST STYLES
   ============================================ */
.question-block {
  background: var(--bg-surface);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
}

.question-text {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.options {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.option-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem var(--space-md);
  background: var(--bg-primary);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}

.option-label:hover {
  background: var(--parchment);
  border-color: var(--border-color-strong);
}

.option-label input[type="radio"] {
  margin: 0;
  margin-top: 3px;
  width: 1rem;
  height: 1rem;
  accent-color: var(--forest);
}

.option-text {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.submit-btn {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.875rem 1.75rem;
  background: var(--terracotta);
  color: white;
  border: var(--border-accent) solid var(--terracotta);
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-top: var(--space-md);
  transition: all var(--duration-fast) var(--ease-out);
}

.submit-btn:hover {
  background: var(--terracotta-dark);
  border-color: var(--terracotta-dark);
  box-shadow: 0 4px 12px rgba(196, 93, 62, 0.3);
}

.feedback {
  margin-top: var(--space-md);
  padding: var(--space-md);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9375rem;
}

.results {
  margin-top: var(--space-md);
}

/* Test feedback styles */
.feedback p.correct {
  color: var(--success);
  background: var(--success-bg);
  padding: 0.75rem var(--space-md);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--success);
}

.feedback p.incorrect {
  color: var(--error);
  background: var(--error-bg);
  padding: 0.75rem var(--space-md);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--error);
}

/* Results summary */
.results-summary {
  text-align: center;
  padding: var(--space-xl);
  background: var(--forest);
  color: var(--gold-light);
  border-radius: var(--radius-lg);
}

.results-summary h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
  color: var(--gold-light);
}

.results-summary .score {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  color: var(--ivory);
}

.results-summary .score-message {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--sage);
}

/* Test controls */
.test-controls {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}

.test-controls .btn {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.75rem 1.5rem;
  border: var(--border-accent) solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.test-controls .btn-primary {
  background: var(--terracotta);
  color: white;
  border-color: var(--terracotta);
}

.test-controls .btn-primary:hover {
  background: var(--terracotta-dark);
  border-color: var(--terracotta-dark);
}

.test-controls .btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color-strong);
}

.test-controls .btn-secondary:hover {
  background: var(--parchment);
}

/* Correct/incorrect highlights */
.correct-answer {
  background: var(--success-bg) !important;
  border-color: var(--success) !important;
}

.incorrect-answer {
  background: var(--error-bg) !important;
  border-color: var(--error) !important;
}

.option-label.selected {
  background: var(--parchment);
  border-color: var(--gold-muted);
}

.option-label.correct {
  background: var(--success-bg);
  border-color: var(--success);
}

.option-label.incorrect {
  background: var(--error-bg);
  border-color: var(--error);
}

/* ============================================
   KEY TERM MODAL
   ============================================ */
.key-term-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 34, 25, 0.85);
  backdrop-filter: blur(4px);
  z-index: 1000;
  overflow-y: auto;
  padding: var(--space-xl);
}

.key-term-modal.active {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.key-term-modal-content {
  background: var(--ivory);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 860px;
  width: 100%;
  margin: var(--space-xl) auto;
  position: relative;
  overflow: hidden;
}

.key-term-modal-close {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 600;
  background: var(--parchment);
  color: var(--text-secondary);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  z-index: 10;
  transition: all var(--duration-fast) var(--ease-out);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.key-term-modal-close:hover {
  background: var(--terracotta);
  color: white;
  border-color: var(--terracotta);
}

.key-term-modal-header {
  background: var(--forest);
  color: var(--gold-light);
  padding: var(--space-xl);
}

.key-term-modal-header h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0;
  color: var(--gold-light);
  letter-spacing: -0.02em;
}

.key-term-modal-body {
  padding: var(--space-xl);
}

.key-term-image-container {
  background: var(--forest-deep);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  text-align: center;
  overflow: hidden;
}

.key-term-image {
  max-width: 100%;
  max-height: 400px;
  display: block;
  margin: 0 auto;
}

.key-term-image-caption {
  background: var(--parchment);
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.key-term-detail-section {
  margin-bottom: var(--space-xl);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  background: var(--bg-surface);
}

.key-term-detail-section h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: var(--border-accent) solid var(--moss);
}

.key-term-detail-section.simplified {
  background: rgba(212, 168, 83, 0.06);
  border-color: var(--gold-muted);
}

.key-term-detail-section.complex {
  background: rgba(42, 72, 88, 0.04);
  border-color: var(--ink-light);
}

.key-term-detail-section.complex h3 {
  border-bottom-color: var(--ink);
}

.key-term-detail-section p {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
}

.key-term-detail-section ul {
  margin-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.key-term-detail-section li {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.key-term-detail-section li::marker {
  color: var(--terracotta);
}

.key-term-facts {
  background: var(--forest);
  color: var(--ivory);
  border: var(--border-width) solid var(--forest);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.key-term-facts h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: var(--space-md);
  border-bottom: var(--border-width) solid rgba(255, 255, 255, 0.1);
  padding-bottom: var(--space-sm);
}

.key-term-facts ul {
  margin-left: var(--space-lg);
}

.key-term-facts li {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: var(--space-sm);
  color: var(--sage);
}

.key-term-facts li::marker {
  color: var(--gold-muted);
}

/* Image placeholder */
.key-term-image-placeholder {
  background: var(--forest-deep);
  color: var(--sage);
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  border-radius: var(--radius-lg);
  border: var(--border-width) solid rgba(255, 255, 255, 0.08);
}

/* Related terms */
.key-term-related {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: var(--border-width) solid var(--border-color);
}

.key-term-related h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.key-term-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.related-term-card {
  background: var(--bg-surface);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.related-term-card:hover {
  border-color: var(--gold-muted);
  box-shadow: var(--shadow-sm);
}

.related-term-card h4 {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  color: var(--forest);
}

.related-term-card p {
  font-family: var(--font-body);
  font-size: 0.75rem;
  line-height: 1.5;
  margin: 0;
  color: var(--text-secondary);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp var(--duration-slow) var(--ease-out) both;
}

.animate-in-delay-1 { animation-delay: 100ms; }
.animate-in-delay-2 { animation-delay: 200ms; }
.animate-in-delay-3 { animation-delay: 300ms; }

/* ============================================
   PDF SECTION
   ============================================ */
.pdf-section {
  margin: var(--space-xl) 0;
  padding: var(--space-lg);
  background: var(--bg-surface);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.pdf-section h2 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: var(--border-accent) solid var(--terracotta);
  color: var(--text-primary);
}

.pdf-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.pdf-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-primary);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--duration-fast) var(--ease-out);
}

.pdf-link:hover {
  background: var(--parchment);
  border-color: var(--border-color-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.pdf-link:active {
  transform: translateY(0);
}

.pdf-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.pdf-title {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Embedded PDF viewer */
.pdf-item {
  margin-bottom: var(--space-sm);
}

.pdf-btn {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-primary);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
  transition: all var(--duration-fast) var(--ease-out);
}

.pdf-btn:hover {
  background: var(--parchment);
  border-color: var(--border-color-strong);
  box-shadow: var(--shadow-sm);
}

.pdf-btn:active {
  transform: translateY(0);
}

.pdf-btn .expand-icon {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pdf-viewer-container {
  margin-top: var(--space-md);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow-md);
}

.pdf-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  background: var(--forest);
  border-bottom: var(--border-width) solid var(--border-color);
}

.pdf-viewer-header h3 {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-light);
  margin: 0;
}

.close-pdf-btn {
  padding: var(--space-sm) var(--space-md);
  background: var(--parchment);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  text-transform: uppercase;
  transition: all var(--duration-fast) var(--ease-out);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-pdf-btn:hover {
  background: var(--terracotta);
  color: white;
  border-color: var(--terracotta);
}

.pdf-viewer-container iframe {
  display: block;
  width: 100%;
  height: 800px;
  border: none;
}

/* ============================================
   GLOSSARY STYLES (moved from inline)
   ============================================ */
.glossary-header {
  background: var(--forest);
  color: var(--ivory);
  padding: var(--space-2xl) var(--space-lg);
}

.glossary-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--gold-light);
  margin-bottom: var(--space-md);
  letter-spacing: -0.02em;
}

.glossary-subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--sage);
  max-width: 50ch;
}

.glossary-search {
  margin: var(--space-xl) auto;
  max-width: 600px;
}

.search-container {
  display: flex;
  border: var(--border-width) solid var(--border-color-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.search-input {
  flex: 1;
  padding: var(--space-md);
  border: none;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--bg-surface);
  color: var(--text-primary);
  min-height: 50px;
}

.search-input:focus {
  outline: none;
  background: var(--ivory-warm);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-btn {
  background: var(--forest);
  color: var(--gold-light);
  border: none;
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  transition: background var(--duration-fast) var(--ease-out);
}

.search-btn:hover {
  background: var(--forest-light);
}

.letter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin: var(--space-xl) 0;
  justify-content: center;
}

.letter-btn {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.letter-btn:hover,
.letter-btn.active {
  background: var(--forest);
  color: var(--gold-light);
  border-color: var(--forest);
}

.letter-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.glossary-section {
  margin-bottom: var(--space-xl);
}

.glossary-letter {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--terracotta);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: var(--border-accent) solid var(--terracotta);
}

.glossary-term {
  padding: var(--space-md) 0;
  border-bottom: var(--border-width) solid var(--border-color);
}

.glossary-term:last-child {
  border-bottom: none;
}

.glossary-term-name {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: var(--space-xs);
}

.glossary-term-def {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-xs);
}

.glossary-term-week {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.glossary-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: var(--space-xl);
}

/* ============================================
   EXAM STYLES (moved from inline)
   ============================================ */
.exam-instructions {
  background: var(--forest);
  color: var(--ivory);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.exam-instructions h2 {
  color: var(--gold-light);
  font-family: var(--font-heading);
  margin-bottom: var(--space-md);
}

.exam-instructions ul {
  margin-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

.exam-instructions li {
  margin-bottom: var(--space-sm);
  color: var(--sage);
  font-family: var(--font-body);
  font-size: 0.9375rem;
}

.exam-instructions strong {
  color: var(--gold-light);
  font-weight: 700;
}

.exam-instructions p {
  color: var(--ivory);
  margin-bottom: var(--space-sm);
}

.exam-instructions a {
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.exam-instructions a:hover {
  color: var(--ivory);
}

.noscript-warning {
  background: var(--error);
  color: white;
  padding: var(--space-xl);
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  border-radius: var(--radius-lg);
}

.timer-display {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-light);
}

/* ============================================
   CASE SECTION (week pages)
   ============================================ */
.case-section {
  margin-top: var(--space-2xl);
  background: var(--bg-surface);
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
}

.case-section h2 {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--terracotta);
  border-bottom: 2px solid var(--terracotta-light);
  padding-bottom: var(--space-sm);
  display: inline-block;
}

.case-section p {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.case-section .btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.875rem 1.75rem;
  background: var(--forest);
  color: var(--ivory);
  border: var(--border-width) solid var(--forest);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: all 0.3s var(--ease-out);
}

.case-section .btn:hover {
  background: var(--forest-light);
  border-color: var(--forest-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ============================================
   EXAM STATS (dashboard)
   ============================================ */
.exam-stats {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: var(--forest);
  color: var(--ivory);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.exam-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  text-align: center;
}

@media (max-width: 600px) {
  .exam-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.exam-stat-value {
  font-size: 2rem;
  font-weight: 900;
  font-family: var(--font-heading);
  color: var(--gold-light);
}

.exam-stat-label {
  font-size: 0.875rem;
  font-family: var(--font-body);
  color: var(--sage);
  margin-top: var(--space-xs);
}

.exam-cta {
  margin-top: var(--space-xl);
  text-align: center;
}

.btn-lg {
  font-size: 1.125rem;
  padding: 1rem 2.5rem;
}

/* ============================================
   PROGRESS SUMMARY (dashboard)
   ============================================ */
.progress-summary {
  text-align: center;
  margin-top: var(--space-md);
  font-family: var(--font-body);
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ============================================
   WEEK PROGRESS GRID (dashboard)
   ============================================ */
.week-progress-grid {
  margin-top: var(--space-xl);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-sm);
}

@media (max-width: 768px) {
  .week-progress-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .week-progress-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   POMODORO WIDGET (dashboard)
   ============================================ */
.pomodoro-container {
  position: fixed;
  bottom: var(--space-xl);
  right: var(--space-xl);
  background: var(--forest);
  color: var(--ivory);
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  min-width: 260px;
  text-align: center;
}

.pomodoro-timer {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: var(--space-md);
  letter-spacing: 0.05em;
}

.pomodoro-timer.break {
  color: var(--terracotta-light);
}

.pomodoro-controls {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-md);
}

.pomodoro-stats {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--sage);
}

.pomodoro-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: none;
  border: none;
  color: var(--ivory);
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  line-height: 1;
  padding: var(--space-xs);
}

.pomodoro-close:hover {
  opacity: 1;
}
