/*
 * code.css — Feuille de styles unique pour tout le portfolio
 *
 * SOMMAIRE (recherche rapide avec Ctrl+F) :
 * 1.  :root — variables globales (couleurs, Works hover, carrousel)
 * 2.  Base — body, liens, images
 * 3.  .scroll-progress — barre de scroll en haut
 * 4.  .site-header — menu fixe, lang-switch, hamburger
 * 5.  .menu-overlay — menu mobile plein écran
 * 6.  .cover — carrousel page d’accueil (index.html)
 * 7.  .stitch-works-* — page Works (marquee, survol couleur)
 * 8.  .piece1-* — grilles + lightbox (works/piece-*.html)
 * 9.  .about-contact-* — page Contact / Über mich
 * 10. .cta-section — bouton e-mail
 * 11. .site-footer — pied de page
 * 12. .js-reveal — animation d’apparition au scroll
 *
 * Fichiers HTML liés : index.html, works.html, contact.html, works/piece-1|2|3.html
 * JavaScript lié : js/code.js
 */

/* --- 1. Variables CSS (:root) --- */
:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #5c5c5c;
  --line: rgba(17, 17, 17, 0.12);
  --header-h: 4.25rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-figure-hover: cubic-bezier(0.33, 1, 0.53, 1);
  --duration-figure-hover: 0.88s;
  --marquee-hover-frame-scale: 1.5;
  --marquee-hover-img-scale: 1.05;
  --font-sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  /* Durées / easing du carrousel index (animé par code.js + translateX) */
  --cover-slide-duration: 1.2s;
  --cover-slide-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --cover-fade-duration: 1.2s;
  --cover-fade-ease: cubic-bezier(0.4, 0, 0.2, 1);
  /*
   * Couleurs page Works (works.html) — lues par code.js au survol :
   * --stitch-works-page-bg-idle = fond par défaut
   * --stitch-works-hover-1 … 6 = une couleur par carte (data-hover-slot dans le HTML)
   */
  --stitch-works-vignette-mid: 0.1;
  --stitch-works-vignette-edge: 0.38;
  --stitch-works-page-bg-idle: #f0eeeb;
  --stitch-works-hover-1: #000000;
  --stitch-works-hover-2: #f5e6eb;
  --stitch-works-hover-3: #faa11c;
  --stitch-works-hover-4: #cf23fa;
  --stitch-works-hover-5: #f01f1f;
  --stitch-works-hover-6: #3955f5;
}

/* --- 2. Reset léger + base typographique --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

/* Scroll progress (MIMEYOI-style thin bar) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--text);
  z-index: 200;
  pointer-events: none;
  transition: width 0.05s linear;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background 0.45s var(--ease),
    border-color 0.45s var(--ease),
    transform 0.5s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: var(--line);
  backdrop-filter: blur(12px);
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

.logo {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-nav-desktop {
  display: none;
  gap: 2rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.header-nav-desktop a {
  position: relative;
  padding-bottom: 2px;
}

.header-nav-desktop a:hover::after,
.header-nav-desktop a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--text);
}

.lang-switch {
  display: flex;
  gap: 0.5rem;
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.lang-switch button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.lang-switch button.is-active {
  color: var(--text);
  font-weight: 600;
}

.menu-toggle {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: border-color 0.3s var(--ease);
}

.menu-toggle:hover {
  border-color: var(--text);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 1px;
  background: var(--text);
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

@media (min-width: 900px) {
  .header-nav-desktop {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }
}

/* Overlay menu */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--bg);
  padding: calc(var(--header-h) + 2rem) clamp(1.5rem, 5vw, 4rem) 2rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.45s var(--ease), visibility 0.45s var(--ease);
}

.menu-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.menu-overlay-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu-overlay-list li {
  border-bottom: 1px solid var(--line);
}

.menu-overlay-list a {
  display: block;
  padding: 1.1rem 0;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: translateY(12px);
  opacity: 0;
  transition:
    transform 0.55s var(--ease),
    opacity 0.55s var(--ease),
    color 0.25s;
}

.menu-overlay.is-open .menu-overlay-list a {
  transform: translateY(0);
  opacity: 1;
}

.menu-overlay-list a:hover {
  color: var(--muted);
}

/* Stagger delays via JS or nth-child */
.menu-overlay-list li:nth-child(1) a {
  transition-delay: 0.05s;
}

.menu-overlay-list li:nth-child(2) a {
  transition-delay: 0.1s;
}

.menu-overlay-list li:nth-child(3) a {
  transition-delay: 0.15s;
}

.menu-overlay-list li:nth-child(4) a {
  transition-delay: 0.2s;
}

.menu-overlay-list li:nth-child(5) a {
  transition-delay: 0.25s;
}

body.menu-open {
  overflow: hidden;
}

