/* PORTFOLIO — ADRIEN SOYEUR · FEUILLE DE STYLES

   SOMMAIRE
   1. Variables & reset
   2. Fond animé (particles.js)
   3. Sidebar, boutons flèche + thème, contenu
   4. Hero / accueil
   5. Titres de section
   6. À propos & compétences
   7. Biographie / timeline
   8. Projets
   9. Contact
   10. Footer
   11. Flou, bouton « haut de page »
   12. Responsive
*/

/* 1. VARIABLES & RESET */
:root {
  --black-color: #000000;
  --white-color: #ffffff;
  --grey-color: #808080;
  --light-grey-color: #f5f5f5;
  --main-color: #27cafe;
  --success-color: #22c55e;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --info-color: #3b82f6;

  /* Couleur du texte principal (+ alias utilisés dans le HTML) */
  --text: color-mix(in srgb, var(--white-color) 92%, var(--main-color));
  --primary: var(--main-color);

  /* Hauteurs des éléments (bordure de 2px comprise) */
  --h-lg: 56px; /* 52px + 2×2px : logo, liens nav, boutons, icônes contact */
  --h-md: 48px; /* 44px + 2×2px : flèche, thème, réseaux, onglets, inputs, haut de page */
  --border-w: 2px;
  --blur: blur(4px); /* flou d'arrière-plan appliqué partout (backdrop-filter) */
  /* Fonds SEMI-TRANSPARENTS : indispensables pour que le flou se voie
     (un fond opaque cache ce qu'il y a derrière, donc il n'y a rien à flouter) */
  --surface: color-mix(in srgb, color-mix(in srgb, var(--black-color) 88%, var(--main-color)) 55%, transparent);
  --surface-deep: color-mix(in srgb, var(--black-color) 45%, transparent); /* champs du formulaire */
  /* Couleur de bordure OPAQUE des boutons : avec une bordure semi-transparente,
     le fond se voit dessous et dessine un 2e contour au survol. */
  --border-c: color-mix(in srgb, var(--main-color) 18%, var(--black-color));

  /* Sidebar : 256px de large, 16px de padding, 16px de marge tout autour */
  --sidebar-w: 256px;
  --sidebar-m: 16px;
  --sidebar-right: calc(var(--sidebar-m) + var(--sidebar-w)); /* bord droit de la sidebar = 272px */
  --sidebar-speed: .45s;
  --sidebar-ease: cubic-bezier(.16, 1, .3, 1);
  --page-offset: 0px; /* décalage du contenu (sidebar ouverte sur grand écran : 16 + 256 + 16 = 288px) */
  --nav-offset: 0px; /* bord droit de la sidebar ouverte (sert à placer flèche + thème) */
  --topbar-h: 120px; /* zone des boutons : 16px + 48px (flèche) + 8px + 48px (thème) */

  --gutter: 48px; /* marge gauche / droite du contenu (desktop) */
  --edge: 16px; /* écart des boutons flottants avec le bord de l'écran / de la sidebar */
}

/* THÈME CLAIR */
:root.light {
  --black-color: #ffffff;
  --white-color: #000000;
  --main-color: #27788F;
}

/* Reset : enlève marges/paddings par défaut, box-sizing cohérent */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* html porte le fond sombre, body est transparent pour laisser voir les particules.
   overflow-x:hidden empêche tout défilement horizontal indésirable. */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px; /* petite marge au-dessus des sections ciblées par les ancres */
  background: var(--black-color);
  overflow-x: hidden;
}

body {
  font-family: 'Poppins',sans-serif;
  background: transparent;
  color: color-mix(in srgb, var(--white-color) 92%, var(--main-color));
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  width: 100%;
}

/* Les titres utilisent une 2e police pour le contraste */
h1, h2, h3 {
  font-family: 'Space Grotesk',sans-serif;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
}

/* Espacement vertical standard des sections. z-index:1 = au-dessus du fond. */
section {
  padding: 112px 0;
  position: relative;
  z-index: 1;
}

