:root {
  --c-bg:        #F7F5F0;
  --c-bg-alt:    #EEEBE4;
  --c-ink:       #1A1916;
  --c-ink-light: #5A5750; /* ratio ~5.5:1 on --c-bg ✓ */
  --c-accent:    #5C4520; /* ratio ~7.2:1 on --c-bg ✓ */
  --c-accent-lt: #8C6535;
  --c-line:      #C8C3BB;
  --ff-serif: 'Cormorant Garamond', Georgia, serif;
  --ff-mono:  'DM Mono', 'Courier New', monospace;
  --fs-xs:   0.75rem;
  --fs-sm:   1rem;
  --fs-base: 1rem;
  --fs-lg:   1.5rem;
  --fs-xl:   2.5rem;
  --fs-2xl:  4rem;
  --fs-3xl:  6.5rem;
  --sp-xs:  0.5rem;
  --sp-sm:  1rem;
  --sp-md:  2rem;
  --sp-lg:  4rem;
  --sp-xl:  7rem;
  --sp-2xl: 10rem;
  --nav-h: 64px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --c-bg:        #131210;
  --c-bg-alt:    #1C1A17;
  --c-ink:       #EDE9E2;
  --c-ink-light: #ABA79F; /* ratio ~5.0:1 on dark bg ✓ */
  --c-accent:    #D4B48A; /* ratio ~7.3:1 on dark bg ✓ */
  --c-accent-lt: #7A5C38;
  --c-line:      #2E2B26;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background-color: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--ff-serif);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

body.has-custom-cursor,
body.has-custom-cursor *,
body.has-custom-cursor a,
body.has-custom-cursor button,
body.has-custom-cursor input,
body.has-custom-cursor textarea,
body.has-custom-cursor select,
body.has-custom-cursor [role="button"],
body.has-custom-cursor label { cursor: none !important; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { border: none; background: none; font-family: inherit; }
p { max-width: 62ch; }


/* ── CURSEUR ── */

.cursor {
  position: fixed; top: 0; left: 0; width: 32px; height: 32px;
  pointer-events: none; z-index: 9999; transform: translate(-50%, -50%); display: none;
}
body.has-custom-cursor .cursor { display: block; }
.cursor__cross--h, .cursor__cross--v {
  position: absolute; background-color: var(--c-accent); transition: background-color 0.3s ease;
}
.cursor__cross--h { top: 50%; left: 0; width: 100%; height: 1px; transform: translateY(-50%); }
.cursor__cross--v { left: 50%; top: 0; height: 100%; width: 1px; transform: translateX(-50%); }
.cursor__dot {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 4px; height: 4px; background: var(--c-accent); border-radius: 50%;
}
.cursor__label {
  position: absolute; top: 20px; left: 20px; font-family: var(--ff-mono);
  font-size: var(--fs-xs); letter-spacing: 0.12em; color: var(--c-accent);
  white-space: nowrap; opacity: 0; transition: opacity 0.2s ease;
}
body.cursor--hover .cursor   { transform: translate(-50%, -50%) scale(1.6); }
body.cursor--hover .cursor__label { opacity: 1; }
body.cursor--project .cursor { transform: translate(-50%, -50%) scale(2); }


/* ── BARRE DE PROGRESSION ── */

.progress-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--c-accent), var(--c-accent-lt));
  z-index: 200; transition: width 0.1s linear;
}


/* ── TOGGLE THÈME ── */

.theme-toggle {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-line); color: var(--c-ink-light); font-size: 1rem;
  transition: all var(--transition); position: relative; overflow: hidden; cursor: pointer;
}
.theme-toggle:hover { border-color: var(--c-accent); color: var(--c-accent); }
.theme-toggle__icon { position: absolute; transition: transform 0.4s ease, opacity 0.4s ease, visibility 0s 0.4s; }
.theme-toggle__icon--dark { opacity: 0; transform: translateY(10px); visibility: hidden; }
[data-theme="dark"] .theme-toggle__icon--light { opacity: 0; transform: translateY(-10px); visibility: hidden; }
[data-theme="dark"] .theme-toggle__icon--dark  { 
  opacity: 1; transform: translateY(0); visibility: visible; 
  transition: transform 0.4s ease, opacity 0.4s ease, visibility 0s 0s; 
}