section[id] {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

/* Cover hero — plein écran + carrousel horizontal (molette) */
.cover {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.cover.cover--slideshow {
  background: var(--bg);
}

.cover-slides-viewport {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.cover-slides-track {
  display: flex;
  flex-direction: row;
  height: 100%;
  width: max-content;
  will-change: transform;
  transition: transform var(--cover-slide-duration) var(--cover-slide-ease);
}

.cover-slide {
  position: relative;
  flex: 0 0 100vw;
  width: 100vw;
  height: 100%;
  overflow: hidden;
}

.cover-slide--loop-clone {
  pointer-events: none;
}

/* Après changement de slide : fondu du contenu (image, texte, lien Explore) */
.cover-slide.is-slide-fade-in .cover-slide-media,
.cover-slide.is-slide-fade-in .cover-slide-overlay,
.cover-slide.is-slide-fade-in .cover-explore {
  animation: coverSlideContentFadeIn var(--cover-fade-duration) var(--cover-fade-ease) both;
}

@keyframes coverSlideContentFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.cover-slide--intro {
  background: linear-gradient(165deg, #f8f8f8 0%, #ffffff 50%, #f3f3f3 100%);
}

.cover-slide-media {
  position: absolute;
  inset: 0;
}

.cover-slide-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.cover-slide-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(var(--header-h) + 2rem) clamp(1.25rem, 4vw, 3rem) clamp(5rem, 14vh, 7rem);
  pointer-events: none;
}

.cover-slide-overlay--intro .cover-title {
  pointer-events: auto;
}

.cover-title {
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 5.5rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.05;
  text-transform: uppercase;
  max-width: 14ch;
}

.cover-wheel-hint {
  margin: 1rem 0 0;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.cover-explore {
  position: absolute;
  left: clamp(1.25rem, 4vw, 3rem);
  bottom: clamp(5rem, 12vh, 6.5rem);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--text);
  transition: letter-spacing 0.4s var(--ease), color 0.25s;
  pointer-events: auto;
}

.cover-explore:hover {
  letter-spacing: 0.28em;
  color: var(--muted);
}

.cover-explore .arrow {
  display: inline-block;
  transition: transform 0.4s var(--ease);
}

.cover-explore:hover .arrow {
  transform: translateX(6px);
}

.cover-slideshow-ui {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(1rem, 3vw, 1.75rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  pointer-events: none;
  z-index: 10;
}

.cover-slide-counter {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.cover-slide-counter-sep {
  margin: 0 0.25em;
  opacity: 0.4;
}

.cover-dots {
  display: flex;
  gap: 0.5rem;
  pointer-events: auto;
}

.cover-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s, border-color 0.25s;
}

.cover-dot:hover,
.cover-dot:focus-visible {
  background: rgba(17, 17, 17, 0.12);
  outline: none;
}

.cover-dot.is-active {
  background: var(--text);
  border-color: var(--text);
  transform: scale(1.12);
}

@media (prefers-reduced-motion: reduce) {
  .cover-slides-track {
    transition: none;
  }

  .cover-slide.is-slide-fade-in .cover-slide-media,
  .cover-slide.is-slide-fade-in .cover-slide-overlay,
  .cover-slide.is-slide-fade-in .cover-explore {
    animation: none !important;
    opacity: 1 !important;
  }
}

/* Intro / news block */
.section {
  padding: clamp(3rem, 10vw, 6rem) clamp(1.25rem, 4vw, 3rem);
}

.section-inner {
  max-width: 720px;
  margin: 0 auto;
}

.section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.section-date {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.section-title-sub {
  margin: 0 0 1.5rem;
  font-size: clamp(1rem, 2vw, 1.125rem);
  font-weight: 400;
  color: var(--muted);
}

.section-body {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.8;
}

/* Works : plein écran ; fond repos = --stitch-works-page-bg-idle ; survol = --stitch-works-hover-* (data-hover-slot) + code.js */
html:has(body[data-page="works"]) {
  height: 100%;
  height: 100dvh;
  height: 100svh;
  overflow: hidden;
  overscroll-behavior: none;
}

html:has(body[data-page="works"]),
body[data-page="works"] {
  background-color: var(--stitch-works-page-bg-idle);
  transition: background-color 0.65s var(--ease);
}

body[data-page="works"] {
  min-height: 0;
  height: 100%;
  max-height: 100dvh;
  max-height: 100svh;
  overflow: hidden;
  overscroll-behavior: none;
  /* Bande marquee = viewport moins header fixe (évite scroll vertical) */
  --stitch-marquee-track-height: calc(100vh - var(--header-h));
  --stitch-marquee-track-height: calc(100dvh - var(--header-h));
  --stitch-marquee-track-height: calc(100svh - var(--header-h));
}

/* Vignette fixe au-dessus du fond (y compris couleurs au survol), sous le contenu */
body[data-page="works"]::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse 92% 82% at 50% 48%,
    rgba(0, 0, 0, 0) 28%,
    rgba(0, 0, 0, var(--stitch-works-vignette-mid)) 58%,
    rgba(0, 0, 0, var(--stitch-works-vignette-edge)) 100%
  );
}

body[data-page="works"] .site-header:not(.is-scrolled) {
  background: transparent;
  border-bottom-color: transparent;
}

body[data-page="works"] .site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.45);
  border-bottom-color: var(--line);
  backdrop-filter: blur(14px);
}

/* Works : survol image + fond teinté → texte clair (sinon texte noir sur blanc / gris neutre) — classe ajoutée par code.js */
body[data-page="works"].works-light-fg {
  --text: #f7f7f7;
  --muted: rgba(247, 247, 247, 0.74);
  --line: rgba(255, 255, 255, 0.35);
}

body[data-page="works"].works-light-fg .site-header,
body[data-page="works"].works-light-fg #stitch-works-gallery {
  transition: color 0.45s var(--ease), border-color 0.45s var(--ease);
}

