/* Forcer le mode clair globalement */
body {
  font-family: 'Inter', 'Exo', 'Roboto Mono', monospace, sans-serif;
  background: #f8fafc;
  color: #1e293b;
}

/* Hero section height (moved from inline style) */
.hero-section {
  min-height: 72vh;
}
@media (max-width: 480px) {
  .hero-section { min-height: auto; }
}
/* Fluid media to prevent overflow */
img, video, svg {
  max-width: 100%;
  height: auto;
}

/* Scaled desktop-like dashboard on mobile */
.dashboard-viewport {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.dashboard-scale {
  transform-origin: top left;
  will-change: transform, height;
}

/* Force two-column hero on all screens */
.hero-fixed {
  display: flex;
  flex-direction: row !important;
}

/* Prevent overflow, allow controlled horizontal scroll as fallback */
@media (max-width: 480px) {
  .hero-fixed {
    overflow-x: auto;
  }
  /* Make hero title span full width and scale fluidly on mobile */
  .hero-left { width: 100% !important; }
  .hero-left .hero-title { font-size: clamp(1.8rem, 9vw, 2.6rem) !important; line-height: 1.1 !important; }
  .hero-left .block { display: block; width: 100%; }
}

/* On mobile, stack hero: 40% top (text) and 60% bottom (dashboard) */
@media (max-width: 768px) {
  .hero-fixed { flex-direction: column !important; }
  .hero-left { width: 100% !important; }
  .hero-right { width: 100% !important; margin-top: 16px; }
  /* Stack first row cards on mobile to use full width */
  .dashboard-scale .dashboard-row { flex-direction: column !important; }
  .dashboard-scale .dashboard-row > * { flex: 1 1 100% !important; max-width: 100% !important; }
  /* Ensure the right column card can fill width */
  .dashboard-scale .max-w-\[18rem\] { max-width: 100% !important; }
  /* Keep all content clipped inside the white dashboard container */
  .dashboard-scale .dashboard-card { overflow: hidden; width: 100% !important; max-width: 100% !important; }
  /* Remove fixed min-width on mobile */
  .dashboard-scale .min-w-\[14rem\] { min-width: 0 !important; width: 100% !important; }
  .dashboard-viewport { overflow-x: hidden; }
  /* Global downsizing */
  .dashboard-scale .text-[11px], .dashboard-scale .text-xs, .dashboard-scale .text-[10px] { font-size: 9px !important; }
  .dashboard-scale .text-sm { font-size: 11px !important; }
  .dashboard-scale .text-base { font-size: 12px !important; }
  .dashboard-scale .p-3 { padding: 0.375rem !important; }
  .dashboard-scale .p-2 { padding: 0.25rem !important; }
  .dashboard-scale .p-2\.5 { padding: 0.375rem !important; }
  .dashboard-scale .h-2 { height: 6px !important; }
  .dashboard-scale .h-1\.5 { height: 4px !important; }
  .dashboard-scale .w-3 { width: 8px !important; height: 8px !important; }
  .dashboard-scale .mb-1 { margin-bottom: 0.2rem !important; }
  .dashboard-scale .mb-1\.5 { margin-bottom: 0.25rem !important; }
  .dashboard-scale .gap-2\.5 { gap: 0.4rem !important; }
  /* Smaller circles */
  .dashboard-scale .w-20 { width: 2.8rem !important; }
  .dashboard-scale .h-20 { height: 2.8rem !important; }
  .dashboard-scale .w-24 { width: 3.2rem !important; }
  .dashboard-scale .h-24 { height: 3.2rem !important; }
}

/* Small phones: tighten scaling and spacing */
@media (max-width: 480px) {
  /* Avoid transform scaling; rely on responsive sizes */
  .dashboard-scale { transform: none !important; }
  .hero-right { margin-top: 14px; }
  /* Keep two-column layout for the first row on small phones */
  .dashboard-scale .dashboard-row { flex-direction: row !important; }
  .dashboard-scale .dashboard-row > * { flex: initial !important; max-width: none !important; }
  .dashboard-scale .dashboard-row > .flex-\[0_0_62\%\] { flex: 0 0 62% !important; }
  .dashboard-scale .dashboard-row > .flex-\[0_0_38\%\] { flex: 0 0 38% !important; }
  /* Responsive left nav width */
  .dashboard-scale .grid { grid-template-columns: minmax(52px, 18vw) 1fr !important; column-gap: 0.45rem !important; }
  /* Extra downsizing for tiny phones */
  /* ~50% font-size reduction for dashboard-only text */
  .dashboard-scale .text-[11px], .dashboard-scale .text-[10px] { font-size: 5.5px !important; }
  .dashboard-scale .text-xs { font-size: 6px !important; }
  .dashboard-scale .text-sm { font-size: 7px !important; }
  .dashboard-scale .text-base { font-size: 8px !important; }
  /* Generic element fallback to ensure labels and inline text scale */
  .dashboard-scale h3 { font-size: 0.6rem !important; }
  .dashboard-scale h4 { font-size: 0.55rem !important; }
  .dashboard-scale p, .dashboard-scale span, .dashboard-scale label { font-size: 0.6rem !important; }
  .dashboard-scale a, .dashboard-scale button { font-size: 0.62rem !important; }
  .dashboard-scale .p-3 { padding: 0.24rem !important; }
  .dashboard-scale .p-2 { padding: 0.16rem !important; }
  .dashboard-scale .p-2\.5 { padding: 0.22rem !important; }
  .dashboard-scale .gap-2\.5 { gap: 0.28rem !important; }
  .dashboard-scale .mb-1 { margin-bottom: 0.16rem !important; }
  .dashboard-scale .mb-1\.5 { margin-bottom: 0.2rem !important; }
  .dashboard-scale .space-y-1 > * + * { margin-top: 0.18rem !important; }
  .dashboard-scale .py-0\.5 { padding-top: 0.1rem !important; padding-bottom: 0.1rem !important; }
  .dashboard-scale .w-3 { width: 0.32rem !important; height: 0.32rem !important; }
  .dashboard-scale .h-2 { height: 0.22rem !important; }
  .dashboard-scale .h-1\.5 { height: 0.16rem !important; }
  /* Reduce min-heights and column gaps to shrink overall dashboard height */
  .dashboard-scale .min-h-\[5\.5rem\] { min-height: 3.2rem !important; }
  .dashboard-scale .dashboard-row { column-gap: 0.4rem !important; }
  /* Circles smaller on very small screens */
  .dashboard-scale .w-20 { width: clamp(1.6rem, 14vw, 2.0rem) !important; }
  .dashboard-scale .h-20 { height: clamp(1.6rem, 14vw, 2.0rem) !important; }
  .dashboard-scale .w-24 { width: clamp(1.9rem, 16vw, 2.4rem) !important; }
  .dashboard-scale .h-24 { height: clamp(1.9rem, 16vw, 2.4rem) !important; }
  /* Smaller labels for Impacted / Not impacted */
  .dashboard-scale .impact-labels { font-size: 0.30rem !important; gap: 0.2rem !important; line-height: 1 !important; letter-spacing: -0.01em; }
  .dashboard-scale .impact-labels > span { white-space: nowrap !important; gap: 0.1rem !important; line-height: 1 !important; margin-top: 0.06rem !important; margin-bottom: 0.06rem !important; }
  .dashboard-scale .impact-labels .px-1\.5 { padding-left: 0.18rem !important; padding-right: 0.18rem !important; }
  .dashboard-scale .impact-labels .py-0\.5 { padding-top: 0.06rem !important; padding-bottom: 0.06rem !important; }
  .dashboard-scale .impact-labels .w-1\.5 { width: 0.18rem !important; height: 0.18rem !important; }
  /* Smaller technology logos */
  .tech-logo { height: 28px; width: 96px; }
  /* Reduce hero top padding on very small screens */
  section.relative.pt-24.pb-2 { padding-top: 4.5rem !important; }
  /* Allow hero section to shrink vertically on mobile despite inline style */
  section[style*="min-height"] { min-height: auto !important; }
  /* Tighten vertical rhythm to reduce overall dashboard height */
  .dashboard-scale .space-y-3 > * + * { margin-top: 0.35rem !important; }
  .dashboard-scale .gap-3 { gap: 0.35rem !important; }
  .dashboard-scale .mb-3 { margin-bottom: 0.3rem !important; }
  .dashboard-scale .mb-4 { margin-bottom: 0.35rem !important; }
  .dashboard-scale .mt-1 { margin-top: 0.12rem !important; }
  .dashboard-scale h3, .dashboard-scale h4 { line-height: 1.1 !important; }
  .dashboard-scale .gap-4 { gap: 0.4rem !important; }
  .dashboard-scale .px-1\.5 { padding-left: 0.3rem !important; padding-right: 0.3rem !important; }
  /* Smaller left nav labels on very small screens */
  .dashboard-main-grid > :first-child .text-xs { font-size: 5.5px !important; line-height: 1 !important; }
}

/* Extra-small phones */
@media (max-width: 380px) {
  .dashboard-scale { transform: none !important; }
  .dashboard-scale .grid { grid-template-columns: minmax(46px, 18vw) 1fr !important; column-gap: 0.36rem !important; }
  .dashboard-scale .text-[11px], .dashboard-scale .text-[10px] { font-size: 5px !important; }
  .dashboard-scale .text-xs { font-size: 5.5px !important; }
  .dashboard-scale .text-sm { font-size: 6.5px !important; }
  .dashboard-scale .text-base { font-size: 7.5px !important; }
  .dashboard-scale h3 { font-size: 0.54rem !important; }
  .dashboard-scale h4 { font-size: 0.5rem !important; }
  .dashboard-scale p, .dashboard-scale span, .dashboard-scale label { font-size: 0.54rem !important; }
  .dashboard-scale a, .dashboard-scale button { font-size: 0.58rem !important; }
  .dashboard-scale .p-3 { padding: 0.22rem !important; }
  .dashboard-scale .p-2 { padding: 0.14rem !important; }
  .dashboard-scale .p-2\.5 { padding: 0.2rem !important; }
  .dashboard-scale .gap-2\.5 { gap: 0.24rem !important; }
  .dashboard-scale .mb-1 { margin-bottom: 0.14rem !important; }
  .dashboard-scale .mb-1\.5 { margin-bottom: 0.18rem !important; }
  .dashboard-scale .space-y-1 > * + * { margin-top: 0.14rem !important; }
  .dashboard-scale .py-0\.5 { padding-top: 0.08rem !important; padding-bottom: 0.08rem !important; }
  .dashboard-scale .w-3 { width: 0.3rem !important; height: 0.3rem !important; }
  .dashboard-scale .h-2 { height: 0.18rem !important; }
  .dashboard-scale .h-1\.5 { height: 0.14rem !important; }
  .dashboard-scale .min-h-\[5\.5rem\] { min-height: 2.8rem !important; }
  .dashboard-scale .w-20 { width: clamp(1.4rem, 12vw, 1.8rem) !important; }
  .dashboard-scale .h-20 { height: clamp(1.4rem, 12vw, 1.8rem) !important; }
  .dashboard-scale .w-24 { width: clamp(1.7rem, 14vw, 2.1rem) !important; }
  .dashboard-scale .h-24 { height: clamp(1.7rem, 14vw, 2.1rem) !important; }
  .tech-logo { height: 24px; width: 88px; }
  /* Extra reduction for Impacted / Not impacted on very small phones */
  .dashboard-scale .impact-labels { font-size: 0.28rem !important; gap: 0.18rem !important; line-height: 1 !important; letter-spacing: -0.01em; }
  .dashboard-scale .impact-labels > span { white-space: nowrap !important; gap: 0.08rem !important; line-height: 1 !important; margin-top: 0.05rem !important; margin-bottom: 0.05rem !important; }
  .dashboard-scale .impact-labels .px-1\.5 { padding-left: 0.14rem !important; padding-right: 0.14rem !important; }
  .dashboard-scale .impact-labels .py-0\.5 { padding-top: 0.05rem !important; padding-bottom: 0.05rem !important; }
  .dashboard-scale .impact-labels .w-1\.5 { width: 0.16rem !important; height: 0.16rem !important; }
  /* Extra reduction for left nav item padding on very small phones */
  .dashboard-main-grid > :first-child .p-1\.5 { padding: 0.14rem !important; }
}

/* Mobile compaction for dashboard keeping 2-column layout */
@media (max-width: 768px) {
  /* Fill full width on mobile and avoid horizontal scroll */
  .dashboard-scale { transform: none !important; width: 100% !important; }
  .dashboard-viewport { overflow-x: hidden; }
  /* Compact paddings and gaps */
  .dashboard-scale .p-3 { padding: 0.5rem !important; }
  .dashboard-scale .p-2 { padding: 0.375rem !important; }
  .dashboard-scale .p-2\.5 { padding: 0.5rem !important; }
  .dashboard-scale .mb-1 { margin-bottom: 0.25rem !important; }
  .dashboard-scale .mb-1\.5 { margin-bottom: 0.3rem !important; }
  .dashboard-scale .space-y-1 > * + * { margin-top: 0.25rem !important; }
  .dashboard-scale .gap-2\.5 { gap: 0.5rem !important; }

  /* Text sizes for dense info */
  .dashboard-scale .text-[11px] { font-size: 9.5px !important; }
  .dashboard-scale .text-xs { font-size: 9.5px !important; }
  .dashboard-scale .text-[10px] { font-size: 8.75px !important; }

  /* bars and legends */
  .dashboard-scale .h-2 { height: 6px !important; }
  .dashboard-scale .h-1\.5 { height: 5px !important; }
  .dashboard-scale .w-3 { width: 10px !important; height: 10px !important; }

  /* circle charts container sizes (responsive) */
  .dashboard-scale .w-20 { width: clamp(2.2rem, 14vw, 3rem) !important; }
  .dashboard-scale .h-20 { height: clamp(2.2rem, 14vw, 3rem) !important; }
  .dashboard-scale .w-24 { width: clamp(2.6rem, 16vw, 3.4rem) !important; }
  .dashboard-scale .h-24 { height: clamp(2.6rem, 16vw, 3.4rem) !important; }
  /* Force 3 circles per row with tighter gaps */
  .dashboard-scale .grid.grid-cols-1.sm\:grid-cols-2.md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; column-gap: 0.4rem !important; }
  .dashboard-scale .circle-container { min-width: 0; }
  .dashboard-scale .circle-container h4 { font-size: 0.75rem !important; margin-bottom: 0.25rem !important; }
  /* Keep desktop-like first row layout on mobile */
  .dashboard-scale .dashboard-row { display: grid !important; grid-template-columns: 1.6fr 1fr !important; column-gap: 0.5rem !important; align-items: start; }
  .dashboard-scale .dashboard-row > * { width: 100% !important; }
  /* Ensure nav + content grid mirrors desktop proportionally */
  .dashboard-main-grid { grid-template-columns: minmax(64px, 20vw) 1fr !important; column-gap: 0.6rem !important; }
  /* Slightly smaller left nav labels on mobile */
  .dashboard-main-grid > :first-child .text-xs { font-size: 8px !important; line-height: 1 !important; }
  /* Reduce left nav item padding on mobile */
  .dashboard-main-grid > :first-child .p-1\.5 { padding: 0.2rem !important; }
}