/* Conteneur : toute la largeur moins la marge --gutter de chaque côté */
.container {
  width: calc(100% - 2 * var(--gutter)); /* 48px à gauche et à droite (16px en tablette / mobile) */
  margin: 0 auto;
}

::selection {
  background: var(--main-color);
  color: var(--black-color);
}

/* 2. FOND ANIMÉ (particles.js) */
#particles-js {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--black-color);
}

/* Le <canvas> injecté par particles.js occupe tout le conteneur */
#particles-js canvas {
  display: block;
}

/* 3. SIDEBAR (navigation à gauche, 256px, flottante) */
/* La sidebar est cachée par défaut (glissée hors de l'écran).
   La classe .nav-open sur <html> l'affiche. Le JS (et un mini-script dans <head>)
   gère cette classe. */
.sidebar {
  position: fixed;
  top: var(--sidebar-m); /* 16px de marge tout autour */
  left: var(--sidebar-m);
  bottom: var(--sidebar-m);
  z-index: 1000;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: var(--border-w) solid color-mix(in srgb, var(--main-color) 18%, transparent); /* 2px */
  overflow-y: auto;
  transform: translateX(calc(-100% - var(--sidebar-m) - 48px)); /* cachée hors de l'écran (ombre comprise) */
  visibility: hidden; /* liens non focusables quand elle est cachée */
  transition: transform var(--sidebar-speed) var(--sidebar-ease), visibility 0s linear var(--sidebar-speed);
}

.nav-open .sidebar {
  transform: none;
  visibility: visible;
  transition: transform var(--sidebar-speed) var(--sidebar-ease), visibility 0s;
}

/* HAUT : PROFIL */
.side-head {
  display: flex;
  align-items: center;
  height: var(--h-lg);
}

.side-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.side-logo {
  display: block;
  width: var(--h-lg);
  height: var(--h-lg);
  flex-shrink: 0;
  object-fit: contain;
  background: var(--main-color);
  border-radius: 12px;
  padding: 4px;
  transition: transform .3s;
  border: var(--border-w) solid var(--main-color);
}

.side-profile:hover .side-logo {
  transform: scale(1.08); /* léger zoom au survol, sans rotation */
}

.side-id b {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.side-id b span {
  color: var(--main-color);
}

.side-id small {
  display: block;
  color: var(--grey-color);
  font-size: .75rem;
  white-space: nowrap;
}

/* LIENS */
/* 96px d'espace sous le logo (32px de gap de la sidebar + 64px) */
.side-nav {
  margin-top: 64px;
}

.side-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.side-links a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  border-radius: 12px;
  color: var(--grey-color);
  font-weight: 500;
  font-size: .98rem;
  transition: color .3s, background .3s, padding-left .3s;
  height: var(--h-lg);
}

.side-links a i {
  width: 20px;
  text-align: center;
  font-size: 1.05rem;
}

.side-links a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--main-color) 8%, transparent);
  padding-left: 20px;
}

.side-links a.active {
  color: var(--main-color);
  background: color-mix(in srgb, var(--main-color) 12%, transparent);
}

/* BAS : BOUTON « ME CONTACTER » (poussé tout en bas de la sidebar) */
.side-cta {
  margin-top: auto;
  width: 100%;
  flex-shrink: 0;
  justify-content: center;
}

/* Le zoom au survol des boutons ferait déborder celui-ci de la sidebar */
.side-cta:hover {
  transform: none;
}

/* Écrans peu hauts : on réduit l'espace sous le logo pour garder le bouton visible */
@media (max-height: 640px) {
  .side-nav {
    margin-top: 0;
  }
}

/* Focus clavier accessible */
.sidebar a:focus-visible,
.topbar button:focus-visible {
  outline: 2px solid var(--main-color);
  outline-offset: 2px;
}

/* BOUTONS FLÈCHE + THÈME (empilés en haut, à 16px du bord de l'écran ou de la sidebar) */
/* Zone invisible (sans fond ni bordure) qui suit la zone du contenu :
   les boutons sont à 16px du bord de l'écran (sidebar fermée)
   ou du bord de la sidebar (ouverte). La flèche en haut, le thème dessous. */
