/* ==========================================================================
   Design tokens
   Palette ancrée dans l'esthétique waterfall SDR (GQRX/SDR#) : fond encre
   marine façon écran de spectre, accent "signal" teal et "alerte" ambre
   évoquant un dégradé de spectrogramme, typo technique façon instrument.
   ========================================================================== */
:root {
  --bg-ink: #0B1220;
  --bg-panel: #101A2E;
  --bg-panel-raised: #16223C;
  --grid-line: #1E2A42;
  --border-hairline: #223252;

  --signal-teal: #3FE0C5;
  --signal-teal-dim: #1F7A6B;
  --alert-amber: #F2A93B;
  --alert-amber-dim: #8A5E1E;

  --text-primary: #E8EDF5;
  --text-secondary: #9AA6BC;
  --text-muted: #5E6A82;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius: 3px;
  --container-max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg-ink);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--signal-teal); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--signal-teal);
  outline-offset: 2px;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Nav
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 18, 32, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-hairline);
}
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}
.nav-brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--signal-teal);
  box-shadow: 0 0 8px var(--signal-teal);
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: var(--text-secondary);
}
.nav-links a { color: var(--text-secondary); }
.nav-links a:hover { color: var(--signal-teal); text-decoration: none; }

/* Indicateur d'état de l'API en direct (façon voyant d'instrument) */
.api-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.api-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s, box-shadow 0.3s;
}
.api-status.online .api-status-dot {
  background: var(--signal-teal);
  box-shadow: 0 0 8px var(--signal-teal);
  animation: status-pulse 2.4s ease-in-out infinite;
}
.api-status.online .api-status-label { color: var(--signal-teal); }
.api-status.offline .api-status-dot { background: var(--alert-amber); box-shadow: 0 0 8px var(--alert-amber); }
.api-status.offline .api-status-label { color: var(--alert-amber); }
@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@media (max-width: 640px) {
  .api-status-label { display: none; }
  .nav-right { gap: 16px; }
}

/* ==========================================================================
   Hero — le waterfall animé, signature de la page
   ========================================================================== */
.hero {
  position: relative;
  border-bottom: 1px solid var(--border-hairline);
  overflow: hidden;
}
.hero-canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}
#waterfall {
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.55;
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,18,32,0.35) 0%, rgba(11,18,32,0.55) 55%, var(--bg-ink) 100%);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 96px 0 72px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal-teal);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: var(--signal-teal);
}
h1.hero-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  max-width: 760px;
}
.hero-title .accent { color: var(--signal-teal); }
.hero-sub {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 0 36px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { border-color: var(--signal-teal); text-decoration: none; }
.btn-primary {
  background: var(--signal-teal);
  border-color: var(--signal-teal);
  color: #06201B;
}
.btn-primary:hover { background: #56E8D0; border-color: #56E8D0; }

/* ==========================================================================
   Stats readout bar — lecture façon instrument
   ========================================================================== */
.readout-bar {
  border-bottom: 1px solid var(--border-hairline);
  background: var(--bg-panel);
}
.readout-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-hairline);
}
.readout-cell {
  background: var(--bg-panel);
  padding: 22px 24px;
}
.readout-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.readout-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--text-primary);
}
.readout-value .unit {
  font-size: 14px;
  color: var(--text-secondary);
  margin-left: 4px;
}
@media (max-width: 760px) {
  .readout-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Section shell
   ========================================================================== */
.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--border-hairline);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 26px;
  margin: 0;
}
.section-note {
  font-size: 14px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Map
   ========================================================================== */
.map-panel {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-panel);
}
#map-canvas {
  height: 460px;
  width: 100%;
  background: var(--bg-panel);
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-hairline);
  font-size: 13px;
  color: var(--text-secondary);
}
.map-legend .item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend-empty { color: var(--text-muted); font-size: 13px; }