/* ── NAV ── */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h); display: flex; align-items: center;
  justify-content: space-between; padding: 0 var(--sp-lg);
  background-color: var(--c-bg); border-bottom: 1px solid var(--c-line);
  transition: background-color var(--transition), box-shadow var(--transition);
}
.nav.nav--scrolled { box-shadow: 0 2px 20px rgba(26,25,22,0.08); }
.nav__initials { font-family: var(--ff-mono); font-size: var(--fs-sm); letter-spacing: 0.12em; color: var(--c-accent); }
.nav__links { display: flex; gap: var(--sp-lg); }
.nav__links a {
  font-family: var(--ff-mono); font-size: var(--fs-xs); letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--c-ink-light); position: relative;
  display: inline-block; padding: 0.5em 0; transition: color var(--transition); cursor: pointer;
}
.nav__links a::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: var(--c-accent); transform: scaleX(0); transform-origin: left;
  transition: transform var(--transition);
}
.nav__links a:hover { color: var(--c-ink); }
.nav__links a:hover::after { transform: scaleX(1); }
.nav__actions { display: flex; align-items: center; gap: var(--sp-sm); }
.nav__burger { display: none; flex-direction: column; gap: 6px; width: 28px; padding: 8px 0; cursor: pointer; }
.nav__burger span { display: block; height: 1px; background: var(--c-ink); transition: transform var(--transition); }


/* ── HERO ── */

.hero {
  position: relative; min-height: 100svh; display: flex; align-items: flex-end;
  padding: var(--nav-h) var(--sp-lg) var(--sp-xl); overflow: hidden;
}
.hero__grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--c-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--c-line) 1px, transparent 1px);
  background-size: 60px 60px; opacity: 0.35; pointer-events: none;
}
.hero__content { position: relative; z-index: 1; padding-bottom: var(--sp-lg); }
.hero__label {
  font-family: var(--ff-mono); font-size: var(--fs-xs); letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--c-accent); margin-bottom: var(--sp-md);
  opacity: 0; animation: fadeUp 0.8s 0.3s ease forwards;
}
.hero__title {
  font-size: clamp(3.5rem, 10vw, var(--fs-3xl)); font-weight: 300;
  line-height: 0.95; letter-spacing: -0.02em; margin-bottom: var(--sp-md);
  opacity: 0; animation: fadeUp 0.9s 0.5s ease forwards;
}
.hero__title em { font-style: italic; color: var(--c-ink-light); }
.hero__tagline {
  font-family: var(--ff-mono); font-size: var(--fs-sm); color: var(--c-ink-light);
  letter-spacing: 0.08em; margin-bottom: var(--sp-lg); max-width: none;
  opacity: 0; animation: fadeUp 0.9s 0.7s ease forwards;
}
.btn {
  display: inline-block; font-family: var(--ff-mono); font-size: var(--fs-xs);
  letter-spacing: 0.2em; text-transform: uppercase; padding: 0.85em 2em;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
  opacity: 0; animation: fadeUp 0.9s 0.9s ease forwards; cursor: pointer;
}
.btn--outline { border: 1px solid var(--c-ink); color: var(--c-ink); background: transparent; }
.btn--outline:hover { background: var(--c-ink); color: var(--c-bg); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero__number {
  position: absolute; bottom: var(--sp-lg); right: var(--sp-lg);
  font-family: var(--ff-serif); font-size: clamp(8rem, 20vw, 18rem);
  font-weight: 300; color: var(--c-line); line-height: 1;
  user-select: none; pointer-events: none; letter-spacing: -0.05em;
}

.hero__number::before { content: attr(data-n); }

.hero__scroll-indicator {
  position: absolute; bottom: var(--sp-lg); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-xs);
}
.hero__scroll-line {
  display: block; width: 1px; height: 48px;
  /* FIX CONTRASTE: --c-ink (#1A1916) au lieu de --c-ink-light (#C8C3BB) — ratio 17:1 ✓ */
  background: var(--c-ink);
  animation: scrollPulse 2s ease-in-out infinite;
}
.hero__scroll-text {
  font-family: var(--ff-mono); font-size: var(--fs-xs); letter-spacing: 0.15em; text-transform: uppercase;
  /* FIX CONTRASTE: --c-ink (#1A1916) au lieu de --c-ink-light (#C8C3BB) — ratio 17:1 ✓ */
  color: var(--c-ink);
}

@keyframes scrollPulse {
  0%, 100% { transform: scaleY(1); opacity: 0.5; }
  50%       { transform: scaleY(0.5); opacity: 1; }
}


/* ── SECTIONS ── */

