/* =====================================================================
   Portfolio Gaetan Malagnini — style.css
   ---------------------------------------------------------------------
   SOMMAIRE
     1.  COULEURS & THÈMES
     2.  RESET & BASE
     3.  HEADER & NAVIGATION
     4.  SECTIONS
     5.  BOUTONS
     6.  ACCUEIL
     7.  À PROPOS
     8.  BIOGRAPHIE
     9.  PROJETS
     10. CONTACT
     11. FOOTER
     11b. PWA — bouton install + bannière de mise à jour
     12. RESPONSIVE — Menu mobile / tablette
     13. RESPONSIVE — Mobile
     14. ACCESSIBILITÉ — réduction des animations
   ===================================================================== */


/* =====================================================================
   1. COULEURS & THÈMES
   ===================================================================== */

:root {
  --main:      #78a5ab;
  --main-600:  #5f8a90;
  --main-glow: rgba(120, 165, 171, 0.45);
}

/* Thème sombre (par défaut) */
[data-theme="dark"] {
  --bg:        #0a0e0a;
  --bg-alt:    #0f150f;
  --surface:   rgba(18, 26, 18, 0.75);
  --surface-2: #172217;
  --border:    rgba(120, 165, 171, 0.20);
  --grid-line: rgba(120, 165, 171, 0.07);
  --text:      #e8f5e8;
  --text-dim:  #9db09d;
  --shadow:    0 20px 60px -20px rgba(0, 0, 0, 0.7);
}

/* Thème clair */
[data-theme="light"] {
  --bg:        #f4f8f4;
  --bg-alt:    #eaf2ea;
  --surface:   rgba(255, 255, 255, 0.75);
  --surface-2: #f0f6f0;
  --border:    rgba(120, 165, 171, 0.24);
  --grid-line: rgba(120, 165, 171, 0.10);
  --text:      #0c150c;
  --text-dim:  #4c614c;
  --shadow:    0 20px 60px -24px rgba(0, 80, 0, 0.25);
}


/* =====================================================================
   2. RESET & BASE
   ===================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  overflow-x: hidden;
}

body {
  position: relative;
  width: 100%;
  max-width: 100%;
  font-family: 'Poppins', system-ui, sans-serif;
  line-height: 1.65;
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
  overflow-wrap: break-word;
  transition: background .3s ease, color .3s ease;

  /* Grille de fond de 48px */
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center center;
}

img {
  display: block;
  max-width: 100%;
}

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

ul {
  list-style: none;
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

.accent {
  color: var(--main);
}

.container {
  width: calc(100% - 32px);
  max-width: 1200px;
  margin-inline: auto;
}


/* =====================================================================
   3. HEADER & NAVIGATION
   ===================================================================== */

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: 72px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: background .3s ease, border-color .3s ease;
}

.header.is-scrolled {
  border-bottom-color: var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo (image + texte) */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.logo img {
  display: block;
  height: 40px;
  width: auto;
  border-radius: 8px;
  transition: transform .3s ease;
}

.logo:hover img {
  transform: scale(1.12) rotate(-6deg);
}

.logo-text {
  font-size: 20px;
  font-weight: 800;
}

/* Nav (desktop) : le <ul> se centre, le thème part à droite */
.nav {
  flex: 1;
  display: flex;
  align-items: center;
}

.nav-link i {
  display: none; /* icônes visibles uniquement dans la sidebar mobile */
}

/* Voile de la sidebar : masqué sur desktop */
.nav-overlay {
  display: none;
}

/* Sur desktop, le logo est à gauche de la nav (les liens se centrent, le thème à droite) */
.nav > .logo {
  flex: 0 0 auto;
  margin-right: 24px;
}

/* Verrouille le défilement quand la sidebar est ouverte */
body.menu-open {
  overflow: hidden;
}

/* Liens de nav */
.nav-list {
  display: flex;
  gap: 32px;
  margin-inline: auto; /* centre les 5 liens */
}

.nav-link {
  position: relative;
  padding-block: 4px;
  font-weight: 500;
  color: var(--text-dim);
  transition: color .3s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--main);
  transition: width .3s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  width: 100%;
}

/* Bouton thème (Light / Dark) */
.theme-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: transform .3s ease, border-color .3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
  border-color: var(--main);
}

