/* ==========================================================================
   TransientPulse: RC Transient Circuit Laboratory Stylesheet
   Modern Dark High-Tech Aesthetic, Glassmorphism, Responsive Grid System
   ========================================================================== */

:root {
  --bg-primary: #070a12;
  --bg-secondary: #0d121f;
  --bg-card: rgba(18, 25, 42, 0.75);
  --bg-card-hover: rgba(24, 34, 58, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(0, 240, 255, 0.35);
  --border-amber: rgba(255, 170, 0, 0.35);
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  
  --cyan-primary: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.4);
  --amber-primary: #ffaa00;
  --amber-glow: rgba(255, 170, 0, 0.45);
  --green-ready: #10b981;
  --red-danger: #ef4444;
  --purple-accent: #a855f7;
  --blue-accent: #3b82f6;

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --shadow-glow: 0 0 25px var(--cyan-glow);
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-size: 16px;
  line-height: 1.6;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Typography Helpers */
h1, h2, h3, h4, h5 {
  color: #ffffff;
  font-weight: 700;
  line-height: 1.25;
}

p {
  color: var(--text-muted);
}

a {
  color: inherit;
  text-decoration: none;
}

.gradient-text {
  background: linear-gradient(135deg, #00f0ff 0%, #38bdf8 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-cyan { color: var(--cyan-primary) !important; }
.text-amber { color: var(--amber-primary) !important; }
.text-blue { color: var(--blue-accent) !important; }
.text-purple { color: var(--purple-accent) !important; }
.text-danger { color: var(--red-danger) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Strobe Whiteout Screen Overlay */
.flash-overlay {
  position: fixed;
  inset: 0;
  background-color: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 99999;
  transition: opacity 0.05s ease-out;
}

.flash-overlay.firing {
  opacity: 0.95;
  transition: none;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.section-pad {
  padding: 5rem 1.5rem;
}

.bg-darker {
  background-color: var(--bg-secondary);
}

.section-container {
  max-width: 1280px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 3rem;
}

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

.section-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.1);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 240, 255, 0.25);
  margin-bottom: 0.75rem;
}

.section-tag.glow {
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.section-title {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1.1rem;
  max-width: 760px;
  margin: 0 auto;
}

/* ==========================================================================
   HEADER & NAVBAR
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(7, 10, 18, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pulse-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #00f0ff, #0077ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #070a12;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.5);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.brand-sub {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--cyan-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
}

.nav-link.highlight-pill {
  color: var(--cyan-primary);
  background: rgba(0, 240, 255, 0.1);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 240, 255, 0.25);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.action-btn-outline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--cyan-primary);
  border: 1px solid rgba(0, 240, 255, 0.4);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.action-btn-outline:hover {
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  position: relative;
  padding: 6rem 1.5rem 5rem;
  overflow: hidden;
}

.hero-glow-bg {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 450px;
  background: radial-gradient(ellipse at center, rgba(0, 240, 255, 0.18) 0%, rgba(59, 130, 246, 0.08) 50%, transparent 75%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 1.5rem;
}

.badge-dot {
  width: 8px;
  height: 8px;
  background-color: var(--cyan-primary);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cyan-primary);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hero-title {
  font-size: 3.2rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.hero-description {
  font-size: 1.25rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 840px;
  margin-left: auto;
  margin-right: auto;
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: rgba(18, 25, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
}

.stat-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}

.stat-icon-wrapper.cyan { background: rgba(0, 240, 255, 0.12); color: var(--cyan-primary); }
.stat-icon-wrapper.amber { background: rgba(255, 170, 0, 0.12); color: var(--amber-primary); }
.stat-icon-wrapper.blue { background: rgba(59, 130, 246, 0.12); color: var(--blue-accent); }
.stat-icon-wrapper.purple { background: rgba(168, 85, 247, 0.12); color: var(--purple-accent); }

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: linear-gradient(135deg, #00f0ff 0%, #0088ff 100%);
  color: #070a12;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.5);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   PROBLEM VS. SOLUTION SECTION
   ========================================================================== */
.comparison-switch-wrapper {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.comp-switch-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(18, 25, 42, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.comp-switch-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.comp-switch-btn.active {
  color: #ffffff;
  background: rgba(30, 41, 69, 0.9);
  border-color: var(--cyan-primary);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
}

.comp-switch-btn[data-mode="direct"].active {
  border-color: var(--red-danger);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
}

.comparison-display-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  padding: 2.5rem;
}

.schematic-mini-preview {
  background: #0a0f1d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.visual-status-banner {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.status-indicator-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.05em;
}

.status-indicator-badge.error {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red-danger);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.status-indicator-badge.success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--green-ready);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.comp-heading {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.comp-body {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.comp-metrics-table {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}

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

.interactive-slider-box {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.slider-display {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--amber-primary);
}

.slider-caption {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 0.4rem;
}

/* ==========================================================================
   SYSTEM ARCHITECTURE & DETAIL DRAWER
   ========================================================================== */
.architecture-diagram-wrapper {
  padding: 2.5rem 1.5rem;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.arch-flow-diagram {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 900px;
  gap: 0.75rem;
}

.arch-node {
  background: rgba(18, 25, 42, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  flex: 1;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.arch-node:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(30, 41, 69, 0.9);
}

.arch-node.active {
  border-color: var(--cyan-primary);
  box-shadow: 0 0 20px var(--cyan-glow);
  background: rgba(24, 38, 66, 0.95);
}

.node-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  color: var(--cyan-primary);
}

.arch-node.active .node-icon {
  background: rgba(0, 240, 255, 0.15);
  color: #ffffff;
}

.node-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.node-spec {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.node-tag {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  color: #94a3b8;
}

.arch-connector {
  color: var(--text-subtle);
  display: flex;
  align-items: center;
}

.component-inspector-card {
  padding: 2rem;
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
}

.inspector-title-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.inspector-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(0, 240, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan-primary);
}

.inspector-name {
  font-size: 1.4rem;
}

.inspector-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.status-badge.live {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--green-ready);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.inspector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.inspector-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.inspector-box h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--cyan-primary);
}

.inspector-box p, .inspector-box ul {
  font-size: 0.88rem;
  line-height: 1.6;
}

.spec-list {
  list-style: none;
}

.spec-list li {
  margin-bottom: 0.4rem;
}

.math-block {
  overflow-x: auto;
  padding: 0.5rem 0;
}

/* ==========================================================================
   LIVE SIMULATION SANDBOX
   ========================================================================== */
.simulator-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin-bottom: 2rem;
}

.sim-left-panel, .sim-right-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.schematic-card, .virtual-camera-card, .control-deck-card, .execution-log-card {
  padding: 1.5rem;
}

.card-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
}

.state-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
}

.state-pill.charging {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
}

.state-pill.ready {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--green-ready);
  color: var(--green-ready);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.state-pill.flashing {
  background: rgba(255, 170, 0, 0.25);
  border-color: var(--amber-primary);
  color: var(--amber-primary);
}

/* Circuit SVG */
.schematic-canvas-container {
  background: #080c16;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.5rem;
  overflow: hidden;
}

.circuit-svg {
  width: 100%;
  height: auto;
  display: block;
}

.wire-base {
  stroke: #334155;
  stroke-width: 2.5;
  fill: none;
  stroke-linecap: round;
}

.comp-line {
  stroke: #94a3b8;
  stroke-linecap: round;
}

.comp-line.thick {
  stroke-width: 4;
}

.comp-line.thin {
  stroke-width: 2;
}

.resistor-path {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.svg-label {
  fill: #f8fafc;
  font-size: 14px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.svg-sublabel {
  fill: #64748b;
  font-size: 11px;
  font-family: var(--font-main);
}

.circuit-node {
  fill: #0ea5e9;
  stroke: #f8fafc;
  stroke-width: 2;
}

.circuit-node.node-b {
  fill: #f59e0b;
}

.svg-node-label {
  fill: #cbd5e1;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.switch-arm {
  stroke: #ffffff;
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cap-charge-indicator {
  fill: var(--cyan-primary);
  opacity: 0.2;
  transition: opacity 0.1s ease;
}

.flash-tube-box {
  fill: rgba(255, 170, 0, 0.08);
  stroke: rgba(255, 170, 0, 0.4);
  stroke-width: 2;
}

.tube-arc-path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 2.5;
}

.tube-arc-path.ignited {
  stroke: #ffffff;
  stroke-width: 4;
  filter: url(#glow-flash);
}

/* Switch Controls Bar */
.switch-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.ctrl-legend {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-group {
  display: flex;
  gap: 0.5rem;
}

.sim-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.sim-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sim-btn.mode-a.active {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.sim-btn.mode-n.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: #cbd5e1;
}

.sim-btn.mode-b.active {
  background: rgba(255, 170, 0, 0.25);
  border-color: var(--amber-primary);
  color: var(--amber-primary);
  box-shadow: 0 0 18px rgba(255, 170, 0, 0.4);
}

/* ==========================================================================
   VIRTUAL CAMERA WIDGET
   ========================================================================== */
.virtual-camera-card {
  background: #090e1a;
}

.camera-body-frame {
  background: #131a29;
  border: 2px solid #2d3748;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 10px 20px rgba(0, 0, 0, 0.4);
}

.camera-top-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.mode-dial {
  width: 44px;
  height: 24px;
  background: #2d3748;
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #4a5568;
}

.dial-mark {
  font-size: 0.75rem;
  font-weight: 800;
  color: #e2e8f0;
}

.hot-shoe {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flash-strobe-head {
  width: 90px;
  height: 48px;
  background: #1a202c;
  border: 2px solid #4a5568;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.reflector-cone {
  position: absolute;
  inset: 4px;
  background: radial-gradient(circle, #4a5568 0%, #1a202c 70%);
  border-radius: 4px;
}

.xenon-bulb-core {
  width: 44px;
  height: 10px;
  background: #cbd5e1;
  border-radius: 5px;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 2px #fff;
}

.flash-strobe-head.firing .xenon-bulb-core {
  background: #ffffff;
  box-shadow: 0 0 35px 20px #ffffff, 0 0 80px 40px #ffaa00;
}

.shutter-button-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.camera-shutter-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, #cbd5e1 30%, #64748b 90%);
  border: 3px solid #1e293b;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, box-shadow 0.1s;
}

.camera-shutter-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.shutter-ring {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 0, 0, 0.4);
}

.shutter-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  margin-top: 0.25rem;
}

/* Camera Viewfinder */
.camera-viewfinder {
  background: #050811;
  border: 2px solid #1e293b;
  border-radius: var(--radius-sm);
  height: 160px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.75rem;
  overflow: hidden;
}

.viewfinder-grid {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.crosshair {
  width: 40px;
  height: 40px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 50%;
}

.viewfinder-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.hud-tag {
  background: rgba(0, 0, 0, 0.5);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: #94a3b8;
  margin-right: 0.4rem;
}

.ready-led-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.ready-led-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ready-led-dot.red {
  background: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

.ready-led-dot.pulsing-green {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-ready 1.2s infinite;
}

@keyframes pulse-ready {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.9); }
}

.ready-led-text {
  font-size: 0.7rem;
  font-weight: 700;
  color: #e2e8f0;
}

.viewfinder-scene-art {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: auto;
  opacity: 0.4;
  gap: 0.35rem;
}

.scene-icon {
  width: 32px;
  height: 32px;
  color: #94a3b8;
}

.scene-text {
  font-size: 0.75rem;
  color: #94a3b8;
}

.camera-bottom-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

.secondary-btn-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.secondary-btn-sm:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   SLIDERS & PARAMETER DECK
   ========================================================================== */
.link-btn {
  background: none;
  border: none;
  color: var(--cyan-primary);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.sliders-vertical-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.slider-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.param-title {
  color: #cbd5e1;
}

.param-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cyan-primary);
  cursor: pointer;
  box-shadow: 0 0 10px var(--cyan-glow);
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.param-micro-expl {
  font-size: 0.72rem;
  color: var(--text-subtle);
}

/* Telemetry Grid */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.telemetry-card {
  padding: 1rem 1.25rem;
}

.telemetry-card.col-span-2 {
  grid-column: span 2;
}

.telemetry-card.highlight-border {
  border-color: rgba(0, 240, 255, 0.3);
}

.telem-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.telem-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.telem-icon {
  width: 16px;
  height: 16px;
  color: var(--text-subtle);
}

.telem-main-val {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.telem-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.telem-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.telem-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f0ff, #38bdf8);
  transition: width 0.1s linear;
}

.badge-accent {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  background: rgba(168, 85, 247, 0.15);
  color: var(--purple-accent);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.power-compare-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.divider-v {
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
}

/* Execution Log */
.log-stream-window {
  background: #060911;
  border-radius: var(--radius-sm);
  height: 110px;
  overflow-y: auto;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.log-entry.system { color: #94a3b8; }
.log-entry.charge { color: #38bdf8; }
.log-entry.flash { color: #f59e0b; font-weight: 700; }
.log-entry.ready { color: #10b981; }

.log-ts {
  color: #64748b;
  margin-right: 0.4rem;
}

/* ==========================================================================
   OSCILLOSCOPE & CHART
   ========================================================================== */
.oscilloscope-wrapper {
  padding: 1.75rem;
}

.scope-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.scope-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.scope-icon {
  width: 32px;
  height: 32px;
  color: var(--cyan-primary);
}

.scope-title {
  font-size: 1.25rem;
}

.scope-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.scope-tabs {
  display: flex;
  gap: 0.5rem;
}

.scope-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.scope-tab-btn.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
}

.chart-canvas-box {
  background: #060911;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  height: 340px;
  padding: 1rem;
  position: relative;
}

.chart-milestones-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.milestone-chip {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 0.75rem;
  line-height: 1.4;
}

.milestone-chip.cyan { border-left: 3px solid var(--cyan-primary); }
.milestone-chip.green { border-left: 3px solid var(--green-ready); }
.milestone-chip.amber { border-left: 3px solid var(--amber-primary); }
.milestone-chip.red { border-left: 3px solid var(--red-danger); }

/* ==========================================================================
   USE CASE SCENARIOS
   ========================================================================== */
.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.scenario-card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.scenario-badge {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.scenario-badge.standard { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.scenario-badge.highspeed { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.scenario-badge.industrial { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.scenario-title {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
}

.scenario-desc {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.scenario-stepper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.step-item {
  display: flex;
  gap: 0.75rem;
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cyan-primary);
  flex-shrink: 0;
}

.step-content {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.scenario-preset-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.scenario-preset-specs span {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
}

.load-scenario-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.load-scenario-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
}

/* ==========================================================================
   TECHNICAL KNOWLEDGE BASE
   ========================================================================== */
.kb-container {
  padding: 2rem;
}

.kb-nav-tabs {
  display: flex;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.kb-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.kb-tab-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.kb-tab-btn.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
}

.kb-pane {
  display: none;
}

.kb-pane.active {
  display: block;
}

.theory-article h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.theory-article p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.math-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.math-card.highlight-math {
  border-color: rgba(0, 240, 255, 0.3);
  background: rgba(0, 240, 255, 0.04);
}

.math-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--cyan-primary);
  margin-bottom: 0.5rem;
}

.math-content {
  overflow-x: auto;
  padding: 0.5rem 0;
}

/* Comparison Matrix Table */
.comparison-matrix-table table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

.comparison-matrix-table th, .comparison-matrix-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.comparison-matrix-table th {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.comparison-matrix-table td.good {
  color: var(--green-ready);
  font-weight: 600;
}

.comparison-matrix-table td.bad {
  color: var(--red-danger);
  font-weight: 600;
}

/* Feature Grid */
.feature-box-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.feature-subbox {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
}

.feature-subbox h4 {
  color: var(--amber-primary);
  margin-bottom: 0.5rem;
}

/* Calculator Grid */
.calc-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.calc-input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.calc-input-group input {
  width: 100%;
  background: #090e1a;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 1rem;
}

.calc-results-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
}

.calc-results-card h4 {
  margin-bottom: 1rem;
  color: #ffffff;
}

.calc-res-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
}

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

/* ==========================================================================
   FOOTER
   ========================================================================== */
.app-footer {
  background: #05070d;
  border-top: 1px solid var(--border-subtle);
  padding: 4rem 1.5rem 2rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-left {
  max-width: 400px;
}

.footer-desc {
  font-size: 0.85rem;
  margin-top: 1rem;
}

.footer-right {
  display: flex;
  gap: 4rem;
}

.footer-links-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.footer-links-group h4 {
  font-size: 0.9rem;
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.footer-links-group a {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.footer-links-group a:hover {
  color: var(--cyan-primary);
}

.footer-bottom-bar {
  max-width: 1280px;
  margin: 0 auto;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-subtle);
}

/* ==========================================================================
   RESPONSIVENESS (MOBILE / TABLET BREAKPOINTS)
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-title { font-size: 2.5rem; }
  .simulator-layout-grid { grid-template-columns: 1fr; }
  .scenarios-grid { grid-template-columns: 1fr; }
  .comparison-display-card { grid-template-columns: 1fr; }
  .chart-milestones-row { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
}

@media (max-width: 640px) {
  .hero-title { font-size: 2rem; }
  .hero-stats-grid { grid-template-columns: 1fr 1fr; }
  .telemetry-grid { grid-template-columns: 1fr; }
  .telemetry-card.col-span-2 { grid-column: span 1; }
  .power-compare-row { flex-direction: column; gap: 0.75rem; align-items: flex-start; }
  .divider-v { display: none; }
  .calc-form-grid { grid-template-columns: 1fr; }
  .feature-box-grid { grid-template-columns: 1fr; }
  .inspector-grid { grid-template-columns: 1fr; }
}