body[data-page="works"].works-light-fg .site-header.is-scrolled {
  background: rgba(0, 0, 0, 0.22);
  border-bottom-color: var(--line);
  backdrop-filter: blur(14px);
}

body[data-page="works"].works-light-fg .menu-toggle {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.1);
}

body[data-page="works"].works-light-fg .menu-toggle span {
  background: var(--text);
}

body[data-page="works"].works-light-fg #stitch-works-gallery .stitch-works-marquee-frame {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

body[data-page="works"].works-light-fg
  #stitch-works-gallery
  .stitch-works-marquee-card-link:hover
  .stitch-works-marquee-frame {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
}

body[data-page="works"].works-light-fg #stitch-works-gallery .stitch-works-marquee-item-title {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

body[data-page="works"].works-light-fg
  #stitch-works-gallery
  .stitch-works-marquee-card-link:hover
  .stitch-works-marquee-item-title {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
}

/* Menu plein écran reste fond clair : forcer texte sombre dans l’overlay */
body[data-page="works"].works-light-fg .menu-overlay {
  --text: #111111;
  --muted: #5c5c5c;
  --line: rgba(17, 17, 17, 0.12);
  color: var(--text);
}

body[data-page="works"].works-light-fg .menu-overlay .menu-overlay-list a {
  color: var(--text);
}

/* Works — marquee plein impact (titre seul + bandeau) */
.stitch-works-section {
  border-top: 1px solid var(--line);
  background: transparent;
}

body[data-page="works"] main#top {
  position: relative;
  z-index: 1;
  height: 100%;
  max-height: 100dvh;
  max-height: 100svh;
  min-height: 0;
  padding-top: var(--header-h);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body[data-page="works"] .stitch-works-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
  border-top-color: transparent;
}

#stitch-works-gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-bottom: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.stitch-works-category {
  margin-bottom: clamp(2.5rem, 6.25vw, 3.75rem);
}

.stitch-works-category:last-child {
  margin-bottom: 0;
}

.stitch-works-back-wrap {
  text-align: center;
  padding-top: clamp(1.875rem, 5vw, 3.125rem);
  padding-bottom: clamp(0.625rem, 2.5vw, 1.25rem);
}

.stitch-works-back-top {
  display: inline-block;
  font-size: 0.78125rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.625rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.25s, border-color 0.25s, letter-spacing 0.35s var(--ease);
}

.stitch-works-back-top:hover {
  color: var(--text);
  letter-spacing: 0.275em;
  border-bottom-color: var(--line);
}