/* Filtre interactif de la carte : chips cliquables par famille */
.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease, transform 0.12s ease;
}
.legend-chip:hover { border-color: var(--signal-teal); color: var(--text-primary); }
.legend-chip:active { transform: scale(0.96); }
.legend-chip .legend-dot { transition: filter 0.18s ease; box-shadow: 0 0 6px currentColor; }
.legend-chip .chip-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}
.legend-chip.off { opacity: 0.38; }
.legend-chip.off .legend-dot { filter: grayscale(1) brightness(0.7); box-shadow: none; }
.legend-chip.reset {
  color: var(--signal-teal);
  border-color: var(--signal-teal-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.legend-chip.reset.off { opacity: 0.38; color: var(--text-muted); border-color: var(--border-hairline); }

/* ==========================================================================
   Category grid
   ========================================================================== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border-hairline);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 48px;
}
.category-card {
  background: var(--bg-panel);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.category-card .icon { color: var(--signal-teal); }
.category-card .icon svg { width: 22px; height: 22px; }
.category-card .name {
  font-size: 14px;
  font-weight: 500;
}
.category-card .count {
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--text-primary);
}
.category-card .count .label {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 4px;
}
.category-card.empty .icon,
.category-card.empty .count { color: var(--text-muted); }

/* ==========================================================================
   Log (dernières trames) — façon carnet de bord radio
   ========================================================================== */
.log-list {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.log-row {
  display: grid;
  grid-template-columns: 90px 1fr 140px 90px;
  gap: 16px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--grid-line);
  font-size: 13px;
}
.log-row:last-child { border-bottom: none; }
.log-row:nth-child(odd) { background: var(--bg-panel); }
.log-time { font-family: var(--font-mono); color: var(--text-muted); }
.log-model { color: var(--text-primary); font-weight: 500; }
.log-category { color: var(--text-secondary); font-family: var(--font-mono); font-size: 12px; }
.log-station { color: var(--text-muted); text-align: right; font-family: var(--font-mono); font-size: 12px; }
@media (max-width: 640px) {
  .log-row { grid-template-columns: 70px 1fr; }
  .log-category, .log-station { display: none; }
}

/* ==========================================================================
   Join / how it works
   ========================================================================== */
.join-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 860px) {
  .join-grid { grid-template-columns: 1fr; }
}
.step-card {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--bg-panel);
}
.step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--signal-teal);
  margin-bottom: 14px;
}
.step-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  margin: 0 0 8px;
}
.step-body {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 16px;
}
.step-card code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--bg-panel-raised);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--signal-teal);
}

/* Panneau technique "brancher un agent / l'app" */
.connect-panel {
  margin-top: 24px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: var(--bg-panel);
  padding: 22px 24px;
}
.connect-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--grid-line);
}
.connect-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--signal-teal);
  letter-spacing: 0.02em;
}
.connect-sub { font-size: 12.5px; color: var(--text-muted); }
.connect-sub code { font-family: var(--font-mono); color: var(--text-secondary); }
.connect-grid { margin: 0; }
.connect-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--grid-line);
}
.connect-row:last-child { border-bottom: none; }
.connect-row dt {
  flex: 0 0 160px;
  font-size: 13px;
  color: var(--text-secondary);
}
.connect-row dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
}
.connect-row dd code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--signal-teal);
}
.connect-note {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.connect-note code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--bg-panel-raised);
  padding: 1px 5px;
  border-radius: 3px;
}
@media (max-width: 560px) {
  .connect-row { flex-direction: column; gap: 3px; }
  .connect-row dt { flex-basis: auto; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding: 40px 0;
}
.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-text {
  font-size: 13px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.footer-links { display: flex; gap: 20px; font-size: 13px; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--signal-teal); }

/* Leaflet dark tweaks */
.leaflet-container { background: var(--bg-panel) !important; font-family: var(--font-body); }
.leaflet-popup-content-wrapper { background: var(--bg-panel-raised); color: var(--text-primary); border-radius: var(--radius); }
.leaflet-popup-tip { background: var(--bg-panel-raised); }
.leaflet-popup-content { font-size: 13px; font-family: var(--font-mono); margin: 12px 14px; }
.leaflet-popup-content-wrapper { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }

/* Popup carte enrichi : modèle + famille + mesures */
.pp { min-width: 168px; }
.pp-head { display: flex; align-items: center; gap: 7px; font-family: var(--font-display); }
.pp-head strong { font-size: 14px; color: var(--text-primary); }
.pp-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 6px currentColor; flex: none; }
.pp-cat { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; margin: 3px 0 8px; }
.pp-values { display: flex; flex-direction: column; gap: 3px; }
.pp-row { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; border-bottom: 1px dashed var(--grid-line); }
.pp-row:last-child { border-bottom: none; }
.pp-k { color: var(--text-secondary); }
.pp-v { color: var(--signal-teal); font-weight: 500; }
.pp-empty { color: var(--text-muted); border-bottom: none; }
.pp-time { margin-top: 8px; font-size: 11px; color: var(--text-muted); }
.log-value { color: var(--signal-teal); font-family: var(--font-mono); font-size: 12px; margin-left: 8px; }