.section { padding: var(--sp-xl) var(--sp-lg); }
.section:nth-of-type(even) { background-color: var(--c-bg-alt); }
.section__header {
  display: flex; align-items: baseline; gap: var(--sp-md);
  margin-bottom: var(--sp-xl); padding-bottom: var(--sp-sm); border-bottom: 1px solid var(--c-line);
}
.section__number { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--c-accent); letter-spacing: 0.1em; }
.section__title { font-size: clamp(2rem, 5vw, var(--fs-2xl)); font-weight: 300; letter-spacing: -0.02em; font-style: italic; }


/* ── À PROPOS ── */

.about__content { display: grid; grid-template-columns: 1fr 320px; gap: var(--sp-xl); align-items: start; }
.about__intro { font-size: var(--fs-lg); font-weight: 300; line-height: 1.5; margin-bottom: var(--sp-md); }
.about__text p { margin-bottom: var(--sp-sm); color: var(--c-ink-light); }
.about__meta { margin-top: var(--sp-md); font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--c-ink-light); letter-spacing: 0.05em; line-height: 1.8; }


/* ── FILTRES ── */

.projects__filters { display: flex; gap: var(--sp-sm); flex-wrap: wrap; margin-bottom: var(--sp-lg); }
.filter-btn {
  font-family: var(--ff-mono); font-size: var(--fs-xs); letter-spacing: 0.15em;
  text-transform: uppercase; padding: 0.6em 1.4em; border: 1px solid var(--c-line);
  color: var(--c-ink-light); transition: all var(--transition);
  cursor: pointer; min-height: 44px; display: inline-flex; align-items: center;
}
.filter-btn:hover,
.filter-btn.active { border-color: var(--c-ink); background-color: var(--c-ink); color: var(--c-bg); }


/* ── GRILLE PROJETS ── */

.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background-color: var(--c-line);
  border: 1px solid var(--c-line);
}

.project-card {
  background-color: var(--c-bg);
  display: flex; flex-direction: column;
  transition: background-color var(--transition);
  position: relative; cursor: pointer;
  min-height: 0;
}
.project-card--wide { grid-column: span 2; }
.project-card--tall { grid-row: span 2; }
.project-card:hover { background-color: var(--c-bg-alt); }
.project-card.hidden { display: none; }


/* ── Zones image ── */

.project-card__image {
  position: relative; overflow: hidden; background-color: var(--c-bg-alt); flex-shrink: 0;
}

.project-card__image--landscape { aspect-ratio: 4 / 3; }
.project-card__image--3d { aspect-ratio: 16 / 7; }
.project-card__image--portrait { flex: 1; min-height: 200px; }

.project-card__image img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: grayscale(15%);
  opacity: 0; transform: scale(1.04);
  transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.project-card:hover .project-card__image img { opacity: 1; transform: scale(1); }


/* ── Zone image 3D ── */

.project-card__image--3d {
  position: relative; overflow: hidden; background-color: var(--c-bg-alt);
}
.project-card__image--3d model-viewer {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
  --poster-color: transparent; background: transparent;
  opacity: 0; transform: scale(1.04);
  transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.project-card:hover .project-card__image--3d model-viewer { opacity: 1; transform: scale(1); }

.project-card__placeholder--3d {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono); font-size: var(--fs-sm); color: var(--c-ink-light);
  letter-spacing: 0.1em; z-index: 2; pointer-events: none;
  opacity: 1; transition: opacity 0.35s ease;
}
.project-card:hover .project-card__placeholder--3d { opacity: 0; }

.project-card__3d-overlay {
  position: absolute; inset: 0; z-index: 3; background: transparent; pointer-events: auto; cursor: pointer;
}

.project-card__placeholder {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono); font-size: var(--fs-sm); color: var(--c-ink-light);
  letter-spacing: 0.1em; transition: opacity 0.3s ease; z-index: 1; pointer-events: none;
}
.project-card:hover .project-card__placeholder:not(.project-card__placeholder--3d) { opacity: 0; }

.project-card__tag {
  position: absolute; top: var(--sp-sm); right: var(--sp-sm);
  font-family: var(--ff-mono); font-size: var(--fs-xs); letter-spacing: 0.12em;
  text-transform: uppercase; background-color: var(--c-bg); color: var(--c-accent);
  padding: 0.25em 0.7em; border: 1px solid var(--c-accent-lt); z-index: 4; pointer-events: none;
}