.stitch-works-marquee-outer {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: 0;
  padding: clamp(0.75rem, 2vh, 1.5rem) 0;
  overflow: hidden;
  overflow-x: clip;
  overscroll-behavior-x: contain;
  touch-action: pan-y;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.js-stitch-marquee-outer.is-marquee-js {
  cursor: grab;
  touch-action: none;
}

.js-stitch-marquee-outer.is-marquee-dragging {
  cursor: grabbing;
  user-select: none;
}

body[data-page="works"] .stitch-works-marquee-outer {
  flex: 1;
  min-height: var(--stitch-marquee-track-height);
  display: flex;
  align-items: center;
  padding-block: 0;
}

body[data-page="works"] .stitch-works-marquee {
  min-height: var(--stitch-marquee-track-height);
  display: flex;
  align-items: center;
}

.stitch-works-marquee {
  overflow: hidden;
  overflow-x: clip;
  overscroll-behavior-x: contain;
  touch-action: pan-y;
}

.stitch-works-marquee-track {
  display: flex;
  width: max-content;
  animation: stitch-works-marquee-x 110s linear infinite;
}

.stitch-works-marquee-track.is-marquee-js {
  animation: none !important;
  will-change: transform;
}

body[data-page="works"] .stitch-works-marquee-track {
  height: var(--stitch-marquee-track-height);
  min-height: var(--stitch-marquee-track-height);
  max-height: var(--stitch-marquee-track-height);
  align-items: stretch;
  box-sizing: border-box;
}

body[data-page="works"] .stitch-works-marquee-group {
  height: 100%;
  align-items: center;
  box-sizing: border-box;
}

.stitch-works-marquee-track.is-marquee-paused {
  animation-play-state: paused;
}

.stitch-works-marquee-track--slow {
  animation-duration: 135s;
}

.stitch-works-marquee-track--slower {
  animation-duration: 162s;
}

@keyframes stitch-works-marquee-x {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

.stitch-works-marquee-group {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: clamp(1.4rem, 3.5vh, 2.8rem);
  padding-right: clamp(1.4rem, 3.5vh, 2.8rem);
}

.stitch-works-marquee-item {
  flex: 0 0 auto;
  cursor: default;
}

#stitch-works-gallery .stitch-works-marquee-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  outline: none;
}

#stitch-works-gallery .stitch-works-marquee-card-link:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
  border-radius: 2px;
}

#stitch-works-gallery .stitch-works-marquee-item:has(.stitch-works-marquee-card-link) {
  cursor: pointer;
}

#stitch-works-gallery .stitch-works-marquee-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.9rem, 2.4vh, 1.45rem);
  max-height: calc(var(--stitch-marquee-track-height) - 0.5rem);
  min-height: 0;
}

/* Bloc titre : mêmes repères que .stitch-works-marquee-frame (bordure, fond, ombre au survol du lien) */
#stitch-works-gallery .stitch-works-marquee-item-title {
  margin: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: min(14rem, 30vw);
  padding: clamp(0.65rem, 1.8vh, 0.9rem) clamp(0.85rem, 2vw, 1.15rem);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.02);
  box-shadow: none;
  transform: scale(1);
  transform-origin: center center;
  transition:
    transform var(--duration-figure-hover) var(--ease-figure-hover),
    color 0.55s var(--ease),
    filter 0.55s var(--ease),
    border-color 0.45s var(--ease),
    box-shadow 0.45s var(--ease),
    background-color 0.45s var(--ease);
  filter: grayscale(20%);
}

#stitch-works-gallery .stitch-works-marquee-item:has(.stitch-works-marquee-card-link:hover) {
  z-index: 2;
}

#stitch-works-gallery .stitch-works-marquee-frame {
  width: auto;
  flex-shrink: 0;
  aspect-ratio: 3 / 4;
  height: min(52dvh, calc(var(--stitch-marquee-track-height) - 5.25rem));
  max-height: min(52dvh, calc(var(--stitch-marquee-track-height) - 5.25rem));
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.02);
  transform: scale(1);
  transform-origin: center center;
  transition:
    transform var(--duration-figure-hover) var(--ease-figure-hover),
    border-color 0.45s var(--ease),
    box-shadow 0.45s var(--ease);
}

.stitch-works-marquee-frame {
  width: auto;
  aspect-ratio: 3 / 4;
  height: 70vh;
  height: 70dvh;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.02);
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.stitch-works-marquee-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  transform-origin: center center;
  transition:
    transform var(--duration-figure-hover) var(--ease-figure-hover),
    filter 0.55s var(--ease);
  filter: grayscale(20%);
}

#stitch-works-gallery .stitch-works-marquee-card-link:hover .stitch-works-marquee-frame {
  border-color: rgba(17, 17, 17, 0.35);
  box-shadow: 0 18px 48px rgba(17, 17, 17, 0.1);
  transform: scale(var(--marquee-hover-frame-scale));
}

#stitch-works-gallery .stitch-works-marquee-card-link:hover .stitch-works-marquee-frame img {
  transform: scale(var(--marquee-hover-img-scale));
  filter: grayscale(0%);
}

/* Zoom aligné sur le visuel : cadre × image intérieure (même combinaison que dans le cadre) */
#stitch-works-gallery .stitch-works-marquee-card-link:hover .stitch-works-marquee-item-title {
  border-color: rgba(17, 17, 17, 0.35);
  box-shadow: 0 18px 48px rgba(17, 17, 17, 0.1);
  transform: scale(calc(var(--marquee-hover-frame-scale) * var(--marquee-hover-img-scale)));
  color: var(--text);
  filter: grayscale(0%);
}

.stitch-works-subpage .stitch-works-marquee-frame {
  transform: scale(1);
  transform-origin: center center;
  transition:
    transform var(--duration-figure-hover) var(--ease-figure-hover),
    border-color 0.45s var(--ease),
    box-shadow 0.45s var(--ease);
}