/* ==========================================================================
   ✦ Couche animations / ambiance — tout ce qui rend le site vivant
   ========================================================================== */

/* --- Sélection + scrollbar teintées instrument ------------------------------ */
::selection { background: rgba(63, 224, 197, 0.28); color: #EAFBF6; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-ink); }
::-webkit-scrollbar-thumb { background: #223252; border-radius: 6px; border: 3px solid var(--bg-ink); }
::-webkit-scrollbar-thumb:hover { background: var(--signal-teal-dim); }
html { scrollbar-color: #223252 var(--bg-ink); }

/* --- Overlay CRT : scanlines + vignette + grain léger, fixe, non cliquable -- */
.crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.11) 0px,
      rgba(0, 0, 0, 0.11) 1px,
      transparent 1px,
      transparent 3px
    ),
    radial-gradient(120% 90% at 50% 0%, transparent 55%, rgba(3, 7, 15, 0.55) 100%);
  mix-blend-mode: multiply;
  opacity: 0.55;
}
/* Balayage lumineux vertical qui traverse lentement l'écran */
.scan-sweep {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 42vh;
  z-index: 901;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(63, 224, 197, 0.05) 45%, rgba(63, 224, 197, 0.09) 50%, transparent 100%);
  animation: sweep-down 7.5s linear infinite;
  opacity: 0.7;
}
@keyframes sweep-down {
  0%   { transform: translateY(-50vh); }
  100% { transform: translateY(150vh); }
}

/* --- Nav : soulignement animé + brand qui respire ------------------------- */
.nav-links a { position: relative; padding-bottom: 3px; transition: color 0.2s ease; }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--signal-teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.1, 1);
}
.nav-links a:hover::after { transform: scaleX(1); }
.nav-brand .dot { animation: brand-breathe 3s ease-in-out infinite; }
@keyframes brand-breathe {
  0%, 100% { box-shadow: 0 0 6px var(--signal-teal); }
  50%      { box-shadow: 0 0 14px var(--signal-teal), 0 0 22px rgba(63,224,197,0.5); }
}

/* --- Hero : cadre instrument, oscilloscope, tuner, curseur ---------------- */
#waterfall { animation: waterfall-fade-in 1.4s ease both; }
@keyframes waterfall-fade-in { from { opacity: 0; } to { opacity: 0.55; } }

.hero-corner {
  position: absolute;
  width: 26px; height: 26px;
  z-index: 2;
  border: 1px solid rgba(63, 224, 197, 0.45);
  opacity: 0;
  animation: corner-in 0.9s 0.5s ease forwards;
}
.hero-corner.tl { top: 20px; left: 20px; border-right: 0; border-bottom: 0; }
.hero-corner.tr { top: 20px; right: 20px; border-left: 0; border-bottom: 0; }
.hero-corner.bl { bottom: 20px; left: 20px; border-right: 0; border-top: 0; }
.hero-corner.br { bottom: 20px; right: 20px; border-left: 0; border-top: 0; }
@keyframes corner-in { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }

