/* ==================== CSS VARIABLES ==================== */
:root {
  --papt-red: #ED230D;
  --papt-yellow: #F1B517;
  --papt-green: #016A16;
  --papt-purple: #49108B;
  --papt-blue: #00209F;
  --papt-brown: #76453B;
  
  /* Haitian Flag Colors */
  --haiti-blue: #00209F;
  --haiti-red: #ED230D;

  /* Light Mode */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-accent: #f1f3f5;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #6c757d;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
  
  /* Typography */
  --font-display: 'Manrope', 'Inter', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Header */
  --header-h: 70px;
  --header-glass-rgb: 255 255 255;
  --header-glass-alpha: 0.65;
  --header-blur: 16px;
  --header-saturate: 140%;
  --header-contrast: 105%;
}

[data-theme="dark"] {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-accent: #1c2128;
  --text-primary: #e6edf3;
  --text-secondary: #b1bac4;
  --text-muted: #7d8590;
  --border-color: #30363d;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  
  --header-glass-rgb: 13 17 23;
  --header-glass-alpha: 0.55;
  --header-blur: 20px;
}

/* Brighten colors in dark mode */
[data-theme="dark"] .line-card,
[data-theme="dark"] .line-header,
[data-theme="dark"] .line-circle {
  filter: brightness(1.15);
}

html.loading * {
  transition: none !important;
}

/* ==================== INLINE SVG ICON STYLES (REPLACES FONT AWESOME) ==================== */
.icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.principle-icon.icon {
  width: 2.5rem;
  height: 2.5rem;
}

/* Theme icon specific sizing */
#theme-icon.icon {
  width: 1.05rem;
  height: 1.05rem;
}

/* ==================== GLOBAL STYLES ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  font-feature-settings: 'kern', 'liga';
  padding-top: var(--header-h);
  /* OPTIMIZED - Mobile scroll performance */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* OPTIMIZED - Prevent zoom on double-tap (but allow pinch zoom) */
* {
  touch-action: manipulation;
}

/* OPTIMIZED - Better tap highlight */
a, button, .stop-item, .concept-station-card {
  -webkit-tap-highlight-color: rgba(0, 32, 159, 0.2);
}

/* ==================== HEADER ==================== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  background: rgba(var(--header-glass-rgb) / var(--header-glass-alpha));
  -webkit-backdrop-filter: blur(var(--header-blur)) saturate(var(--header-saturate)) contrast(var(--header-contrast));
  backdrop-filter: blur(var(--header-blur)) saturate(var(--header-saturate)) contrast(var(--header-contrast));
  border-bottom: 1px solid rgba(var(--header-glass-rgb) / 0.18);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  min-height: var(--header-h);
  /* OPTIMIZED - Safe area for iOS */
  padding-top: max(0.75rem, env(safe-area-inset-top));
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

/* Inner layout: title left, nav + toggle right */
.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-header.solid { --header-glass-alpha: 0.88; }

/* Title */
.site-title { margin: 0; font-size: 1.85rem; line-height: 1; }
.site-title a { color: var(--text-primary); text-decoration: none; }
.site-title a:hover { color: var(--text-secondary); }

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  outline: none;
  transition: transform 0.3s ease;
}
.logo-img {
  height: 45px;
  width: auto;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.logo:hover .logo-img { transform: translateY(-3px); }
.logo:focus-visible {
  outline: 3px solid var(--haiti-blue);
  outline-offset: 4px;
  border-radius: 8px;
}
[data-theme="dark"] .logo-img { filter: brightness(1.1); }

/* Right-side cluster (nav + theme toggle) */
.header-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

/* Primary nav */
.main-nav { position: relative; }
.main-nav .nav-menu {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0; padding: 0;
}
.main-nav .nav-menu a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
}
.main-nav .nav-menu a:hover { color: var(--text-secondary); }

/* Hamburger (mobile only) */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 2px solid var(--border-color);
  background: rgba(var(--header-glass-rgb) / 0.5);
  color: var(--text-primary);
  cursor: pointer;
  min-height: 44px; /* OPTIMIZED - Touch target */
}