.stitch-works-subpage .stitch-works-marquee-item:hover .stitch-works-marquee-frame {
  border-color: rgba(17, 17, 17, 0.35);
  box-shadow: 0 15px 45px rgba(17, 17, 17, 0.08);
  transform: scale(var(--marquee-hover-frame-scale));
}

.stitch-works-subpage .stitch-works-marquee-item:hover .stitch-works-marquee-frame img {
  transform: scale(var(--marquee-hover-img-scale));
  filter: grayscale(0%);
}

/* Works subpages (works/*.html) */
.stitch-works-subpage-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.25s;
}

.stitch-works-subpage-back:hover {
  color: var(--text);
}

.stitch-works-detail-title {
  margin: 0 0 1.5rem;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
}

.stitch-works-detail-gallery {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 3vw, 1.75rem);
  max-width: min(960px, 100%);
  margin: 0 auto;
}

.stitch-works-detail-figure {
  margin: 0;
  border: 1px solid var(--line);
  background: #fafafa;
  overflow: hidden;
}

.stitch-works-detail-figure img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: min(85vh, 900px);
  margin: 0 auto;
}

.stitch-works-detail-caption {
  padding: 0.65rem 1rem;
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.stitch-works-subpage-gallery-wrap {
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Fiches projet Works — page détail (pas de scroll vertical : tout tient dans le viewport) */
html:has(body[data-page="works-detail"]) {
  height: 100%;
  overflow: hidden;
}

body[data-page="works-detail"] {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  height: 100dvh;
  max-height: 100svh;
  overscroll-behavior: none;
}

/*
 * Pièces Works : lien Works centré + bandeau d’images horizontal (sans gouttière), hauteur = reste du viewport.
 */
.stitch-works-piece.mime-about {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  max-height: none;
  padding-top: var(--header-h);
  padding-bottom: 0;
  overflow: hidden;
  background: var(--bg);
}

.mime-about-toolbar {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0.4rem 1rem 0.3rem;
}

.mime-about-inner {
  max-width: min(40rem, 92vw);
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 2.25rem) clamp(1rem, 4vw, 1.5rem) 0;
}

.mime-about-back.stitch-works-subpage-back {
  position: static;
  margin: 0;
  padding: 0.35rem 0.5rem;
  background: transparent;
  backdrop-filter: none;
}

.mime-about-pagehead {
  margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

.mime-about-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.mime-about-title {
  margin: 0;
  font-size: clamp(1.35rem, 3.2vw, 1.85rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.12;
  color: var(--text);
}

/* Galerie infinie piece-*.html : translate3d + rAF (voir initMimeInfiniteGalleries dans code.js) */
.mime-infinite {
  flex: 1 1 0;
  min-height: 0;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  display: flex;
  flex-direction: column;
  outline: none;
}

.mime-infinite__viewport {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
}

.mime-infinite__track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  width: max-content;
  height: 100%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.mime-infinite__segment {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  flex-shrink: 0;
  height: 100%;
  align-items: stretch;
}

.mime-infinite__cell {
  flex: 0 0 auto;
  flex-shrink: 0;
  height: 100%;
  min-width: max(32vw, min-content);
  margin: 0;
  padding: 0;
  display: block;
  box-sizing: border-box;
}

.mime-infinite__frame {
  margin: 0;
  height: 100%;
  width: max-content;
  min-width: 100%;
  box-sizing: border-box;
  background: #fafafa;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mime-infinite__cell:not(:last-child) .mime-infinite__frame,
.mime-infinite__cell:not(:last-child) .mime-infinite__category {
  border-right: 1px solid var(--line);
}

.mime-infinite__cell:first-child .mime-infinite__frame,
.mime-infinite__cell:first-child .mime-infinite__category {
  border-left: 1px solid var(--line);
}

.mime-infinite__cell:last-child .mime-infinite__frame,
.mime-infinite__cell:last-child .mime-infinite__category {
  border-right: 1px solid var(--line);
}

/* Étiquette de catégorie (ex. piece-1 3D) : bandeau scrollé avec les images */
.mime-infinite__cell--category {
  min-width: max(28vw, 11rem);
  display: flex;
  flex-direction: column;
}

.mime-infinite__category {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.35rem;
  padding: clamp(0.75rem, 2.5vw, 1.25rem) clamp(1rem, 3vw, 1.75rem);
  box-sizing: border-box;
  height: 100%;
  width: 100%;
  min-width: 100%;
  background: #fafafa;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mime-infinite__category-heading {
  margin: 0;
  font-size: clamp(0.65rem, 1.35vw, 0.8rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.25;
  color: var(--text);
  max-width: 14rem;
}

.mime-infinite__category-sub {
  margin: 0;
  font-size: clamp(0.55rem, 1.1vw, 0.68rem);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.35;
  color: var(--muted);
  max-width: 16rem;
}

/* piece-1 (3D) : un seul bloc ; catégories par titres à l’intérieur */
.piece1-block {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  padding: 0 clamp(0.4rem, 1.8vw, 0.85rem) 0.35rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.piece1-block__surface {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(180deg, #f4f2ee 0%, #e9e6e1 55%, #e4e1db 100%);
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.piece1-block__scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.45rem clamp(0.4rem, 1.5vw, 0.75rem) 0.55rem;
  box-sizing: border-box;
}

.piece1-category-group {
  margin: 0;
}

.piece1-category {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.28rem;
  padding: clamp(0.65rem, 2.2vw, 1.05rem) 0.75rem clamp(0.7rem, 2.4vw, 1.15rem);
}

.piece1-category--divider {
  margin-top: clamp(0.55rem, 2vw, 0.95rem);
  padding-top: clamp(0.85rem, 2.8vw, 1.35rem);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.piece1-category__title {
  margin: 0;
  font-size: clamp(0.62rem, 1.25vw, 0.78rem);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  line-height: 1.35;
  color: var(--text);
}

.piece1-category__tagline {
  margin: 0;
  font-size: clamp(0.52rem, 1vw, 0.62rem);
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.piece1-category__link,
.piece1-category__note {
  margin: 0.65rem 0 0;
  max-width: 42ch;
  font-size: 0.8125rem;
  line-height: 1.6;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
}

.piece1-category__link a,
.piece1-category__note a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  color: inherit;
  transition: opacity 0.25s var(--ease);
}

.piece1-category__link a:hover,
.piece1-category__note a:hover {
  opacity: 0.65;
}

/* Grilles piece-1 : vignettes remplies (cover) pour limiter les grands vides */
.piece1-grid {
  display: grid;
  grid-auto-rows: min-content;
  gap: 0.4rem;
  align-content: start;
  align-items: stretch;
  margin-bottom: 0.2rem;
}

.piece1-grid--official {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 6.25rem), 1fr));
}

.piece1-grid--personal {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 6.25rem), 1fr));
}

@media (min-width: 520px) {
  .piece1-grid--official {
    grid-template-columns: repeat(4, 1fr);
  }

  .piece1-grid--personal {
    grid-template-columns: repeat(5, 1fr);
  }
}

.piece1-grid__cell {
  position: relative;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: block;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  align-self: stretch;
  aspect-ratio: 1;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.piece1-grid__cell:hover {
  border-color: var(--text);
}

.piece1-grid__cell:focus {
  outline: none;
}

.piece1-grid__cell:focus-visible {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
}

.piece1-grid__frame {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  line-height: 0;
  pointer-events: none;
  overflow: hidden;
}

.piece1-grid__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.piece1-grid__play::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 0.2rem;
  border-style: solid;
  border-width: 0.65rem 0 0.65rem 1.1rem;
  border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}

.piece1-grid__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}

/* Lightbox piece-1 */
.piece1-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  box-sizing: border-box;
}