.project-card__info {
  padding: var(--sp-md); flex-shrink: 0; display: flex; flex-direction: column; position: relative; z-index: 5;
}
.project-card__category { font-family: var(--ff-mono); font-size: var(--fs-xs); letter-spacing: 0.15em; text-transform: uppercase; color: var(--c-accent); margin-bottom: var(--sp-xs); }
.project-card__title { font-size: var(--fs-lg); font-weight: 300; margin-bottom: var(--sp-xs); line-height: 1.2; }
.project-card__desc { font-size: var(--fs-sm); color: var(--c-ink-light); line-height: 1.6; margin-bottom: var(--sp-sm); }
.project-card__link {
  font-family: var(--ff-mono); font-size: var(--fs-xs); letter-spacing: 0.1em;
  color: var(--c-accent); text-transform: uppercase; margin-top: auto;
  transition: letter-spacing var(--transition); display: inline-block; pointer-events: none;
}
.project-card:hover .project-card__link { letter-spacing: 0.2em; }


/* ── COMPÉTENCES ── */

.skills__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-xl) var(--sp-2xl); }
.skill-group__title {
  font-family: var(--ff-mono); font-size: var(--fs-xs); letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--c-accent); margin-bottom: var(--sp-md);
  padding-bottom: var(--sp-xs); border-bottom: 1px solid var(--c-line);
}
.skill-group__list li { margin-bottom: var(--sp-md); }
.skill-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.5em; }
.skill-name { font-size: var(--fs-sm); color: var(--c-ink); }
.skill-percent { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--c-accent); letter-spacing: 0.05em; min-width: 3ch; text-align: right; }
.skill-bar { height: 1px; background-color: var(--c-line); position: relative; overflow: visible; }
.skill-bar__fill { height: 100%; background-color: var(--c-accent); width: 0; transition: width 1.4s cubic-bezier(0.4, 0, 0.2, 1); position: relative; }
.skill-bar__fill::after {
  content: ''; position: absolute; right: -3px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; background: var(--c-accent); border-radius: 50%;
}
.skill-bar__fill.animated { width: var(--w); }


/* ── CONTACT ── */

.contact__tagline { font-size: var(--fs-xl); font-weight: 300; font-style: italic; line-height: 1.3; margin-bottom: var(--sp-xl); max-width: none; color: var(--c-ink-light); }
.contact__layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-lg); align-items: start; }
.contact__links { display: grid; grid-template-columns: 1fr; gap: 1px; background-color: var(--c-line); border: 1px solid var(--c-line); height: fit-content; }
.contact__item {
  background-color: var(--c-bg); padding: var(--sp-md) var(--sp-lg);
  display: flex; flex-direction: column; gap: 0.4em;
  transition: background-color var(--transition); cursor: pointer; min-height: 72px; justify-content: center;
}
.contact__item:hover { background-color: var(--c-ink); }
.contact__item:hover .contact__label,
.contact__item:hover .contact__value { color: var(--c-bg); }
.contact__label { font-family: var(--ff-mono); font-size: var(--fs-xs); letter-spacing: 0.2em; text-transform: uppercase; color: var(--c-accent); transition: color var(--transition); }
.contact__value { font-size: var(--fs-base); color: var(--c-ink); transition: color var(--transition); }


/* ── FORMULAIRE ── */

.contact__form { display: flex; flex-direction: column; gap: var(--sp-sm); }
.form-group { display: flex; flex-direction: column; gap: 0.4em; }
.form-label { font-family: var(--ff-mono); font-size: var(--fs-xs); letter-spacing: 0.15em; text-transform: uppercase; color: var(--c-ink-light); cursor: default; }
.form-input {
  background: transparent; border: none; border-bottom: 1px solid var(--c-line);
  color: var(--c-ink); font-family: var(--ff-serif); font-size: var(--fs-base);
  padding: 0.75em 0; outline: none; transition: border-color var(--transition); width: 100%; cursor: text;
}
.form-input::placeholder { color: var(--c-ink-light); }
.form-input:focus { border-bottom-color: var(--c-accent); }
.form-textarea { resize: vertical; min-height: 120px; }

/* FIX CONTRASTE bouton submit:
   - background-color explicite (jamais transparent) pour que WAVE puisse mesurer le ratio
   - opacity:1 forcé (pas d'animation fadeUp sur ce bouton spécifique) */
