/* ============================================
   Portfolio — Version statique (HTML/CSS)
   Thème clair / sombre au choix
   ============================================ */

/* Thème clair (défaut) */
:root,
[data-theme="light"] {
  --bg: #f5f5f4;
  --bg-alt: #e8e6e3;
  --text: #1c1917;
  --text-muted: #57534e;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --border: rgba(28, 25, 23, 0.12);
  --card-bg: #fff;
  --header-bg: rgba(245, 245, 244, 0.95);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.1);
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --nav-h: 4rem;
  --container: min(72rem, calc(100vw - 2rem));
  --section-pad: clamp(2.5rem, 6vw, 5rem);
}

/* Thème sombre */
[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-alt: #171717;
  --text: #ededed;
  --text-muted: #a3a3a3;
  --accent: #14b8a6;
  --accent-hover: #0d9488;
  --border: rgba(255, 255, 255, 0.1);
  --card-bg: #171717;
  --header-bg: rgba(10, 10, 10, 0.95);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(15px, 1.8vw + 0.5rem, 17px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--text);
  background: var(--bg);
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

/* ---- Skip link ---- */
.skip-link {
  position: fixed;
  left: 0.5rem;
  top: 0.5rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius);
  transform: translateY(-200%);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Navbar ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.site-header .inner {
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(0.75rem, 4vw, 1.5rem);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Bouton thème dans la nav */
.theme-toggle {
  padding: 0.35rem 0.5rem;
  font-size: 1.1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius);
}
.theme-toggle:hover {
  color: var(--accent);
  background: var(--bg-alt);
}

.site-header .logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.site-header .logo:hover {
  color: var(--accent);
}

.site-header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 2rem);
}

.site-header nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.site-header nav a:hover,
.site-header nav a:focus {
  color: var(--accent);
}

/* Menu mobile : bouton hamburger */
.menu-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.menu-toggle:hover {
  background: var(--bg-alt);
}

.menu-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}

.menu-toggle[aria-expanded="true"] .icon-open {
  display: none;
}

.menu-toggle[aria-expanded="false"] .icon-close {
  display: none;
}

@media (max-width: 767px) {
  .menu-toggle {
    display: flex;
  }

  .site-header nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }

  .site-header nav ul.is-open {
    display: flex;
  }

  .site-header nav a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
  }

  .site-header nav a:hover {
    background: var(--bg-alt);
  }
}

@media (min-width: 768px) {
  .site-header nav ul {
    display: flex;
  }
}

/* ---- Main ---- */
main {
  padding-top: var(--nav-h);
  min-height: 100vh;
}

section {
  width: 100%;
  max-width: 100vw;
  padding: var(--section-pad) clamp(0.75rem, 4vw, 1.5rem);
  overflow-x: hidden;
}

section .wrap {
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

/* Texte : toujours dans l'encadré, retour à la ligne, case qui s'agrandit */
.wrap,
.section-title,
.project-card .body,
.skill-card,
.formation-card,
.exp-item .content,
.interest-card,
.about-text,
.info-grid,
.contact-form {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}
.project-card h3,
.project-card .desc,
.skill-card span,
.formation-card h3,
.formation-card p,
.exp-item .content h3,
.exp-item .content p,
.interest-card span {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}
.project-card .body,
.project-card .desc {
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
}

/* Section titles */
.section-title {
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.section-title h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.section-title p {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Hero #accueil ---- */
#accueil {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: calc(var(--nav-h) + 0.75rem);
}
#accueil .hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#accueil .hero-inner {
  max-width: 40rem;
}

#accueil .hero-inner p {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
}

#accueil .hero-inner h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  color: var(--text);
  margin: 0.25rem 0 0;
  line-height: 1.2;
}

#accueil .hero-inner .role {
  margin: 0.5rem 0 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
}

#accueil .cta {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

#accueil .scroll-hint {
  margin-top: 2.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---- À propos ---- */
#a-propos .about-grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  align-items: start;
}

@media (min-width: 900px) {
  #a-propos .about-grid {
    grid-template-columns: 1fr auto;
  }
}

#a-propos .about-text p {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 1.05rem;
}












/**/