/* Theme toggle */
.theme-toggle {
  background: rgba(var(--header-glass-rgb) / 0.5);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px; /* OPTIMIZED - Touch target */
}
.theme-toggle:hover {
  background: var(--papt-blue);
  color: #fff;
  border-color: var(--papt-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 32, 159, 0.3);
}
.theme-toggle:focus-visible {
  outline: 3px solid var(--papt-blue);
  outline-offset: 2px;
}

/* Responsive behavior */
@media (max-width: 768px) {
  .site-header { padding: 0.75rem 0; }
  .nav-toggle { display: inline-flex; }

  /* Collapse menu into a dropdown */
  .main-nav .nav-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 10px;
    min-width: 220px;
    z-index: 1100;
    display: none;
  }
  .main-nav .nav-menu.open { display: flex; }

  .toggle-text { display: none; }
}

@media (min-width: 769px) {
  .nav-toggle { display: none; }
  .main-nav .nav-menu {
    position: static;
    display: flex !important;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    min-width: 0;
  }
}

/* Tiny screens */
@media (max-width: 420px) {
  .logo-img { height: 38px; }
}

/* ==================== SCROLL HERO (OPTIMIZED) ==================== */
.scroll-hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-primary);
  /* OPTIMIZED - Performance containment */
  contain: layout style paint;
}

.sign-container {
  position: sticky;
  top: var(--header-h);
  width: 100%;
  max-width: 1200px;
  height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  padding: 2rem;
}

.scroll-sign {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 12px;
  /* OPTIMIZED - GPU acceleration */
  will-change: opacity;
}
.scroll-sign.active { 
  opacity: 1;
  will-change: auto; /* Remove after transition */
}

/* OPTIMIZED - Mobile scroll hero adjustments */
@media (max-width: 768px) {
  .scroll-hero {
    /* Reduced height for mobile - smoother experience */
    height: 80vh;
  }
  
  .sign-container {
    height: calc(80vh - var(--header-h));
    padding: 1rem;
  }
}

/* ==================== INTRO SECTION ==================== */
.intro {
  text-align: center;
  background: var(--bg-primary);
  padding: 6rem 2rem;
  border-top: 1px solid var(--border-color);
  position: relative;
}

