/* ==========================================
   VARIABLES & RESET : PALETTE PASTEL
   ========================================== */
:root {
  /* Une couleur pastel par zone */
  --z0: #fde2e4; /* rose */
  --z1: #dfe7fd; /* bleu lavande */
  --z2: #dff3d3; /* vert menthe */
  --z3: #fff1c9; /* citron */
  --z4: #d3f0f0; /* aqua */
  --z5: #e9dcf7; /* lilas */
  --z6: #ffdcc9; /* pêche */
  --z7: #cfe6ff; /* ciel */
  --z8: #fbdcec; /* rose bonbon */

  --ink: #3d3a52;
  --muted: #787590;
  --accent: #8b7cf0;
  --accent-dark: #6d5ed6;
  --card: rgba(255, 255, 255, 0.62);
  --card-border: rgba(255, 255, 255, 0.95);
  --shadow: 0 10px 30px rgba(110, 90, 160, 0.12);
  --shadow-hover: 0 18px 40px rgba(110, 90, 160, 0.22);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
  background: #fdf6ee;
  color: var(--ink);
}

/* ==========================================
   NAVIGATION
   ========================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 3rem;
  background: rgba(253, 246, 238, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

.logo {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 2px;
  color: var(--ink);
}

nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

nav a:hover {
  color: var(--accent-dark);
}

.btn-cv {
  border: 1.5px solid var(--accent);
  color: var(--accent-dark) !important;
  padding: 0.45rem 1.2rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.6);
}

.btn-cv:hover {
  background: var(--accent);
  color: #fff !important;
}

/* ==========================================
   SCÈNE & MONDE (déplacement : bas, droite, bas, droite…)
   ========================================== */
.stage {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.world {
  position: absolute;
  top: 0;
  left: 0;
  width: 500vw;   /* 5 colonnes */
  height: 500vh;  /* 5 lignes */
  will-change: transform;
}

.zone {
  position: absolute;
  width: 20%;
  height: 20%;
  left: calc(var(--c) * 20%);
  top: calc(var(--r) * 20%);
  background: var(--zbg);
  padding: 80px clamp(1.5rem, 5vw, 5rem) 92px clamp(5.5rem, 7vw, 7rem);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Bulles décoratives douces */
.zone::before,
.zone::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  filter: blur(2px);
  pointer-events: none;
}

.zone::before {
  width: 38vmin;
  height: 38vmin;
  top: -10vmin;
  right: -8vmin;
}

.zone::after {
  width: 24vmin;
  height: 24vmin;
  bottom: -8vmin;
  left: -6vmin;
  background: rgba(255, 255, 255, 0.35);
}


.zone-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1400px;
}

/* Mise en page : texte à gauche + contenu à droite */
.layout-split {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) 1.4fr;
  gap: 3rem;
  align-items: center;
  --img-h: clamp(300px, calc(100vh - 240px), 760px);
}

.layout-split:not(.about-layout) {
  grid-template-columns: minmax(300px, 0.8fr) 1.9fr;
  gap: 3rem;
}

/* Projet 3D : image à gauche, texte à droite */
.layout-split.text-right {
  grid-template-columns: 1.9fr minmax(300px, 0.8fr);
}
.layout-split.text-right .zone-text { order: 2; }
.layout-split.text-right .cards { order: 1; }

/* Colonne de texte : titre de la zone puis infos du projet */
.zone-text .project-info {
  margin-top: 2rem;
  padding: 1.6rem 0 0;
  border-top: 2px solid rgba(255, 255, 255, 0.8);
}
.zone-text .project-title { font-size: 1.55rem; }
.zone-text .project-desc { max-width: none; }

/* Mise en page : titre en haut + rangée de cartes */
.layout-row {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  --img-h: clamp(200px, calc(100vh - 490px), 560px);
}

.layout-row .zone-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
}

.layout-row .zone-desc {
  max-width: 460px;
  text-align: right;
}

.zone-desc {
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.6;
  margin-top: 1rem;
}

.layout-row .zone-desc {
  margin-top: 0;
}

/* ==========================================
   TEXTES COMMUNS
   ========================================== */
.sub-tag {
  display: inline-block;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  margin-top: 0.7rem;
  color: var(--ink);
}

