/* ==========================================================================
   Python4Physics - Physics Laboratory Design System
   Typography: 'Outfit' (Headings), 'Inter' (Body), 'JetBrains Mono' (Code), 'STIX Two Text' (Math)
   Aesthetic: Scholarly, Precise, Laboratory Notebook & Scientific Terminal
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@500;600;700;800&family=STIX+Two+Text:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');

:root {
  /* Dark Theme (Default) - Scientific Slate / Blackboard Terminal */
  --bg: #090d16;
  --bg-secondary: #0f1626;
  --bg-tertiary: #162035;
  --card-bg: #0f1626;
  --card-bg-solid: #131d31;
  --card-border: rgba(148, 163, 184, 0.12);
  --card-hover-border: rgba(56, 189, 248, 0.45);
  --card-hover-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(56, 189, 248, 0.2);

  /* Millimeter Graph Coordinate Grid */
  --grid-line: rgba(56, 189, 248, 0.035);
  --grid-major: rgba(56, 189, 248, 0.075);
  
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Physical Emission Lines & Spectroscopy Palette */
  --primary: #3b82f6;               /* Royal Quantum Blue */
  --primary-glow: rgba(59, 130, 246, 0.25);
  --accent: #38bdf8;                /* Laser Cyan / Deuterium */
  --accent-glow: rgba(56, 189, 248, 0.25);
  --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
  --accent-gradient-subtle: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(37, 99, 235, 0.08));
  
  --bg-equations: url('../images/physics-equations-bg.svg');
  
  --success: #10b981;               /* 532nm Nd:YAG Laser Green */
  --warning: #f59e0b;               /* Sodium-D Line 589nm Gold/Amber */
  --danger: #f43f5e;                /* 632.8nm He-Ne Laser Crimson */
  --purple: #8b5cf6;                /* 365nm UV Mercury Line */
  
  --navbar-bg: rgba(9, 13, 22, 0.92);
  --navbar-border: rgba(148, 163, 184, 0.12);
  --dropdown-bg: #131d31;
  
  --code-bg: #060911;
  --code-border: rgba(148, 163, 184, 0.12);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 6px 18px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 14px 34px -8px rgba(0, 0, 0, 0.6);
  
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  /* Light Theme - Archival Scientific Paper / Laboratory Journal */
  --bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --card-bg: #ffffff;
  --card-bg-solid: #ffffff;
  --card-border: #e2e8f0;
  --card-hover-border: #2563eb;
  --card-hover-shadow: 0 12px 30px -8px rgba(15, 23, 42, 0.08), 0 0 1px 1px rgba(37, 99, 235, 0.18);
  
  /* Millimeter Graph Coordinate Grid (Paper) */
  --grid-line: rgba(15, 23, 42, 0.035);
  --grid-major: rgba(15, 23, 42, 0.075);

  --text: #0f172a;                  /* Oxford Dark Slate */
  --text-muted: #475569;
  --text-dim: #94a3b8;
  
  --primary: #1d4ed8;               /* Oxford Blue */
  --primary-glow: rgba(29, 78, 216, 0.15);
  --accent: #0284c7;                /* Cobalt Cyan */
  --accent-glow: rgba(2, 132, 199, 0.15);
  --accent-gradient: linear-gradient(135deg, #0284c7 0%, #1d4ed8 100%);
  --accent-gradient-subtle: linear-gradient(135deg, rgba(2, 132, 199, 0.06), rgba(29, 78, 216, 0.06));
  
  --bg-equations: url('../images/physics-equations-bg-light.svg');
  
  --success: #059669;
  --warning: #d97706;
  --danger: #e11d48;
  --purple: #7c3aed;
  
  --navbar-bg: rgba(255, 255, 255, 0.94);
  --navbar-border: #e2e8f0;
  --dropdown-bg: #ffffff;
  
  --code-bg: #0f172a;
  --code-border: #e2e8f0;
  
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 18px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 14px 34px -8px rgba(15, 23, 42, 0.12);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  /* Millimeter Graph Coordinate Grid Background (Authentic Lab Notebook Texture) */
  background-image: 
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px, 120px 120px, 120px 120px;
  background-position: center top;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  max-width: 100vw;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
}