.intro-title {
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-logo {
  width: 100%;
  max-width: 450px;
  height: auto;
  display: block;
  margin: 0 auto;
  transition: transform 0.3s ease;
}

.intro-logo:hover {
  transform: scale(1.02);
}

[data-theme="dark"] .intro-logo {
  filter: brightness(1.1);
}

.tagline {
  font-size: 1.3rem;
  color: var(--text-secondary);
  max-width: 850px;
  margin: 0 auto 3rem;
  font-weight: 400;
  line-height: 1.7;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.stat-card {
  background: var(--bg-primary);
  padding: 2.5rem 2rem;
  border-radius: 16px;
  border: 2px solid var(--border-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  /* OPTIMIZED - Performance containment */
  contain: layout style paint;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--haiti-blue), var(--haiti-red));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--papt-blue);
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-card .number {
  font-size: 3.5rem;
  font-weight: 900;
  font-family: var(--font-display);
  color: var(--papt-blue);
  display: block;
  margin-bottom: 0.75rem;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stat-card .label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==================== SECTIONS ==================== */
section {
  padding: 6rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

section h2 {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 2rem;
  color: var(--text-primary);
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

section h3 {
  font-family: var(--font-display);
  font-weight: 800;
}

section p {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.highlight { 
  font-weight: 700; 
  color: var(--text-primary); 
}

.stat { 
  font-weight: 700;
  color: var(--papt-red);
  background: rgba(237, 35, 13, 0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .stat {
  background: rgba(237, 35, 13, 0.15);
  color: #ff5544;
}

/* ==================== DESIGN ETHOS ==================== */
.design-ethos { 
  background: var(--bg-secondary); 
}

.design-principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.principle-card {
  background: var(--bg-primary);
  padding: 2.5rem;
  border-radius: 16px;
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  /* OPTIMIZED - Performance containment */
  contain: layout style paint;
}

.principle-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--papt-blue);
}

.principle-card h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.principle-card p { 
  font-size: 1rem; 
  color: var(--text-secondary); 
  margin: 0; 
}

/* Icon styling for principle cards */
.principle-icon {
  font-size: 2.5rem;
  color: var(--papt-blue);
  margin-bottom: 1rem;
  display: block;
  transition: transform 0.3s ease;
}

/* Ensure SVG icons inherit the color */
.principle-icon.icon {
  color: var(--papt-blue);
  fill: var(--papt-blue);
}

/* Font Awesome icon sizing */
.principle-icon.fa-solid {
  color: var(--papt-blue);
}

[data-theme="dark"] .principle-icon {
  color: var(--papt-blue);
  filter: brightness(1.2);
}

.principle-card:hover .principle-icon {
  transform: scale(1.1);
}

/* ==================== LINE CARDS ==================== */
.lines-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.line-card {
  background: var(--bg-secondary);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid transparent;
  /* OPTIMIZED - Performance containment */
  contain: layout style paint;
}

.line-card:hover {
  transform: translateY(-10px) scale(1.02);
}

.line-card[data-line="red"]:hover { 
  box-shadow: 0 20px 40px rgba(237, 35, 13, 0.3);
  border-color: var(--papt-red);
}
.line-card[data-line="yellow"]:hover { 
  box-shadow: 0 20px 40px rgba(241, 181, 23, 0.3);
  border-color: var(--papt-yellow);
}
.line-card[data-line="green"]:hover { 
  box-shadow: 0 20px 40px rgba(1, 106, 22, 0.3);
  border-color: var(--papt-green);
}
.line-card[data-line="purple"]:hover { 
  box-shadow: 0 20px 40px rgba(73, 16, 139, 0.3);
  border-color: var(--papt-purple);
}
.line-card[data-line="blue"]:hover { 
  box-shadow: 0 20px 40px rgba(0, 32, 159, 0.3);
  border-color: var(--papt-blue);
}
.line-card[data-line="brown"]:hover { 
  box-shadow: 0 20px 40px rgba(118, 69, 59, 0.3);
  border-color: var(--papt-brown);
}

.line-header {
  padding: 2rem 1.75rem;
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.line-card[data-line="red"] .line-header { background: var(--papt-red); }
.line-card[data-line="yellow"] .line-header { background: var(--papt-yellow); }
.line-card[data-line="green"] .line-header { background: var(--papt-green); }
.line-card[data-line="purple"] .line-header { background: var(--papt-purple); }
.line-card[data-line="blue"] .line-header { background: var(--papt-blue); }
.line-card[data-line="brown"] .line-header { background: var(--papt-brown); }

.line-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.25rem;
  font-family: var(--font-display);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.line-card[data-line="red"] .line-badge { color: var(--papt-red); }
.line-card[data-line="yellow"] .line-badge { color: var(--papt-yellow); }
.line-card[data-line="green"] .line-badge { color: var(--papt-green); }
.line-card[data-line="purple"] .line-badge { color: var(--papt-purple); }
.line-card[data-line="blue"] .line-badge { color: var(--papt-blue); }
.line-card[data-line="brown"] .line-badge { color: var(--papt-brown); }

.line-body {
  padding: 2rem 1.75rem;
  background: var(--bg-primary);
}

.line-body h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.line-body p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 0 1.5rem 0;
  line-height: 1.6;
}

.line-meta {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.line-meta div {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.line-meta span {
  font-weight: 700;
  color: var(--text-primary);
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
}

/* ==================== LINE DETAIL SECTIONS ==================== */
.line-detail {
  padding: 4rem 2rem;
  border-top: 1px solid var(--border-color);
}

.line-detail h2 {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.line-detail .line-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 1.3rem;
  font-family: var(--font-display);
}

.stops-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.stop-item {
  background: var(--bg-accent);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border-left: 4px solid;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.stop-item:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-sm);
}

.stop-item.transfer {
  font-weight: 700;
  position: relative;
}

.stop-item.transfer::after {
  content: '⟲';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  opacity: 0.5;
}

.transfer-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ==================== STATION OVERLAY ==================== */
.station-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  /* OPTIMIZED - Touch scrolling */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.station-overlay.open {
  display: flex;
}

.station-card {
  position: relative;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 1rem 1rem 0.75rem;
  max-width: min(900px, 92vw);
  max-height: min(85vh, 900px);
  display: grid;
  gap: 0.5rem;
  animation: stationFlipIn 420ms cubic-bezier(.22,.61,.36,1);
}

.station-card .station-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  background: var(--bg-secondary);
}

.station-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 0.4rem 0 0.6rem;
}

.station-close {
  position: absolute;
  top: 8px;
  right: 8px;
  height: 38px;
  width: 38px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  min-height: 44px; /* OPTIMIZED - Touch target */
}

.station-close:hover {
  transform: translateY(-2px);
  background: var(--papt-blue);
  color: #fff;
  border-color: var(--papt-blue);
}

@keyframes stationFlipIn {
  from {
    opacity: 0;
    transform: perspective(1000px) rotateX(-12deg) translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: perspective(1000px) rotateX(0deg) translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .station-card {
    animation: none;
  }
}

/* ==================== MAP SECTION (OPTIMIZED) ==================== */
.map-section {
  background: var(--bg-secondary);
  padding: 6rem 2rem;
  text-align: center;
}

.map-container {
  position: relative;
  max-width: 1400px;
  margin: 2rem auto;
  background: var(--bg-primary);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 2px solid var(--border-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.map-container:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--papt-blue);
}

#map-svg-container {
  width: 100%;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  position: relative; 
  overflow: hidden;
}

/* CRITICAL OPTIMIZATION: Responsive SVG Map Sizing */
#map-svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.3s ease, filter 0.3s ease;
  
  /* MOBILE: Render at 1000px max width */
  max-width: 1000px;
}

/* TABLET: Render at 2000px max width */
@media (min-width: 769px) {
  #map-svg {
    max-width: 2000px;
  }
}

/* DESKTOP: Full resolution */
@media (min-width: 1200px) {
  #map-svg {
    max-width: none;
  }
}

#map-svg:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

/* ==================== IMPACT SECTION ==================== */
.impact {
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}

.impact-card {
  background: var(--bg-primary);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border-top: 5px solid var(--papt-green);
  transition: all 0.3s ease;
  /* OPTIMIZED - Performance containment */
  contain: layout style paint;
}

.impact-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.impact-card h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.impact-card ul {
  list-style: none;
  padding: 0;
}

.impact-card li {
  padding: 0.75rem 0;
  color: var(--text-secondary);
  position: relative;
  padding-left: 2rem;
  line-height: 1.6;
}

.impact-card li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--papt-green);
  font-weight: 900;
  font-size: 1.25rem;
}