.theme-toggle-icons {
  position: relative;
  width: 18px;
  height: 18px;
}

.theme-toggle i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
  transition: transform .3s ease, opacity .3s ease;
}

.theme-toggle-text {
  display: none; /* visible seulement dans la sidebar mobile */
}

.icon-sun {
  color: var(--main);
}

[data-theme="dark"] .icon-moon {
  opacity: 1;
  transform: translateY(0);
}

[data-theme="dark"] .icon-sun {
  opacity: 0;
  transform: translateY(140%);
}

[data-theme="light"] .icon-moon {
  opacity: 0;
  transform: translateY(-140%);
}

[data-theme="light"] .icon-sun {
  opacity: 1;
  transform: translateY(0);
}

.nav-burger {
  display: none;
  position: relative;
  z-index: 210;
  width: 44px;
  height: 44px;
  font-size: 20px;
}


/* =====================================================================
   4. SECTIONS (titres communs)
   ===================================================================== */

.section {
  position: relative;
  min-height: 100vh;
  padding-block: 48px;
}

/* Chaque section (hors accueil) remplit l'écran et centre son contenu */
.section:not(.hero) {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Le contenu passe au-dessus du grand numéro */
.section > .container {
  position: relative;
  z-index: 1;
}

/* Grand numéro de section (filigrane) */
.section-index {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  font-size: 240px;
  font-weight: 800;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px var(--border);
  opacity: .8;
  pointer-events: none;
  user-select: none;
  transform: translate(-50%, -50%);
}

.section-head {
  position: relative;
  margin-bottom: 48px;
  text-align: center;
}

.section-head .section-tag,
.section-head .section-title,
.section-head .section-lead {
  position: relative;
  z-index: 1;
}

.section-lead {
  max-width: 56ch;
  margin: 16px auto 0;
  color: var(--text-dim);
}

.section-tag {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--main);
}

.section-title {
  position: relative;
  display: inline-block;
  font-size: 44px;
  font-weight: 800;
  line-height: 1.1;
}


/* =====================================================================
   5. BOUTONS
   ===================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 999px;
  transition: transform .3s ease, box-shadow .3s ease, background .3s ease,
              color .3s ease, border-color .3s ease;
}

.btn--primary {
  color: #041004;
  background: var(--main);
  box-shadow: 0 0 20px -2px var(--main-glow);
}

.btn--primary:hover {
  transform: scale(1.05);
  box-shadow: 0 0 28px 0 var(--main-glow);
}

.btn--ghost {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
}

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

.btn--block {
  width: 100%;
}

.btn:active {
  transform: scale(.97);
}


/* =====================================================================
   6. ACCUEIL (HERO)
   ===================================================================== */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding-top: 72px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: 48px;
}

/* Photo + halo */
.hero-photo {
  position: relative;
  display: grid;
  place-items: center;
}

.halo {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--main-glow) 0%, transparent 68%);
  filter: blur(8px);
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1);    opacity: .85; }
  50%      { transform: scale(1.12); opacity: 1; }
}

.photo-frame {
  position: relative;
  z-index: 1;
  width: 360px;
  height: 360px;
  padding: 12px;
  border-radius: 50%;
}

.photo-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--main), transparent 55%, var(--main));
  animation: spin 8s linear infinite;
}

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

.photo-frame-img,
.photo-frame-fallback {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 4px solid var(--bg);
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.photo-frame-fallback {
  display: grid;
  place-items: center;
  font-size: 88px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--main);
}

.status-badge {
  position: absolute;
  bottom: 16px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.status-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--main);
  box-shadow: 0 0 0 0 var(--main-glow);
  animation: blip 1.6s ease-out infinite;
}

@keyframes blip {
  0%   { box-shadow: 0 0 0 0 var(--main-glow); }
  100% { box-shadow: 0 0 0 10px transparent; }
}