/* --- Carte mise en avant "À propos" --- */
.highlight-box {
  position: relative;
  padding: 2rem 2rem 2rem 2.5rem;
  margin: 2rem auto 1.5rem auto;
  max-width: 48rem; /* pour centrer et limiter la largeur */
  background: #f0f7ff; /* bleu très clair */
  border: 1px solid #bdd3f0;
  border-left: 6px solid #2563eb;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  color: #1e293b; /* texte sombre pour lisibilité */
}

.highlight-box.visible {
  opacity: 1;
  transform: translateY(0);
  animation: fadeSlideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.highlight-box:hover {
  box-shadow: 0 20px 25px -5px rgba(37, 99, 235, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  transform: translateY(-2px);
}

.highlight-box p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #1e293b; /* noir/gris foncé */
}

.highlight-box strong {
  color: #1d4ed8; /* bleu vif pour les mots-clés */
  font-weight: 600;
}

/* Icône flottante */
.highlight-icon {
  position: absolute;
  left: -1rem;
  top: -1rem;
  background: #ffffff;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid #bdd3f0;
  font-size: 1.2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.highlight-box:hover .highlight-icon {
  transform: scale(1.1) rotate(-5deg);
}

/* Animation */
@keyframes fadeSlideUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Mode sombre (Dark Mode) : couleurs inversées pour rester lisible --- */
@media (prefers-color-scheme: dark) {
  .highlight-box {
    background: #f5f5f4; /* fond sombre mais pas noir */
    border-color: #475569;
    border-left-color: #60a5fa;
  }
  .highlight-box p {
    color: #e2e8f0; /* texte clair */
  }
  .highlight-box strong {
    color: #7978fb; /* bleu clair pour les mots-clés */
  }
  .highlight-icon {
    background: #0f172a;
    border-color: #475569;
  }
}

/* --- Si tu as un thème manuel (data-theme="dark") --- */
[data-theme="dark"] .highlight-box {
  background: #1e293b;
  border-color: #475569;
  border-left-color: #60a5fa;
}
[data-theme="dark"] .highlight-box p {
  color: #e2e8f0;
}
[data-theme="dark"] .highlight-box strong {
  color: #93c5fd;
}
[data-theme="dark"] .highlight-icon {
  background: #0f172a;
  border-color: #475569;
}




/**/





#a-propos .about-text p:last-of-type {
  margin-bottom: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
}
@media (min-width: 580px) {
  .info-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    justify-content: center;
  }
}
[data-theme="dark"] .info-grid {
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.08), 0 4px 20px rgba(0, 0, 0, 0.25);
}

.info-grid dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.info-grid dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}
.info-grid .text-muted {
  color: var(--text-muted);
}

#a-propos .about-text a[href^="mailto"] {
  color: var(--accent);
}

#a-propos .social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

#a-propos .social-row a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-lg);
  background: var(--bg-alt);
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}

#a-propos .social-row a:hover {
  background: var(--accent);
  color: #fff;
}

/* Icônes externes (Simple Icons CDN) et SVG inline */
.icon-img,
.icon-svg {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}
.icon-svg {
  width: 100%;
  height: 100%;
}
.skill-card .icon .icon-svg,
.interest-card .icon .icon-svg {
  width: 2rem;
  height: 2rem;
}
.social-row .icon-svg,
.contact-social .icon-svg {
  width: 24px;
  height: 24px;
}
.site-footer .links .icon-svg {
  width: 22px;
  height: 22px;
}
.social-row .icon-img,
.contact-social .icon-img {
  width: 24px;
  height: 24px;
}
.site-footer .links .icon-img {
  width: 22px;
  height: 22px;
}
/* Thème sombre : icônes sociales et footer visibles (éviter noir sur fond sombre) */
[data-theme="dark"] .social-row .icon-img,
[data-theme="dark"] .social-row .icon-svg,
[data-theme="dark"] .contact-social .icon-img,
[data-theme="dark"] .contact-social .icon-svg,
[data-theme="dark"] .site-footer .links .icon-img,
[data-theme="dark"] .site-footer .links .icon-svg {
  filter: brightness(0) saturate(100%) invert(1);
}
/* LinkedIn : garder la couleur bleue dans les deux thèmes (ne pas inverser) */
[data-theme="dark"] .icon-link-linkedin .icon-svg {
  filter: none;
}

/* ---- Compétences ---- */
#competences .wrap,
#projets .wrap,
#formations .wrap,
#experiences .wrap,
#centres-interets .wrap {
  text-align: center;
}
#competences .filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