.impact-card .stat {
  font-weight: 700;
  color: var(--papt-green);
  background: rgba(1, 106, 22, 0.08);
}

[data-theme="dark"] .impact-card .stat {
  background: rgba(1, 106, 22, 0.15);
  color: #22cc44;
}

/* ==================== CONCEPT IMAGES SECTION (OPTIMIZED) ==================== */
.concept-images {
  background: var(--bg-secondary);
  padding: 6rem 2rem;
}

/* Line Selector */
.concept-line-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 3rem auto;
  max-width: 900px;
}

.concept-line-btn {
  background: var(--bg-primary);
  border: 3px solid transparent;
  border-radius: 14px;
  padding: 1rem 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  min-height: 44px; /* OPTIMIZED - Touch target */
}

.concept-line-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.concept-line-btn.active {
  border-color: currentColor;
  box-shadow: var(--shadow-lg);
}

.line-badge-mini {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 0.95rem;
  font-family: var(--font-display);
}

.line-name-mini {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* Station Grid (OPTIMIZED - will use Intersection Observer for lazy loading) */
.concept-stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.concept-station-card {
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
  /* OPTIMIZED - Performance containment */
  contain: layout style paint;
  min-height: 44px; /* OPTIMIZED - Touch target */
}

.concept-station-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--line-color);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.concept-station-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-color);
}

.concept-station-card:hover::before {
  transform: scaleX(1);
}

.concept-station-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}

/* Modal (OPTIMIZED - Touch gestures enabled) */
.concept-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 2rem;
  overflow-y: auto;
  /* OPTIMIZED - Touch scrolling */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.concept-modal.open {
  display: flex;
}

.concept-modal-content {
  background: var(--bg-primary);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  /* OPTIMIZED - Touch scrolling */
  -webkit-overflow-scrolling: touch;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.concept-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.25s ease;
  z-index: 10;
  min-height: 44px; /* OPTIMIZED - Touch target */
}