/* Présentation */
.hero-hello {
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.hero-name {
  margin-block: 4px 8px;
  font-size: 64px;
  font-weight: 800;
  line-height: 1.05;
}

/* Desktop : le "01" ancré en haut de l'accueil */
.hero-num-top {
  top: 96px; /* 72 (header) + 24 */
  transform: translate(-50%, 0);
}

.hero-num-name {
  display: none; /* affiché seulement quand le nom passe sous la photo */
}

.hero-role {
  min-height: 1.4em;
  margin-bottom: 16px;
  font-size: 26px;
  font-weight: 600;
  color: var(--main);
}

.hero-role::after {
  content: "|";
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.hero-text {
  max-width: 52ch;
  margin-bottom: 24px;
  color: var(--text-dim);
}

.hero-socials {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
}

.social {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 18px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: transform .3s ease, color .3s ease, border-color .3s ease, background .3s ease;
}

.social:hover {
  transform: scale(1.15) translateY(-2px);
  color: var(--main);
  border-color: var(--main);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}


/* =====================================================================
   7. À PROPOS
   ===================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

/* Gauche : contexte (haut) + informations (bas). Droite : stack. */
.about-desc {
  grid-column: 1;
  grid-row: 1;
  padding: 4px 0;
  background: transparent;
  border: none;
}

.about-infos {
  grid-column: 1;
  grid-row: 2;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform .3s ease, border-color .3s ease;
}

.about-infos:hover {
  transform: scale(1.01);
  border-color: var(--main);
}

.about-stack {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.about-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 700;
}

.about-desc p {
  color: var(--text-dim);
}

.about-desc p + p {
  margin-top: 12px;
}

/* Liste d'infos */
.infos {
  display: grid;
  gap: 4px;
}

.infos li {
  display: grid;
  grid-template-columns: 24px 120px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}

.infos li:last-child {
  border-bottom: none;
}

.infos i {
  font-size: 15px;
  text-align: center;
  color: var(--main);
}

.infos-k {
  font-size: 14px;
  color: var(--text-dim);
}

.infos-v {
  font-weight: 600;
}

/* Filtres (Isotope) */
.stack-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: transform .3s ease, color .3s ease, background .3s ease, border-color .3s ease;
}

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

.filter-btn.is-active {
  color: #041004;
  background: var(--main);
  border-color: var(--main);
}

/* Stack technique (Isotope) */
.stack {
  position: relative;
}

.stack::after { /* clearfix pour le repli en float */
  content: "";
  display: block;
  clear: both;
}

/* Sizers Isotope : largeur de colonne + gouttière (4 colonnes sur desktop). */
.grid-sizer,
.tech-card {
  width: 23%;
}

.gutter-sizer {
  width: 2.66%;
}

.stack-loading,
.carousel-loading {
  width: 100%;
  padding: 32px;
  text-align: center;
  color: var(--text-dim);
}

.tech-card {
  position: relative;
  float: left;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1; /* cartes carrées */
  margin-bottom: 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  /* PAS de transition sur transform : Isotope gère le déplacement. */
  transition: border-color .3s ease, box-shadow .3s ease;
}

.tech-card:hover {
  border-color: var(--main);
  box-shadow: var(--shadow);
}

/* Le zoom au survol est appliqué au logo interne (pas à l'item Isotope). */
.tech-card:hover .tech-card-logo {
  transform: scale(1.12);
}

.tech-card.is-hidden {
  display: none; /* masqué par le filtre */
}

.tech-card-logo {
  display: grid;
  place-items: center;
  height: 56px;
  transition: transform .3s ease;
}

.tech-card-icon {
  font-size: 52px;
  line-height: 1;
}

.tech-card-icon--fa {
  color: var(--main);
}

/* Image de techno venant de l'API */
.tech-card-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
}

/* Nom en pastille, révélé au survol. */
.tech-card-label {
  position: absolute;
  left: 50%;
  bottom: -14px;
  z-index: 2;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  color: #041004;
  background: var(--main);
  border-radius: 999px;
  box-shadow: 0 6px 16px -6px var(--main-glow);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(6px);
  transition: opacity .3s ease, transform .3s ease;
}

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


/* =====================================================================
   8. BIOGRAPHIE (Formation & Expérience)
   ===================================================================== */

.bio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.bio-col {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: transform .3s ease, border-color .3s ease;
}

.bio-col:hover {
  transform: scale(1.01);
  border-color: var(--main);
}

