/* ==========================================================================
   BMW E46 PWM Fan Controller Tutorial Design System & Styles
   Theme: Sleek Dark / Carbon / BMW Amber Accent / M-Performance Accents
   ========================================================================== */

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

:root {
  /* Colors */
  --bg-darker: #08090b;
  --bg-dark: #0f1115;
  --bg-light: #16191f;
  --card-bg: rgba(22, 25, 31, 0.65);
  --card-bg-hover: rgba(28, 32, 40, 0.85);
  --border-light: rgba(255, 255, 255, 0.07);
  --border-glow: rgba(255, 140, 0, 0.3);
  
  /* BMW Classic Amber Instrument Cluster color */
  --bmw-amber: #ff8c00;
  --bmw-amber-glow: rgba(255, 140, 0, 0.5);
  --bmw-amber-dim: rgba(255, 140, 0, 0.15);
  
  /* BMW M-Stripes Colors */
  --m-blue: #00a4e4;
  --m-navy: #002e7a;
  --m-red: #e10600;
  
  /* Status Colors */
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Layout & Animations */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 16px;
  --shadow-glow: 0 0 20px var(--bmw-amber-glow);
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--bmw-amber) var(--bg-dark);
  scrollbar-width: thin;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-darker);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Carbon Fiber/Grid Background overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background: 
    linear-gradient(rgba(8, 9, 11, 0.95), rgba(8, 9, 11, 0.95)),
    radial-gradient(circle at 50% 50%, rgba(255, 140, 0, 0.08) 0%, transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.007) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.007) 1px, transparent 1px) 0 0 / 40px 40px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-light);
  border-radius: 10px;
  border: 2px solid var(--bg-darker);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--bmw-amber);
}

/* Typography & Layout Utilities */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.1;
  font-weight: 800;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--bmw-amber), var(--m-red));
  border-radius: 2px;
}

p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

a {
  color: var(--bmw-amber);
  text-decoration: none;
  transition: var(--transition-smooth);
}
a:hover {
  color: var(--text-primary);
  text-shadow: 0 0 8px var(--bmw-amber-glow);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* M-Performance Stripes Header Accent */
.m-stripes {
  height: 6px;
  width: 100%;
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}
.stripe-blue { flex: 1; background-color: var(--m-blue); }
.stripe-navy { flex: 1; background-color: var(--m-navy); }
.stripe-red { flex: 1; background-color: var(--m-red); }

/* ==========================================================================
   Header & Hero Section
   ========================================================================== */
header {
  padding: 2.5rem 0 1rem;
  border-bottom: 1px solid var(--border-light);
  background: rgba(8, 9, 11, 0.8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 6px;
  z-index: 999;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.logo span {
  color: var(--bmw-amber);
  text-shadow: 0 0 10px var(--bmw-amber-glow);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--bmw-amber);
}

.hero {
  padding: 8rem 0 6rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 140, 0, 0.1);
  border: 1px solid var(--border-glow);
  padding: 0.5rem 1rem;
  border-radius: 100px;
  color: var(--bmw-amber);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 2rem;
  backdrop-filter: blur(5px);
}

.hero-title span {
  display: block;
  background: linear-gradient(135deg, #ffffff 30%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title em {
  font-style: normal;
  color: var(--bmw-amber);
  text-shadow: 0 0 20px var(--bmw-amber-glow);
}

.hero p {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 2.5rem;
  max-width: 600px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bmw-amber);
  color: var(--bg-darker);
  font-weight: 700;
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
}

.btn:hover {
  background: #ffaa33;
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
  color: var(--bg-darker);
}

/* Hero graphic of fan */
.hero-graphic {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.shroud-svg-container {
  width: 100%;
  max-width: 380px;
  filter: drop-shadow(0 15px 35px rgba(0,0,0,0.7));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
}

/* ==========================================================================
   Common Section Styles
   ========================================================================== */
section {
  padding: 6rem 0;
  border-top: 1px solid var(--border-light);
}

.section-header {
  margin-bottom: 4rem;
  text-align: center;
}

.section-header p {
  max-width: 600px;
  margin: 1rem auto 0;
}

/* Glass Card styling */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  padding: 2.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  background: var(--card-bg-hover);
  border-color: var(--border-glow);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   Section 1: The Problem & Concept
   ========================================================================== */
.concept-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.info-block {
  margin-bottom: 2rem;
}

.info-block h3 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.info-block h3 i {
  color: var(--bmw-amber);
}

/* ==========================================================================
   Section 2: Parts List (Interactive Cards)
   ========================================================================== */
.parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.part-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.part-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 140, 0, 0.05);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  transition: var(--transition-smooth);
}