.form-submit {
  position: relative; overflow: hidden; cursor: pointer; min-height: 48px;
  background-color: var(--c-bg);
  /* Pas d'animation fadeUp héritée du .btn — on force opacity:1 */
  opacity: 1 !important;
  animation: none !important;
}
.form-submit__sending { 
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; 
  opacity: 0; visibility: hidden; 
  transition: opacity var(--transition), visibility 0s var(--transition); 
}
.form-submit.sending .form-submit__text { opacity: 0; visibility: hidden; }
.form-submit.sending .form-submit__sending { 
  opacity: 1; visibility: visible; 
  transition: opacity var(--transition), visibility 0s 0s; 
}
.form-success { 
  font-family: var(--ff-mono); font-size: var(--fs-xs); letter-spacing: 0.1em; color: var(--c-accent); 
  opacity: 0; visibility: hidden; 
  transition: opacity var(--transition), visibility 0s var(--transition); 
  height: 0; overflow: hidden; 
}
.form-success.visible { 
  opacity: 1; visibility: visible; height: auto; 
  transition: opacity var(--transition), visibility 0s 0s; 
}


/* ── LIGHTBOX ── */

.lightbox__overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 900;
  opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
  display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.lightbox__overlay.open { opacity: 1; pointer-events: all; }

.lightbox {
  position: relative; z-index: 901; opacity: 0; pointer-events: none;
  transform: translateY(16px); transition: opacity 0.4s ease, transform 0.4s ease;
  width: 100%; max-width: 1100px;
}
.lightbox.open { opacity: 1; pointer-events: all; transform: translateY(0); }

.lightbox__close {
  position: absolute; top: 0.75rem; right: 0.75rem;
  font-family: var(--ff-mono); font-size: var(--fs-base); color: var(--c-ink-light);
  transition: opacity var(--transition); z-index: 902;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-line); background: var(--c-bg); cursor: pointer;
}
.lightbox__close:hover { opacity: 1; color: var(--c-accent); border-color: var(--c-accent); }

.lightbox__inner {
  background-color: var(--c-bg);
  display: flex; flex-direction: row;
  width: 100%;
  height: 85vh;
  border: 1px solid var(--c-line);
  overflow: hidden;
}

.lightbox__media {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--c-bg-alt);
  overflow: hidden;
}

.lightbox__carousel {
  flex: 1; position: relative; overflow: hidden; min-height: 0;
}

.lightbox__carousel-track {
  display: flex; width: 100%; height: 100%;
  transition: transform 0.45s cubic-bezier(0.4,0,0.2,1);
}

.lightbox__slide {
  flex-shrink: 0;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-bg-alt); padding: 1.5rem;
  overflow: hidden;
}

.lightbox__slide img {
  display: block;
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
}

.lightbox__slide--3d { padding: 0; }
.lightbox__slide--3d model-viewer {
  width: 100%; height: 100%; display: block;
  --poster-color: transparent; background: transparent;
}

.lightbox__slide video {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain; background: #000; outline: none;
}

.lightbox__slide--iframe { padding: 0; }
.lightbox__slide--iframe iframe { width: 100%; height: 100%; border: none; }

.lightbox__nav {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-md);
  padding: var(--sp-sm); border-top: 1px solid var(--c-line); flex-shrink: 0;
}
.lightbox__arrow {
  font-family: var(--ff-mono); font-size: var(--fs-sm); color: var(--c-ink-light);
  padding: 0.5em 1em; min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-line); transition: all var(--transition); cursor: pointer;
}
.lightbox__arrow:hover { border-color: var(--c-accent); color: var(--c-accent); }
.lightbox__arrow:disabled { opacity: 0.3; pointer-events: none; cursor: not-allowed; }
.lightbox__counter { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--c-ink-light); letter-spacing: 0.1em; }

.lightbox__info {
  width: 300px; flex-shrink: 0;
  padding: var(--sp-lg) var(--sp-md);
  display: flex; flex-direction: column;
  overflow-y: auto; border-left: 1px solid var(--c-line);
}
.lightbox__category { font-family: var(--ff-mono); font-size: var(--fs-xs); letter-spacing: 0.2em; text-transform: uppercase; color: var(--c-accent); margin-bottom: var(--sp-xs); }
.lightbox__title { font-size: var(--fs-xl); font-weight: 300; font-style: italic; line-height: 1.2; margin-bottom: var(--sp-md); }

/* FIX CONTRASTE lightbox__desc:
   WAVE détectait #5A5750 avec alpha 0.70 (rgba) → ratio 3.33:1 sur fond clair
   Fix: on utilise var(--c-ink) sans transparence = ratio 17:1 ✓ */