.topbar {
  position: fixed;
  top: 0;
  left: var(--nav-offset);
  right: 0;
  z-index: 998;
  pointer-events: none; /* la zone ne bloque pas les clics… */
  transition: left var(--sidebar-speed) var(--sidebar-ease);
}

.topbar button {
  pointer-events: auto; /* …seuls les boutons sont cliquables */
}

.topbar-inner {
  padding: var(--edge) 0 0 var(--edge); /* 16px du haut et du bord / de la sidebar */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px; /* écart entre la flèche et le thème */
}

/* Les 2 boutons : carrés 48×48 (44px + 2×2px de bordure) */
.side-arrow,
.theme-toggle {
  width: var(--h-md);
  height: var(--h-md);
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: var(--border-w) solid var(--border-c);
  background: var(--surface);
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .3s, border-color .3s, color .3s, transform var(--sidebar-speed) var(--sidebar-ease);
}

.side-arrow {
  color: var(--main-color);
}

.theme-toggle {
  color: var(--grey-color);
}

.side-arrow:hover,
.theme-toggle:hover {
  background: var(--main-color);
  border-color: var(--main-color);
  color: var(--black-color);
}

.side-arrow i {
  transition: transform var(--sidebar-speed) var(--sidebar-ease);
}

/* Sidebar cachée → la flèche pointe vers la droite */
html:not(.nav-open) .side-arrow i {
  transform: rotate(180deg);
}

/* Voile derrière la sidebar : uniquement en tablette / mobile (voir section 12) */
.nav-overlay {
  display: none;
}

/* CONTENU (main.page) */
/* Quand la sidebar est ouverte sur grand écran, le contenu se décale de 288px (16 + 256 + 16).
   « container » permet aux sections de s'adapter à la LARGEUR DISPONIBLE
   (container queries, section 12) et non à la largeur de l'écran. */
.page {
  position: relative;
  z-index: 1;
  container: page / inline-size;
  transition: margin-left var(--sidebar-speed) var(--sidebar-ease);
}

/* Grand écran + sidebar ouverte : le contenu se décale de 288px */
@media (min-width: 993px) {
  .nav-open {
    --page-offset: calc(var(--sidebar-right) + var(--sidebar-m)); /* 288px */
    --nav-offset: var(--sidebar-right); /* 272px */
  }
}

.page {
  margin-left: var(--page-offset);
}

/* Pas d'animation au premier affichage (classe retirée par le JS) */
.no-anim .sidebar,
.no-anim .topbar,
.no-anim .side-arrow,
.no-anim .theme-toggle,
.no-anim .side-arrow i,
.no-anim .page,
.no-anim .to-top {
  transition: none !important;
}

/* 4. HERO / ACCUEIL */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center; /* contenu centré verticalement… */
  padding: 80px 0; /* …avec la même marge en haut et en bas */
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 52px;
  align-items: center;
}

.hero h1 {
  /* Taille fluide : 6,4 % de la largeur du contenu (écran moins la sidebar), entre 2,3rem et 4rem */
  font-size: clamp(2.3rem, calc((100vw - var(--page-offset)) * .064), 4rem);
  line-height: 1.1;
  font-weight: 700;
  margin-bottom: 20px;
}