/* Timeline */
.timeline {
  position: relative;
  margin-left: 8px;
  padding-left: 24px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before { /* point sur la ligne */
  content: "";
  position: absolute;
  top: 6px;
  left: -30px;
  width: 12px;
  height: 12px;
  background: var(--main);
  border: 2px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--main-glow);
  transition: transform .3s ease;
}

.timeline-item:hover::before {
  transform: scale(1.3);
}

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

.timeline-title {
  font-size: 17px;
  font-weight: 700;
}

.timeline-place {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text-dim);
}

.timeline-desc {
  font-size: 14px;
  color: var(--text-dim);
}


/* =====================================================================
   9. PROJETS (CAROUSEL)
   ===================================================================== */

.carousel {
  display: flex;
  align-items: center;
  gap: 16px;
}

.carousel-viewport {
  flex: 1;
  overflow: hidden;
  border-radius: 24px;
}

.carousel-track {
  display: flex;
  transition: transform .5s cubic-bezier(.6, .2, .1, 1);
}

.carousel-arrow {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  font-size: 18px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: transform .3s ease, background .3s ease, color .3s ease, border-color .3s ease;
}

.carousel-arrow:hover {
  transform: scale(1.12);
  color: #041004;
  background: var(--main);
  border-color: var(--main);
}

.carousel-arrow:active {
  transform: scale(.95);
}

/* Carte projet */
.project-card {
  flex: 0 0 100%;
  padding: 4px;
}

.project-card-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 24px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.project-card-media {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  background: var(--surface-2);
}

.project-card-media img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.project-card-inner:hover .project-card-media img {
  transform: scale(1.06);
}

.project-card-media-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  color: var(--main);
  background:
    radial-gradient(circle at 50% 40%, rgba(120, 165, 171, 0.18), transparent 60%),
    repeating-linear-gradient(
      45deg,
      var(--surface-2),
      var(--surface-2) 12px,
      var(--surface) 12px,
      var(--surface) 24px
    );
}

.project-card-media-fallback span {
  font-size: 96px;
  font-weight: 800;
  line-height: 1;
  opacity: .9;
}

.project-card-body {
  display: flex;
  flex-direction: column;
  padding: 32px;
}

.project-card-date {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--main);
}

.project-card-title {
  margin-block: 8px 12px;
  font-size: 30px;
  font-weight: 800;
}

.project-card-desc {
  flex: 1;
  color: var(--text-dim);
}

.project-card-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: transform .3s ease, color .3s ease, border-color .3s ease;
}

.tag:hover {
  transform: scale(1.08);
  color: var(--main);
  border-color: var(--main);
}

.project-card-links {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.project-card-links .btn {
  padding: 8px 20px;
  font-size: 14px;
}

.project-card-links .is-disabled {
  opacity: .45;
  pointer-events: none;
}

/* Points de navigation */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.dot-btn {
  width: 10px;
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  transition: transform .3s ease, background .3s ease, width .3s ease;
}

.dot-btn.is-active {
  width: 28px;
  background: var(--main);
}

.dot-btn:hover {
  transform: scale(1.3);
}


/* =====================================================================
   10. CONTACT
   ===================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  align-items: start;
  gap: 48px;
}

.contact-info {
  height: 100%;
  padding: 4px 0;
  background: transparent;
  border: none;
}

.contact-lead {
  margin-bottom: 24px;
  color: var(--text-dim);
}

.contact-list {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 16px;
}

.contact-ic {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  font-size: 18px;
  color: var(--main);
  background: var(--surface-2);
  border-radius: 12px;
  transition: transform .3s ease;
}

.contact-list li:hover .contact-ic {
  transform: scale(1.1);
}

.contact-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0; /* autorise l'email à se couper au lieu de déborder */
}

.contact-meta small {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.contact-meta a,
.contact-meta span {
  font-weight: 600;
  overflow-wrap: anywhere;
  transition: color .3s ease;
}

.contact-meta a:hover {
  color: var(--main);
}

.contact-socials {
  display: flex;
  gap: 12px;
}

/* Formulaire */
.contact-form {
  display: grid;
  gap: 16px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 14px;
  font-weight: 600;
}

.field label .req {
  color: var(--main);
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  resize: vertical;
  transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--main);
  box-shadow: 0 0 0 3px var(--main-glow);
}