/* ==========================================
   ZONE 1 : À PROPOS
   ========================================== */
.main-title {
  font-size: clamp(2.6rem, 5.5vw, 4.4rem);
  font-weight: 800;
  line-height: 1;
  margin: 0.8rem 0;
  letter-spacing: -2px;
}

.hero-subtitle {
  font-size: clamp(1.3rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--accent-dark);
  margin-bottom: 1.2rem;
}

.about-description {
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
  margin-bottom: 1.8rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  padding: 0.8rem 1.8rem;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(139, 124, 240, 0.35);
}

.btn-primary:hover {
  transform: translateY(-3px);
  background: var(--accent-dark);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border: 1.5px solid #fff;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.about-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 1.4rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card-label {
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  display: block;
  margin-bottom: 0.4rem;
}

.card-main .card-name {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.card-main .card-tags {
  color: var(--muted);
  font-size: 0.85rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.card-small {
  padding: 1.1rem;
}

.card-value {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.card-subtext {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

/* ==========================================
   ZONE 2 : STAGES & DIPLÔMES
   ========================================== */
.timeline-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.8rem;
}

.timeline-subtitle {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stage-card {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.2rem 1.4rem;
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.stage-role {
  font-size: 1.05rem;
  font-weight: 700;
}

.stage-company {
  display: block;
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.stage-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: rgba(139, 124, 240, 0.12);
  padding: 0.3rem 0.7rem;
  border-radius: 12px;
  white-space: nowrap;
}

.stage-location {
  font-size: 0.85rem;
  color: var(--muted);
}

.stage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
}

/* ==========================================
   CARTES PROJETS
   ========================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr));
  gap: 1.4rem;
}

/* Projets sans cadre : juste l'image + le titre */
.project-card {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.project-card:hover {
  transform: translateY(-6px);
}

.image-wrapper {
  width: 100%;
  height: var(--img-h, 300px);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: transparent;
  cursor: zoom-in;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-wrapper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* image entière, sans rognage */
  opacity: 0;
  transition: opacity 0.7s ease-in-out;
}

.image-wrapper img:first-child { opacity: 1; }

.project-info {
  padding: 1.4rem 0.4rem 0.2rem;
}

.project-title {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
}

.project-category {
  font-size: 0.98rem;
  color: var(--accent-dark);
  margin-top: 0.2rem;
}

.project-link {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.3s ease;
}

.project-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

/* ==========================================
   PROJETS EN COLLAGE
   ========================================== */
.cards.collage {
  position: relative;
  isolation: isolate;
  align-items: start;
}

/* Ronds pastel : toujours derrière les images */
.cards.collage::before,
.cards.collage::after {
  content: '';
  position: absolute;
  z-index: 0;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}
.cards.collage::before { width: 34%; top: -14%; left: 24%; }
.cards.collage::after  { width: 24%; bottom: 6%; right: 4%; background: rgba(255, 255, 255, 0.4); }

.layout-split .cards.collage::before { width: 52%; top: -10%; left: auto; right: -6%; }
.layout-split .cards.collage::after  { width: 30%; bottom: -4%; left: 4%; right: auto; }

.cards.collage > .project-card {
  position: relative;
  z-index: 1;
}

.cards.collage .image-wrapper {
  filter: drop-shadow(0 14px 22px rgba(110, 90, 160, 0.22));
  transition: transform 0.4s ease;
}

/* 1re image : légèrement penchée à gauche */
.cards.collage > .project-card:nth-child(odd) .image-wrapper {
  transform: rotate(-2deg);
}

/* 2e image : même taille, penchée à droite, chevauche un peu la 1re (textes alignés) */
.cards.collage > .project-card:nth-child(even) {
  justify-self: start;
  width: 100%;
  margin-left: -2.6rem;
  z-index: 2;
}
.cards.collage > .project-card:nth-child(even) .image-wrapper {
  transform: rotate(2.2deg);
}

/* Le texte de la 1re carte ne touche jamais celui de la 2e */
.cards.collage > .project-card:nth-child(odd):not(:last-child) .project-info {
  padding-right: 3.6rem;
}

/* Au survol : l'image se redresse */
.cards.collage > .project-card:hover .image-wrapper {
  transform: rotate(0deg) scale(1.03);
}

/* ==========================================
   INFOS SOUS LA PHOTO + FLÈCHES DU CARROUSEL
   ========================================== */
.project-desc {
  margin-top: 0.5rem;
  max-width: 70ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Barre de contrôle en bas de la photo : ‹ ● ● ● › */
.carousel-controls {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 14px rgba(61, 58, 82, 0.18);
  z-index: 10;
  cursor: default;
}

.carousel-arrow {
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.carousel-arrow:hover {
  background: var(--accent);
  color: #fff;
}

.carousel-dots {
  display: flex;
  gap: 7px;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(61, 58, 82, 0.22);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
}

.carousel-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

/* ==========================================
   INDICATEUR DE SCROLL + MINI-PLAN
   ========================================== */
.hint {
  position: fixed;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.2rem;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.hint.hidden {
  opacity: 0;
}

.hint-arrow {
  display: inline-block;
  color: var(--accent-dark);
  font-size: 1.1rem;
  animation: bounceDown 1.4s ease-in-out infinite;
}

.hint[data-dir="right"] .hint-arrow {
  animation-name: bounceRight;
}

@keyframes bounceDown {
  0%, 100% { transform: translateY(-2px); }
  50% { transform: translateY(4px); }
}

@keyframes bounceRight {
  0%, 100% { transform: translateX(-2px); }
  50% { transform: translateX(4px); }
}

.minimap {
  position: fixed;
  right: 1.6rem;
  bottom: 1.6rem;
  z-index: 900;
  display: grid;
  grid-template-columns: repeat(5, 16px);
  grid-template-rows: repeat(5, 11px);
  gap: 3px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}

.minimap button {
  border: 2px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.minimap button:hover {
  opacity: 1;
}

.minimap button.active {
  border-color: var(--ink);
  opacity: 1;
  transform: scale(1.15);
}

/* ==========================================
   CONTACT
   ========================================== */
.contact-text {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 1rem 0 2rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  padding: 1.1rem 1.6rem;
  border-radius: 18px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.contact-card .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.contact-card .icon svg {
  width: 24px;
  height: 24px;
}

.contact-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.contact-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.email-icon svg { fill: #f08aa8; }
.email-card .contact-label { color: #e0678c; }

.linkedin-icon svg { fill: #6aa8f0; }
.linkedin-card .contact-label { color: #4a8ee0; }

.phone-icon svg { fill: #6cc79a; }
.phone-card .contact-label { color: #48b07c; }

/* ==========================================
   MODALE DE PROJET
   ========================================== */
.project-modal {
  position: fixed;
  inset: 0;
  background: rgba(61, 58, 82, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.project-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #fffaf5;
  border: 1px solid #fff;
  border-radius: 24px;
  padding: 2.5rem;
  max-width: 700px;
  width: 92%;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 60px rgba(61, 58, 82, 0.35);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.project-modal.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #fff;
  border: 1px solid rgba(61, 58, 82, 0.1);
  color: var(--ink);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.3s ease;
}

.modal-close:hover {
  background: var(--accent);
  color: #fff;
}

.modal-carousel {
  position: relative;
  width: 100%;
  height: clamp(240px, 45vh, 420px);
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.6rem;
  border: 1px solid rgba(61, 58, 82, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-img-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
}

.modal-img-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.carousel-btn,
.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(61, 58, 82, 0.12);
  color: var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-btn {
  width: 44px;
  height: 44px;
  font-size: 1.1rem;
  z-index: 10;
}

.carousel-btn:hover,
.lightbox-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.prev-btn { left: 14px; }
.next-btn { right: 14px; }

.modal-carousel.single-image .carousel-btn,
.modal-carousel.single-image .carousel-counter {
  display: none;
}

.carousel-counter {
  position: absolute;
  bottom: 14px;
  right: 18px;
  background: rgba(61, 58, 82, 0.7);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.82rem;
  letter-spacing: 1px;
}

.modal-category {
  display: block;
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.modal-title {
  color: var(--ink);
  font-size: 1.9rem;
  margin: 0.4rem 0 0.8rem;
}

.modal-description {
  color: var(--muted);
  line-height: 1.65;
  font-size: 1.02rem;
}

/* ==========================================
   LIGHTBOX PLEIN ÉCRAN
   ========================================== */
.lightbox-fullscreen {
  position: fixed;
  inset: 0;
  background: rgba(40, 36, 58, 0.94);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 2rem;
}

.lightbox-fullscreen.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-img-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-fullscreen img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 2rem;
  font-size: 2.6rem;
  color: #fff;
  cursor: pointer;
  z-index: 100000;
  line-height: 1;
}

.lightbox-btn {
  position: fixed;
  width: 50px;
  height: 50px;
  font-size: 1.4rem;
  z-index: 100000;
}

.lightbox-prev { left: 30px; }
.lightbox-next { right: 30px; }

.lightbox-fullscreen.single-image .lightbox-btn,
.lightbox-fullscreen.single-image .lightbox-counter {
  display: none;
}

.lightbox-counter {
  position: fixed;
  bottom: 25px;
  right: 40px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.95rem;
  letter-spacing: 1px;
  z-index: 100000;
}

/* ==========================================
   BONHOMME BÂTON + ÉCHELLE
   ========================================== */
:root { --fig-x: 56px; }

/* Échelle posée dans le décor : part du bas d'une zone et descend jusqu'au bas de la suivante */
.world-ladder {
  position: absolute;
  left: calc(var(--c) * 20% + 32px);
  top: calc((var(--r) + 1) * 20% - 110px);
  height: calc(20% + 96px);
  width: 48px;
  z-index: 5;
  pointer-events: none;
  border-left: 5px solid rgba(109, 94, 214, 0.6);
  border-right: 5px solid rgba(109, 94, 214, 0.6);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 40px,
    rgba(109, 94, 214, 0.6) 40px,
    rgba(109, 94, 214, 0.6) 46px
  );
}

.runner {
  position: fixed;
  left: calc(var(--fig-x) - 36px);
  bottom: 14px;
  width: 72px;
  height: 89px;
  z-index: 860;
  pointer-events: none;
  transition: bottom 0.5s ease;
}

.runner svg { width: 100%; height: 100%; overflow: visible; }
.runner[data-face="left"] svg { transform: scaleX(-1); }

.runner line,
.runner circle {
  stroke: var(--ink);
  stroke-width: 5;
  stroke-linecap: round;
  fill: none;
}
.runner circle { fill: #fff; }

/* Points de rotation (hanche, genou, épaule, coude) */
.runner g { transform-box: view-box; }
.runner .body { transform-origin: 50px 70px; }
.runner .legL, .runner .legR { transform-origin: 50px 70px; }
.runner .shin { transform-origin: 50px 95px; }
.runner .armL, .runner .armR { transform-origin: 50px 38px; }
.runner .fore { transform-origin: 50px 54px; }

/* Pose au repos */
.runner .legL { transform: rotate(5deg); }
.runner .legR { transform: rotate(-5deg); }
.runner .armL { transform: rotate(9deg); }
.runner .armR { transform: rotate(-9deg); }

/* Pause quand on ne scrolle pas, sens inverse quand on remonte */
.runner[data-moving="0"] g { animation-play-state: paused; }
.runner[data-dir="back"] g { animation-direction: reverse; }

/* --- COURSE (vers la droite) --- */
.runner[data-pose="run"] .bob { animation: runBob 0.7s ease-in-out infinite; }
.runner[data-pose="run"] .body { transform: rotate(12deg); }
.runner[data-pose="run"] .legL { animation: runThigh 0.7s ease-in-out infinite; }
.runner[data-pose="run"] .legR { animation: runThigh 0.7s ease-in-out infinite -0.35s; }
.runner[data-pose="run"] .legL .shin { animation: runShin 0.7s ease-in-out infinite; }
.runner[data-pose="run"] .legR .shin { animation: runShin 0.7s ease-in-out infinite -0.35s; }
.runner[data-pose="run"] .armL { animation: runArm 0.7s ease-in-out infinite; }
.runner[data-pose="run"] .armR { animation: runArm 0.7s ease-in-out infinite -0.35s; }
.runner[data-pose="run"] .fore { transform: rotate(-85deg); }

@keyframes runThigh {
  0%, 100% { transform: rotate(-55deg); }
  50% { transform: rotate(35deg); }
}
@keyframes runShin {
  0% { transform: rotate(15deg); }
  25% { transform: rotate(5deg); }
  50% { transform: rotate(55deg); }
  75% { transform: rotate(115deg); }
  100% { transform: rotate(15deg); }
}
@keyframes runArm {
  0%, 100% { transform: rotate(50deg); }
  50% { transform: rotate(-50deg); }
}
@keyframes runBob {
  0%, 50%, 100% { transform: translateY(0); }
  25%, 75% { transform: translateY(-4px); }
}

/* --- ÉCHELLE (vers le bas) --- */
.runner[data-pose="climb"] .foot { display: none; }
.runner[data-pose="climb"] .legL { animation: climbLegL 0.8s ease-in-out infinite; }
.runner[data-pose="climb"] .legR { animation: climbLegR 0.8s ease-in-out infinite; }
.runner[data-pose="climb"] .legL .shin { animation: climbShinL 0.8s ease-in-out infinite; }
.runner[data-pose="climb"] .legR .shin { animation: climbShinR 0.8s ease-in-out infinite; }
.runner[data-pose="climb"] .armL { animation: climbArmL 0.8s ease-in-out infinite; }
.runner[data-pose="climb"] .armR { animation: climbArmR 0.8s ease-in-out infinite; }

@keyframes climbLegL {
  0%, 100% { transform: rotate(6deg); }
  50% { transform: translateY(-3px) rotate(40deg); }
}
@keyframes climbLegR {
  0%, 100% { transform: translateY(-3px) rotate(-40deg); }
  50% { transform: rotate(-6deg); }
}
@keyframes climbShinL {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-65deg); }
}
@keyframes climbShinR {
  0%, 100% { transform: rotate(65deg); }
  50% { transform: rotate(0deg); }
}
@keyframes climbArmL {
  0%, 100% { transform: rotate(145deg); }
  50% { transform: rotate(105deg); }
}
@keyframes climbArmR {
  0%, 100% { transform: rotate(-105deg); }
  50% { transform: rotate(-145deg); }
}

@media (max-width: 768px) {
  .runner, .world-ladder { display: none; }
}

/* ==========================================
   RESPONSIVE : sur petits écrans, les zones s'empilent
   (pas de déplacement bas/droite)
   ========================================== */
@media (max-width: 768px) {
  .navbar {
    padding: 0.8rem 1rem;
    flex-direction: column;
    gap: 0.4rem;
  }

  nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
  }

  nav a {
    margin-left: 0;
    font-size: 0.8rem;
  }

  .stage {
    height: auto;
    overflow: visible;
  }

  .world {
    position: relative;
    width: 100%;
    height: auto;
    transform: none !important;
  }

  .zone {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    height: auto;
    padding: 4rem 1.2rem 3.5rem;
  }

  #a-propos {
    padding-top: 9rem;
  }


  .layout-split,
  .timeline-container,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .layout-split {
    gap: 1.6rem;
    --img-h: 260px;
  }

  .layout-row {
    --img-h: 260px;
  }

  .layout-row .zone-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .layout-row .zone-desc {
    text-align: left;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .cards.collage > .project-card:nth-child(even) {
    margin: 0;
    width: auto;
  }

  .layout-split.text-right .zone-text,
  .layout-split.text-right .cards {
    order: 0;
  }

  .cards.collage .image-wrapper,
  .cards.collage > .project-card:nth-child(even) .image-wrapper {
    transform: none;
    height: var(--img-h, 260px);
  }

  .layout-split:not(.about-layout) {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }

  .stage-header {
    flex-direction: column;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .contact-links {
    flex-direction: column;
  }

  .contact-card {
    width: 100%;
  }

  .hint,
  .minimap {
    display: none;
  }

  .modal-content {
    padding: 1.5rem;
  }
}

/* ==========================================
   INDICES DE CLIC
   ========================================== */
/* Pastille « Agrandir » sur chaque photo */
.image-wrapper::after {
  content: "⤢ Agrandir";
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 14px rgba(61, 58, 82, 0.18);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.75;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9;
}
.image-wrapper:hover::after {
  opacity: 1;
  transform: scale(1.06);
}

/* Titres de sites : clairement des liens */
.project-link {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* Bouton « Visiter le site » */
.visit-btn {
  display: inline-block;
  margin-top: 0.9rem;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform 0.25s ease, background 0.25s ease;
}
.visit-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}