/* .grad = dégradé cyan animé sur le prénom */
.hero h1 .grad {
  background: linear-gradient(120deg,var(--main-color),color-mix(in srgb, var(--main-color) 60%, #ffffff),var(--main-color));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 4s linear infinite;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

/* Rôles en « volet » : le texte se dévoile de gauche à droite (comme une machine
   à écrire, mais fluide), puis se referme de droite à gauche avant le suivant. */
.hero .role {
  font-size: 1.3rem;
  color: var(--main-color);
  font-weight: 500;
  margin-bottom: 20px;
  min-height: 1.6em;
}

/* Tous les mots sont empilés dans la même case de grille :
   la ligne prend la largeur du plus long, rien ne « saute » à la mise en page. */
.role-words {
  display: inline-grid;
  max-width: 100%; /* jamais plus large que le contenu (petits écrans) */
}

/* Le volet : un masque en dégradé (opaque → transparent, bord adouci)
   2,5× plus large que le mot. On le fait glisser pour cacher / montrer le texte. */
.role-word {
  grid-area: 1 / 1;
  justify-self: start; /* la boîte colle au texte : le volet démarre sur la 1re lettre */
  -webkit-mask-image: linear-gradient(90deg, #000 40%, transparent 60%);
          mask-image: linear-gradient(90deg, #000 40%, transparent 60%);
  -webkit-mask-size: 250% 100%;
          mask-size: 250% 100%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0; /* caché : la partie transparente couvre le mot */
          mask-position: 100% 0;
  /* fermeture (droite → gauche) : rapide */
  transition: -webkit-mask-position .5s cubic-bezier(.65, 0, .35, 1),
                      mask-position .5s cubic-bezier(.65, 0, .35, 1);
}

/* Mot affiché : le volet s'ouvre de gauche à droite */
.role-word.is-active {
  -webkit-mask-position: 0 0;
          mask-position: 0 0;
  transition: -webkit-mask-position 1s cubic-bezier(.65, 0, .35, 1),
                      mask-position 1s cubic-bezier(.65, 0, .35, 1);
}

/* Accessibilité : pas d'animation si l'utilisateur l'a demandé */
@media (prefers-reduced-motion: reduce) {
  .role-word,
  .role-word.is-active {
    transition: none;
  }
}

.hero p.lead {
  color: var(--grey-color);
  font-size: 1.05rem;
  max-width: 540px;
  margin-bottom: 32px;
}

/* Boutons : hover en scale (agrandissement) */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: .98rem;
  cursor: pointer;
  border: var(--border-w) solid transparent;
  transition: .3s;
  font-family: inherit;
  height: var(--h-lg);
}

.btn-primary {
  background: var(--main-color);
  color: var(--black-color);
  box-shadow: 0 0 20px -2px color-mix(in srgb, var(--main-color) 45%, transparent);
  border-color: var(--main-color);
}

.btn-primary:hover {
  transform: scale(1.06);
  box-shadow: 0 0 32px 0px color-mix(in srgb, var(--main-color) 45%, transparent);
}

.btn-ghost {
  background: transparent;
  color: color-mix(in srgb, var(--white-color) 92%, var(--main-color));
  border: var(--border-w) solid color-mix(in srgb, var(--main-color) 18%, transparent);
}

.btn-ghost:hover {
  border-color: var(--main-color);
  color: var(--main-color);
  transform: scale(1.06);
}

/* Réseaux sociaux (carrés de 48px) */
.hero-socials {
  display: flex;
  gap: 16px;
}

.hero-socials a {
  width: var(--h-md);
  height: var(--h-md);
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface);
  border: var(--border-w) solid var(--border-c);
  color: var(--grey-color);
  font-size: 1.1rem;
  transition: .3s;
}

.hero-socials a:hover {
  color: var(--black-color);
  background: var(--main-color);
  transform: scale(1.06);
  box-shadow: 0 12px 20px -8px color-mix(in srgb, var(--main-color) 45%, transparent);
  border-color: var(--main-color);
}

/* Carte avatar : photo dans un anneau lumineux qui tourne */
.hero-card {
  position: relative;
  min-width: 0; /* la colonne ne s'élargit pas pour la photo : max-width: 100% s'applique */
}

.avatar-ring {
  position: relative;
  width: 400px;
  max-width: 100%; /* jamais plus large que sa colonne */
  aspect-ratio: 1;
  margin: 0 auto;
}

.avatar-ring::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,var(--main-color),transparent 40%,var(--main-color));
  animation: spin 6s linear infinite;
  filter: blur(2px);
  opacity: .8;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.avatar {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(160deg,color-mix(in srgb, var(--black-color) 86%, var(--main-color)),var(--black-color));
  border: 4px solid var(--black-color);
  z-index: 2;
  overflow: hidden;
}

/* La photo remplit tout le cercle */
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 5. TITRES DE SECTION */
.sec-head {
  text-align: center;
  margin-bottom: 60px;
}

.sec-tag {
  color: var(--main-color);
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-size: .8rem;
  display: inline-block;
  margin-bottom: 12px;
}

.sec-head h2 {
  font-size: 2.8rem;
  font-weight: 700;
}

.sec-head p {
  color: var(--grey-color);
  max-width: 560px;
  margin: 16px auto 0;
}

/* 6. À PROPOS & COMPÉTENCES */
/* Bio à gauche, compétences à droite */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 52px;
  align-items: center;
}

.about-text h3 {
  font-size: 1.6rem;
  margin-bottom: 16px;
}

.about-text p {
  color: var(--grey-color);
  margin-bottom: 20px;
}

/* Fiche d'infos sur 2 colonnes, sous les paragraphes */
.info-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .92rem;
}