.piece1-lightbox[hidden] {
  display: none !important;
}

.piece1-lightbox__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  cursor: pointer;
  background: rgba(10, 10, 10, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 0;
}

.piece1-lightbox__close {
  position: absolute;
  top: clamp(0.65rem, 2.5vw, 1.1rem);
  right: clamp(0.65rem, 2.5vw, 1.1rem);
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.piece1-lightbox__close:hover {
  background: rgba(0, 0, 0, 0.65);
  border-color: rgba(255, 255, 255, 0.55);
}

.piece1-lightbox__close:focus {
  outline: none;
}

.piece1-lightbox__close:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(10, 10, 10, 0.8);
}

.piece1-lightbox__shell {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  padding: 0 clamp(2.75rem, 9vw, 4rem);
  box-sizing: border-box;
  pointer-events: none;
}

.piece1-lightbox__shell > * {
  pointer-events: auto;
}

.piece1-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.65rem;
  height: 2.65rem;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  color: rgba(255, 255, 255, 0.95);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.piece1-lightbox__nav:hover {
  background: rgba(0, 0, 0, 0.62);
  border-color: rgba(255, 255, 255, 0.55);
}

.piece1-lightbox__nav:focus {
  outline: none;
}

.piece1-lightbox__nav:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(10, 10, 10, 0.85);
}

.piece1-lightbox__nav--prev {
  left: clamp(0.4rem, 2.5vw, 1rem);
}

.piece1-lightbox__nav--next {
  right: clamp(0.4rem, 2.5vw, 1rem);
}

.piece1-lightbox--single .piece1-lightbox__nav {
  display: none;
}

.piece1-lightbox__chev {
  display: block;
}

