/* Permet d’animer les variables de couleur */
@property --bg {
  syntax: "<color>";
  inherits: true;
  initial-value: #0b0f14;
}
@property --bg-soft {
  syntax: "<color>";
  inherits: true;
  initial-value: #0f1520;
}
@property --card {
  syntax: "<color>";
  inherits: true;
  initial-value: #0f172a;
}
@property --text {
  syntax: "<color>";
  inherits: true;
  initial-value: #e6edf3;
}
@property --muted {
  syntax: "<color>";
  inherits: true;
  initial-value: #9aa4b2;
}
@property --brand {
  syntax: "<color>";
  inherits: true;
  initial-value: #5599dd;
}
@property --brand-2 {
  syntax: "<color>";
  inherits: true;
  initial-value: #77aaff;
}
@property --ring {
  syntax: "<color>";
  inherits: true;
  initial-value: rgba(120, 170, 255, 0.4);
}
@property --ok {
  syntax: "<color>";
  inherits: true;
  initial-value: #22c55e;
}
@property --warn {
  syntax: "<color>";
  inherits: true;
  initial-value: #f59e0b;
}

:root {
  /* Animation fluide des couleurs du thème */
  transition: --bg var(--switch-dur) var(--switch-ease),
    --bg-soft var(--switch-dur) var(--switch-ease),
    --card var(--switch-dur) var(--switch-ease),
    --text var(--switch-dur) var(--switch-ease),
    --muted var(--switch-dur) var(--switch-ease),
    --brand var(--switch-dur) var(--switch-ease),
    --brand-2 var(--switch-dur) var(--switch-ease),
    --ring var(--switch-dur) var(--switch-ease),
    --ok var(--switch-dur) var(--switch-ease),
    --warn var(--switch-dur) var(--switch-ease);

  --bg: #0b0f14;
  --bg-soft: #0f1520;
  --card: #0f172a;
  --text: #e6edf3;
  --muted: #9aa4b2;
  --brand: #59d;
  --brand-2: #7af;
  --ring: rgba(120, 170, 255, 0.4);
  --ok: #22c55e;
  --warn: #f59e0b;
  /* transitions thème */
  --switch-dur: 240ms;
  --switch-ease: cubic-bezier(0.45, 0, 0.55, 1);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fb;
    --bg-soft: #f2f4f7;
    --card: #ffffff;
    --text: #0b1220;
    --muted: #5b6777;
    --brand: #3b82f6;
    --brand-2: #60a5fa;
    --ring: rgba(59, 130, 246, 0.25);
  }
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background-color: var(--bg); /* couleur uniforme */
  color: var(--text);
  transition: background-color var(--switch-dur) var(--switch-ease),
    color var(--switch-dur) var(--switch-ease);
}

a {
  color: inherit;
}
.container {
  max-width: 1100px;
  margin-inline: auto;
  padding: 24px;
}

/* variante sombre conservée */
body.dark header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Ajoute APRES la définition du header */
main {
  padding-top: var(--header-h);
  position: relative; /* évite des surprises de stacking */
  z-index: 0;
}

section {
  scroll-margin-top: var(--header-h);
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: radial-gradient(
    120% 120% at 10% 10%,
    var(--brand),
    var(--brand-2)
  );
  box-shadow: 0 10px 30px rgba(96, 165, 250, 0.35);
}
.brand h1 {
  font-size: 18px;
  margin: 0;
}
.tagline {
  color: var(--muted);
  font-size: 13px;
}
.links {
  display: flex;
  gap: 14px;
}
.links a {
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--muted);
}
.links a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.hero {
  padding: 48px 0 12px;
}
.hero h2 {
  font-size: 36px;
  line-height: 1.1;
  margin: 0 0 8px;
}
.hero p {
  color: var(--muted);
  margin: 0;
}

