@import url('https://fonts.googleapis.com/css2?family=Golos+Text:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   CS50-INSPIRED LIGHT THEME & DESIGN SYSTEM
   High-contrast, academic, clean, maker-oriented aesthetic.
   No AI-slop: crisp typography, functional borders, zero blurry glows.
   ========================================================================== */

:root {
  color-scheme: light;
  
  /* Core palette - cool light slate background with pure white cards */
  --bg: #f6f8fb;
  --bg-subtle: #edf2f7;
  --bg-muted: #e2e8f0;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  
  /* Typography & Ink */
  --ink: #0f172a;          /* Slate 900 - Headings & high-emphasis text */
  --ink-body: #334155;     /* Slate 700 - Body copy, high readability */
  --muted: #64748b;        /* Slate 500 - Secondary text, captions */
  --muted-light: #94a3b8;  /* Slate 400 - Subtle hints, dividers */
  
  /* Brand & Accents (CS50 Crimson + Arduino Teal + CS50 Amber) */
  --primary: #a51c30;      /* CS50 Crimson / Harvard Red */
  --primary-hover: #891324;
  --primary-subtle: #fef2f2;
  --primary-border: #fecaca;
  
  --accent-amber: #d97706; /* CS50 Gold / Amber */
  --accent-amber-bg: #fffbeb;
  --accent-amber-border: #fde68a;
  
  --accent-teal: #0d9488;  /* Arduino Teal / Hardware */
  --accent-teal-bg: #f0fdfa;
  --accent-teal-border: #99f6e4;
  
  --accent-blue: #0284c7;  /* Technical Blue */
  --accent-blue-bg: #f0f9ff;
  --accent-blue-border: #bae6fd;
  
  /* Structure & Borders */
  --line: #e2e8f0;         /* Slate 200 - Clean 1px division */
  --line-strong: #cbd5e1;  /* Slate 300 - Interactive borders */
  --radius: 8px;
  --radius-sm: 5px;
  --radius-lg: 12px;
  
  /* Layout */
  --max-width: 1280px;
  --font-sans: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, 'SFMono-Regular', Menlo, Monaco, monospace;
}

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

html {
  background: var(--bg);
  color: var(--ink-body);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
  margin-top: 0;
  letter-spacing: -0.02em;
}

h1 { font-size: 36px; letter-spacing: -0.03em; margin-bottom: 16px; }
h2 { font-size: 24px; letter-spacing: -0.02em; margin-bottom: 12px; }
h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
p { margin-top: 0; margin-bottom: 16px; color: var(--ink-body); }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

a:hover {
  color: var(--primary);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
}

.eyebrow-badge {
  background: var(--primary-subtle);
  border: 1px solid var(--primary-border);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.muted { color: var(--muted); }
.small, small { font-size: 13px; color: var(--muted); }
.accent { color: var(--primary); }

/* Accessible Skip Link */
.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--ink);
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 100;
  font-weight: 600;
  font-size: 13px;
}
.skip:focus {
  top: 16px;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

/* ==========================================================================
   SITE HEADER & NAVIGATION (CS50 style)
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: var(--ink);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.brand-icon span {
  color: var(--accent-amber);
  margin-right: 1px;
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title strong {
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.brand-title small {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Navigation Menu */
.sidebar {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-body);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--bg-subtle);
  color: var(--ink);
}

.nav-link.active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
  border: 1px solid var(--primary-border);
}

.menu-button {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 18px;
  cursor: pointer;
  color: var(--ink);
}

/* Layout Shell */
.shell {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.shell main {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 40px 32px 64px;
  flex: 1;
}

/* Footer */
footer {
  border-top: 1px solid var(--line);
  background: var(--bg-subtle);
  padding: 24px 32px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

footer a {
  color: var(--ink-body);
  font-weight: 500;
}

footer a:hover {
  color: var(--primary);
}

/* ==========================================================================
   UI COMPONENTS (Cards, Buttons, Badges, Tables)
   ========================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.button:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
}

.button:active {
  transform: translateY(1px);
}

.button.secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}

.button.secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--ink);
  color: var(--ink);
}

.quiet-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.quiet-link:hover {
  color: var(--ink);
  background: var(--bg-subtle);
}

.text-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.text-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--ink-body);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.badge.green, .badge.teal {
  background: var(--accent-teal-bg);
  color: #0f766e;
  border-color: var(--accent-teal-border);
}

.badge.amber, .badge.yellow {
  background: var(--accent-amber-bg);
  color: #b45309;
  border-color: var(--accent-amber-border);
}

.badge.crimson, .badge.red {
  background: var(--primary-subtle);
  color: var(--primary);
  border-color: var(--primary-border);
}

.badge.blue {
  background: var(--accent-blue-bg);
  color: #0369a1;
  border-color: var(--accent-blue-border);
}

/* Page Heading Layout */
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.page-heading h1 {
  margin-bottom: 8px;
}

.page-heading p {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 0;
  max-width: 650px;
}

/* Filters & Search */
.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  flex: 1;
  min-width: 220px;
}

.search-field span {
  color: var(--muted-light);
  font-size: 16px;
}

.search-field input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--ink);
  width: 100%;
}

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