.part-card:hover .part-icon-wrap {
  background: rgba(255, 140, 0, 0.15);
  border-color: var(--bmw-amber);
  box-shadow: 0 0 15px var(--bmw-amber-glow);
  transform: scale(1.1);
}

.part-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.part-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  flex-grow: 1;
}

.part-card .price-tag {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--bmw-amber);
  letter-spacing: 0.05em;
  background: rgba(255, 140, 0, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
}

/* ==========================================================================
   Section 3: Wiring Schematic (Interactive SVG)
   ========================================================================== */
.schematic-box {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 3rem;
  align-items: center;
}

.schematic-graphic {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.interactive-schematic-svg {
  width: 100%;
  height: auto;
  max-width: 650px;
}

/* Schematic SVG interactive styles */
.schematic-node {
  cursor: pointer;
  transition: var(--transition-smooth);
}

.schematic-node:hover {
  filter: drop-shadow(0 0 8px var(--bmw-amber-glow));
}

.wire-line {
  stroke-dasharray: 8, 4;
  animation: flow 30s linear infinite;
  transition: var(--transition-smooth);
}

.wire-line.active {
  stroke-width: 3;
  filter: drop-shadow(0 0 4px currentColor);
}

@keyframes flow {
  to {
    stroke-dashoffset: -1000;
  }
}

.schematic-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-pane {
  background: rgba(8, 9, 11, 0.5);
  border-left: 4px solid var(--bmw-amber);
  padding: 1.5rem;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.info-pane h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  color: var(--bmw-amber);
}

.info-pane p {
  font-size: 1rem;
}

.connection-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.connection-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.connection-item:hover, .connection-item.active {
  border-color: var(--bmw-amber);
  background: rgba(255, 140, 0, 0.05);
}

.connection-item span:first-child {
  font-weight: 600;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
}

.connection-item span:last-child {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ==========================================================================
   Section 4: Step-by-Step Slide Carousel
   ========================================================================== */
.carousel-container {
  position: relative;
  width: 100%;
}

.scroller-wrapper {
  overflow: hidden;
  position: relative;
  width: 100%;
  border-radius: var(--border-radius);
}

.scroller {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Hide scrollbar for standard browsers */
}

.scroller::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Webkit */
}

.slide-entry {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  padding: 1rem;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

.slide-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.slide-text h3 {
  font-size: 1.8rem;
  color: var(--bmw-amber);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.slide-number {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.1rem;
  background: var(--bmw-amber-dim);
  border: 1px solid var(--border-glow);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.slide-text p {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.slide-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.slide-list li {
  position: relative;
  padding-left: 1.75rem;
  color: var(--text-secondary);
}

.slide-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--success);
  font-weight: bold;
}

.slide-visual {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  padding: 2rem;
  height: 380px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

/* Animations for step slides */
.visual-animation-box {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.carousel-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  padding: 0 1rem;
}

.carousel-btn {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition-smooth);
}

.carousel-btn:hover {
  background: var(--bmw-amber);
  color: var(--bg-darker);
  border-color: var(--bmw-amber);
  box-shadow: 0 0 15px var(--bmw-amber-glow);
}

.carousel-dots {
  display: flex;
  gap: 0.75rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.dot.active {
  background: var(--bmw-amber);
  border-color: var(--bmw-amber);
  box-shadow: 0 0 8px var(--bmw-amber-glow);
  transform: scale(1.25);
}

/* Scroll-driven animations styling (progressive enhancement) */
@supports ((animation-timeline: view()) and (animation-range: entry)) {
  .scroller > * {
    /* Anonymous view progress timeline */
    animation: slide-fade auto linear both;
    animation-timeline: view(inline);
    animation-range: cover 20% cover 80%;
  }

  @keyframes slide-fade {
    0% {
      opacity: 0.3;
      transform: scale(0.92) translateX(50px);
      filter: blur(4px);
    }
    45%, 55% {
      opacity: 1;
      transform: scale(1) translateX(0);
      filter: blur(0);
    }
    100% {
      opacity: 0.3;
      transform: scale(0.92) translateX(-50px);
      filter: blur(4px);
    }
  }
}

/* ==========================================================================
   Section 5: Arduino Code Block & Syntax
   ========================================================================== */
.code-section-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 3rem;
  align-items: flex-start;
}

.code-container {
  background: #0d0e12;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}

.code-header {
  background: var(--bg-light);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
}

.code-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.code-title span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #007acc; /* Arduino blue-ish */
}

.btn-copy {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-copy:hover {
  background: var(--bmw-amber);
  color: var(--bg-darker);
  border-color: var(--bmw-amber);
}

.code-body {
  padding: 1.5rem;
  overflow-x: auto;
  max-height: 550px;
}

.code-body pre {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.95rem;
  tab-size: 4;
}

/* Syntax Highlighting */
.code-comment { color: #5c6370; font-style: italic; }
.code-keyword { color: #c678dd; }
.code-type { color: #e5c07b; }
.code-function { color: #61afef; }
.code-string { color: #98c379; }
.code-number { color: #d19a66; }
.code-macro { color: #e06c75; }

.code-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.feature-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.feature-tag {
  background: rgba(255, 140, 0, 0.06);
  border: 1px solid var(--border-glow);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--bmw-amber);
}

/* ==========================================================================
   Section 6: Interactive Simulator
   ========================================================================== */
.simulator-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.sim-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-label {
  font-weight: 600;
  font-size: 1.1rem;
}

.control-value {
  font-family: 'Roboto Mono', monospace;
  font-weight: 700;
  color: var(--bmw-amber);
  background: var(--bmw-amber-dim);
  padding: 0.2rem 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border-glow);
}

/* Custom Slider Styling */
.sim-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  outline: none;
  cursor: pointer;
}

.sim-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bmw-amber);
  border: 2px solid var(--text-primary);
  box-shadow: 0 0 10px var(--bmw-amber-glow);
  cursor: pointer;
  transition: transform 0.1s;
}

.sim-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.switch-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-light);
  transition: .4s;
  border-radius: 34px;
}

.slider-toggle:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: var(--text-primary);
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider-toggle {
  background-color: var(--bmw-amber);
}

input:checked + .slider-toggle:before {
  transform: translateX(24px);
}

.status-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.stat-card {
  background: rgba(8, 9, 11, 0.4);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.stat-card .label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.stat-card .value {
  font-family: 'Roboto Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
}

/* Visualization Panel */
.sim-visual-panel {
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.fan-shroud-svg {
  width: 280px;
  height: 280px;
  position: relative;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

.fan-blade {
  transform-origin: 140px 140px;
  animation: rotate-fan var(--spin-speed, 0s) linear infinite;
}

@keyframes rotate-fan {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.logic-pulses {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  background: rgba(0,0,0,0.5);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.pulse-bar {
  width: 4px;
  height: 20px;
  background: var(--border-light);
  transform-origin: bottom;
  transition: transform 0.1s;
}

.pulse-bar.active {
  background: var(--bmw-amber);
  box-shadow: 0 0 5px var(--bmw-amber-glow);
}

/* Fail safe warning indicator overlay */
.failsafe-alert {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(239, 68, 68, 0.95);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
  box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
}

.failsafe-alert.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  padding: 4rem 0;
  background: var(--bg-darker);
  border-top: 1px solid var(--border-light);
  text-align: center;
  color: var(--text-muted);
}

footer p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

footer .disclaimer {
  max-width: 700px;
  margin: 1.5rem auto 0;
  font-size: 0.8rem;
  line-height: 1.4;
}

/* ==========================================================================
   Responsive Media Queries
   ========================================================================== */
@media (max-width: 992px) {
  .hero-grid, .concept-grid, .schematic-box, .code-section-layout, .simulator-box {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .hero {
    padding: 5rem 0 4rem;
  }
  
  .hero-graphic {
    order: -1;
  }
  
  .slide-content-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .slide-visual {
    height: 300px;
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .container {
    padding: 0 1.5rem;
  }
  
  section {
    padding: 4rem 0;
  }
}