/* Ensure inner cards never overflow the dashboard card */
.dashboard-viewport * { min-width: 0; }

@media (min-width: 768px) {
  .dashboard-viewport {
    overflow: visible;
    height: auto !important;
  }
  .dashboard-scale {
    transform: none !important;
    width: 100% !important;
  }
}
.scan-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  background: repeating-linear-gradient(90deg, rgba(255,0,0,0.08) 0 2px, transparent 2px 40px);
  animation: scanmove 3s linear infinite;
}
@keyframes scanmove {
  0% { background-position-x: 0; }
  100% { background-position-x: 40px; }
}
.shield-pulse {
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { filter: drop-shadow(0 0 0 #ef4444); }
  50% { filter: drop-shadow(0 0 32px #ef4444cc); }
}
.alert-blink {
  animation: blink 1.2s steps(2, start) infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Animation pour le titre tapé */
#animated-title.typing::after {
  content: '|';
  color: #ef4444;
  animation: blink-caret 0.75s step-end infinite;
}
@keyframes blink-caret {
  from, to { opacity: 1; }
  50% { opacity: 0; }
}

/* Animations supplémentaires */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease-out forwards;
}
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  animation: slideInLeft 0.8s ease-out forwards;
}
@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  animation: slideInRight 0.8s ease-out forwards;
}
@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Statistiques animées */
.counter {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: bold;
  color: #ef4444;
}

/* Navigation */
.nav-blur {
  backdrop-filter: blur(10px);
  background: rgba(24, 24, 27, 0.8);
}

/* Header hide/show on scroll */
#siteHeader {
  transition: transform 0.25s ease-in-out;
}
#siteHeader.header-hidden {
  transform: translateY(-100%);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(45deg, #ef4444, #dc2626, #b91c1c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Scroll indicator */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 1000;
}
.scroll-indicator::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #ef4444;
  width: 0%;
  transition: width 0.1s ease;
}