.hero-oscilloscope {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%; height: 90px;
  z-index: 1;
  opacity: 0.9;
  pointer-events: none;
}

/* Révélation en cascade des blocs du hero */
.hero-content > * { opacity: 0; transform: translateY(18px); animation: hero-rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.hero-content > .eyebrow      { animation-delay: 0.15s; }
.hero-content > .hero-title   { animation-delay: 0.30s; }
.hero-content > .hero-sub     { animation-delay: 0.48s; }
.hero-content > .hero-tuner   { animation-delay: 0.62s; }
.hero-content > .hero-actions { animation-delay: 0.76s; }
@keyframes hero-rise { to { opacity: 1; transform: none; } }

.rec-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--alert-amber);
  box-shadow: 0 0 8px var(--alert-amber);
  animation: rec-blink 1.3s steps(1) infinite;
}
@keyframes rec-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.15; } }

.hero-title .accent {
  color: var(--signal-teal);
  background: linear-gradient(90deg, #3FE0C5, #7CF3DE, #3FE0C5);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 26px rgba(63, 224, 197, 0.35);
  animation: accent-shimmer 5s linear infinite;
}
@keyframes accent-shimmer { to { background-position: 200% 0; } }

.type-caret {
  display: inline-block;
  width: 3px; height: 0.95em;
  margin-left: 6px;
  vertical-align: -0.08em;
  background: var(--signal-teal);
  box-shadow: 0 0 8px var(--signal-teal);
  animation: caret-blink 1s steps(1) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

.hero-tuner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 30px;
  padding: 8px 14px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  background: rgba(16, 26, 46, 0.6);
  backdrop-filter: blur(4px);
  font-family: var(--font-mono);
}
.tuner-label { font-size: 10.5px; letter-spacing: 0.14em; color: var(--text-muted); }
.tuner-freq { font-size: 17px; color: var(--signal-teal); text-shadow: 0 0 10px rgba(63,224,197,0.4); min-width: 84px; }
.tuner-unit { font-size: 12px; color: var(--text-secondary); }
.tuner-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; margin-left: 2px; }
.tuner-bars i {
  width: 3px;
  background: var(--signal-teal);
  border-radius: 1px;
  opacity: 0.85;
  animation: eq-bounce 1.1s ease-in-out infinite;
}
.tuner-bars i:nth-child(1) { height: 40%; animation-delay: 0.0s; }
.tuner-bars i:nth-child(2) { height: 70%; animation-delay: 0.12s; }
.tuner-bars i:nth-child(3) { height: 100%; animation-delay: 0.24s; }
.tuner-bars i:nth-child(4) { height: 55%; animation-delay: 0.36s; }
.tuner-bars i:nth-child(5) { height: 85%; animation-delay: 0.48s; }
.tuner-bars i:nth-child(6) { height: 45%; animation-delay: 0.60s; }
.tuner-bars i:nth-child(7) { height: 65%; animation-delay: 0.72s; }
@keyframes eq-bounce { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }

/* --- Boutons : halo + balayage lumineux au survol ------------------------- */
.btn { position: relative; overflow: hidden; transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.2s ease; }
.btn::before {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
}
.btn:hover::before { left: 140%; }
.btn:hover { transform: translateY(-1px); }
.btn-primary:hover { box-shadow: 0 6px 24px rgba(63, 224, 197, 0.35), 0 0 0 1px rgba(63,224,197,0.4); }
.btn:not(.btn-primary):hover { box-shadow: 0 0 18px rgba(63, 224, 197, 0.12); }

/* --- Système de révélation au scroll (progressive enhancement) ------------ */
html.has-js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
html.has-js .reveal.is-visible { opacity: 1; transform: none; }