/* Fullscreen Authentic Physics Equations & Diagrams Vector Watermark Layer */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--bg-equations);
  background-repeat: repeat-y;
  background-position: center top;
  background-size: 1550px auto;
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s ease, background-image 0.3s ease;
}

[data-theme="light"] body::before {
  opacity: 0.08;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

h1 { font-size: 2.4rem; letter-spacing: -0.02em; }
h2 { font-size: 1.9rem; letter-spacing: -0.015em; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }

p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

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

code, pre, kbd, samp {
  font-family: 'JetBrains Mono', monospace;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1320px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  position: relative;
  z-index: 1;
}

.container-fluid {
  width: 100%;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  position: relative;
  z-index: 1;
}

/* Scientific Laboratory Module Cards (High Legibility, Precision Borders) */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.glass-card.highlight {
  border-color: rgba(56, 189, 248, 0.35);
  background: var(--card-bg-solid);
}

/* Physics Precision Heading Accent */
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  font-weight: 800;
}

/* Buttons */
.btn-modern {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-modern:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--card-bg-solid);
  color: var(--text) !important;
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent);
  color: var(--accent) !important;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--accent) !important;
  border: 1px solid var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}

.btn-sm {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Scientific Badges & Notation Chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-cyan {
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-purple {
  background: rgba(139, 92, 246, 0.12);
  color: var(--purple);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.badge-crimson {
  background: rgba(244, 63, 94, 0.12);
  color: var(--danger);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

/* Fundamental Physics Constants Strip */
.physics-constants-strip {
  display: flex;
  align-items: center;
  overflow-x: auto;
  white-space: nowrap;
  padding: 0.65rem 1.25rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--card-border);
  border-bottom: 1px solid var(--card-border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  gap: 1.75rem;
  scrollbar-width: thin;
}

.physics-constant-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.physics-constant-item .sym {
  color: var(--accent);
  font-weight: 600;
}

.physics-constant-item .val {
  color: var(--text);
  font-weight: 500;
}

.physics-constant-item .unit {
  color: var(--text-dim);
  font-size: 0.72rem;
}

/* Modern Laboratory Header */
.site-navbar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--navbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--navbar-border);
  transition: var(--transition);
}

.site-navbar .container {
  max-width: 100%;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 0.75rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.28rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 40px;
  max-width: 130px;
  object-fit: contain;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--accent-gradient);
  color: #fff;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-full);
  margin-left: 0.2rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.nav-link-item:hover, .nav-link-item.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link-item.active {
  color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  font-weight: 600;
}

[data-theme="light"] .nav-link-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* Stylish Modern Classic v1 Archive Badge Link */
.btn-classic-archive {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.72rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.btn-classic-archive:hover {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2);
}

.btn-classic-archive i.fa-clock-rotate-left {
  color: #f59e0b;
  font-size: 0.84rem;
  transition: transform 0.4s ease;
}

.btn-classic-archive:hover i.fa-clock-rotate-left {
  transform: rotate(-360deg);
}

.btn-classic-archive .classic-external-icon {
  font-size: 0.62rem;
  opacity: 0.65;
  margin-left: 1px;
}

[data-theme="light"] .btn-classic-archive {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-muted);
}

[data-theme="light"] .btn-classic-archive:hover {
  background: rgba(217, 119, 6, 0.08);
  border-color: rgba(217, 119, 6, 0.3);
  color: #b45309;
}

@media (max-width: 992px) {
  .btn-classic-archive .classic-text,
  .btn-classic-archive .classic-external-icon {
    display: none;
  }
  .btn-classic-archive {
    padding: 0.4rem 0.55rem;
  }
}

@media (max-width: 768px) {
  .btn-classic-archive {
    display: none;
  }
}

/* Quick Search Trigger in Navbar */
.nav-search-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-dim);
  font-size: 0.84rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-search-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.18);
}