.toolbar {
  margin: 28px 0;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .toolbar {
    grid-template-columns: 1fr 220px;
  }
}
.toolbox {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.search {
  flex: 1;
  display: flex;
  gap: 8px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
}
.search input {
  all: unset;
  flex: 1;
}
.select {
  position: relative;
}
.select select {
  appearance: none;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
}
.chip.active {
  outline: 2px solid var(--ring);
  color: var(--text);
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
@media (min-width: 600px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 960px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background-color var(--switch-dur) var(--switch-ease),
    border-color var(--switch-dur) var(--switch-ease);
}
.thumb {
  height: 140px;
  display: flex;
  align-items: end;
  justify-content: end;
  padding: 12px;
  background: none; /* pas de voile bleu */
}
.status {
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.status.ok {
  color: #10b981;
  border-color: #10b98133;
  background: #10b98111;
}
.status.warn {
  color: #f59e0b;
  border-color: #f59e0b33;
  background: #f59e0b11;
}
.card h3 {
  font-size: 18px;
  margin: 14px 14px 6px;
}
.card p {
  margin: 0 14px 12px;
  color: var(--muted);
  min-height: 44px;
}
.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 14px 14px;
}
.tag {
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
}
.card footer {
  margin-top: auto;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.btn {
  appearance: none;
  border: none;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  color: white;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--card);
  color: var(--muted);
}

.section {
  padding: 60px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  transition: background var(--switch-dur) var(--switch-ease),
    background-color var(--switch-dur) var(--switch-ease),
    color var(--switch-dur) var(--switch-ease),
    border-color var(--switch-dur) var(--switch-ease), padding 120ms ease; /* padding non lié au thème, plus rapide */
}
.section h2 {
  margin: 0 0 12px;
}
.muted {
  color: var(--muted);
}

/* Modal */
dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}
dialog {
  border: none;
  padding: 0;
  border-radius: 16px;
  width: min(720px, 94vw);
  background: var(--card);
  color: var(--text);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-body {
  padding: 18px;
}
.close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
}

footer.site {
  padding: 40px 0;
  color: var(--muted);
  background: var(--bg-soft); /* s’adapte au thème */
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  transition: background-color var(--switch-dur) var(--switch-ease),
    border-color var(--switch-dur) var(--switch-ease),
    color var(--switch-dur) var(--switch-ease);
}

body.dark footer.site {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.kpi {
  display: flex;
  gap: 10px;
  align-items: center;
}

.scroller-row {
  display: flex;
  gap: 16px;
  width: 100%;
  overflow: hidden;
  position: relative;
  will-change: transform;
}
.scroller-content {
  display: flex;
  gap: 16px;
  position: relative;
  will-change: transform;
}

.scroller-content > div {
  /* uniformiser la taille */
  width: 260px !important;
  min-width: 260px !important;
  max-width: 260px !important;
  height: 170px; /* même hauteur partout */
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;

  /* style visuel (remplace l'inline JS) */
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  overflow: hidden; /* on garde l'overflow pour le UL */
}

/* le tag en haut (le nom de la techno) */
.scroller-content > div > .tag {
  flex: 0 0 auto;
}

/* la liste des projets défile dans la carte (pas la carte elle-même) */
.scroller-content > div > ul {
  margin: 8px 0 0;
  padding-left: 16px;
  color: var(--muted);
  list-style: disc;
  flex: 1 1 auto;
  overflow-y: auto; /* scroll interne si beaucoup d’items */
}

/* optionnel : évite que le scroll interne soit trop “nervieux” */
.scroller-content > div > ul::-webkit-scrollbar {
  width: 6px;
}
.scroller-content > div > ul::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
}

.theme-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background var(--switch-dur) var(--switch-ease),
    color var(--switch-dur) var(--switch-ease);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* Mode sombre forcé */
body.dark {
  --bg: #0b0f14;
  --bg-soft: #0f1520;
  --card: #0f172a;
  --text: #e6edf3;
  --muted: #9aa4b2;
  --brand: #59d;
  --brand-2: #7af;
  --ring: rgba(120, 170, 255, 0.4);
  --ok: #22c55e;
  --warn: #f59e0b;
  background-color: var(--bg);
  color: var(--text);
}

/* adoucit la transition globale pendant le switch */
/* Harmonise la transition sur tous les éléments pendant le switch */
body.theme-switching,
body.theme-switching *,
body.theme-switching *::before,
body.theme-switching *::after,
body.theme-switching dialog::backdrop {
  transition: color var(--switch-dur) var(--switch-ease),
    background var(--switch-dur) var(--switch-ease),
    background-color var(--switch-dur) var(--switch-ease),
    border-color var(--switch-dur) var(--switch-ease),
    outline-color var(--switch-dur) var(--switch-ease),
    text-decoration-color var(--switch-dur) var(--switch-ease),
    box-shadow var(--switch-dur) var(--switch-ease),
    fill var(--switch-dur) var(--switch-ease),
    stroke var(--switch-dur) var(--switch-ease) !important;
}

/* accessibilité: pas de transitions si l’utilisateur préfère réduire le mouvement */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

.card .thumb {
  position: relative;
  background-size: cover;
  background-position: center;
}
.card .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25); /* voile gris/noir discret */
}
.card .status {
  position: relative;
  z-index: 1;
}