#competences .filters button {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

#competences .filters button:hover,
#competences .filters button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 1rem;
}

.skill-card {
  padding: 1.25rem;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  text-align: center;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.skill-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.skill-card .icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--accent);
}
.skill-card .icon img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}
/* Thème sombre : rendre les icônes (souvent noires) visibles */
[data-theme="dark"] .skill-card .icon img,
[data-theme="dark"] .skill-card .icon .icon-svg,
[data-theme="dark"] .interest-card .icon img,
[data-theme="dark"] .interest-card .icon .icon-svg {
  filter: brightness(0) saturate(100%) invert(1);
}

.skill-card span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

/* ---- Projets ---- */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.25rem, 3vw, 2rem);
  justify-items: center;
}

@media (min-width: 640px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: var(--container);
    margin-left: auto;
    margin-right: auto;
  }
}
.project-card {
  width: 100%;
  max-width: 100%;
}

.project-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  color: inherit;
}

.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.project-card .thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-alt);
}

.project-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card .body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  line-height: 1.3;
}

.project-card .desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
}

.project-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.project-card .tags span {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  background: var(--bg-alt);
  border-radius: 999px;
  color: var(--text-muted);
}

.project-card .footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* Projet en maintenance ou désactivé */
.project-badge {
  display: none;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  width: fit-content;
}
.project-badge--maintenance {
  display: inline-block;
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
[data-theme="dark"] .project-badge--maintenance {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}
.project-badge--disabled {
  display: inline-block;
  background: rgba(107, 114, 128, 0.2);
  color: #4b5563;
  border: 1px solid rgba(107, 114, 128, 0.3);
}
[data-theme="dark"] .project-badge--disabled {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
  border-color: rgba(107, 114, 128, 0.3);
}

.project-card[data-status="maintenance"] {
  opacity: 0.92;
}
.project-card[data-status="maintenance"]:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.project-card[data-status="disabled"],
.project-card--disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.project-card[data-status="disabled"]:hover,
.project-card--disabled:hover {
  border-color: var(--border);
  box-shadow: none;
}
.project-card--disabled {
  cursor: not-allowed;
}

/* Bannière "En maintenance" sur la page projet */
.maintenance-banner {
  display: block;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  color: #b45309;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}
[data-theme="dark"] .maintenance-banner {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}
.maintenance-banner:empty {
  display: none;
}

/* Message "projet désactivé" (aria-live) */
.project-status-message {
  min-height: 0;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}
.project-status-message:empty {
  display: none;
}

.portfolio-evolution {
  text-align: center;
  max-width: 28rem;
  margin: 2.5rem auto 0;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

.project-card .footer .btn-ghost {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

.project-card .footer .btn-ghost:hover {
  text-decoration: underline;
}

/* Détail projet (section ancrée) */
.project-detail {
  padding-top: calc(var(--nav-h) + 1rem);
  scroll-margin-top: var(--nav-h);
}

.project-detail .wrap {
  max-width: 50rem;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}
.page-project .wrap {
  text-align: center;
}
.page-project .block {
  text-align: left;
}

.project-detail h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 0.5rem;
  color: var(--text);
}

.project-detail .meta {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.project-detail .header-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.project-detail .block {
  margin-bottom: 1.5rem;
}

.project-detail .block h2,
.project-detail .block h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--accent);
}

.project-detail .block p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.65;
}

.project-detail .skills-used {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-detail .skills-used span {
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  color: var(--text);
}

.project-detail .back {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
}

.project-detail .back:hover {
  text-decoration: underline;
}

/* ---- Formations ---- */
.formations-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .formations-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.formation-card {
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.formation-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--text);
}

.formation-card .institution {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.formation-card .period,
.formation-card .location {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.formation-card p:last-child {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- Expériences ---- */
#experiences .filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

#experiences .filters button {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

#experiences .filters button:hover,
#experiences .filters button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.timeline {
  position: relative;
  max-width: 42rem;
  margin: 0 auto;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.75rem;
  top: 1rem;
  bottom: 1rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--border), transparent);
}

.exp-item {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 2rem;
  position: relative;
}

.exp-item:last-child {
  margin-bottom: 0;
}

.exp-item .dot {
  flex-shrink: 0;
  width: 1.5rem;
  display: flex;
  justify-content: center;
  padding-top: 0.35rem;
}

.exp-item .dot::after {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--border);
}