/* Mobile menu */
.mobile-menu {
  transform: translateX(-100%);
  transition: all 0.3s ease-in-out;
  visibility: hidden;
  opacity: 0;
  backdrop-filter: blur(10px);
}
.mobile-menu.open {
  transform: translateX(0);
  visibility: visible;
  opacity: 1;
}

/* Empêcher le scroll du body quand le menu est ouvert */
body.menu-open {
  overflow: hidden;
}

/* Responsive text sizes */
.hero-title {
  font-size: clamp(2rem, 8vw, 4rem);
}
.hero-subtitle {
  font-size: clamp(1rem, 4vw, 1.5rem);
}
.section-title {
  font-size: clamp(1.5rem, 6vw, 2.5rem);
}

/* Touch-friendly buttons */
.touch-button {
  min-height: 44px;
  min-width: 44px;
}

/* Theme transitions */
html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Éviter le flash pendant le chargement */
html:not(.theme-applied) {
  background: #18181b !important;
  color: #fafafa !important;
}

/* Light theme */
html.light-theme {
  background: #f8fafc;
  color: #1e293b;
}

html.light-theme body {
  background: #f8fafc;
  color: #1e293b;
}

html.light-theme .bg-zinc-900 {
  background-color: #ffffff;
}

html.light-theme .bg-zinc-800 {
  background-color: #f1f5f9;
}