.lightbox__desc {
  font-size: var(--fs-sm);
  color: var(--c-ink);
  line-height: 1.7; margin-bottom: var(--sp-md); max-width: none;
}

.lightbox__tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: var(--sp-lg); }
.lightbox__tools span { font-family: var(--ff-mono); font-size: var(--fs-xs); letter-spacing: 0.08em; background: var(--c-bg-alt); color: var(--c-ink-light); padding: 0.3em 0.8em; border: 1px solid var(--c-line); }
.lightbox__project-nav { margin-top: auto; display: flex; justify-content: space-between; padding-top: var(--sp-md); border-top: 1px solid var(--c-line); }
.lightbox__project-btn {
  font-family: var(--ff-mono); font-size: var(--fs-xs); letter-spacing: 0.1em;
  color: var(--c-ink-light); text-transform: uppercase; transition: color var(--transition);
  padding: 0.5em 0; min-height: 44px; display: inline-flex; align-items: center; cursor: pointer;
}
.lightbox__project-btn:hover { color: var(--c-accent); }
.lightbox__project-btn:disabled { opacity: 0.3; pointer-events: none; cursor: not-allowed; }


/* ── FOOTER ── */

.footer { border-top: 1px solid var(--c-line); padding: var(--sp-md) var(--sp-lg); }
.footer__inner { display: flex; justify-content: space-between; align-items: center; }
.footer__name { font-family: var(--ff-mono); font-size: var(--fs-xs); letter-spacing: 0.15em; color: var(--c-accent); }
.footer__copy { font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--c-ink-light); letter-spacing: 0.08em; }


/* ── REVEAL ── */

html.js-reveal-ready .reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
html.js-reveal-ready .reveal.visible { opacity: 1; transform: translateY(0); }


/* ── RESPONSIVE ── */

@media (max-width: 1024px) {
  :root { --sp-xl: 5rem; --sp-2xl: 7rem; }

  .projects__grid { grid-template-columns: repeat(2, 1fr); }
  .project-card--wide { grid-column: span 2; }
  .project-card--tall { grid-row: span 1; }
  .project-card__image--portrait { flex: none; aspect-ratio: 3 / 2; }

  .lightbox__inner { flex-direction: column; height: auto; max-height: 92vh; overflow-y: auto; }
  .lightbox__media { height: 55vw; min-height: 260px; max-height: 50vh; flex: none; }
  .lightbox__info  { width: 100%; border-left: none; border-top: 1px solid var(--c-line); padding: var(--sp-md); }
}

@media (max-width: 768px) {
  :root { --sp-lg: 1.5rem; --sp-xl: 3.5rem; }

  .cursor { display: none !important; }
  body.has-custom-cursor,
  body.has-custom-cursor * { cursor: auto !important; }

  .nav { padding: 0 var(--sp-sm); }
  .nav__links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: var(--c-bg); flex-direction: column; align-items: center;
    padding: var(--sp-lg) 0; gap: var(--sp-md); border-bottom: 1px solid var(--c-line);
    transform: translateY(-120%); transition: transform var(--transition); z-index: 99;
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links a { padding: 0.8em 1.5em; font-size: 1rem; }
  .nav__burger { display: flex; }

  .about__content { grid-template-columns: 1fr; }

  .projects__grid { grid-template-columns: 1fr; }
  .project-card--wide,
  .project-card--tall { grid-column: span 1; grid-row: span 1; }
  .project-card__image--portrait { flex: none; aspect-ratio: 3 / 4; }
  .project-card__image--3d { aspect-ratio: 4 / 3; }

  .skills__grid { grid-template-columns: 1fr; gap: var(--sp-xl); }
  .contact__layout { grid-template-columns: 1fr; }
  .contact__links { grid-template-columns: repeat(2, 1fr); }
  .contact__tagline { font-size: var(--fs-lg); }

  .lightbox__overlay { padding: 0; align-items: flex-end; }
  .lightbox { max-width: 100%; }
  .lightbox__inner { height: auto; max-height: 96vh; }
  .lightbox__media { height: 56vw; min-height: 220px; }

  .filter-btn { min-height: 48px; padding: 0.7em 1.2em; }
}

@media (max-width: 480px) {
  .section { padding: var(--sp-lg) var(--sp-sm); }
  .hero { padding: var(--nav-h) var(--sp-sm) var(--sp-xl); }
  .contact__links { grid-template-columns: 1fr; }
}