.concept-modal-close:hover {
  background: var(--papt-red);
  color: white;
  border-color: var(--papt-red);
  transform: rotate(90deg);
}

.concept-modal-title {
  font-size: 2rem;
  font-weight: 900;
  font-family: var(--font-display);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  padding-right: 3rem;
}

.concept-modal-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-weight: 600;
}

/* Tabs */
.concept-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 2rem;
}

.concept-tab {
  background: transparent;
  border: none;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-secondary);
  position: relative;
  transition: all 0.25s ease;
  font-family: var(--font-body);
  min-height: 44px; /* OPTIMIZED - Touch target */
}

.concept-tab:hover {
  color: var(--text-primary);
}

.concept-tab.active {
  color: var(--papt-blue);
}

.concept-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--papt-blue);
}

/* Tab Panels */
.concept-tab-panel {
  display: none;
}

.concept-tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.concept-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  background: var(--bg-secondary);
}

.concept-card-img {
  max-width: 600px;
  margin: 0 auto;
  display: block;
}

/* Enhanced Grid */
.concept-enhanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.concept-enhanced-item h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-family: var(--font-display);
}

/* Metro Banner + Stops Preview */
.concept-banner-preview {
  max-width: 1200px;
  margin: 3rem auto 2rem;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--bg-primary);
  border: 2px solid var(--border-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.concept-banner-preview:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--papt-blue);
}

.concept-banner-img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 4;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.concept-banner-preview:hover .concept-banner-img {
  transform: scale(1.02);
}

.concept-banner-preview + .concept-banner-preview {
  margin-top: 1rem;
}

.concept-stops-preview .concept-banner-img {
  image-rendering: auto;
}

.concept-banner-img,
.concept-enhanced-item .concept-image {
  cursor: zoom-in;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.concept-banner-img:hover,
.concept-enhanced-item .concept-image:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

/* ==================== LIGHTBOX (OPTIMIZED FOR MOBILE GESTURES) ==================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  cursor: zoom-out;
  padding: 2rem;
  /* OPTIMIZED - Touch scrolling */
  -webkit-overflow-scrolling: touch;
  /* CRITICAL: Allow pinch-to-zoom on mobile */
  touch-action: pinch-zoom pan-x pan-y;
}

.lightbox.open {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  cursor: grab;
  transition: transform 0.3s ease;
  /* OPTIMIZED - Touch scrolling */
  -webkit-overflow-scrolling: touch;
  /* CRITICAL: Enable pinch-to-zoom gestures */
  touch-action: pinch-zoom pan-x pan-y;
}

.lightbox-content:active {
  cursor: grabbing;
}

.lightbox-content img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.lightbox-close {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.25s ease;
  z-index: 4001;
  /* OPTIMIZED - Touch target */
  min-height: 48px;
  min-width: 48px;
}

.lightbox-close:hover {
  background: var(--papt-red);
  border-color: var(--papt-red);
  transform: rotate(90deg) scale(1.1);
}

.lightbox-controls {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.75rem;
  z-index: 4001;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  padding: 0.75rem 1rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  transition: all 0.2s ease;
  min-height: 40px; /* OPTIMIZED - Touch target */
  min-width: 40px;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* ==================== FOOTER ==================== */
footer {
  background: var(--bg-accent);
  border-top: 1px solid var(--border-color);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--text-secondary);
  /* OPTIMIZED - Safe area for iOS */
  padding-top: max(3rem, env(safe-area-inset-top));
  padding-bottom: max(3rem, env(safe-area-inset-bottom));
}

footer p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.8;
}

footer a {
  color: var(--papt-blue);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--papt-red);
  text-decoration: underline;
}

/* Header Typography */
.site-title,
.site-title a {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.015em;
}

.main-nav,
.nav-menu a,
.nav-toggle,
.theme-toggle {
  font-family: var(--font-body);
  font-weight: 600;
}

/* Simulator Link */
.simulator-link .simulator-btn,
.simulator-link .simulator-btn:link,
.simulator-link .simulator-btn:visited {
  color: #333333;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.simulator-link .simulator-btn:hover {
  color: #ffa500;
  text-decoration: underline;
}