html.light-theme .bg-zinc-950\/90 {
  background-color: rgba(241, 245, 249, 0.9);
}

html.light-theme .bg-zinc-900\/95 {
  background-color: rgba(255, 255, 255, 0.95);
}

html.light-theme .text-zinc-100 {
  color: #1e293b;
}

html.light-theme .text-zinc-200 {
  color: #334155;
}

html.light-theme .text-zinc-300 {
  color: #475569;
}

html.light-theme .text-zinc-400 {
  color: #64748b;
}

html.light-theme .text-zinc-500 {
  color: #94a3b8;
}

html.light-theme .border-zinc-800 {
  border-color: #e2e8f0;
}

html.light-theme .border-zinc-700 {
  border-color: #cbd5e1;
}

html.light-theme .bg-zinc-900\/80 {
  background-color: rgba(255, 255, 255, 0.8);
}

html.light-theme .bg-zinc-900\/95 {
  background-color: rgba(255, 255, 255, 0.95);
}

html.light-theme .bg-zinc-950\/90 {
  background-color: rgba(241, 245, 249, 0.9);
}

html.light-theme .nav-blur {
  background: rgba(255, 255, 255, 0.8);
}

html.light-theme .mobile-menu {
  background: rgba(255, 255, 255, 0.95);
}