.search-field:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-subtle);
}

.filters select {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 32px 9px 12px;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  cursor: pointer;
}

.filters select:focus {
  border-color: var(--primary);
}

/* ==========================================================================
   LESSONS LIST & MODULE BLOCKS (/lessons/)
   ========================================================================== */

.module-groups {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.lesson-group {
  padding: 0;
  overflow: hidden;
}

.module-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
}

.module-number {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  background: var(--ink);
  color: white;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.module-heading h2 {
  font-size: 18px;
  margin: 0;
  font-weight: 700;
}

.module-heading .badge {
  margin-left: auto;
}

.lesson-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
  color: var(--ink-body);
}

.lesson-row:last-child {
  border-bottom: none;
}

.lesson-row:hover {
  background: var(--bg-subtle);
  color: var(--ink);
}

.lesson-row:hover h3 {
  color: var(--primary);
}

.lesson-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  min-width: 28px;
}

.lesson-row > div {
  flex: 1;
  min-width: 0;
}

.lesson-row h3 {
  font-size: 14px;
  margin: 0 0 3px 0;
  font-weight: 600;
  transition: color 0.15s ease;
}

.lesson-time {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* ==========================================================================
   LESSON DETAIL & CS50 READING PROSE (/lessons/<number>/)
   ========================================================================== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 16px;
}

.back-link:hover {
  color: var(--primary);
}

.detail-title {
  font-size: 34px;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.lead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 800px;
  margin-bottom: 20px;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 36px;
  align-items: start;
}

/* CS50 High-Contrast Reading Document */
.prose {
  padding: 36px 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink-body);
}

.prose h2 {
  font-size: 22px;
  margin-top: 36px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 17px;
  margin-top: 24px;
  margin-bottom: 8px;
}

.prose p {
  margin-bottom: 18px;
}

.prose ul, .prose ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.prose li {
  margin-bottom: 6px;
}

.prose section + section {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
}

/* Callouts / Objectives */
.objective {
  background: var(--accent-teal-bg);
  border: 1px solid var(--accent-teal-border);
  border-left: 4px solid var(--accent-teal);
  padding: 18px 22px;
  border-radius: var(--radius-sm);
  margin-bottom: 28px;
}

.objective .eyebrow {
  color: var(--accent-teal);
  margin-bottom: 6px;
}

.objective p {
  color: #134e4a;
  font-weight: 500;
  margin: 0;
}

.prose blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--bg-subtle);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  font-style: italic;
}

.prose blockquote p:last-child {
  margin: 0;
}

/* Inline Code & Code Blocks */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.prose p code, .prose li code {
  background: var(--bg-muted);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.codehilite {
  position: relative;
  background: #1e242e; /* Dark terminal block within light page - crisp CS50 style */
  color: #e2e8f0;
  border-radius: var(--radius);
  margin: 24px 0;
  overflow: hidden;
  border: 1px solid #334155;
}

.codehilite pre {
  margin: 0;
  padding: 44px 20px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.copy-code {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(255,255,255,0.1);
  color: #cbd5e1;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-code:hover {
  background: rgba(255,255,255,0.2);
  color: white;
}

/* Tables inside prose */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}

.prose th, .prose td {
  padding: 10px 14px;
  border: 1px solid var(--line);
  text-align: left;
}

.prose th {
  background: var(--bg-subtle);
  font-weight: 600;
  color: var(--ink);
}

/* Reading Aside */
.reading-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 90px;
}

.reading-aside .card {
  padding: 20px;
}

.reading-aside h3 {
  font-size: 14px;
  margin-bottom: 12px;
  color: var(--ink);
}

.reading-aside a {
  display: block;
  font-size: 13px;
  color: var(--ink-body);
  padding: 6px 0;
  border-bottom: 1px solid var(--bg-subtle);
}

.reading-aside a:last-child {
  border-bottom: none;
}

.reading-aside a:hover {
  color: var(--primary);
  padding-left: 4px;
}

/* Pagination */
.lesson-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 36px;
}

.lesson-pagination a {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lesson-pagination span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}