.nav-search-btn kbd {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: inherit;
  border: 1px solid var(--card-border);
}

/* Theme Toggle Button - Modern Lab Interactive Switch */
.theme-toggle-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  color: var(--text);
  height: 40px;
  padding: 0 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  transition: var(--transition);
  flex-shrink: 0;
  white-space: nowrap;
  user-select: none;
}

.theme-toggle-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 2px 12px rgba(56, 189, 248, 0.22);
}

.theme-toggle-btn i {
  font-size: 1rem;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle-btn:hover i {
  transform: rotate(20deg) scale(1.15);
}

.theme-toggle-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.theme-toggle-btn:hover .theme-toggle-label {
  color: var(--text);
}

/* Mobile Drawer Theme Row */
.mobile-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.mobile-theme-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-theme-toggle-btn {
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  font-size: 0.84rem;
}

/* Mobile Hamburger */
.mobile-nav-toggle {
  display: none;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* Global Command Palette / Search Modal */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.search-modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.search-modal {
  background: var(--card-bg-solid);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 680px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transform: translateY(-15px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-modal-backdrop.active .search-modal {
  transform: translateY(0);
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
}

.search-input-wrapper i {
  color: var(--accent);
  font-size: 1.25rem;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1.15rem;
  font-family: inherit;
}

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

.search-results-container {
  max-height: 420px;
  overflow-y: auto;
  padding: 0.75rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
  margin-bottom: 0.25rem;
}

.search-result-item:hover, .search-result-item.selected {
  background: rgba(56, 189, 248, 0.12);
  border-left: 3px solid var(--accent);
}

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

.search-result-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-modal-footer {
  padding: 0.75rem 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--card-bg-solid);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  min-width: 260px;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast-success i {
  color: var(--success);
}

.toast-error {
  border-left: 4px solid var(--danger);
}

.toast-error i {
  color: var(--danger);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Modern Footer */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--navbar-border);
  padding-top: 4rem;
  padding-bottom: 2rem;
  margin-top: 6rem;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand h3 {
  margin-bottom: 0.75rem;
}

.footer-col h4 {
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  color: var(--text);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.faculty-pill {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.faculty-pill-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.faculty-pill-affil {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--navbar-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-dim);
}

/* Responsive Rules - Zero Horizontal Scroll & Guaranteed Theme Switcher Visibility */
@media (max-width: 1440px) {
  .nav-search-btn span, .nav-search-btn kbd {
    display: none;
  }
  .nav-search-btn {
    padding: 0.4rem 0.6rem;
  }
  .nav-link-item {
    padding: 0.4rem 0.45rem;
    font-size: 0.82rem;
    gap: 0.2rem;
  }
}

@media (max-width: 1260px) {
  .theme-toggle-label {
    display: none;
  }
  .theme-toggle-btn {
    padding: 0;
    width: 40px;
    height: 40px;
  }
  .nav-link-item {
    padding: 0.35rem 0.4rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 1160px) {
  .nav-links {
    display: none;
  }
  .mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .theme-toggle-label {
    display: none;
  }
  .theme-toggle-btn {
    padding: 0;
    width: 40px;
    height: 40px;
  }
  .nav-search-btn span, .nav-search-btn kbd {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .site-navbar .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .navbar-inner {
    height: 62px;
    gap: 0.4rem;
  }
  .brand-link {
    font-size: 1.1rem;
    gap: 0.4rem;
  }
  .brand-link i {
    font-size: 1.3rem !important;
  }
  .brand-badge {
    display: none;
  }
  .nav-actions {
    gap: 0.35rem;
  }
  .nav-search-btn, .theme-toggle-btn, .mobile-nav-toggle {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
    padding: 0;
  }
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* ==========================================================================
   Physics Laboratory Specialty Components
   ========================================================================== */

/* Formula Chip & Mathematical Notations */
.physics-formula-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'STIX Two Text', 'KaTeX_Math', serif;
  font-size: 0.95rem;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.physics-metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  padding: 0.2rem 0.55rem;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
}

/* Simulation Canvas Telemetry Overlay */
.canvas-telemetry {
  position: absolute;
  bottom: 1rem;
  left: 1.5rem;
  z-index: 2;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(4px);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  pointer-events: none;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}

[data-theme="light"] .canvas-telemetry {
  background: rgba(255, 255, 255, 0.9);
}

.canvas-telemetry span.active-val {
  color: var(--accent);
  font-weight: 600;
}

/* Engineering Top Accent on Cards */
.glass-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: var(--transition);
}

.glass-card:hover::after {
  background: var(--accent-gradient);
}

/* Ambient Physics Mathematical Watermarks */
.physics-watermark {
  position: absolute;
  font-family: 'STIX Two Text', 'KaTeX_Math', serif;
  font-size: clamp(1.4rem, 2.6vw, 2.4rem);
  color: var(--accent);
  opacity: 0.15;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
  transition: opacity 0.3s ease;
}

[data-theme="light"] .physics-watermark {
  color: var(--primary);
  opacity: 0.10;
}

/* Simulation Field Potential Mode Switcher Buttons */
.potential-mode-btn {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  pointer-events: auto;
  transition: var(--transition);
}

.potential-mode-btn:hover, .potential-mode-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(56, 189, 248, 0.14);
}

/* ==========================================================================
   Interactive Physics Parameter Studio & Sliders
   ========================================================================== */
.param-slider-studio {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  transition: var(--transition);
}

.param-slider-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  padding-bottom: 0.75rem;
}

.param-studio-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.param-sliders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem 1.75rem;
}

.param-slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.param-slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.param-slider-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.physics-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.25);
  outline: none;
  transition: background 0.2s;
  cursor: pointer;
}

.physics-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.5);
  cursor: pointer;
  transition: transform 0.15s, background-color 0.15s;
}