html[data-theme="dark"] .simulator-link .simulator-btn,
html[data-theme="dark"] .simulator-link .simulator-btn:link,
html[data-theme="dark"] .simulator-link .simulator-btn:visited {
  color: #ffffff;
}

html[data-theme="dark"] .simulator-link .simulator-btn:hover {
  color: #ffa500;
}

/* ==================== RESPONSIVE (OPTIMIZED) ==================== */
@media (max-width: 768px) {
  .site-header {
    padding: 1rem;
  }
  
  .hero-content {
    padding: 2rem 1.5rem;
  }
  .hero-content .intro-logo {
    max-width: 300px;
  }
  .hero-content .tagline {
    font-size: 1.1rem;
  }
  .hero-content .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .hero-content .stat-card {
    padding: 1.5rem 1rem;
  }
  .hero-content .stat-card .number {
    font-size: 2.5rem;
  }
  section {
    padding: 4rem 1.5rem;
  }
  section h2 {
    font-size: 2.25rem;
  }
  .lines-grid {
    grid-template-columns: 1fr;
  }
  #map-svg-container {
    height: 400px;
  }
  
  /* OPTIMIZED - Mobile concept grid */
  .concept-line-selector {
    gap: 0.75rem;
  }
  
  .concept-line-btn {
    padding: 0.75rem 1rem;
  }
  
  .concept-stations-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
  
  .concept-modal-content {
    padding: 2rem 1.5rem;
  }
  
  .concept-modal-title {
    font-size: 1.5rem;
  }
  
  .concept-enhanced-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .concept-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .concept-tab {
    white-space: nowrap;
    padding: 0.75rem 1.25rem;
  }
  
  /* OPTIMIZED - Mobile lightbox */
  .lightbox-controls {
    bottom: 1rem;
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }
  
  .lightbox-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .lightbox-close {
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
  }
  
  /* OPTIMIZED - Mobile banner */
  .concept-banner-preview {
    margin: 2rem 1rem 1.5rem;
  }
  
  .concept-banner-preview + .concept-banner-preview {
    margin-top: 1rem;
  }
  
  .concept-banner-img {
    aspect-ratio: 16 / 5;
    object-fit: cover;
  }
}

@media (max-width: 480px) {
  /* OPTIMIZED - Small screen concept grid */
  .concept-stations-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
  }
  .concept-station-card {
    padding: 1rem;
  }
}

@media (max-width: 420px) {
  .hero-content .intro-logo {
    max-width: 240px;
  }
  .hero-content .tagline {
    font-size: 1rem;
  }
  .hero-content .stats-grid {
    grid-template-columns: 1fr;
  }
  
  /* OPTIMIZED - Tiny screen modal */
  .concept-modal-content {
    padding: 1.25rem 1rem;
  }
  .concept-modal-title {
    font-size: 1.35rem;
    padding-right: 2.5rem;
  }
}

/* OPTIMIZED - Dynamic viewport height support */
@supports (height: 100dvh) {
  .scroll-hero { height: 100dvh; }
  .sign-container { height: calc(100dvh - var(--header-h)); }
}

/* OPTIMIZED - Disable hover effects on touch devices */
@media (hover: none) {
  .concept-banner-preview:hover,
  .map-container:hover,
  .concept-station-card:hover,
  .line-card:hover,
  #map-svg:hover,
  .concept-banner-img:hover,
  .concept-enhanced-item .concept-image:hover,
  .stat-card:hover,
  .principle-card:hover {
    transform: none;
    filter: none;
  }
  
  /* Keep shadow changes on mobile tap */
  .line-card:active {
    box-shadow: var(--shadow-lg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .concept-modal-content,
  .concept-tab-panel {
    animation: none;
  }
}

/* ==================== ACCESSIBILITY ==================== */
*:focus-visible {
  outline: 3px solid var(--papt-blue);
  outline-offset: 2px;
}

/* OPTIMIZED - Skip to main content link */
.skip-to-main {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--papt-blue);
  color: white;
  padding: 1rem 2rem;
  z-index: 9999;
  text-decoration: none;
  font-weight: 700;
}

.skip-to-main:focus {
  top: 0;
}