.lesson-pagination strong {
  font-size: 14px;
  color: var(--ink);
}

.lesson-pagination a:hover strong {
  color: var(--primary);
}

/* ==========================================================================
   CATALOG / MATERIALS / DOCUMENTS (/materials/, /documents/)
   ========================================================================== */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.cards-grid.two-columns {
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
}

.catalog-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.file-icon {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: var(--ink);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
}

.catalog-card h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.catalog-card h2 a:hover {
  color: var(--primary);
}

.catalog-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.resource-relations {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.resource-relations a {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
}

.resource-relations a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Empty State */
.empty {
  padding: 48px 32px;
  text-align: center;
  grid-column: 1 / -1;
  background: var(--bg-subtle);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.reset {
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  padding: 6px 10px;
}

.reset:hover {
  color: var(--primary);
}

.demo-notice {
  background: var(--accent-amber-bg);
  border: 1px solid var(--accent-amber-border);
  color: #92400e;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 13px;
}

/* Video Cards & Player */
.video-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.video-cover {
  position: relative;
  height: 160px;
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.video-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  position: absolute;
  z-index: 2;
  transition: transform 0.15s ease, background 0.15s ease;
}

.video-cover:hover .play {
  transform: scale(1.1);
  background: var(--primary);
}

.duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: white;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.video-info {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.video-info h3 {
  font-size: 15px;
  margin: 0;
}

.video-info p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.video-pattern {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  font-weight: 600;
  padding: 20px;
}

.video-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 24px 0;
}

.external-video {
  padding: 48px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 24px 0;
}

/* Project Cards */
.project-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.project-art {
  height: 160px;
  background: var(--bg-muted);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
}

.project-art span {
  font-size: 36px;
  color: var(--primary);
}

.project-art small {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.project-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-info h2 {
  font-size: 18px;
  margin: 0;
}

.project-info p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.resource-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  margin-bottom: 10px;
}

/* ==========================================================================
   VOLUMETRIC DARK FOOTER (Screenshot 2 Style)
   ========================================================================== */

.volumetric-footer {
  display: block;
  background: #0b1329;
  color: #cbd5e1;
  padding: 56px 0 32px;
  margin-top: 64px;
  border-top: 1px solid #1e293b;
  width: 100%;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1.1fr 1fr 1.1fr;
  gap: 48px;
}

.brand-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.footer-code-icon {
  width: 32px;
  height: 32px;
  background: #ffffff;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: #0b1329;
  flex-shrink: 0;
}

.footer-brand-text strong {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}

.footer-about {
  font-size: 13px;
  line-height: 1.6;
  color: #94a3b8;
  margin: 0;
  max-width: 320px;
}

.footer-badge-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.footer-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
}

.footer-col-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.05em;
  margin: 0 0 16px 0;
  text-transform: uppercase;
}

.footer-tech-list, .footer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-tech-list li {
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

.footer-tech-list li span {
  color: #38bdf8;
  margin-right: 8px;
  font-weight: 700;
}

.footer-nav-list a {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.6;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-nav-list a:hover {
  color: #ffffff;
}

.footer-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid #1e293b;
  font-size: 12px;
  color: #64748b;
  flex-wrap: wrap;
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-bottom-links a {
  color: #94a3b8;
  text-decoration: none;
}

.footer-bottom-links a:hover {
  color: #ffffff;
}

.footer-sep {
  color: #334155;
}

/* ==========================================================================
   RESPONSIVENESS
   ========================================================================== */

@media (max-width: 900px) {
  .site-header {
    padding: 0 20px;
  }
  
  .menu-button {
    display: block;
  }
  
  .sidebar {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    flex-direction: column;
    align-items: stretch;
    padding: 20px;
    border-bottom: 1px solid var(--line);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 40;
  }
  
  .sidebar.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  
  .nav-link {
    font-size: 15px;
    padding: 12px 16px;
  }
  
  .shell main {
    padding: 28px 20px 48px;
  }
  
  .reading-layout {
    grid-template-columns: 1fr;
  }
  
  .reading-aside {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
  
  .cards-grid.two-columns {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
}

@media (max-width: 600px) {
  h1 { font-size: 28px; }
  h2 { font-size: 20px; }
  
  .page-heading {
    flex-direction: column;
  }
  
  .lesson-pagination {
    grid-template-columns: 1fr;
  }
  
  .prose {
    padding: 24px 20px;
  }
  
  .lesson-row {
    padding: 14px 16px;
    gap: 12px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .footer-container {
    padding: 0 20px;
    gap: 36px;
  }
  
  .footer-bottom-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}