.physics-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #0284c7;
}

.physics-range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  cursor: pointer;
}

/* Real-Time Live Telemetry HUD Bar */
.param-hud-ribbon {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.95rem;
  margin-top: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.param-hud-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.param-hud-val {
  color: var(--accent);
  font-weight: 700;
}

.param-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.status-laminar {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-turbulent {
  background: rgba(244, 63, 94, 0.15);
  color: var(--danger);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.status-transitional {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   Hero Interactive Physics Domain Pillars (Flagship Discovery Modules)
   ========================================================================== */
.p4p-pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  width: 100%;
  margin: 0 auto;
  text-align: left;
}

@media (max-width: 1100px) {
  .p4p-pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .p4p-pillars-grid {
    grid-template-columns: 1fr;
  }
}

.p4p-pillar-card {
  background: var(--card-bg-solid, #131d31);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.p4p-pillar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.25s ease;
}

/* Card Specific Theming */
.p4p-pillar-card.card-python:hover {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 12px 30px -6px rgba(56, 189, 248, 0.22), 0 0 0 1px rgba(56, 189, 248, 0.35);
  transform: translateY(-6px);
}
.p4p-pillar-card.card-python::before {
  background: linear-gradient(90deg, #38bdf8, #2563eb);
}

.p4p-pillar-card.card-gnuplot:hover {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: 0 12px 30px -6px rgba(245, 158, 11, 0.22), 0 0 0 1px rgba(245, 158, 11, 0.35);
  transform: translateY(-6px);
}
.p4p-pillar-card.card-gnuplot::before {
  background: linear-gradient(90deg, #f59e0b, #ea580c);
}

.p4p-pillar-card.card-latex:hover {
  border-color: rgba(168, 85, 247, 0.55);
  box-shadow: 0 12px 30px -6px rgba(168, 85, 247, 0.22), 0 0 0 1px rgba(168, 85, 247, 0.35);
  transform: translateY(-6px);
}
.p4p-pillar-card.card-latex::before {
  background: linear-gradient(90deg, #a855f7, #6366f1);
}

.p4p-pillar-card.card-arduino:hover {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 12px 30px -6px rgba(16, 185, 129, 0.22), 0 0 0 1px rgba(16, 185, 129, 0.35);
  transform: translateY(-6px);
}
.p4p-pillar-card.card-arduino::before {
  background: linear-gradient(90deg, #10b981, #059669);
}

/* Header with Icon and Badge */
.p4p-pillar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.p4p-pillar-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: transform 0.25s ease;
}
.p4p-pillar-card:hover .p4p-pillar-icon {
  transform: scale(1.1);
}

.py-icon { background: rgba(56, 189, 248, 0.12); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.25); }
.gnu-icon { background: rgba(245, 158, 11, 0.12); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.25); }
.tex-icon { background: rgba(168, 85, 247, 0.12); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.25); }
.ard-icon { background: rgba(16, 185, 129, 0.12); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.25); }

.p4p-pillar-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.py-badge { background: rgba(56, 189, 248, 0.1); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.2); }
.gnu-badge { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.tex-badge { background: rgba(168, 85, 247, 0.1); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.2); }
.ard-badge { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }

/* Typography */
.p4p-pillar-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
  line-height: 1.25;
}

.p4p-pillar-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.85rem;
  min-height: 2.8em;
}