.info-item i {
  color: var(--main-color);
  width: 20px;
  text-align: center;
}

.info-item b {
  color: color-mix(in srgb, var(--white-color) 92%, var(--main-color));
  font-weight: 500;
}

.info-item span {
  color: var(--grey-color);
}

/* Bloc compétences : grille de cartes technos (logo + badge au survol) */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* Carte blanche contenant un logo, avec badge-nom au survol */
.skill-card {
  position: relative;
  background: var(--white-color);
  border-radius: 12px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s;
}

.skill-card i {
  font-size: 3.8rem;
  /* Carte toujours blanche → logo sombre dans les deux thèmes */
  color: color-mix(in srgb, var(--black-color) 90%, var(--main-color));
  transition: transform .3s, color .3s;
}

/* Survol : la carte se soulève, le logo passe en cyan et grossit */
.skill-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -16px color-mix(in srgb, var(--main-color) 45%, transparent);
}

.skill-card:hover i {
  color: var(--main-color);
  transform: scale(1.12);
}

/* Badge affichant le nom (data-name) sous la carte, révélé au survol */
.skill-card::after {
  content: attr(data-name);
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--main-color);
  color: var(--black-color);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: .8rem;
  padding: 4px 16px;
  border-radius: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
}

.skill-card:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 7. BIOGRAPHIE / TIMELINE */
.timeline-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 52px;
  flex-wrap: wrap;
}

.tl-tab {
  background: var(--surface);
  border: var(--border-w) solid var(--border-c);
  color: var(--grey-color);
  padding: 0 24px;
  border-radius: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  font-size: .95rem;
  transition: .3s;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--h-md);
}

.tl-tab.active, .tl-tab:hover {
  background: var(--main-color);
  color: var(--black-color);
  border-color: var(--main-color);
}

.tl-panel {
  display: none;
}

.tl-panel.active {
  display: block;
  animation: fadeUp .5s;
}

.timeline {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding-left: 48px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(var(--main-color),color-mix(in srgb, var(--main-color) 25%, transparent));
  transform: translateX(-50%);
}

.tl-item {
  position: relative;
  margin-bottom: 36px;
}

.tl-item::before {
  content: '';
  position: absolute;
  left: -40px;
  top: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--black-color);
  border: 4px solid var(--main-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--main-color) 12%, transparent);
  transform: translateX(-50%);
}

.tl-item .date {
  color: var(--main-color);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: 1px;
}

.tl-item h4 {
  font-size: 1.2rem;
  margin: 4px 0 4px;
}

.tl-item .place {
  color: var(--grey-color);
  font-size: .9rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tl-item p {
  color: var(--grey-color);
  font-size: .92rem;
}

.tl-card {
  background: var(--surface);
  border: var(--border-w) solid color-mix(in srgb, var(--main-color) 18%, transparent);
  border-radius: 12px;
  padding: 20px 24px;
  transition: .3s;
}

.tl-card:hover {
  transform: translateX(8px);
  border-color: var(--main-color);
}

/* 8. PROJETS */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(332px, 1fr));
  gap: 28px;
}