body:not(.dark) .tags .tag,
body:not(.dark) #modalMeta .tag {
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.06); /* équivalent du voile blanc en sombre */
  border: 1px solid rgba(0, 0, 0, 0.1); /* équivalent du trait blanc en sombre */
  color: var(--muted);
}

.lang-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background var(--switch-dur) var(--switch-ease),
    color var(--switch-dur) var(--switch-ease);
  z-index: 20000 !important;
  position: relative !important;
  pointer-events: auto !important;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lang-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==== Header mobile tweaks ==== */
@media (max-width: 560px) {
  .container {
    padding: 16px;
  }

  header .nav {
    flex-direction: column;
    align-items: stretch;
    gap: 10px; /* espace entre brand et nav */
  }

  .brand h1 {
    font-size: 16px;
  }
  .tagline {
    font-size: 12px;
    line-height: 1.2;
    /* si vraiment très petit écran, on peut tronquer sur 1 ligne: */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70vw;
  }

  .links {
    order: 2;
    display: flex;
    gap: 8px;
    flex-wrap: wrap; /* autorise le retour à la ligne */
    align-items: center;
    justify-content: center; /* centre les liens */
    overflow-x: auto; /* si ça déborde quand même, scroll horizontal doux */
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px; /* espace pour le scroll */
  }

  .links a,
  .theme-toggle,
  .lang-toggle {
    padding: 8px 10px; /* plus compact */
    font-size: 14px;
    border-radius: 10px;
    flex: 0 0 auto; /* évite l’étirement */
  }

  /* avatar + texte plus serrés */
  .avatar {
    width: 40px;
    height: 40px;
  }
  .brand {
    gap: 10px;
  }
}

body:not(.dark) {
  --bg: #f7f8fb;
  --bg-soft: #f2f4f7;
  --card: #ffffff;
  --text: #0b1220;
  --muted: #5b6777;
  --brand: #3b82f6;
  --brand-2: #60a5fa;
  --ring: rgba(59, 130, 246, 0.25);
  --ok: #22c55e;
  --warn: #f59e0b;
  background-color: var(--bg);
  color: var(--text);
}

html {
  scroll-behavior: smooth;
}

section {
  scroll-margin-top: 80px; /* ajuste selon la hauteur du header */
}

/* remplace ton bloc header existant ou ajoute ces propriétés */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000; /* ++ pour passer au-dessus des éléments transformés */
  background: var(
    --card
  ); /* déjà présent chez toi, garde un fond non transparent */
}

/* par sécurité : fixe le contexte du contenu */
main {
  position: relative;
  z-index: 0;
}

/* si besoin, désactive tout z-index involontaire côté scroller (pas nécessaire
   si on augmente celui du header, mais utile si tu as encore un chevauchement) */
.scroller-row,
.scroller-content {
  z-index: auto; /* laisse 'auto' (pas de z-index positif) */
}

/* --- flags sizing tweak --- */

/* Flag button sizing */
.lang-toggle {
  font-size: 18px;
  line-height: 1;
  width: 44px;
  text-align: center;
}

/* Contact form: prevent textarea resizing */
#contact textarea {
  resize: none;
}

.small {
  font-size: 12px;
  color: var(--muted);
}
.mt1 {
  margin-top: 8px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  margin: 6px 0 10px;
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  outline: none;
}
body:not(.dark) .input {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.ring:focus {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

#contact > div {
  margin-bottom: 24px;
}

/* ===== Footer social icons ===== */
footer.site .footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
footer.site .footer-copy {
  line-height: 1.4;
}
footer.site .footer-social {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
}
footer.site .footer-social .social-link {
  color: currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  transition: opacity 150ms ease, color var(--switch-dur) var(--switch-ease);
}
footer.site .footer-social .social-link:hover {
  opacity: 1;
}
footer.site .footer-social svg {
  display: block;
}