.exp-item[data-has-proof="true"] .dot::after {
  background: var(--accent);
}

.exp-item .content {
  flex: 1;
  min-width: 0;
  padding: 1.25rem;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.exp-item .content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--text);
}

.exp-item .content .org {
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.exp-item .content .meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.exp-item .content p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Expérience avec logo (ex. Mini Entreprise Tilponem) */
.exp-item--with-logo .content {
  position: relative;
  padding-right: 4rem;
}
.exp-item-logo {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.exp-group-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 2rem 0 1rem;
}

.exp-group-title:first-child {
  margin-top: 0;
}

/* ---- Centres d'intérêts ---- */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: min(56rem, 100%);
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 480px) {
  .interests-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .interests-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.interest-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  aspect-ratio: 1;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.interest-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.interest-card .icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.5rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--accent);
}
.interest-card .icon img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

.interest-card span {
  font-size: clamp(0.75rem, 1.5vw, 0.9rem);
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}

/* ---- Contact ---- */
#contact .wrap {
  max-width: 32rem;
  margin: 0 auto;
}

.contact-form {
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.contact-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  margin-bottom: 1rem;
}

.contact-form textarea {
  min-height: 6rem;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}

.contact-form .error {
  font-size: 0.85rem;
  color: #b91c1c;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
}

.contact-form button[type="submit"] {
  margin-top: 0.5rem;
}

.contact-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.contact-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-lg);
  background: var(--bg-alt);
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}

.contact-social a:hover {
  background: var(--accent);
  color: #fff;
}

/* ---- Footer ---- */
.site-footer {
  padding: 1.5rem clamp(0.75rem, 4vw, 1.5rem);
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.site-footer .inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer .links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.site-footer .links a {
  color: var(--text-muted);
}

.site-footer .links a:hover {
  color: var(--accent);
}

/* ---- Ancres : scroll-margin pour navbar fixe ---- */
[id="accueil"],
[id="a-propos"],
[id="competences"],
[id="projets"],
[id="formations"],
[id="experiences"],
[id="centres-interets"],
[id="contact"] {
  scroll-margin-top: var(--nav-h);
}

.project-detail {
  scroll-margin-top: var(--nav-h);
}

/* ---- Utilitaires ---- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Terminal preview (projet Jeu Terminal) */
.terminal-preview {
  background: #0d1117;
  border-radius: var(--radius) var(--radius) 0 0;
  border: 1px solid var(--border);
  min-height: 10rem;
  padding: 0.75rem 1rem;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: #22c55e;
}

.terminal-preview .bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(34, 197, 94, 0.2);
}

.terminal-preview .bar span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.terminal-preview .bar .red { background: #ef4444; }
.terminal-preview .bar .yellow { background: #eab308; }
.terminal-preview .bar .green { background: #22c55e; }

/* ---- Page Admin ---- */
body.admin-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--bg);
  color: var(--text);
}
.admin-login {
  width: 100%;
  max-width: 24rem;
  padding: 2rem;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.admin-login h1 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.admin-login p { margin: 0 0 1.5rem; font-size: 0.9rem; color: var(--text-muted); }
.admin-login label { display: block; text-align: left; margin-bottom: 0.35rem; font-size: 0.9rem; }
.admin-login input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}
.admin-login .error { font-size: 0.85rem; color: #b91c1c; margin-bottom: 1rem; text-align: left; }
.admin-login .btn { width: 100%; margin-bottom: 0.5rem; }
.admin-login a { font-size: 0.9rem; }

/* ---- Page 404 ---- */
body.not-found-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  background: var(--bg);
  color: var(--text);
}
.not-found-page h1 { font-size: clamp(3rem, 10vw, 6rem); margin: 0; color: var(--text-muted); }
.not-found-page p { margin: 1rem 0; font-size: 1.1rem; color: var(--text-muted); }
.not-found-page a { margin-top: 1rem; }

/* ---- Retour en haut ---- */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, background 0.2s;
  text-decoration: none;
}
.back-to-top:hover {
  background: var(--accent-hover);
  color: #fff;
}
.back-to-top:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top svg {
  display: block;
  flex-shrink: 0;
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
  }
}