.project-card {
  border: var(--border-w) solid color-mix(in srgb, var(--main-color) 18%, transparent);
  border-radius: 12px;
  overflow: hidden;
  transition: .3s;
  position: relative;
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--main-color);
  /* Halo tout autour de la carte (offset 0 = ombre centrée) */
  box-shadow: 0 0 32px color-mix(in srgb, var(--main-color) 45%, transparent);
}

.pc-banner {
  height: 300px;
  position: relative;
  overflow: hidden;
}

.pc-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: .3s;
}

.project-card:hover .pc-banner img {
  transform: scale(1.06);
}

.pc-tagimg {
  position: absolute;
  top: 16px;
  left: 16px;
  background: color-mix(in srgb, var(--black-color) 80%, transparent);
  color: var(--main-color);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: .74rem;
  font-weight: 600;
  z-index: 4;
}

.pc-overlay {
  position: absolute;
  inset: 0; /* couvre toute la carte, quelle que soit la quantité de texte */
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* le contenu reste calé en bas */
  padding: 24px;
  background: linear-gradient(to top, color-mix(in srgb, var(--black-color) 97%, transparent) 0%, color-mix(in srgb, var(--black-color) 82%, transparent) 45%, transparent 100%);
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  z-index: 3;
}

.project-card:hover .pc-overlay {
  transform: translateY(0);
}

.pc-overlay h3 {
  font-size: 1.2rem;
  color: var(--white-color);
  margin-bottom: 8px;
}

.pc-overlay p {
  color: color-mix(in srgb, var(--white-color) 72%, transparent);
  font-size: .88rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.pc-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.pc-stack span {
  background: color-mix(in srgb, var(--white-color) 12%, transparent);
  color: color-mix(in srgb, var(--white-color) 80%, transparent);
  font-size: .74rem;
  padding: 4px 12px;
  border-radius: 12px;
}

.pc-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--main-color);
  font-weight: 600;
  font-size: .92rem;
  transition: .3s;
}

.pc-link:hover {
  gap: 12px;
}

/* 9. CONTACT */
.contact-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 48px;
}

.contact-info h3 {
  font-size: 1.6rem;
  margin-bottom: 16px;
}

.contact-info p {
  color: var(--grey-color);
  margin-bottom: 32px;
}

.contact-line {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.contact-line .ci {
  width: var(--h-lg);
  height: var(--h-lg);
  border-radius: 12px;
  background: var(--surface);
  border: var(--border-w) solid var(--border-c);
  display: grid;
  place-items: center;
  color: var(--main-color);
  font-size: 1.2rem;
  flex-shrink: 0;
  transition: .3s;
}

.contact-line:hover .ci {
  background: var(--main-color);
  color: var(--black-color);
  border-color: var(--main-color);
}

.contact-line .lbl {
  font-size: .78rem;
  color: var(--grey-color);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.contact-line .val {
  font-weight: 500;
}

/* FORMULAIRE */
form {
  background: var(--surface);
  border: var(--border-w) solid color-mix(in srgb, var(--main-color) 18%, transparent);
  border-radius: 12px;
  padding: 36px;
  box-shadow: 0 20px 52px -20px color-mix(in srgb, var(--black-color) 70%, transparent);
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: color-mix(in srgb, var(--white-color) 92%, var(--main-color));
}

.field input, .field textarea {
  width: 100%;
  background: var(--surface-deep);
  border: var(--border-w) solid color-mix(in srgb, var(--main-color) 18%, transparent);
  border-radius: 12px;
  padding: 12px 16px;
  color: color-mix(in srgb, var(--white-color) 92%, var(--main-color));
  font-family: inherit;
  font-size: .95rem;
  transition: .3s;
}

/* Inputs : 48px de haut (textarea garde sa hauteur libre) */
.field input {
  height: var(--h-md);
  padding: 0 16px;
}

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--main-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--main-color) 12%, transparent);
}