/* Dark theme (default) */
html {
  background: #f8fafc;
  color: #1e293b;
}

body {
  background: #f8fafc;
  color: #1e293b;
}

html .bg-zinc-900 {
  background-color: #ffffff;
}

html .bg-zinc-800 {
  background-color: #f1f5f9;
}

html .bg-zinc-950\/90 {
  background-color: rgba(241, 245, 249, 0.9);
}

html .bg-zinc-900\/95 {
  background-color: rgba(255, 255, 255, 0.95);
}

html .text-zinc-100 {
  color: #1e293b;
}

html .text-zinc-200 {
  color: #334155;
}

html .text-zinc-300 {
  color: #475569;
}

html .text-zinc-400 {
  color: #64748b;
}

html .text-zinc-500 {
  color: #94a3b8;
}

html .border-zinc-800 {
  border-color: #27272a;
}

html .border-zinc-700 {
  border-color: #3f3f46;
}

html .bg-zinc-900\/80 {
  background-color: rgba(24, 24, 27, 0.8);
}

html .bg-zinc-900\/95 {
  background-color: rgba(24, 24, 27, 0.95);
}

html .bg-zinc-950\/90 {
  background-color: rgba(9, 9, 11, 0.9);
}

html .nav-blur {
  background: rgba(24, 24, 27, 0.8);
}