.field.has-error input,
.field.has-error textarea {
  border-color: #ff5252;
}

.field-error {
  min-height: 14px;
  font-size: 12px;
  color: #ff5252;
}

.form-feedback {
  min-height: 20px;
  font-weight: 600;
  text-align: center;
}

.form-feedback.is-ok {
  color: var(--main);
}

.form-feedback.is-err {
  color: #ff5252;
}


/* =====================================================================
   11. FOOTER
   ===================================================================== */

.footer {
  margin-top: 48px;
  padding-block: 24px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  color: var(--text-dim);
}


/* =====================================================================
   11bis. PWA — bouton d'installation + bannière de mise à jour
   ===================================================================== */

/* Sécurité : l'attribut hidden l'emporte même si on définit un display. */
[hidden] {
  display: none !important;
}

/* Bouton "Installer l'app" (en bas à gauche) */
.pwa-install {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  color: #041004;
  background: var(--main);
  border-radius: 999px;
  box-shadow: 0 0 20px -2px var(--main-glow);
  transition: transform .3s ease;
}

.pwa-install:hover {
  transform: scale(1.05);
}

/* Bannière "Nouvelle version disponible" (en bas, centrée) */
.pwa-update {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 1001;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.pwa-update button {
  flex: 0 0 auto;
  padding: 6px 14px;
  font-weight: 600;
  color: #041004;
  background: var(--main);
  border-radius: 999px;
  transition: transform .3s ease;
}

.pwa-update button:hover {
  transform: scale(1.05);
}


/* =====================================================================
   12. RESPONSIVE — Menu mobile / tablette (< 992px (lg))
   ===================================================================== */

@media (max-width: 992px) {

  /* La barre du haut disparaît : il ne reste qu'un hamburger flottant */
  .header {
    height: auto;
    background: transparent;
    backdrop-filter: none;
    border-bottom: none;
    pointer-events: none;
  }

  .header.is-scrolled {
    border-bottom-color: transparent;
  }

  .header-inner {
    display: block;
    padding: 0;
  }

  /* Bouton hamburger flottant */
  .nav-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    pointer-events: auto;
    box-sizing: border-box;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
    padding: 0;
    font-size: 20px;
    line-height: 1;
    color: var(--text);
    background: var(--bg-alt);
    border: 2px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    transition: transform .3s ease, color .3s ease, border-color .3s ease;
  }

  /* Bordure principale seulement à l'interaction */
  .nav-burger:hover,
  .nav-burger:focus-visible,
  body.menu-open .nav-burger {
    color: var(--main);
    border-color: var(--main);
  }

  .nav-burger:hover {
    transform: scale(1.08);
  }

  /* Sidebar et voile restent cliquables malgré le header pass-through */
  .nav,
  .nav-overlay {
    pointer-events: auto;
  }

  /* Sidebar qui vient de la droite, sur toute la hauteur */
  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    width: 84vw;
    max-width: 320px;
    padding: 84px 24px 24px;
    background: var(--bg);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform .3s ease;
    overflow-y: auto;
  }

  .nav.is-open {
    transform: translateX(0);
    box-shadow: var(--shadow);
  }

  /* Voile sombre derrière la sidebar */
  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 190;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
  }

  .nav-overlay.show {
    opacity: 1;
    visibility: visible;
  }

  /* Logo en haut de la sidebar */
  .nav > .logo {
    flex: 0 0 auto;
    margin: 0 0 8px;
  }

  .nav > .logo img {
    height: 44px; /* un peu plus grand dans la sidebar */
  }

  .nav-list {
    flex-direction: column;
    gap: 4px;
    width: 100%;
  }

  .nav-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    font-size: 18px;
    border-radius: 12px;
    transition: background .3s ease, color .3s ease, box-shadow .3s ease;
  }

  .nav-link i {
    display: inline-block;
    width: 24px;
    font-size: 18px;
    text-align: center;
    color: var(--text-dim);
    transition: color .3s ease;
  }

  .nav-link::after {
    display: none; /* pas de soulignement dans la sidebar */
  }

  .nav-link:hover {
    background: var(--surface-2);
    color: var(--text);
  }

  .nav-link.is-active {
    background: var(--surface-2);
    color: var(--main);
  }

  .nav-link:hover i,
  .nav-link.is-active i {
    color: var(--main);
  }

  /* Light/Dark en bas */
  .theme-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    width: 100%;
    height: auto;
    margin-top: auto;
    padding: 12px 16px;
    overflow: visible;
    border-radius: 12px;
  }

  .theme-toggle:hover {
    transform: none;
    border-color: var(--main);
  }

  .theme-toggle-icons {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
  }

  .theme-toggle i {
    font-size: 18px;
  }

  .theme-toggle-text {
    display: inline;
    font-size: 16px;
    font-weight: 600;
  }

  /* Mise en page tablette */
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-photo {
    order: -1;
    gap: 20px;
  }

  /* "Disponible" passe sous la photo */
  .status-badge {
    position: static;
    box-shadow: none;
  }

  /* Le nom passe sous la photo : on affiche le "01" derrière le nom */
  .hero-num-top {
    display: none;
  }

  .hero-name {
    position: relative;
    z-index: 0;
    font-size: 52px;
  }

  .hero-num-name {
    display: block;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
  }

  /* Tailles réduites sur tablette (remplacent l'ancien clamp) */
  .section-index {
    font-size: 160px;
  }

  .section-title {
    font-size: 36px;
  }

  .hero-text {
    margin-inline: auto;
  }

  .hero-socials,
  .hero-cta {
    justify-content: center;
  }

  .about-grid,
  .contact-grid,
  .bio-grid {
    grid-template-columns: 1fr;
  }

  /* En une colonne : contexte, informations, puis stack */
  .about-desc,
  .about-infos,
  .about-stack {
    grid-column: auto;
    grid-row: auto;
  }

  /* Stack pleine largeur : 4 colonnes */
  .grid-sizer,
  .tech-card {
    width: 23%;
  }

  .gutter-sizer {
    width: 2.66%;
  }

  .project-card-inner {
    grid-template-columns: 1fr;
  }

  .project-card-media {
    min-height: 220px;
  }
}