.field textarea {
  resize: vertical;
  min-height: 132px;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* Le gap gère l'espacement dans .row-2 : pas de marge propre sur les champs
   (sinon, une fois empilés en mobile, gap + marge se cumulent). */
.row-2 .field {
  margin-bottom: 0;
}

form .btn-primary {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

/* Erreurs renvoyées par le serveur, sous chaque champ */
.field-error {
  margin-top: 8px;
  color: var(--danger-color);
  font-size: .82rem;
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--danger-color);
}

/* ANTI-SPAM : champ invisible pour les humains (les robots le remplissent) */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Message de confirmation (caché tant que le JS n'ajoute pas .show) */
.form-note {
  text-align: center;
  margin-top: 16px;
  font-size: .88rem;
  color: var(--success-color);
  display: none;
}

.form-note.show {
  display: block;
}

.form-note.error {
  color: var(--danger-color);
}

/* 10. FOOTER */
/* Carte flottante, même style que la sidebar : fond flouté, bordure 2px, coins 12px */
.site-footer {
  position: relative;
  z-index: 1;
  /* sous la carte : la place du bouton « haut de page » (16 + 48 + 16 = 80px),
     pour qu'il ne la recouvre jamais en bas de page */
  padding-bottom: calc(var(--edge) * 2 + var(--h-md));
}

.foot-card {
  background: var(--surface);
  border: var(--border-w) solid var(--border-c);
  border-radius: 12px;
  padding: 48px;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1fr auto; /* identité à gauche | réseaux à droite */
  gap: 48px;
}

/* COLONNE 1 : IDENTITÉ */
.foot-id {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.foot-logo {
  width: var(--h-lg);
  height: var(--h-lg);
  object-fit: contain;
  background: var(--main-color);
  border: var(--border-w) solid var(--main-color);
  border-radius: 12px;
  padding: 4px;
  transition: transform .3s;
}

/* Même survol que le logo de la sidebar : léger zoom, sans rotation */
.foot-id:hover .foot-logo {
  transform: scale(1.08);
}

.foot-id b {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.foot-id b span {
  color: var(--main-color);
}

.foot-id small {
  display: block;
  color: var(--grey-color);
  font-size: .8rem;
}

.foot-brand p {
  color: var(--grey-color);
  font-size: .92rem;
  max-width: 420px;
  margin-bottom: 24px;
}

/* COLONNE 2 : RÉSEAUX */
.foot-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.foot-title {
  color: var(--main-color);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* 2 par 2, dans le même ordre que l'accueil : Facebook, Instagram / LinkedIn, GitHub */
.foot-socials {
  display: grid;
  grid-template-columns: repeat(2, var(--h-md));
  gap: 8px;
}

.foot-socials a {
  width: var(--h-md);
  height: var(--h-md);
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface);
  border: var(--border-w) solid var(--border-c);
  color: var(--grey-color);
  font-size: 1rem;
  transition: color .3s, background-color .3s, border-color .3s;
}

.foot-socials a:hover {
  color: var(--black-color);
  background: var(--main-color);
  border-color: var(--main-color);
}

/* BAS : COPYRIGHT */
.foot-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: var(--border-w) solid var(--border-c);
  color: var(--grey-color);
  font-size: .85rem;
}

/* 11. FLOU, BOUTON « HAUT DE PAGE » */

/* Flou d'arrière-plan de 4px sur toutes les surfaces (boutons, cartes, champs…).
   Les liens de la sidebar n'en ont pas besoin : la sidebar est déjà floutée. */
.side-arrow,
.theme-toggle,
.btn,
.hero-socials a,
.foot-socials a,
.skill-card,
.tl-tab,
.tl-card,
.project-card,
.pc-tagimg,
.pc-stack span,
.contact-line .ci,
form,
.field input,
.field textarea,
.foot-card,
.to-top,
.nav-overlay {
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Bouton retour en haut (caché tant que le JS n'ajoute pas .show) */
.to-top {
  position: fixed;
  bottom: var(--edge); /* en bas à droite, à 16px des bords */
  right: var(--edge);
  width: var(--h-md);
  height: var(--h-md);
  border-radius: 12px;
  background: var(--main-color);
  color: var(--black-color);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  border: var(--border-w) solid var(--main-color);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  box-shadow: 0 12px 28px -8px color-mix(in srgb, var(--main-color) 45%, transparent);
  z-index: 900;
}

.to-top.show {
  opacity: 1;
  pointer-events: auto;
}

.to-top:hover {
  transform: translateY(-4px);
}

/* 12. RESPONSIVE */
/* A) NAVIGATION : dépend de la taille de l'ÉCRAN (media queries) */
@media (max-width: 992px) {
  :root {
    /* sur petit écran on garde 256px, mais on laisse toujours la place pour la flèche */
    --sidebar-w: min(256px, calc(100vw - 112px)); /* 16 + nav + 16 + 48 + 16 */
  }
  /* Contenu à 16px des bords gauche et droit */
  :root {
    --gutter: var(--edge); /* 16px */
  }
  /* La sidebar passe AU-DESSUS du contenu (le contenu ne se décale plus) */
  .sidebar {
    background: var(--surface);
    box-shadow: 12px 0 44px color-mix(in srgb, var(--black-color) 40%, transparent);
  }
  /* Sidebar ouverte : les boutons restent visibles au-dessus du voile,
     et se placent juste à droite de la sidebar */
  .topbar {
    z-index: 1001;
  }
  .sidebar {
    z-index: 1002;
  }
  .nav-open .side-arrow,
  .nav-open .theme-toggle {
    transform: translateX(var(--sidebar-right)); /* → 16px à droite de la sidebar */
  }
  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: color-mix(in srgb, var(--black-color) 55%, transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    z-index: 999;
  }
  .nav-open .nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  /* Pas de défilement de la page derrière la sidebar ouverte */
  html.nav-open body {
    overflow: hidden;
  }
}

/* B) CONTENU : dépend de la LARGEUR DISPONIBLE (container queries)
   Ex. : écran 1440px + sidebar ouverte = 1152px pour le contenu. */

/* MOYEN : les grilles 2 colonnes repassent en 1 colonne */
@container page (max-width: 860px) {
  .hero-grid, .about-grid, .contact-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  /* photo au-dessus du texte : on laisse la place aux boutons flèche + thème en haut */
  .hero {
    padding-top: calc(var(--topbar-h) + 32px);
  }
  .hero-card {
    order: -1;
  }
  /* photo au-dessus du texte */
  .avatar-ring {
    width: 300px;
  }
  /* texte centré sous la photo */
  .hero-text {
    text-align: center;
  }
  .role-word {
    justify-self: center;
  }
  .hero p.lead {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-actions,
  .hero-socials {
    justify-content: center;
  }
  .info-list {
    grid-template-columns: 1fr 1fr;
  }
  .skills-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .sec-head h2 {
    font-size: 2.4rem;
  }
}

/* PETIT */
@container page (max-width: 700px) {
  section {
    padding: 80px 0;
  }
  .sec-head h2 {
    font-size: 2.2rem;
  }
  .row-2 {
    grid-template-columns: 1fr;
  }
  .skills-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .info-list {
    grid-template-columns: 1fr;
  }
  form {
    padding: 28px;
  }
  .foot-card {
    padding: 28px;
  }
  .foot-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .foot-socials {
    grid-template-columns: repeat(4, var(--h-md)); /* mobile : les 4 sur une ligne */
  }
  .foot-bottom {
    flex-direction: column;
    margin-top: 32px;
  }
}

/* TRÈS PETIT : boutons en pleine largeur */
@container page (max-width: 520px) {
  .avatar-ring {
    width: 232px;
  }
  .sec-head h2 {
    font-size: 2rem;
  }
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .hero-actions {
    flex-direction: column;
  }
  .btn {
    width: 100%;
    justify-content: center;
  }
}