html .mobile-menu {
  background: rgba(24, 24, 27, 0.95);
}

/* Animation de remplissage progressif pour les cercles */
.progress-circle {
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
}

.progress-segment {
  stroke-dasharray: 0, 100;
  animation: progressFill 1.5s ease-out forwards;
}

/* Animation d'apparition du cercle */
@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: scale(0.8) rotate(-90deg);
  }
  to { 
    opacity: 1; 
    transform: scale(1) rotate(-90deg);
  }
}

/* Animation de remplissage des segments */
@keyframes progressFill {
  0% {
    stroke-dasharray: 0, 100;
  }
  100% {
    stroke-dasharray: var(--final-dasharray);
  }
}

/* Délais d'animation pour chaque segment (dans l'ordre d'affichage) */
.progress-segment:nth-child(1) { animation-delay: 0.1s; }
.progress-segment:nth-child(2) { animation-delay: 0.3s; }
.progress-segment:nth-child(3) { animation-delay: 0.5s; }
.progress-segment:nth-child(4) { animation-delay: 0.7s; }
.progress-segment:nth-child(5) { animation-delay: 0.9s; }
.progress-segment:nth-child(6) { animation-delay: 1.3s; animation-duration: 2s; }

/* Accent sur le segment final */
.progress-segment:nth-child(6) {
  filter: drop-shadow(0 0 4px currentColor);
}

/* Effet hover sur les segments */
.progress-circle:hover .progress-segment {
  filter: brightness(1.2);
  transition: filter 0.3s ease;
}

/* Stagger d'entrée pour chaque cercle */
.circle-container:nth-child(1) .progress-circle { animation-delay: 0s; }
.circle-container:nth-child(2) .progress-circle { animation-delay: 0.2s; }
.circle-container:nth-child(3) .progress-circle { animation-delay: 0.4s; }

/* -------------------------------------------------- */
/* Defer animations until elements are in the viewport */
/* -------------------------------------------------- */

/* Disable auto-play animations by default */
.fade-in-up,
.slide-in-left,
.slide-in-right {
  opacity: 0;
  animation: none !important;
}

/* Enable when visible */
.fade-in-up.is-visible { animation: fadeInUp 0.8s ease-out forwards !important; }
.slide-in-left.is-visible { animation: slideInLeft 0.8s ease-out forwards !important; }
.slide-in-right.is-visible { animation: slideInRight 0.8s ease-out forwards !important; }

/* Progress circles: disable by default, enable when container is visible */
.progress-circle { opacity: 0; animation: none !important; }
.progress-segment { animation: none !important; }
.progress-circle.is-visible { animation: fadeIn 0.8s ease-out forwards !important; }
.progress-circle.is-visible .progress-segment { animation: progressFill 1.5s ease-out forwards !important; }

/* Bars: only animate when in-view */
.animate-fill { animation: none !important; }
.animate-fill.in-view { animation: barFill 1.4s ease-out forwards !important; }
.animate-fill-target { animation: none !important; }
.animate-fill-target.in-view { animation: barFillToTarget 1.2s ease-out forwards !important; }