/* --- Readout bar : cellules vivantes -------------------------------------- */
.readout-cell { position: relative; overflow: hidden; transition: background 0.25s ease; }
.readout-cell::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--signal-teal), transparent);
  transform: translateX(-100%);
  opacity: 0;
}
.readout-cell:hover { background: var(--bg-panel-raised); }
.readout-cell:hover::after { animation: cell-scan 1.1s ease; }
@keyframes cell-scan { 0% { transform: translateX(-100%); opacity: 0.9; } 100% { transform: translateX(100%); opacity: 0; } }
.readout-value { transition: text-shadow 0.3s ease; }
.readout-cell:hover .readout-value { text-shadow: 0 0 16px rgba(63, 224, 197, 0.5); color: var(--signal-teal); }
.readout-value.counting { color: var(--signal-teal); }

/* --- Section titres : index mono animé ------------------------------------ */
.section-title { position: relative; display: inline-block; }
.section-title::before {
  content: '';
  position: absolute;
  left: -14px; top: 50%;
  width: 4px; height: 0;
  background: var(--signal-teal);
  box-shadow: 0 0 10px var(--signal-teal);
  transform: translateY(-50%);
  transition: height 0.5s ease 0.1s;
}
.reveal.is-visible .section-title::before,
.section-head.is-visible .section-title::before { height: 70%; }

/* --- Cartes catégories : cascade + halo coloré au survol ------------------ */
.category-card {
  position: relative;
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.28s ease;
  cursor: default;
}
.category-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--cat, var(--signal-teal));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
}
.category-card:not(.empty):hover {
  transform: translateY(-3px);
  background: var(--bg-panel-raised);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--cat, var(--signal-teal));
  z-index: 2;
}
.category-card:not(.empty):hover::before { transform: scaleY(1); }
.category-card .icon { transition: transform 0.3s ease, filter 0.3s ease; }
.category-card:not(.empty):hover .icon { transform: translateY(-2px) scale(1.08); filter: drop-shadow(0 0 8px currentColor); }
.category-card.empty { opacity: 0.5; }

/* --- Journal : lignes qui glissent, ligne « live » ------------------------ */
.log-list { position: relative; }
.log-row {
  transition: background 0.2s ease, transform 0.2s ease;
  animation: row-in 0.5s ease both;
}
@keyframes row-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.log-row:hover { background: var(--bg-panel-raised); transform: translateX(3px); }
.log-time { position: relative; }
.log-row.fresh { animation: row-flash 1.6s ease; }
@keyframes row-flash {
  0% { background: rgba(63, 224, 197, 0.18); box-shadow: inset 2px 0 0 var(--signal-teal); }
  100% { background: transparent; box-shadow: inset 2px 0 0 transparent; }
}

/* --- Map panel : coins d'instrument + label scan -------------------------- */
.map-panel { position: relative; }
.map-panel::before,
.map-panel::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 1px solid rgba(63, 224, 197, 0.5);
  z-index: 5;
  pointer-events: none;
}
.map-panel::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.map-panel::after { bottom: 52px; right: 8px; border-left: 0; border-top: 0; }

/* --- Connect panel : liseré animé ----------------------------------------- */
.connect-panel { position: relative; overflow: hidden; }
.connect-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--signal-teal), transparent);
  transform: translateX(-100%);
  animation: border-run 4s linear infinite;
}
@keyframes border-run { to { transform: translateX(100%); } }

/* --- Footer status link glow ---------------------------------------------- */
.footer-links a { transition: color 0.2s ease, text-shadow 0.2s ease; }
.footer-links a:hover { text-shadow: 0 0 10px rgba(63, 224, 197, 0.5); }

/* --- Respect de prefers-reduced-motion ------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .scan-sweep, .crt-overlay, .accent-shimmer, .tuner-bars i,
  .rec-dot, .type-caret, .connect-panel::before, .nav-brand .dot,
  .hero-content > * { animation: none !important; }
  html.has-js .reveal { opacity: 1 !important; transform: none !important; }
  .hero-content > * { opacity: 1 !important; transform: none !important; }
  .hero-corner { opacity: 1 !important; animation: none !important; }
}