.piece1-lightbox__stage {
  position: relative;
  z-index: 1;
  max-width: min(92vw, calc(100vw - 2rem));
  max-height: min(88vh, calc(100vh - 2rem));
}

.piece1-lightbox__img,
.piece1-lightbox__video {
  display: block;
  max-width: min(92vw, calc(100vw - 2rem));
  max-height: min(88vh, calc(100vh - 2rem));
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.piece1-lightbox__img {
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.piece1-lightbox__img[hidden],
.piece1-lightbox__video[hidden] {
  display: none !important;
}

.piece1-lightbox__video {
  background: #000;
}

.mime-infinite__frame img {
  width: auto;
  height: 100%;
  max-width: none;
  max-height: none;
  display: block;
  object-fit: contain;
  object-position: center;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
  /* Pas de content-visibility : avec translate3d sur la piste, le moteur se trompe sur la
     zone « visible » et les images clignotent fortement pendant le défilement. */
}

.mime-about-stack {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  margin-top: 0;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  /* auto : l’auto-scroll JS met scrollLeft à chaque frame ; smooth le casse */
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
  scrollbar-width: none;
  outline: none;
  cursor: grab;
}

.mime-about-stack.is-drag-scrolling {
  cursor: grabbing;
  user-select: none;
  scroll-snap-type: none;
}

.mime-about-stack.is-snap-animating {
  scroll-snap-type: none;
  user-select: none;
}

.mime-about-stack::-webkit-scrollbar {
  display: none;
}

.mime-about-figure {
  margin: 0;
}

.mime-about-figure--bleed {
  flex: 0 0 auto;
  flex-shrink: 0;
  height: 100%;
  width: auto;
  max-width: none;
  margin: 0;
  /* Au moins ~1/3 de l’écran par panneau → plusieurs images = scroll horizontal garanti (scrollWidth > clientWidth) */
  min-width: max(32vw, min-content);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.mime-about-frame {
  margin: 0;
  height: 100%;
  width: max-content;
  min-width: 100%;
  box-sizing: border-box;
  background: #fafafa;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mime-about-figure--bleed:not(:last-child) .mime-about-frame {
  border-right: 1px solid var(--line);
}

.mime-about-figure--bleed:first-child .mime-about-frame {
  border-left: 1px solid var(--line);
}

.mime-about-figure--bleed:last-child .mime-about-frame {
  border-right: 1px solid var(--line);
}

.mime-about-frame img {
  width: auto;
  height: 100%;
  max-width: none;
  max-height: none;
  display: block;
  object-fit: contain;
  object-position: center;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: auto;
}

.mime-about-caption {
  margin: 0;
  padding: 0.65rem clamp(1rem, 4vw, 1.5rem);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--bg);
}

/* Ancienne galerie horizontale (conservée si réutilisée ailleurs) */
/* La galerie fait la hauteur viewport : le main ne doit pas s’effondrer (flex / stacking contexts) */
body[data-page="works-detail"] main.mime-figure.mime-figure--scroll-gallery {
  min-height: 100dvh;
  min-height: 100svh;
}

.mime-figure.mime-figure--scroll-gallery {
  padding-top: 0;
}

.mime-figure-scroll {
  padding-top: var(--header-h);
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100svh;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
  scrollbar-width: none;
  outline: none;
}

.mime-figure-scroll::-webkit-scrollbar {
  display: none;
}

.mime-figure-scroll-track {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  box-sizing: border-box;
  height: calc(100dvh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  width: max-content;
}

.mime-figure-scroll-slide {
  position: relative;
  box-sizing: border-box;
  flex: 0 0 100vw;
  width: 100vw;
  max-width: 100vw;
  height: calc(100dvh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #0c0c0c;
}

/* Image directe sous la slide (piece-2, piece-3) : slide a une hauteur explicite → remplissage sûr */
.mime-figure-scroll-slide > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Même principe que > img : hauteur explicite sur la slide, média en inset 0 (évite flex + enfant absolu = 0 px) */
.mime-figure-scroll-slide-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.mime-figure-scroll-slide-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center;
  display: block;
}

.mime-figure-scroll-back {
  position: absolute;
  top: 1rem;
  left: clamp(1.25rem, 4vw, 3rem);
  z-index: 5;
  padding: 0.5rem 0.75rem;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  transition: background 0.25s, color 0.25s;
}

.mime-figure-scroll-back:hover {
  background: var(--text);
  color: var(--bg);
}

@media (prefers-reduced-motion: reduce) {
  .mime-figure-scroll,
  .mime-about-stack {
    scroll-behavior: auto;
  }

  .mime-about-stack {
    scroll-snap-type: none;
  }
}

/* --- 9. Page Contact / Über mich (contact.html) --- */
.about-contact-section {
  padding: calc(var(--header-h) + clamp(2.5rem, 6vw, 4rem)) clamp(1.25rem, 4vw, 3rem)
    clamp(3rem, 8vw, 5rem);
  border-bottom: 1px solid var(--line);
}

.about-contact-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: start;
}

/* Logos BVB + HOMAG : cercles, liens vers iF Award et YouTube */
.about-project-badges {
  max-width: 1200px;
  margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
  padding-top: clamp(2rem, 4vw, 2.5rem);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(2.5rem, 8vw, 5rem);
  flex-wrap: wrap;
}

.about-project-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
  min-width: 8rem;
  transition: opacity 0.25s var(--ease);
}

.about-project-badge:hover {
  opacity: 0.65;
}

/* Cercles identiques (5rem) — alignés en haut via align-items: flex-start sur le parent */
.about-project-badge img {
  display: block;
  flex-shrink: 0;
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  object-fit: contain;
  object-position: center;
  padding: 0.45rem;
  box-sizing: border-box;
  background: #f5f5f5;
  border: 1px solid var(--line);
}

.about-project-badge span {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 14rem;
  line-height: 1.5;
  min-height: 2.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

@media (min-width: 900px) {
  .about-contact-inner {
    grid-template-columns: minmax(0, 1fr) min(38%, 420px);
    gap: clamp(3rem, 6vw, 5rem);
    align-items: start;
  }

  /* Photo à droite, centrée verticalement par rapport au texte à gauche */
  .about-contact-photo {
    align-self: center;
    justify-content: flex-end;
  }
}

.about-contact-kicker {
  margin: 0 0 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.about-contact-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.about-contact-role {
  margin: 0 0 1.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.about-contact-body {
  display: grid;
  gap: 1.15rem;
  max-width: 52ch;
}

.about-contact-body p {
  margin: 0;
  color: var(--text);
}

.about-contact-body a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: opacity 0.25s var(--ease);
}

.about-contact-body a:hover {
  opacity: 0.65;
}

.about-contact-tools {
  margin: 2rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  line-height: 1.7;
  color: var(--muted);
}

.about-contact-photo {
  margin: 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Portrait : forme circulaire (object-fit cover recadre le haut du visage) */
.about-contact-photo img {
  width: min(100%, 22rem);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  background: #f0eeeb;
  border: 1px solid var(--line);
}

@media (max-width: 899px) {
  .about-contact-photo img {
    max-width: 18rem;
  }
}

/* CTA */
.cta-section {
  border-top: 1px solid var(--line);
  padding: clamp(3rem, 8vw, 5rem) clamp(1.25rem, 4vw, 3rem);
}

.cta-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.cta-inner h2 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  max-width: 12ch;
}

.cta-mail {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.cta-mail:hover {
  background: var(--text);
  color: var(--bg);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.25rem, 4vw, 3rem);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: start;
    row-gap: 1.75rem;
  }

  .footer-brand {
    grid-column: 1;
    grid-row: 1;
  }

  .footer-links {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .footer-copy {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.footer-brand {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  font-size: 0.625rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.footer-links a:hover {
  color: var(--muted);
}

.footer-copy {
  margin: 0;
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

/* Pied de page compact — pages projet Works (piece-*.html) */
.site-footer--detail {
  flex-shrink: 0;
  padding: 0.5rem clamp(1rem, 3vw, 1.5rem) 0.6rem;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.site-footer--detail .footer-inner--detail {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.site-footer--detail .footer-copy {
  margin: 0;
  text-align: center;
}

/* Reveal on scroll */
.js-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.js-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .js-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .stitch-works-marquee-track {
    animation: none;
  }

  #stitch-works-gallery .stitch-works-marquee-frame,
  #stitch-works-gallery .stitch-works-marquee-frame img,
  #stitch-works-gallery .stitch-works-marquee-item-title,
  .stitch-works-subpage .stitch-works-marquee-frame,
  .stitch-works-subpage .stitch-works-marquee-frame img {
    transition-duration: 0.01ms;
  }

  #stitch-works-gallery .stitch-works-marquee-card-link:hover .stitch-works-marquee-frame,
  #stitch-works-gallery .stitch-works-marquee-card-link:hover .stitch-works-marquee-frame img,
  #stitch-works-gallery .stitch-works-marquee-card-link:hover .stitch-works-marquee-item-title,
  .stitch-works-subpage .stitch-works-marquee-item:hover .stitch-works-marquee-frame,
  .stitch-works-subpage .stitch-works-marquee-item:hover .stitch-works-marquee-frame img {
    transform: none;
  }

  #stitch-works-gallery .stitch-works-marquee-card-link:hover .stitch-works-marquee-item-title {
    filter: none;
  }
}

@media (min-width: 900px) {
  .header-nav-desktop a.is-active {
    font-weight: 600;
  }
}