/* Responsive theme adjustments */
@media (max-width: 768px) {
  html.light-theme .nav-blur {
    background: rgba(255, 255, 255, 0.9);
  }
  
  html .nav-blur {
    background: rgba(24, 24, 27, 0.9);
  }
  
  html.light-theme .mobile-menu {
    background: rgba(255, 255, 255, 0.98);
  }
  
  html .mobile-menu {
    background: rgba(24, 24, 27, 0.98);
  }
  
  /* Mobile theme toggle button */
  #mobileThemeToggle {
    min-width: 64px;
    min-height: 20px;
    touch-action: manipulation;
  }
  
  #mobileToggleSlider {
    min-width: 20px;
    min-height: 20px;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  #themeToggle, #mobileThemeToggle {
    min-width: 64px;
    min-height: 24px;
  }
  
  #toggleSlider, #mobileToggleSlider {
    min-width: 20px;
    min-height: 20px;
  }
}

/* Large screen adjustments */
@media (min-width: 1025px) {
  #themeToggle, #mobileThemeToggle {
    min-width: 64px;
    min-height: 24px;
  }
  
  #toggleSlider, #mobileToggleSlider {
    min-width: 20px;
    min-height: 20px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  #themeToggle, #mobileThemeToggle {
    min-height: 44px;
    min-width: 44px;
    padding: 8px;
  }
  
  #toggleSlider, #mobileToggleSlider {
    min-height: 28px;
    min-width: 28px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  body.light-theme {
    background: #ffffff;
    color: #000000;
  }
  
  body.light-theme .text-zinc-300 {
    color: #000000;
  }
  
  body .text-zinc-300 {
    color: #ffffff;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Theme toggle accessibility */
#themeToggle, #mobileThemeToggle {
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

#themeToggle:focus, #mobileThemeToggle:focus {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

/* Ensure visibility on all devices */
#themeToggle, #mobileThemeToggle {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
}

/* Dark mode for light theme toggle */
html.light-theme #themeToggle,
html.light-theme #mobileThemeToggle {
  background-color: #ffffff;
  border-color: #e5e7eb;
}

html.light-theme #toggleSlider,
html.light-theme #mobileToggleSlider {
  background-color: #18181b;
}

/* Light mode for dark theme toggle */
html #themeToggle,
html #mobileThemeToggle {
  background-color: #18181b;
  border-color: #3f3f46;
}

html #toggleSlider,
html #mobileToggleSlider {
  background-color: #ffffff;
}

/* Animation fadein */
@keyframes fadein { 
  from { 
    opacity: 0; 
    transform: translateY(20px);
  } 
  to { 
    opacity: 1; 
    transform: none; 
  } 
} 

.animate-fadein { 
  animation: fadein 0.7s; 
}

/* Progress charts animations are enabled (see inline styles in index.html) */

/* Animated fill for All security devices */
.bar-fill {
  width: 0%;
}
@keyframes barFill {
  from { width: 0%; }
  to { width: 100%; }
}
.animate-fill {
  animation: barFill 1.4s ease-out forwards;
}

/* Animated fill to a target width (for System Resources) */
.bar-fill-target {
  width: 0%;
}
@keyframes barFillToTarget {
  from { width: 0%; }
  to { width: var(--target-width, 0%); }
}
.animate-fill-target {
  animation: barFillToTarget 1.2s ease-out forwards;
}

/* Subtle green boost for resource bars */
.bar-green-boost {
  box-shadow: inset 0 0 2px rgba(34, 197, 94, 0.6), 0 0 6px rgba(34, 197, 94, 0.35);
}

/* Uniform sizing for technology logos */
.tech-logo {
  height: 36px;
  width: 128px;
  object-fit: contain;
}

@media (min-width: 768px) {
  .tech-logo {
    height: 48px;
    width: 160px;
  }
}

/* Train-like marquee for supported technologies */
.tech-marquee {
  position: relative;
  overflow: hidden;
  width: 100%;
}
.tech-track {
  display: inline-flex;
  align-items: center;
  gap: 2.5rem;
  white-space: nowrap;
  will-change: transform;
  animation: techTrain 30s linear infinite;
}
.tech-marquee:hover .tech-track {
  animation-play-state: paused;
}
@keyframes techTrain {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