/* Micro-Preview Visual Container */
.p4p-pillar-preview {
  background: rgba(6, 9, 17, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .p4p-pillar-preview {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.p4p-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  color: var(--text-dim);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  padding-bottom: 0.3rem;
}

.p4p-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 3px;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.p4p-code-line {
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  font-size: 0.7rem;
}
.p4p-code-line .c-kw { color: #f43f5e; font-weight: 600; }
.p4p-code-line .c-fn { color: #38bdf8; font-weight: 600; }
.p4p-code-line .c-var { color: #f59e0b; }
.p4p-code-line .c-num { color: #10b981; }

.p4p-formula-display {
  font-size: 0.92rem;
  color: #e9d5ff;
  text-align: center;
  margin: 3px 0;
  font-family: 'STIX Two Text', serif;
}

[data-theme="light"] .p4p-formula-display {
  color: #6b21a8 !important;
}

[data-theme="light"] .p4p-pillar-preview .p4p-code-line {
  color: #334155;
}

[data-theme="light"] .p4p-pillar-preview .p4p-preview-header {
  color: #64748b;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

/* SVG Animated Wave / Orbit */
.p4p-curve-svg {
  width: 100%;
  height: 38px;
  display: block;
}
.p4p-animated-orbit {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  animation: p4pTraceOrbit 3.5s ease-in-out infinite alternate;
}
@keyframes p4pTraceOrbit {
  0% { stroke-dashoffset: 220; }
  100% { stroke-dashoffset: 0; }
}

/* Pulsing Hardware Telemetry */
.p4p-live-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  display: inline-block;
  animation: p4pBlink 1.4s infinite;
}
@keyframes p4pBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.85); }
}

.p4p-scope-trace {
  stroke-dasharray: 200;
  animation: p4pScopeTrace 2.2s linear infinite;
}
@keyframes p4pScopeTrace {
  from { stroke-dashoffset: 200; }
  to { stroke-dashoffset: 0; }
}

/* Micro-Tags Ribbon */
.p4p-pillar-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.p4p-mini-chip {
  font-size: 0.68rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.15);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--text-dim);
}
.p4p-pillar-card:hover .p4p-mini-chip {
  color: var(--text-muted);
  border-color: rgba(148, 163, 184, 0.25);
}

/* Footer Action */
.p4p-pillar-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  transition: color 0.2s ease;
}
.p4p-pillar-action i {
  transition: transform 0.2s ease;
}
.p4p-pillar-card:hover .p4p-pillar-action i {
  transform: translateX(5px);
}
.card-python .p4p-pillar-action { color: #38bdf8; }
.card-gnuplot .p4p-pillar-action { color: #f59e0b; }
.card-latex .p4p-pillar-action { color: #c084fc; }
.card-arduino .p4p-pillar-action { color: #10b981; }