/* =====================================================================
   13. RESPONSIVE — Mobile (< 576px (sm))
   ===================================================================== */

@media (max-width: 576px) {

  html {
    scroll-padding-top: 64px;
  }

  .hero {
    padding-top: 64px;
  }

  .section {
    padding-block: 40px;
  }

  .halo {
    width: 260px;
    height: 260px;
  }

  .photo-frame {
    width: 230px;
    height: 230px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }

  .infos li {
    grid-template-columns: 20px 100px 1fr;
  }

  .contact-form,
  .about-infos {
    padding: 20px;
  }

  /* Carousel plein largeur : flèches en superposition sur l'image */
  .carousel {
    position: relative;
    gap: 0;
  }

  .carousel-viewport {
    width: 100%;
  }

  .carousel-arrow {
    position: absolute;
    top: 105px;
    transform: translateY(-50%);
    z-index: 3;
    width: 40px;
    height: 40px;
    font-size: 15px;
    background: color-mix(in srgb, var(--bg) 62%, transparent);
    backdrop-filter: blur(4px);
    border: 1px solid var(--border);
    color: var(--text);
  }

  .carousel-arrow:hover {
    transform: translateY(-50%) scale(1.1);
  }

  .carousel-arrow:active {
    transform: translateY(-50%) scale(.95);
  }

  .carousel-arrow--prev {
    left: 8px;
  }

  .carousel-arrow--next {
    right: 8px;
  }

  .project-card-media {
    height: 210px;
    min-height: 0;
  }

  .project-card-body {
    padding: 20px;
  }

  .project-card-title {
    font-size: 22px;
  }

  /* Stack : 2 colonnes sur mobile */
  .grid-sizer,
  .tech-card {
    width: 48%;
  }

  .gutter-sizer {
    width: 4%;
  }

  /* Tailles réduites sur mobile */
  .section-index {
    font-size: 120px;
    opacity: .5;
  }

  .section-title {
    font-size: 30px;
  }

  .hero-name {
    font-size: 40px;
  }

  .hero-role {
    font-size: 22px;
  }
}


/* =====================================================================
   14. ACCESSIBILITÉ — réduction des animations
   ===================================================================== */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }

  html {
    scroll-behavior: auto;
  }
}
