/* ============================================================
   PORTFOLIO ANICET EVEN — Style V4
   Fixes: sketch-rect overflow, showcase sizing, notebook, menu
   ============================================================ */

/* ─────────────────────────────────────
   1. CUSTOM FONT
───────────────────────────────────── */
@font-face {
    font-family: 'Skribblugh';
    src: url('../fonts/SkribblughRegular-XGW02.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ─────────────────────────────────────
   2. VARIABLES
───────────────────────────────────── */
:root {
    --bg: #1a1a1a;
    --white: #FFFFFF;
    --red: #FF364A;
    --muted: rgba(255,255,255,0.45);
    --notebook-bg: #f2f0eb;
    --notebook-line: rgba(140,135,125,0.35);
    --notebook-text: #1a1a1a;

    --font-display: 'Bebas Neue', 'Impact', sans-serif;
    --font-body:    'Space Grotesk', sans-serif;
    --font-sketch:  'Skribblugh', 'Permanent Marker', cursive;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --dur-fast: 0.22s;
    --dur-med:  0.55s;
}

/* ─────────────────────────────────────
   3. RESET & BASE
───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--white);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

a, button { color: inherit; text-decoration: none; background: none; border: none; cursor: pointer; font-family: inherit; }

img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; }

.font-sketch { font-family: var(--font-sketch); }

/* ─────────────────────────────────────
   4. HEADER
───────────────────────────────────── */
.site-header {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 72px;
    z-index: 100; pointer-events: none;
    background: linear-gradient(180deg, rgba(26,26,26,0.85) 0%, transparent 100%);
}

.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 100%; padding: 0 42px;
}

.burger-btn {
    width: 36px; height: 22px;
    display: flex; flex-direction: column; justify-content: space-between;
    pointer-events: auto; z-index: 110; position: relative;
}

.b-line {
    display: block; width: 100%; height: 2px; background: var(--white);
    transform-origin: center;
    transition: transform var(--dur-med) var(--ease-out), opacity var(--dur-med) var(--ease-out), background var(--dur-fast);
}

.burger-btn:hover .b-line { background: var(--red); }

.header-back-btn { transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.header-back-btn:hover { transform: translateX(-8px) scale(1.05); }
.header-back-btn:active { transform: scale(0.95); }

body.menu-open .b-line:nth-child(1) { transform: translateY(10px) rotate(45deg); }
body.menu-open .b-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
body.menu-open .b-line:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

.header-logo {
    position: absolute; left: 50%; transform: translateX(-50%);
    opacity: 0; pointer-events: none;
    transition: opacity 0.4s var(--ease-out);
}

.header-logo.is-visible { opacity: 1; pointer-events: auto; }

.header-logo-text {
    font-size: 2.3rem; line-height: 1; letter-spacing: 0.03em;
    animation: logoWobbleMini 0.3s steps(1) infinite;
}

@keyframes logoWobbleMini {
    0%,33%   { filter: url(#sketch-1); }
    34%,66%  { filter: url(#sketch-2); }
    67%,100% { filter: url(#sketch-3); }
}

.header-right { display: flex; align-items: center; gap: 54px; pointer-events: auto; }

.lang-switcher { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; }
.lang-btn { opacity: 0.35; transition: opacity var(--dur-fast); }

/* ── FIX R-02 : zones tactiles conformes ───────────────────────────
   Les pastilles ci-dessous agrandissent UNIQUEMENT la surface cliquable
   via un pseudo-element transparent. Aucun pixel dessine ne bouge.
   Les debordements horizontaux s'arretent au milieu du gap : deux
   cibles voisines se touchent sans jamais se chevaucher. */
.lang-btn { position: relative; }
.lang-btn::after {
    content: '';
    position: absolute;
    inset: -14px -6px;
    /* pas de background : purement une surface de contact */
}
/* Les icones sociales sont trop rapprochees pour s'elargir des deux cotes
   sans se chevaucher. On elargit donc largement vers l'exterieur (aucun
   voisin) et seulement jusqu'au milieu du gap vers l'interieur. */
.social-lnk::before {
    content: '';
    position: absolute;
    inset: -14px -4px;
}
.social-lnk:first-child::before  { inset: -14px -4px -14px -11px; }
.social-lnk:last-child::before   { inset: -14px -11px -14px -4px; }
.burger-btn::after {
    content: '';
    position: absolute;
    inset: -11px -6px;
}
.lang-btn.active { opacity: 1; }
.lang-btn:hover { opacity: 0.75; }
.lang-sep { opacity: 0.2; }

.social-nav { display: flex; gap: 16px; align-items: center; }
.social-lnk {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
    position: relative;
}
.social-lnk::after { content: ''; position: absolute; bottom: -6px; left: 0; width: 0; height: 1px; background: var(--red); transition: width var(--dur-fast); }
.social-lnk:hover { opacity: 1; color: var(--red); transform: translateY(-2px); }
.social-lnk:hover::after { width: 100%; }

/* ─────────────────────────────────────
   5. MENU OVERLAY
───────────────────────────────────── */
.menu-overlay {
    position: fixed; inset: 0; z-index: 90;
    background: var(--bg);
    display: flex; flex-direction: column;
    padding: 0 60px 50px;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity var(--dur-med) var(--ease-out), visibility var(--dur-med);
    overflow-y: auto;
}

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

.menu-logo-wrap { padding-top: 100px; padding-bottom: 40px; }

.menu-logo {
    font-size: clamp(3rem, 6vw, 5rem); line-height: 1; color: var(--white);
    animation: logoWobbleMini 0.3s steps(1) infinite;
}

/* Items alignés, espacement vertical régulier */
.menu-nav {
    display: flex; flex-direction: column;
    gap: 18px;
    flex: 1;
    justify-content: center;
}

.menu-nav-item {
    display: flex; align-items: baseline; gap: 18px;
    width: fit-content; padding: 10px 0;
    position: relative;
}

.mn-num { font-family: var(--font-display); font-size: 1rem; color: var(--red); line-height: 1; min-width: 28px; }

.mn-label {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 6vw, 4.8rem);
    line-height: 1; letter-spacing: 0.02em;
    transition: transform var(--dur-med) var(--ease-out), color var(--dur-fast);
}

.mn-deco {
    font-size: clamp(1.4rem, 2.2vw, 1.8rem);
    color: var(--red); opacity: 0;
    transform: translateX(-8px) rotate(-3deg);
    transition: opacity 0.3s, transform 0.4s var(--ease-out);
    white-space: nowrap;
}

.menu-nav-item:hover .mn-label { transform: translateX(12px); color: var(--red); }
.menu-nav-item:hover .mn-deco { opacity: 0.85; transform: translateX(6px) rotate(-2deg); }

.menu-scribble {
    position: absolute; top: 110px; right: 60px;
    font-size: 2.8rem; color: var(--red); opacity: 0.35; transform: rotate(-8deg);
}

.menu-footer {
    padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.06);
    display: flex; align-items: center; gap: 40px;
}

.menu-mail { font-size: 0.88rem; letter-spacing: 0.06em; opacity: 0.4; transition: opacity var(--dur-fast), color var(--dur-fast); }
.menu-mail:hover { opacity: 1; color: var(--red); }

.menu-footer-social { display: flex; gap: 12px; font-size: 0.82rem; opacity: 0.3; }
.menu-footer-social a { transition: color var(--dur-fast); }
.menu-footer-social a:hover { color: var(--red); }

/* ─────────────────────────────────────
   6. PAGES SPA
───────────────────────────────────── */
#page-wrapper { width: 100%; height: 100%; position: relative; }

.page {
    position: absolute; inset: 0; width: 100%; height: 100%;
    overflow-y: auto; overflow-x: hidden;
    opacity: 0; pointer-events: none;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.page.is-active { opacity: 1; pointer-events: auto; }
.page:not(.is-active) * { pointer-events: none !important; }

/* ── FIX P-01 : masquage REEL des pages inactives ──────────────────
   Avant : opacity:0 seul. Le navigateur continuait a mettre en page,
   peindre et animer les 7 pages invisibles (61 animations infinies et
   46 filtres feTurbulence tournaient dans le vide), et le
   loading="lazy" des images etait neutralise -> 47,5 Mo au chargement.

   visibility:hidden       -> retire du flux de tabulation clavier (21 elements)
   content-visibility:hidden -> le navigateur saute entierement le rendu
                                du sous-arbre, donc les images lazy ne se
                                telechargent plus tant que la page n'est pas ouverte.

   Les navigateurs anciens (Safari < 15.4, Firefox < 125) ignorent
   content-visibility et retombent sur visibility:hidden : degradation
   propre, aucun element casse.

   contain-intrinsic-size reserve une hauteur plausible pour que la
   barre de defilement ne saute pas a l'ouverture de la page. */
.page:not(.is-active) {
    visibility: hidden;
    content-visibility: hidden;
    contain-intrinsic-size: auto 100vh;
}
.page.is-active {
    visibility: visible;
    content-visibility: visible;
}
.page::-webkit-scrollbar { width: 4px; }
.page::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

/* ─────────────────────────────────────
   7. HERO
───────────────────────────────────── */
.hero-screen {
    width: 100%; min-height: 100vh; min-height: 100dvh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 80px 40px 60px; position: relative;
    /* FIX: évite que le hero capture les événements de scroll/click en dehors des zones interactives */
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.hero-logo-wrap { text-align: center; z-index: 2; pointer-events: none; }

.hero-logo {
    font-size: clamp(5rem, 14vw, 12rem); line-height: 0.85;
    color: var(--white); text-transform: uppercase;
    will-change: transform, filter;
    animation: logoWobble 0.26s steps(1) infinite;
}

@keyframes logoWobble {
    0%,33%   { filter: url(#sketch-1) drop-shadow(0 0 0 transparent); }
    34%,66%  { filter: url(#sketch-2) drop-shadow(0 0 0 transparent); }
    67%,100% { filter: url(#sketch-3) drop-shadow(0 0 0 transparent); }
}

.hero-profession {
    font-family: var(--font-display);
    font-size: clamp(1rem, 2.2vw, 1.6rem); font-weight: 300;
    letter-spacing: 0.25em; text-transform: uppercase;
    color: var(--red); margin-top: 14px;
    /* Initialement invisible, GSAP anime l'entrée */
    opacity: 0;
}

.scroll-invite {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    z-index: 3; opacity: 0.45; pointer-events: none;
}

.scroll-line { width: 1px; height: 50px; background: var(--white); animation: scrollPulse 2s ease-in-out infinite; transform-origin: top; }
@keyframes scrollPulse { 0% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(0); opacity: 0; } }
.scroll-label { font-size: 1.4rem; letter-spacing: 0.15em; text-transform: uppercase; }

/* ─────────────────────────────────────
   8. SHOWCASE (coins arrondis Fortiche, taille limitée)
───────────────────────────────────── */
.home-showcase {
    padding: 0 60px;
    margin-bottom: 110px;
    pointer-events: auto;  /* FIX: explicite auto hors du hero */
    opacity: 0;             /* Animé par GSAP au chargement */
}

.showcase-frame {
    position: relative;
    width: 100%;
    max-height: 60vh;
    border-radius: 18px;
    overflow: hidden;
    background: #111;
    cursor: pointer;         /* FIX: feedback visuel cliquable */
}

.showcase-img {
    width: 100%;
    height: 100%;
    max-height: 60vh;
    object-fit: cover;
    display: block;
    transition: transform 0.7s var(--ease-out);
    will-change: transform;  /* FIX: promotion GPU évite repaint */
}

.showcase-frame:hover .showcase-img {
    transform: scale(1.03);
}

/* === BOUTON EXPOSITION PROJETS (SUPERPOSITION MAQUETTE) === */
.home-projects-shortcut {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    margin-top: -25px;
    margin-bottom: 20px;
    cursor: pointer;
    text-align: center;
    user-select: none;        /* FIX: empêche la sélection de texte au double-click */
    -webkit-user-select: none;
    pointer-events: auto;     /* FIX: réactive les événements sur ce bouton (parent est none) */
    transition: transform var(--dur-med) var(--ease-out);
}

.shortcut-sub-text {
    font-family: var(--font-sketch);
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    color: var(--white); /* Devient blanc par défaut */
    transform: translateY(18px) rotate(-4deg);
    z-index: 2;
    pointer-events: none;
    transition: transform var(--dur-med) var(--ease-out), color var(--dur-fast);
    animation: logoWobbleMini 0.3s steps(1) infinite;
}

.shortcut-main-text {
    font-family: var(--font-display);
    font-size: clamp(3.8rem, 12vw, 9.8rem);
    font-weight: bold;
    line-height: 0.75;
    letter-spacing: -0.01em;
    color: var(--red);
    text-transform: uppercase;
    pointer-events: none;
    transition: transform var(--dur-med) var(--ease-out), color var(--dur-fast);
}

/* Effets au survol */
.home-projects-shortcut:hover {
    transform: scale(1.03);
}

.home-projects-shortcut:hover .shortcut-sub-text {
    transform: translateY(10px) rotate(-6deg) scale(1.08);
    color: var(--red); /* Devient rouge au survol pour vibrer */
}

.home-projects-shortcut:hover .shortcut-main-text {
    transform: scaleY(1.06);
    color: #ff4a5c; /* Rouge légèrement plus lumineux */
}

/* Underline crayonné animé */
.shortcut-underline-svg {
    width: min(400px, 50vw);
    height: 16px;
    margin-top: 10px;
    pointer-events: none;
    z-index: 3;
}

.shortcut-underline-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 0.5s var(--ease-out);
}

.home-projects-shortcut:hover .shortcut-underline-path {
    stroke-dashoffset: 0;
}

/* Annotation flèche "cliquez !" */
.shortcut-click-hint {
    position: absolute;
    left: calc(50% + min(290px, 25vw));
    top: 15px; /* Aligné dans l'angle droit de "MES PROJETS", au niveau de la fin du texte */
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    z-index: 4;
    transition: transform var(--dur-med) var(--ease-out);
    transform: rotate(5deg);
}

.click-hint-text {
    font-size: 3.0rem; /* Taille augmentée encore plus */
    color: var(--red);
    white-space: nowrap;
    animation: logoWobbleMini 0.28s steps(1) infinite;
    transform: translateY(-8px) rotate(4deg); /* Légèrement surélevé par rapport à la flèche */
}

.click-hint-arrow {
    width: 72px; /* Flèche augmentée */
    height: 48px;
    transform: scaleX(-1); /* Retourne horizontalement le tracé courbe pour pointer vers la gauche */
}

/* Feedback au survol pour la flèche et le texte */
.home-projects-shortcut:hover .shortcut-click-hint {
    transform: scale(1.08) rotate(7deg);
}

/* ─────────────────────────────────────
   9. FRAME-WRAP + TORN PAPER + SKETCH RECT
───────────────────────────────────── */

/* === FRAME-WRAP : contient le cadre + le SVG rect rouge par-dessus === */
.frame-wrap {
    position: relative;
}

/* === TORN FRAME : clip-path papier déchiré ===
   NOTE: On utilise clip-path: url(#torn-1) et non mask: url(#mask-torn-1)
   car le mask avec filter="url(#paper-tear)" n'est pas supporté sur iOS Safari
   (WebKit), ce qui génère des bandes noires. clip-path + clipPath SVG sans
   filtre est compatible sur tous les navigateurs modernes.
*/
.torn-frame {
    position: relative;
    overflow: hidden;
    width: 100%;
    clip-path: url(#torn-1);
    /* Webkit prefix pour compatibilité maximale */
    -webkit-clip-path: url(#torn-1);
}

.torn-frame.torn-alt {
    clip-path: url(#torn-2);
    -webkit-clip-path: url(#torn-2);
}

.media-frame-inner {
    position: relative; 
    width: 100%; 
    overflow: hidden; 
    line-height: 0;
}

.media-frame-img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.7s var(--ease-out);
}

.torn-frame:hover .media-frame-img,
.frame-wrap:hover .torn-frame .media-frame-img {
    transform: scale(1.04);
}

/* Overlay texte */
.frame-text-overlay {
    position: absolute; inset: 0; z-index: 3;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 22px 26px;
    pointer-events: none;
}

.overlay-tl { justify-content: flex-start; align-items: flex-start; }
.overlay-tr { justify-content: flex-start; align-items: flex-end; }
.overlay-bl { justify-content: flex-end;   align-items: flex-start; }
.overlay-br { justify-content: flex-end;   align-items: flex-end; }

.frame-big-text {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 3.5rem);
    line-height: 0.9; letter-spacing: 0.02em; text-transform: uppercase;
    color: var(--white); text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 1px 3px rgba(0,0,0,0.6);
    transition: transform 0.6s var(--ease-out);
}

.frame-sub { display: block; font-size: 1.45rem; color: var(--red); margin-top: 6px; text-transform: uppercase; letter-spacing: 0.05em; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }

.frame-wrap:hover .frame-big-text { transform: translateY(-4px); }

/* ═══════════════════════════════════
   RECTANGLE ROUGE DESSINÉ MAIN (SVG)
   ✓ Positionné sur .frame-wrap (DEHORS du clip-path)
   ✓ Déborde du cadre comme un collage
   ✓ Tourné de 4° et légèrement plus grand
   ✓ Animation de tracé au hover
═══════════════════════════════════ */
.sketch-rect-svg {
    position: absolute;
    top: -2.5%;
    left: -2.5%;
    width: 105%;
    height: 105%;
    z-index: 10;
    pointer-events: none;
    transform: rotate(2deg);
    opacity: 0;
    transition: opacity 0.2s var(--ease-out); /* Révélation rapide pour voir le tracé dès le début */
}

.sketch-rect-path {
    stroke-dasharray: 1800;
    stroke-dashoffset: 1800;
    transition: stroke-dashoffset 1.5s var(--ease-out); /* Dessin progressif en 1.5s */
    animation: rectWobble 0.3s steps(1) infinite;
}

/* Rotations et vitesses de dessin alternées pour casser la répétition visuelle */
.hc-item:nth-child(2n) .sketch-rect-svg { transform: rotate(-1.5deg); }
.hc-item:nth-child(3n) .sketch-rect-svg { transform: rotate(1.2deg); }
.hc-item:nth-child(4n) .sketch-rect-svg { transform: rotate(-2.5deg); }

.hc-item:nth-child(2n) .sketch-rect-path { transition: stroke-dashoffset 1.2s var(--ease-out); }
.hc-item:nth-child(3n) .sketch-rect-path { transition: stroke-dashoffset 1.7s var(--ease-out); }
.hc-item:nth-child(4n) .sketch-rect-path { transition: stroke-dashoffset 1.4s var(--ease-out); }

.project-item:nth-child(2n) .sketch-rect-svg { transform: rotate(-1.8deg); }
.project-item:nth-child(3n) .sketch-rect-svg { transform: rotate(1deg); }

.project-item:nth-child(2n) .sketch-rect-path { transition: stroke-dashoffset 1.3s var(--ease-out); }
.project-item:nth-child(3n) .sketch-rect-path { transition: stroke-dashoffset 1.6s var(--ease-out); }

.drawing-item:nth-child(2n) .sketch-rect-svg { transform: rotate(-1.5deg); }
.drawing-item:nth-child(2n) .sketch-rect-path { transition: stroke-dashoffset 1.3s var(--ease-out); }

@keyframes rectWobble {
    0%,33%   { filter: url(#sketch-1); }
    34%,66%  { filter: url(#sketch-2); }
    67%,100% { filter: url(#sketch-3); }
}

/* Hover sur le frame-wrap → dessine le rectangle */
.frame-wrap:hover > .sketch-rect-svg {
    opacity: 1;
}

.frame-wrap:hover > .sketch-rect-svg .sketch-rect-path {
    stroke-dashoffset: 0;
}

/* Variante bouton */
.btn-wrap {
    display: inline-block;
    align-self: flex-start;
}

.btn-rect {
    top: -5%;
    left: -3%;
    width: 106%;
    height: 110%;
    transform: rotate(1deg);
}

.btn-wrap:hover > .sketch-rect-svg { opacity: 1; }
.btn-wrap:hover > .sketch-rect-svg .sketch-rect-path { stroke-dashoffset: 0; }

/* ─── 9.5. PATCHWORK PROJETS HUB ─── */
.projects-patchwork {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    padding: 20px 0 60px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .projects-patchwork {
        grid-template-columns: repeat(12, 1fr);
        grid-auto-rows: 100px;
        grid-auto-flow: dense;
    }
    .patchwork-item.prio-1 { grid-column: span 6; grid-row: span 5; }
    .patchwork-item.prio-2 { grid-column: span 5; grid-row: span 4; }
    .patchwork-item.prio-3 { grid-column: span 4; grid-row: span 3; }
}

.patchwork-item {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.patchwork-item:hover {
    transform: scale(1.02) rotate(-1deg);
    z-index: 10;
}

/* Polaroid Design */
.polaroid-card {
    background: #e8e8e8; /* Off-white slightly textured look */
    padding: 12px 12px 60px 12px;
    border-radius: 2px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3), 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.polaroid-img-wrap {
    flex: 1;
    overflow: hidden;
    background: #111;
    position: relative;
    border-radius: 2px;
}

.polaroid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.patchwork-item:hover .polaroid-img {
    transform: scale(1.05);
}

/* Tape */
.polaroid-tape {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%) rotate(-2deg);
    width: 120px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    backdrop-filter: blur(4px);
    z-index: 5;
    border: 1px solid rgba(255,255,255,0.05);
}

.patchwork-item:nth-child(even) .polaroid-tape {
    transform: translateX(-50%) rotate(3deg);
    top: -10px;
}

/* Polaroid Text Label */
.polaroid-label {
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    text-align: center;
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 10px;
}

.polaroid-label .pl-num {
    color: var(--red);
    font-size: 2.8rem;
    line-height: 1;
    transform: rotate(-8deg) translateY(-2px);
}

.polaroid-label .pl-text {
    font-size: 1.8rem;
    line-height: 1;
    letter-spacing: 0.05em;
}

.prio-1 .polaroid-label .pl-num { font-size: 3.5rem; }
.prio-1 .polaroid-label .pl-text { font-size: 2.5rem; }

/* Red Scribble Integration */
.polaroid-card .sketch-rect-svg {
    pointer-events: none;
    z-index: 20;
    width: 106%;
    height: 106%;
    left: -3%;
    top: -3%;
}

.patchwork-item:hover .sketch-rect-svg {
    opacity: 1;
}

.patchwork-item:hover .sketch-rect-svg .sketch-rect-path {
    stroke-dashoffset: 0;
}

/* ─────────────────────────────────────
   10. SECTION CAHIER DE BROUILLON
───────────────────────────────────── */
.notebook-section {
    position: relative;
    color: var(--notebook-text);
}

.notebook-bg-sheet {
    position: absolute;
    top: -85px;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--notebook-bg);
    clip-path: polygon(0% 2.5%, 10% 1.8%, 25% 2.8%, 40% 1.5%, 55% 3.2%, 70% 1.8%, 85% 2.8%, 100% 1.8%, 100% 97.2%, 85% 98.2%, 70% 97.2%, 55% 98.5%, 40% 97.2%, 25% 98.2%, 10% 97.2%, 0% 98.2%);
    z-index: 0;
    filter: url(#paper-tear);
    will-change: transform;  /* FIX: promotion GPU réduit le repaint au hover */
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.36, 1), clip-path 0.8s cubic-bezier(0.25, 1, 0.36, 1);
    transform-origin: center;
    pointer-events: none;
}

/* Au survol de la section cahier, la feuille de papier se déroule (scaleX/Y) et les bords déchirés se déforment dynamiquement (morphing) */
.notebook-section:hover .notebook-bg-sheet {
    transform: scale(1.015, 1.07);
    clip-path: polygon(0% 3.5%, 10% 2.2%, 25% 3.8%, 40% 2%, 55% 4.2%, 70% 2.2%, 85% 3.8%, 100% 2.2%, 100% 96.2%, 85% 97.5%, 70% 96.2%, 55% 97.8%, 40% 96.2%, 25% 97.5%, 10% 96.2%, 0% 97.5%);
}

.notebook-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 110px 80px 130px;
    position: relative;
    z-index: 1;
}

/* Lignes : conteneur vide, rempli par JS avec des longueurs aléatoires */
.notebook-lines {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

/* Chaque ligne générée par JS */
.nb-line {
    position: absolute;
    height: 4px;
    background: var(--notebook-line);
    border-radius: 2px;
}

/* Marge rouge de cahier (placée sur la feuille d'arrière-plan pour suivre son étirement) */
.notebook-bg-sheet::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: 80px;
    width: 2px;
    background: rgba(255, 54, 74, 0.3);
    z-index: 1;
}

.notebook-bg-sheet::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: 84px;
    width: 1px;
    background: rgba(255, 54, 74, 0.18);
    z-index: 1;
}

.notebook-content {
    position: relative;
    z-index: 2;
    padding-left: 30px;
}

.notebook-title-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 24px;
}

.notebook-title {
    font-size: clamp(3.2rem, 6vw, 5rem);
    line-height: 1;
    margin-bottom: 0;
    color: var(--notebook-text);
}

.notebook-text {
    font-size: 1.1rem;
    line-height: 34px; /* Correspond exactement au pas des lignes du cahier (spacing = 34px) */
    color: rgba(26,26,26,0.75);
    max-width: 640px;
    margin-bottom: 34px; /* Permet aux paragraphes de rester calés sur la grille */
    transition: transform 0.3s var(--ease-out);
    position: relative;
    top: -2px; /* Ajustement fin de 5px entre la ligne et l'écriture */
}

/* Hover wobble sur le texte du cahier */
.notebook-hover-zone:hover .notebook-text {
    animation: notebookWobble 0.4s ease-out;
}

@keyframes notebookWobble {
    0%   { transform: rotate(0deg); }
    25%  { transform: rotate(-0.3deg) translateX(-1px); }
    50%  { transform: rotate(0.2deg) translateX(1px); }
    75%  { transform: rotate(-0.15deg); }
    100% { transform: rotate(0deg); }
}

.notebook-title-wrap:hover .notebook-title {
    animation: notebookWobble 0.5s ease-out;
}

.notebook-annotation {
    display: inline-block;
    font-size: 1.9rem;
    color: var(--red);
    margin-top: 24px;
    transform: rotate(-2deg);
    opacity: 0.85;
}

/* Signature "EVEN" avec flèche courbée - cachée par défaut */
.notebook-signature {
    position: absolute;
    bottom: 25%;
    left: 95%;
    z-index: 3;
    opacity: 0;
    transform: translateY(10px) translateX(-10px);
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
    pointer-events: none;
    display: flex;
    align-items: flex-end;
}

/* Affichage de la signature uniquement au survol du titre "Qui suis-je ?" */
.notebook-title-wrap:hover .notebook-signature {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

.signature-arrow {
    position: absolute;
    left: 0;
    bottom: -15px;
    width: 80px;
    height: 60px;
}

.signature-name {
    font-size: 3.0rem;
    color: var(--red);
    transform: rotate(-6deg);
    white-space: nowrap;
    margin-left: 65px; /* Décalage pour laisser la place à la flèche */
    margin-bottom: 25px; /* Surélève le nom pour que la flèche pointe dessus */
}

/* ─────────────────────────────────────
   10b. FLÈCHE "SUIVANT" EN BAS DES PAGES
───────────────────────────────────── */
.page-next {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 80px;
    margin-bottom: 40px;
    float: right;
    clear: both;
    padding: 10px 0;
    transition: transform 0.3s var(--ease-out);
}

.page-next:hover {
    transform: translateX(10px);
}

.page-next-label {
    font-family: var(--font-sketch);
    font-size: 3.5rem;
    text-transform: lowercase;
    letter-spacing: 0.03em;
    color: var(--white);
    transition: color 0.3s;
}

.page-next:hover .page-next-label {
    color: var(--red);
}

.page-next-arrow {
    width: 60px;
    height: 30px;
    animation: rectWobble 0.3s steps(1) infinite;
}

.page-next-arrow path {
    stroke: var(--red);
}

/* ─────────────────────────────────────
   11. CONTACT (intégré dans accueil)
───────────────────────────────────── */
.home-contact { padding: 0; background: var(--bg); }

.home-contact-inner {
    max-width: 1200px; margin: 0 auto; padding: 100px 60px;
}

.contact-layout {
    display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 80px; align-items: start;
}

.contact-form { display: flex; flex-direction: column; gap: 36px; }

.fg { position: relative; }

.fi {
    display: block;
    width: 100%; padding: 12px 0;
    background: transparent; border: none;
    border-bottom: 1px solid rgba(255,255,255,0.18);
    color: var(--white); font-family: var(--font-body);
    font-size: 1rem; outline: none;
    transition: border-color var(--dur-fast);
}

.fi-ta {
    height: 48px;
    resize: none;
    overflow: hidden;
    padding-top: 0 !important;
    margin-top: 12px;
    transition: height 0.4s var(--ease-out), border-color var(--dur-fast);
}

.fi-ta:focus,
.fi-ta:not(:placeholder-shown) {
    height: 120px;
    overflow-y: auto;
}

.fl {
    position: absolute; left: 0; top: 12px;
    font-family: var(--font-display); font-size: 1.1rem;
    letter-spacing: 0.05em; color: rgba(255,255,255,0.3);
    pointer-events: none; transform-origin: left top;
    transition: transform 0.3s var(--ease-out), color 0.3s;
}

.fi:focus ~ .fl, .fi:not(:placeholder-shown) ~ .fl {
    transform: translateY(-24px) scale(0.82); color: var(--red);
}

/* La ligne rouge animée est gérée uniquement par le span .fb pour éviter tout dédoublement */

.fb { position: absolute; bottom: 0; left: 0; width: 0; height: 1px; background: var(--red); transition: width var(--dur-med) var(--ease-out); }
.fi:focus ~ .fb { width: 100%; }

.submit-btn {
    padding: 14px 42px;
    font-family: var(--font-display); font-size: 1.3rem;
    letter-spacing: 0.07em; color: var(--white);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: border-color var(--dur-fast), color var(--dur-fast);
}

.submit-btn:hover { border-color: var(--red); color: var(--red); }

/* ── Validation formulaire (BUG-07 FIX) ── */
.fi-error {
    border-bottom-color: var(--red) !important;
}

.fi-error ~ .fl {
    color: var(--red) !important;
    transform: translateY(-24px) scale(0.82) !important;
}

.form-feedback {
    min-height: 22px;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-feedback--error {
    color: var(--red);
    opacity: 1;
}

.form-feedback--success {
    color: #4ade80; /* vert succès */
    opacity: 1;
}


.contact-info { display: flex; flex-direction: column; gap: 36px; padding-top: 12px; }
.ci-label { font-family: var(--font-display); font-size: 0.9rem; letter-spacing: 0.12em; color: rgba(255,255,255,0.25); margin-bottom: 10px; text-transform: uppercase; }
.ci-link { font-family: var(--font-display); font-size: 1.4rem; letter-spacing: 0.03em; display: inline-block; transition: color var(--dur-fast); }
.ci-link:hover { color: var(--red); }
.ci-soc {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    opacity: 0.6;
    margin-bottom: 12px;
    transition: opacity var(--dur-fast), color var(--dur-fast), transform var(--dur-fast);
}
.ci-soc:hover {
    opacity: 1;
    color: var(--red);
    transform: translateX(4px);
}
.ci-soc-icon {
    flex-shrink: 0;
}
.ci-text { font-size: 1rem; font-weight: 300; opacity: 0.5; }

/* ─────────────────────────────────────
   12. FOOTER LÉGAL
───────────────────────────────────── */
.site-footer {
    background: #111111;
    color: rgba(255,255,255,0.4);
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-bottom: -100px;
    padding-left: 60px;
    padding-right: 60px;
    position: relative;
    clear: both;
    /* FIX R-01 : 100vw inclut la barre de defilement de .page (4px),
       ce qui faisait deborder le footer de ~5px sur toutes les pages.
       --sbw est mesure au runtime par app.js ; 0px = comportement d'avant. */
    width: calc(100vw - var(--sbw, 0px));
    left: 50%;
    right: 50%;
    margin-left: calc(-50vw + var(--sbw, 0px) / 2) !important;
    margin-right: calc(-50vw + var(--sbw, 0px) / 2) !important;
    box-sizing: border-box;
}
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 50px 60px 40px; }
.footer-top { display: flex; align-items: baseline; gap: 16px; margin-bottom: 30px; }
.footer-logo { font-size: 1.6rem; color: var(--white); animation: logoWobbleMini 0.3s steps(1) infinite; }
.footer-year { font-size: 0.85rem; opacity: 0.5; }
.footer-legal { font-size: 0.8rem; line-height: 1.7; opacity: 0.5; max-width: 800px; margin-bottom: 26px; }
.footer-legal p { margin-bottom: 12px; }
.footer-bottom { display: flex; gap: 14px; font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; opacity: 0.3; }
.footer-sep { opacity: 0.3; }

/* ─────────────────────────────────────
   13. PAGES INTÉRIEURES
───────────────────────────────────── */
.page-inner { max-width: 1200px; margin: 0 auto; padding: 120px 60px 100px; overflow: visible; }
.page-heading { display: flex; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.page-num { font-family: var(--font-display); font-size: 1.1rem; color: var(--red); letter-spacing: 0.05em; }
.page-title { font-family: var(--font-display); font-size: clamp(3rem, 7vw, 6rem); line-height: 0.9; letter-spacing: 0.02em; text-transform: uppercase; }
.page-intro { font-size: 1.05rem; color: var(--muted); font-weight: 300; max-width: 550px; margin-bottom: 60px; line-height: 1.7; }

/* ─────────────────────────────────────
   14. GRILLE PROJETS
───────────────────────────────────── */
.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 30px; }
.project-item { position: relative; }
.pi-wide { grid-column: 1 / -1; }
.pi-wide .torn-frame .media-frame-inner { aspect-ratio: 16 / 7; }
.pi-medium .torn-frame .media-frame-inner { aspect-ratio: 4 / 3; }
.pi-portrait .torn-frame .media-frame-inner { aspect-ratio: 1 / 1.3; }
.pi-meta { margin-top: 10px; display: flex; align-items: center; gap: 10px; }
.pi-num { font-family: var(--font-display); font-size: 1.1rem; color: var(--red); letter-spacing: 0.05em; }

/* ─────────────────────────────────────
   15. CARROUSEL HORIZONTAL
───────────────────────────────────── */
.hcarousel-wrap { width: 100%; margin-left: 0; padding: 10px 0 30px; }
.hcarousel-track { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 40px 30px; width: 100%; }
.hc-item { flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }
.hc-portrait { width: 260px; }
.hc-portrait .torn-frame .media-frame-inner { aspect-ratio: 3/4; }
.hc-landscape { width: 520px; }
.hc-landscape .torn-frame .media-frame-inner { aspect-ratio: 16/9; }
.hc-medium { width: 380px; }
.hc-medium .torn-frame .media-frame-inner { aspect-ratio: 4/3; }
.hc-a4 { width: 240px; }
.hc-a4 .torn-frame .media-frame-inner { aspect-ratio: 1/1.414; }
.hc-caption { font-size: 1.1rem; color: var(--muted); padding-left: 4px; }

/* ─────────────────────────────────────
   16. GALERIE DESSINS
───────────────────────────────────── */
.drawings-gallery { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 40px; align-items: end; }

.drawing-item { 
    display: flex; flex-direction: column; gap: 18px; 
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), 
                filter 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), 
                opacity 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    z-index: 1;
}

@media (hover: hover) {
    .drawings-gallery:hover .drawing-item {
        filter: blur(4px) grayscale(50%);
        opacity: 0.5;
    }
    .drawings-gallery .drawing-item:hover {
        filter: none;
        opacity: 1;
        transform: scale(1.08);
        z-index: 20;
    }
}

/* Curseur "loupe" uniquement quand la page Dessins est active et visible */
.page.is-active .drawing-item .frame-wrap,
.page.is-active .bd-slide.active .drawing-sheet-wrap {
    cursor: zoom-in;
}
.drawing-sheet-wrap .media-frame-inner { background: white; padding: 0; }
.drawing-item.orient-portrait .media-frame-inner { aspect-ratio: 1 / 1.414; }
.drawing-item.orient-landscape .media-frame-inner { aspect-ratio: 1.414 / 1; }
.drawing-sheet img,
.drawing-sheet object {
    transform: scale(1.18); /* Zoom 18% to crop white borders and fill beautifully */
    transform-origin: center center;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.drawing-meta { text-align: left; }
.drawing-title { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 0.02em; line-height: 1.2; margin-bottom: 6px; }
.drawing-detail { font-size: 1.3rem; color: var(--red); }

/* Animation photo de référence Noir & Blanc */
.ref-photo-wrap {
    position: absolute;
    top: -15px;
    right: -110px;
    width: 120px;
    z-index: 5;
    pointer-events: none;
}

.ref-photo {
    width: 100%;
    opacity: 0;
    transform: rotate(15deg) translateY(20px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 15px 25px rgba(0,0,0,0.6));
}

.ref-photo .media-frame-inner {
    padding: 10px 10px 36px 10px;
    background: #fdfdfd;
    border-radius: 2px;
}

.ref-photo .media-frame-img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
    width: 100%;
    height: 100%;
    display: block;
}

.drawing-item:hover .ref-photo {
    opacity: 1;
    transform: rotate(6deg) translateY(0);
}

.ref-arrow {
    position: absolute;
    top: -50px;
    left: -40px;
    width: 90px;
    height: 90px;
    overflow: visible;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
    transform: rotate(5deg);
    animation: rectWobble 0.3s steps(1) infinite;
}

.ref-arrow-path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.5s ease 0.2s;
}

.drawing-item:hover .ref-arrow {
    opacity: 1;
}

.drawing-item:hover .ref-arrow-path {
    stroke-dashoffset: 0;
}

/* Animation épingle Cartographie */
.map-pin-wrap {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 100px;
    z-index: 15;
    pointer-events: none;
}

.map-pin-icon {
    width: 32px;
    height: 48px;
    position: absolute;
    top: 26px;
    left: 84px;
    opacity: 0;
    transform: translateY(-40px) scale(1.2);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 8px 10px rgba(0,0,0,0.5));
    animation: rectWobble 0.3s steps(1) infinite;
}

.map-pin-text {
    font-size: 2.8rem;
    color: var(--red);
    position: absolute;
    top: -20px;
    left: -20px;
    transform: rotate(-15deg) scale(0.8);
    opacity: 0;
    transition: all 0.4s ease 0.2s;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.4);
    letter-spacing: 2px;
}

.drawing-item:hover .map-pin-icon {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.drawing-item:hover .map-pin-text {
    opacity: 1;
    transform: rotate(-15deg) scale(1);
}
/* ─────────────────────────────────────
   BD CAROUSEL (BANDE DESSINÉE)
───────────────────────────────────── */
.bd-carousel-section {
    margin-top: 0;
    padding-top: 60px;
    position: relative;
    text-align: center;
}

.panel-section::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 20px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 20' preserveAspectRatio='none'%3E%3Cpath d='M 0 12 L 15 11 L 30 12 L 50 13 L 65 14 L 85 14 L 100 12 L 115 9 L 130 6 L 145 3 L 125 7 L 160 8 L 180 8 L 195 10 L 210 12 L 230 13 L 255 14 L 275 14 L 285 12 L 295 10 L 310 10 L 330 11 L 350 11 L 375 11 L 390 10 L 405 10 L 415 13 L 425 16 L 410 15 L 435 15 L 460 14 L 480 13 L 500 12' stroke='white' stroke-width='2.5' fill='none' stroke-linejoin='miter' stroke-linecap='round'/%3E%3C/svg%3E");
      background-size: 500px 20px;
      background-repeat: repeat-x;
      z-index: 1;
      pointer-events: none;
  }

.bd-title-wrap {
    position: relative;
    text-align: center;
    margin-bottom: 5px;
    z-index: 2;
    pointer-events: none;
}

.bd-section-title {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    color: var(--white);
    letter-spacing: 0.05em;
    transform: translateY(18px) rotate(-4deg);
    margin-bottom: 0;
    display: inline-block;
    position: relative;
    z-index: 15;
}

.bd-section-subtitle {
    font-family: var(--font-display);
    font-size: clamp(3.8rem, 12vw, 9.8rem);
    font-weight: bold;
    line-height: 0.75;
    letter-spacing: -0.01em;
    color: var(--red);
    text-transform: uppercase;
    display: block;
    position: relative;
    z-index: 10;
    cursor: default;
    pointer-events: auto;
}

.animation-explosion-detail {
    position: absolute;
    bottom: -40px;
    left: 50%;
    margin-left: -285px;
    width: 150px;
    height: 150px;
    background-image: url('../assets/gemini-svg2.svg');
    background-size: 500% 100%;
    background-position: 0 0;
    transform-origin: 50% 100%;
    transform: rotate(-45deg) scale(1.15);
    opacity: 0;
    pointer-events: none;
    z-index: 20;
}

.bd-section-subtitle:hover ~ .animation-explosion-detail {
    opacity: 1;
    animation: explosion-flipbook-detail 0.6s steps(4) forwards;
}

@keyframes explosion-flipbook-detail {
    from { background-position: 0% 0; }
    to { background-position: 100% 0; }
}

@media (max-width: 768px) {
    .animation-explosion-detail {
        width: 100px;
        height: 100px;
        margin-left: -190px;
        bottom: -20px;
    }
}



/* BD frame SVG sits exactly on the viewport, not the wider frame-wrap */
.bd-frame-svg {
    top: -3%;
    left: -3%;
    width: 106%;
    height: 106%;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.frame-wrap:hover .bd-frame-svg {
    opacity: 1;
}
.frame-wrap:hover .bd-frame-svg .sketch-rect-path {
    stroke-dashoffset: 0;
}

.bd-carousel-container { align-items: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 24px;
}

.bd-carousel-viewport {
    width: 420px;
    aspect-ratio: 1 / 1.414;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
}

.carousel-landscape .bd-carousel-viewport {
    width: 600px;
    max-width: 90vw;
    aspect-ratio: 1.414 / 1;
}

.bd-carousel-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.bd-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(0.96) translateY(10px);
    transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
    z-index: 1;
}

.bd-slide.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
    z-index: 2;
}

.bd-slide .drawing-sheet-wrap,
.bd-slide .media-frame-inner {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* Animation hover sur les plans avant (même style que les coupes) */
.bd-slide .drawing-sheet-wrap {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.bd-slide .drawing-sheet-wrap:hover {
    transform: scale(1.02);
    box-shadow: 15px 15px 40px rgba(0,0,0,0.5);
}

.bd-slide .media-frame-inner {
    padding: 0 !important;
    /* removed transparent */
}

.bd-nav-btn { z-index: 20;
    background: transparent;
    border: none;
    color: var(--white);
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.bd-nav-btn:hover {
    color: var(--red);
    transform: scale(1.15) rotate(-5deg);
}

/* 3-Frame Sketch Animation for arrows */
.sketch-f1 { animation: frame-toggle 0.45s infinite; animation-delay: 0s; }
.sketch-f2 { animation: frame-toggle 0.45s infinite; animation-delay: 0.15s; }
.sketch-f3 { animation: frame-toggle 0.45s infinite; animation-delay: 0.3s; }

@keyframes frame-toggle {
    0%, 33.32% { opacity: 1; }
    33.33%, 100% { opacity: 0; }
}

.bd-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 28px;
}

.bd-play-pause-btn {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease, transform 0.2s ease;
}

.bd-play-pause-btn:hover {
    color: var(--red);
    transform: scale(1.15);
}

.bd-dots {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bd-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: all 0.3s ease;
}

.bd-dot.active {
    background: var(--red);
    transform: scale(1.3);
}

.bd-progress-container {
    width: 180px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.bd-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--red);
}

.bd-page-indicator {
    font-size: 1.3rem;
    color: var(--muted);
    min-width: 50px;
    text-align: right;
}

/* ─────────────────────────────────────
   17. DIPLÔME
───────────────────────────────────── */
.diploma-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 50px; align-items: start; }
.school-name-wrap { margin-bottom: 28px; }
.school-name { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1; }
.school-city { font-size: 2.3rem; color: var(--red); margin-left: 8px; }
.school-img-wrap .media-frame-inner { aspect-ratio: 4/3; }
.study-list { list-style: none; margin-top: 30px; display: flex; flex-direction: column; gap: 22px; font-size: 0.95rem; line-height: 1.6; }
.study-list strong { display: block; font-family: var(--font-display); font-size: 1.15rem; text-transform: uppercase; margin-bottom: 3px; }
.study-year { color: var(--red); font-weight: 600; }
.diploma-placeholder .media-frame-inner {
    aspect-ratio: 1 / 1.414;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.diploma-card-inner {
    aspect-ratio: 1 / 1.414;
    padding: 36px 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    box-sizing: border-box;
    line-height: 1.4; /* Override line-height: 0 from .media-frame-inner */
}

.diploma-cert-header {
    border-bottom: 1px solid rgba(255, 54, 74, 0.2);
    padding-bottom: 18px;
    position: relative;
}

.diploma-cert-stamp {
    position: absolute;
    top: -15px;      /* Déplacé vers le haut pour chevaucher la bordure */
    right: -25px;    /* Déplacé vers la droite pour chevaucher la bordure */
    font-size: 1.5rem; /* Beaucoup plus gros */
    font-weight: 800;
    letter-spacing: 0.15em;
    color: var(--red);
    border: 3.5px solid var(--red); /* Bordure plus épaisse */
    padding: 8px 20px;
    border-radius: 6px;
    transform: rotate(-12deg); /* Rotation négative (incliné vers le haut-droit) */
    opacity: 0.95;
    z-index: 20; /* Passer par-dessus le cadre */
    background: var(--bg); /* Fond opaque pour masquer la bordure du cadre en dessous */
    animation: logoWobbleMini 0.3s steps(1) infinite;
}

.diploma-cert-title {
    font-family: var(--font-display);
    font-size: 1.5rem; /* Augmenté de 1.25rem */
    letter-spacing: 0.05em;
    color: var(--white);
    margin-bottom: 6px;
    line-height: 1.2;
}

.diploma-cert-subtitle {
    font-size: 0.95rem; /* Augmenté de 0.8rem */
    color: var(--red);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.3;
}

.diploma-cert-body {
    display: flex;
    flex-direction: column;
    gap: 18px; /* Ajusté pour s'adapter aux polices plus grandes */
    margin-top: 18px;
    flex-grow: 1;
}

.diploma-cert-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.diploma-section-label {
    font-family: var(--font-display);
    font-size: 0.9rem; /* Augmenté de 0.82rem */
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
}

.diploma-section-text {
    font-size: 0.92rem; /* Augmenté de 0.82rem */
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 300;
}

.diploma-skills-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px; /* Ajusté */
}

.diploma-skills-list li {
    font-size: 0.9rem; /* Augmenté de 0.8rem */
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.65);
    padding-left: 14px;
    position: relative;
    font-weight: 300;
}

.diploma-skills-list li::before {
    content: '▪';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--red);
    font-size: 0.6rem;
}

.diploma-cert-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem; /* Augmenté de 0.72rem */
    color: rgba(255, 255, 255, 0.35);
}

.diploma-cert-code {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 991px) {
    .page {
        padding: 100px 30px 40px 30px;
    }
}

/* ── Inline PDF Loader ── */
.inline-pdf-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    color: var(--c-primary);
    z-index: 10;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.inline-pdf-loader svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

.sketch-dot {
    animation: dot-bounce 1s infinite ease-in-out;
    transform-origin: center;
}

.sketch-dot-1 {
    animation-delay: 0s;
}

.sketch-dot-2 {
    animation-delay: 0.2s;
}

.sketch-dot-3 {
    animation-delay: 0.4s;
}

.pdf-loaded + .inline-pdf-loader {
    opacity: 0;
    visibility: hidden;
}

@keyframes dot-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@media (max-width: 480px) {
    .diploma-card-inner {
        padding: 22px 18px;
    }
    .diploma-cert-body {
        gap: 15px;
    }
}

.diploma-scan-container {
    margin-top: 60px;
    position: relative;
    padding-top: 40px;
    text-align: center;
}

.scan-section-title {
    font-size: 2.2rem;
    color: var(--white);
    margin-bottom: 24px;
    text-transform: uppercase;
}

.diploma-scan-wrap {
    max-width: 850px;
    margin: 0 auto;
    width: 100%;
}

.diploma-scan-frame {
    width: 100%;
    aspect-ratio: 1.414 / 1; /* A4 Paysage */
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.diploma-scan-inner {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.diploma-scan-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px;
    opacity: 0.35;
    transition: opacity var(--dur-fast);
}

.diploma-scan-wrap:hover .diploma-scan-placeholder {
    opacity: 0.7;
}

.diploma-stamp-icon {
    width: 80px;
    height: 80px;
    color: var(--red);
    animation: logoWobbleMini 0.3s steps(1) infinite;
}

.scan-coming {
    font-size: 2.2rem;
    color: var(--white);
    text-align: center;
}

.scan-sub {
    font-size: 1.4rem;
    color: var(--red);
    text-align: center;
}

/* ─────────────────────────────────────
   LIGHTBOX ULTRA-ÉPURÉE (STYLE FORTICHE)
───────────────────────────────────── */
.drawing-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 90px 60px 60px;
    box-sizing: border-box;
    background: #121212;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0s linear 0.35s;
    cursor: default;
}

.drawing-lightbox[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.35s ease, visibility 0s linear 0s;
}

/* ── Logo centré en haut ── */
.lb-logo {
    position: absolute;
    top: 26px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.2rem;
    color: var(--white);
    z-index: 10010;
    letter-spacing: 0.04em;
    opacity: 0.85;
    transition: opacity 0.4s ease;
    animation: logoWobbleMini 0.3s steps(1) infinite;
}

/* ── Compteur discret sous le logo ── */
.lb-counter {
    position: absolute;
    top: 78px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.35);
    z-index: 10010;
    letter-spacing: 0.04em;
    transition: opacity 0.4s ease;
}

/* ── Outils (Plein écran, Zoom, Fermer) ── */
.lb-tools {
    position: absolute;
    top: 20px;
    right: 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 10010;
}

.lb-tool-btn, .lb-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.lb-close {
    font-size: 2.4rem;
    line-height: 1;
}

.lb-tool-btn:hover, .lb-close:hover {
    color: var(--white);
    transform: scale(1.15);
}

/* ── Flèches de navigation ── */
.lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    z-index: 10005;
    padding: 14px;
    transition: color 0.25s ease, transform 0.25s ease;
}

.lb-prev { left: 18px; }
.lb-next { right: 18px; }

.lb-arrow:hover {
    color: var(--white);
    transform: translateY(-50%) scale(1.2);
}

/* ── Conteneur du canvas (l'image) ── */
.lb-canvas-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    z-index: 10001;
    background: transparent;
    overflow: hidden;
    box-sizing: border-box;
    padding: 110px 70px 50px 70px;
}

.lb-canvas-wrap img,
.lb-canvas-wrap canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border: none;
    outline: none;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

/* ── Slider de Zoom (Crayonné) ── */
.lb-zoom-slider-container {
    position: relative;
    width: 120px;
    height: 30px;
    display: none;
    align-items: center;
    margin-right: 5px;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.drawing-lightbox.zoomed .lb-zoom-slider-container {
    display: flex;
    opacity: 1;
    transform: translateX(0);
}

.lb-slider-svg {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 20px;
    transform: translateY(-50%);
    pointer-events: none;
    animation: rectWobble 0.3s steps(1) infinite;
}

#lb-zoom-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
    z-index: 2;
    margin: 0;
}

#lb-zoom-range:focus {
    outline: none;
}

#lb-zoom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 30px;
    background: transparent;
}
#lb-zoom-range::-moz-range-thumb {
    width: 20px;
    height: 30px;
    background: transparent;
    border: none;
}

/* ── État zoomé (Pan & Zoom) ── */
.drawing-lightbox.zoomed .lb-canvas-wrap {
    overflow: hidden !important; 
    touch-action: none;
}

.drawing-lightbox.zoomed .lb-canvas-wrap img,
.drawing-lightbox.zoomed .lb-canvas-wrap canvas {
    cursor: grab;
    transform-origin: center center;
}

.drawing-lightbox.zoomed .lb-canvas-wrap img.dragging,
.drawing-lightbox.zoomed .lb-canvas-wrap canvas.dragging {
    cursor: grabbing;
    transition: none !important;
}

/* Fallback embed PDF — supprimer le cadre gris du viewer natif */
.lb-canvas-wrap embed,
.lb-canvas-wrap object {
    display: block;
    border: none;
    outline: none;
    background: #121212;
}

/* ── Loader spinner ── */
.lb-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lb-loader.active {
    opacity: 1;
}

.lb-spinner {
    width: 32px;
    height: 32px;
    border: 2.5px solid rgba(255, 255, 255, 0.12);
    border-top: 2.5px solid var(--red);
    border-radius: 50%;
    animation: lb-spin 0.9s linear infinite;
}

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

/* ── Points indicateurs en bas ── */
.lb-dots {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10010;
}

.lb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.25s ease;
}

.lb-dot.active {
    background: var(--white);
    transform: scale(1.35);
}

.lb-dot:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

/* ── Auto-masquage des contrôles (classe JS) ── */
.drawing-lightbox.controls-hidden .lb-logo,
.drawing-lightbox.controls-hidden .lb-counter,
.drawing-lightbox.controls-hidden .lb-close,
.drawing-lightbox.controls-hidden .lb-arrow,
.drawing-lightbox.controls-hidden .lb-dots {
    opacity: 0;
    pointer-events: none;
}

/* ─────────────────────────────────────
   18. RESPONSIVE — MOBILE (≤ 768px)
───────────────────────────────────── */
@media (max-width: 768px) {

    /* ── Header ── */
    .header-inner { padding: 0 18px; }
    .header-right { gap: 14px; }
    .social-nav { display: flex; gap: 8px; }
    .social-icon { width: 15px; height: 15px; }
    .lang-switcher { gap: 4px; font-size: 0.75rem; }

    /* ── Menu overlay ── */
    .menu-overlay { padding: 0 20px 30px; }
    .menu-logo-wrap { padding-top: 85px; padding-bottom: 20px; }
    .menu-scribble { right: 20px; top: 100px; font-size: 2rem; }
    .menu-footer { gap: 20px; flex-direction: column; align-items: flex-start; }

    /* ── Pages intérieures ── */
    .page-inner { padding: 95px 20px 80px; }
    .page-title { font-size: clamp(2.2rem, 8vw, 3.5rem); }
    .page-intro { font-size: 0.95rem; margin-bottom: 36px; }

    /* ── Accueil ── */
    .home-showcase { padding: 0 16px; margin-bottom: 36px; }
    .home-projects-shortcut { margin-top: -10px; margin-bottom: 10px; }
    .shortcut-click-hint { 
        display: flex;
        opacity: 0;
        transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s;
        transform: translateY(-40px) scale(1.2) rotate(5deg);
        left: auto;
        right: -10px; /* Décalé vers la droite, dans la zone anthracite */
        top: -15px; /* Décalé vers le haut */
    }
    .click-hint-text {
        font-size: 2.2rem;
    }
    .click-hint-arrow {
        width: 45px;
        height: 30px;
    }
    .shortcut-underline-svg { width: 80%; }
    .shortcut-main-text { font-size: clamp(3rem, 12vw, 7rem); }

    /* ── Cahier de brouillon ── */
    .notebook-bg-sheet { top: -45px; }
    .notebook-inner { padding: 80px 20px 100px; }
    .notebook-bg-sheet::before { left: 20px; }
    .notebook-bg-sheet::after { left: 24px; }
    .notebook-content { padding-left: 12px; }

    /* ── Contact ── */
    .home-contact-inner { padding: 60px 20px 80px; }
    .contact-layout { grid-template-columns: 1fr; gap: 40px; }

    /* ── Footer ── */
    .footer-inner { padding: 36px 20px 28px; }
    .footer-bottom { flex-wrap: wrap; gap: 8px; }

    /* ── Grille Projets ── */
    .projects-grid { grid-template-columns: 1fr; gap: 24px; }
    .pi-wide { grid-column: 1; }
    .pi-wide .torn-frame .media-frame-inner { aspect-ratio: 4/3; }

    /* ── Galerie Photos ── */
    .hcarousel-wrap { width: 100%; margin-left: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .hcarousel-track { flex-wrap: nowrap; justify-content: flex-start; padding: 0 20px 20px; gap: 16px; width: max-content; }
    .hc-portrait { width: 180px; }
    .hc-landscape { width: 300px; }
    .hc-medium { width: 240px; }
    .hc-a4 { width: 150px; }

    /* ── Galerie Dessins ── */
    .drawings-gallery { grid-template-columns: 1fr; gap: 28px; }

    /* ── Diplôme ── */
    .diploma-layout { grid-template-columns: 1fr; }
    .diploma-placeholder .media-frame-inner,
    .diploma-card-inner { aspect-ratio: auto; height: auto; }
    .diploma-scan-container { margin-top: 40px; padding-top: 30px; }
    .scan-section-title { font-size: 1.8rem; margin-bottom: 16px; }
    .scan-coming { font-size: 1.4rem; }
    .scan-sub { font-size: 1rem; }
    .diploma-stamp-icon { width: 50px; height: 50px; }
    .diploma-scan-placeholder { padding: 20px; gap: 10px; }
    .diploma-cert-stamp {
        font-size: 1rem;
        padding: 6px 14px;
        border-width: 2.5px;
        top: -10px;
        right: -10px;
    }

    /* ── BD Carousel ── */
    .bd-carousel-container { align-items: center; gap: 10px; }
    .bd-carousel-viewport { width: min(280px, 80vw); }
    .carousel-landscape .bd-carousel-viewport { width: 90vw; }
    .bd-nav-btn { z-index: 20; width: 44px; height: 44px; }
    .bd-progress-container { width: 80px; }
    .bd-section-title { font-size: 1.6rem; margin-bottom: 20px; }

    /* ────────────────────────────────────────
       LIGHTBOX — REFONTE COMPLÈTE MOBILE
       Problèmes résolus :
       - Barre zoom superposée au logo
       - Bouton plein écran mal placé
       - Canvas trop petit / padding excessif
       - Flèches trop petites pour les doigts
    ──────────────────────────────────────── */

    /* Conteneur global : padding safe-area pour les encoches */
    .drawing-lightbox {
        padding: 0;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    /* Logo : remonté, taille ajustée, reste centré */
    .lb-logo {
        font-size: 1.6rem;
        top: calc(12px + env(safe-area-inset-top, 0px));
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
    }

    /* Compteur sous le logo, plus petit */
    .lb-counter {
        top: calc(50px + env(safe-area-inset-top, 0px));
        font-size: 0.9rem;
    }

    /* Barre d'outils — sur mobile, on la déplace EN BAS
       pour éviter toute superposition avec le logo haut */
    .lb-tools {
        top: auto;
        bottom: calc(44px + env(safe-area-inset-bottom, 0px));
        right: 50%;
        transform: translateX(50%);
        flex-direction: row;
        gap: 24px;
        background: rgba(18, 18, 18, 0.75);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border-radius: 30px;
        padding: 10px 22px;
        border: 1px solid rgba(255,255,255,0.08);
    }

    /* Boutons outils : plus grands pour les doigts */
    .lb-tool-btn {
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
    }
    .lb-tool-btn svg { width: 22px; height: 22px; }

    /* Bouton fermer : intégré dans la barre du bas */
    .lb-close {
        font-size: 2rem;
        padding: 8px;
        min-width: 44px;
        min-height: 44px;
    }

    /* Slider de zoom : visible mais dans la barre du bas, plein largeur */
    .lb-zoom-slider-container {
        width: 90px;
        height: 36px;
        margin-right: 0;
    }

    /* Canvas : prend tout l'écran avec espace pour logo et barre du bas */
    .lb-canvas-wrap {
        padding: 90px 45px 140px 45px;
        padding-top: calc(90px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px));
    }

    /* Flèches de navigation : plus petites, sans fond (Swipe disponible) */
    .lb-arrow {
        padding: 12px 8px;
        min-width: 44px;
        min-height: 60px;
        background: none;
        border-radius: 0;
    }
    .lb-prev { left: 0px; }
    .lb-next { right: 0px; }
    .lb-arrow svg { width: 18px; height: 18px; }

    /* Points indicateurs : remontés pour ne pas chevaucher la barre */
    .lb-dots {
        bottom: calc(125px + env(safe-area-inset-bottom, 0px));
        gap: 12px;
    }
    .lb-dot { width: 10px; height: 10px; }
}


/* ─────────────────────────────────────
   19. ANIMATIONS AU SCROLL — MOBILE TOUCH
   Sur les appareils tactiles (hover: none), les animations
   de survol sont remplacées par des animations déclenchées
   au scroll via la classe .is-inview ajoutée par JS.
───────────────────────────────────── */
@media (hover: none) {

    /* ── Cadres : rectangle rouge se dessine au clic/touch (active) ── */
    .frame-wrap > .sketch-rect-svg {
        transition: opacity 0.15s 0.1s var(--ease-out); /* Délai de 0.1s pour éviter le flash au scroll */
    }
    .frame-wrap:active > .sketch-rect-svg {
        opacity: 1;
        transition-delay: 0s;
    }
    .frame-wrap:active > .sketch-rect-svg .sketch-rect-path {
        stroke-dashoffset: 0;
    }

    /* ── Cadres : image légèrement zoomée au touch ── */
    .frame-wrap .torn-frame .media-frame-img,
    .frame-wrap .showcase-img {
        transition: transform 0.2s 0.1s ease;
    }
    .frame-wrap:active .torn-frame .media-frame-img,
    .frame-wrap:active .showcase-img {
        transform: scale(1.04);
        transition-delay: 0s;
    }

    /* ── Cadres : texte overlay glisse vers le haut au touch ── */
    .frame-wrap:active .frame-big-text {
        transform: translateY(-4px);
    }

    /* ── Bouton ENVOYER : rect rouge au touch ── */
    .btn-wrap:active > .sketch-rect-svg { opacity: 1; }
    .btn-wrap:active > .sketch-rect-svg .sketch-rect-path { stroke-dashoffset: 0; }

    /* ── Galerie dessins : désactiver le blur global au hover
       et animer chaque item individuellement à son entrée ── */
    .drawings-gallery:hover .drawing-item {
        filter: none;
        opacity: 1;
        transform: none;
    }
    .drawing-item {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s var(--ease-out),
                    transform 0.6s var(--ease-out);
    }
    .drawing-item.is-inview {
        opacity: 1;
        transform: translateY(0);
    }

    /* Délais en cascade pour les dessins */
    .drawing-item:nth-child(1) { transition-delay: 0s; }
    .drawing-item:nth-child(2) { transition-delay: 0.1s; }
    .drawing-item:nth-child(3) { transition-delay: 0.2s; }

    /* ── Bouton "MES PROJETS" : animer à l'entrée ── */
    .home-projects-shortcut {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
        transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
    }
    .home-projects-shortcut.is-inview {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    /* ── Items du carousel photos (hc-item) ── */
    .hc-item {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
    }
    .hc-item.is-inview {
        opacity: 1;
        transform: translateY(0);
    }
    /* Délais en cascade pour les photos */
    .hc-item:nth-child(1) { transition-delay: 0s; }
    .hc-item:nth-child(2) { transition-delay: 0.1s; }
    .hc-item:nth-child(3) { transition-delay: 0.2s; }
    .hc-item:nth-child(4) { transition-delay: 0.3s; }

    /* ── Items projets ── */
    .project-item {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
    }
    .project-item.is-inview {
        opacity: 1;
        transform: translateY(0);
    }
    .project-item:nth-child(2) { transition-delay: 0.1s; }
    .project-item:nth-child(3) { transition-delay: 0.2s; }

    /* ── Blocs d'infos contact ── */
    .ci-block {
        opacity: 0;
        transform: translateX(16px);
        transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
    }
    .ci-block.is-inview {
        opacity: 1;
        transform: translateX(0);
    }
    .ci-block:nth-child(2) { transition-delay: 0.1s; }
    .ci-block:nth-child(3) { transition-delay: 0.2s; }

    /* ── Groupes de champs formulaire ── */
    .fg {
        opacity: 0;
        transform: translateY(16px);
        transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
    }
    .fg.is-inview {
        opacity: 1;
        transform: translateY(0);
    }
    .fg:nth-child(2) { transition-delay: 0.08s; }
    .fg:nth-child(3) { transition-delay: 0.16s; }

    /* ── Désactiver les hover visuels sur mobile (ils ne font rien
       mais laissent un état intermédiaire bloqué sur certains OS) ── */
    .frame-wrap:hover .frame-big-text { transform: none; }
    .frame-wrap:hover .torn-frame .media-frame-img { transform: none; }
    .torn-frame:hover .media-frame-img { transform: none; }
    .showcase-frame:hover .showcase-img { transform: none; }
    .home-projects-shortcut:hover { transform: none; }
    .home-projects-shortcut:hover .shortcut-sub-text { transform: translateY(18px) rotate(-4deg); }
    .home-projects-shortcut:hover .shortcut-main-text { transform: none; }
    .home-projects-shortcut:hover .shortcut-underline-path { stroke-dashoffset: 400; }
    .drawings-gallery .drawing-item:hover { transform: none; filter: none; }
    
    /* ── Base Bounce States for Mobile ── */
    .notebook-signature, .ref-photo, .ref-arrow {
        transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s !important;
    }
    .notebook-signature { transform: translateY(-40px) translateX(20px) scale(1.2) !important; }
    .ref-photo { transform: translateY(-40px) scale(1.2) !important; }
    .ref-arrow { transform: translateY(-40px) scale(1.2) !important; }

    /* ── Extras sur dessins (mobile au scroll) ── */
    .drawing-item.is-inview .ref-photo {
        opacity: 1 !important;
        transform: rotate(15deg) translateY(0) scale(1) !important;
    }
    .drawing-item.is-inview .ref-arrow {
        opacity: 1 !important;
        transform: translateY(0) scale(1) !important;
    }
    .drawing-item.is-inview .ref-arrow-path {
        stroke-dashoffset: 0 !important;
        transition: stroke-dashoffset 0.6s var(--ease-out) 0.8s !important;
    }
    .drawing-item.is-inview .map-pin-icon {
        opacity: 1 !important;
        transform: translateY(0) scale(1) !important;
        transition-delay: 0.8s !important;
    }
    .drawing-item.is-inview .map-pin-text {
        opacity: 1 !important;
        transform: rotate(-15deg) scale(1) !important;
        transition-delay: 0.9s !important;
    }

    /* ── Agrandissement du brouillon au scroll ── */
    .notebook-section.is-inview .notebook-bg-sheet {
        transform: scale(1.02) rotate(-1deg);
        transition-delay: 0.3s;
    }
    .notebook-section.is-inview .notebook-signature {
        opacity: 1 !important;
        transform: translateY(0) translateX(0) scale(1) !important;
    }

    /* ── Cliquez ! au scroll ── */
    .home-projects-shortcut.is-inview .shortcut-click-hint {
        opacity: 1 !important;
        transform: translateY(0) scale(1) rotate(5deg) !important;
    }

    /* ── Dessin Noir et Blanc (3ème) : rétrécissement pour faire de la place ── */
    .drawing-item:nth-child(3).is-inview .frame-wrap {
        transform: scale(0.70) translateX(-18%);
        transition: transform 0.8s var(--ease-out) 0.1s;
    }

    /* Disable hover rules for mobile on extras when not in view */
    .drawing-item:not(.is-inview):hover .ref-photo { opacity: 0; }
    .drawing-item:not(.is-inview):hover .ref-arrow { opacity: 0; }
    .drawing-item:not(.is-inview):hover .map-pin-icon { opacity: 0; }
    .drawing-item:not(.is-inview):hover .map-pin-text { opacity: 0; }
}



/* ========================================================= */
/* PROJECTS REDESIGN (FORTICHE STYLE) */
/* ========================================================= */

.fortiche-projects-board {
    position: relative;
    padding: 0;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.projects-board-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.tape-title {
    color: var(--white);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    display: inline-block;
    background: #1a1a1a;
    padding: 10px 20px;
    transform: rotate(-1deg);
    box-shadow: 2px 2px 0px var(--red);
    position: relative;
    z-index: 2;
}

.tape-title::after {
    content: '#';
    position: absolute;
    top: -20px;
    left: -25px;
    color: var(--red);
    font-size: clamp(3.5rem, 7vw, 5.2rem);
    font-family: var(--font-sketch);
    transform: rotate(-15deg);
    line-height: 1;
    z-index: 5;
}

.tape-title::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) rotate(2deg);
    width: 60px;
    height: 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    z-index: 3;
}

.board-subtitle {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: #888;
    margin-top: 15px;
}





/* 1. SCRAPBOOK GRID (Zoning) */
.scrapbook-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2vw;
    align-items: center;
}

.scrapbook-item {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), z-index 0s;
    cursor: pointer;
}

.scrapbook-item:hover {
    transform: scale(1.05) rotate(0deg) !important;
    z-index: 20;
}

.item-large {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    transform: rotate(1deg);
}

.item-tilted-right {
    grid-column: 2 / 3;
    transform: rotate(3deg);
}

.item-tilted-left {
    grid-column: 3 / 4;
    transform: rotate(-2deg);
}

.item-tilted-right-more {
    grid-column: 2 / 4;
    transform: rotate(1.5deg);
    margin-top: -20px;
}

.scrapbook-note {
    position: absolute;
    bottom: -15px;
    right: -10px;
    background: #fff;
    color: #000;
    padding: 2px 8px;
    font-size: 0.9rem;
    transform: rotate(-5deg);
    z-index: 5;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* 2. FILMSTRIP (Plans) */
.blueprint-section {
    padding: 60px 0 !important;
    /* removed transparent */
    border: none !important;
}

.custom-filmstrip .bd-carousel-header {
    display: none; /* Hide old giant headers */
}

.custom-filmstrip .bd-carousel-container { align-items: center;
    width: 100%;
    padding: 20px 0;
}

.custom-filmstrip .bd-slide { opacity: 0; transform: scale(0.85); transition: all 0.5s ease; }

.custom-filmstrip .bd-slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 5;
}

.filmstrip-note {
    position: absolute;
    top: 10px; left: 10px; background: rgba(0,0,0,0.7); padding: 4px 8px; border-radius: 4px;
    font-size: 1.1rem;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.3s;
}

.custom-filmstrip .bd-slide.active .filmstrip-note {
    opacity: 1;
}

/* 3. CUT STACK (Coupes) */
.cut-stack {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-top: 30px;
}

.stack-item {
    position: relative;
    width: 60vw; max-width: 1200px; margin: 0 auto; transition: transform 0.3s ease;
}

.stack-item:nth-child(even) {
    align-self: flex-end;

/* 3-frame animated border for full-bleed sections */












.fortiche-section.bg-light 

@keyframes floatingText {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-10px) rotate(-1deg); }
}: flex-end;
    transform: rotate(1deg);
}

.stack-item:nth-child(odd) {
    align-self: flex-start;
    transform: rotate(-1deg);
}

.stack-item:hover {
    transform: scale(1.02) rotate(0deg);
    z-index: 5;
}

.stack-note {
    position: absolute;
    top: -15px;
    left: -20px;
    background: #222;
    color: #fff;
    padding: 5px 10px;
    font-size: 1.1rem;
    border: 1px solid var(--red);
    z-index: 5;
}

.stack-item:nth-child(even) .stack-note {
    left: auto;
    right: -20px;
}

/* Responsive */
@media (max-width: 900px) {
    .scrapbook-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2vw;
    align-items: center;
}
    .item-large, .item-tilted-right, .item-tilted-left, .item-tilted-right-more {
        grid-column: 1 / 2;
        transform: rotate(0);
        margin: 0;
    }
    .stack-item {
        width: 100%;
        align-self: center !important;
        transform: rotate(0) !important;
    }
}


/* Patchwork 3D section */
.patchwork-3d {
    position: relative;
    width: 100%;
    min-height: 800px;
    margin-top: 60px;
}
.patchwork-background-coupes {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.6; /* Slightly fade out the background cuts */
}
.patchwork-background-coupes .scrapbook-item {
    position: absolute;
    width: 35%;
}
.bg-coupe-1 { top: 5%; left: 5%; transform: rotate(-5deg); }
.bg-coupe-2 { top: 15%; right: 5%; transform: rotate(4deg); }
.bg-coupe-3 { bottom: 10%; left: 15%; transform: rotate(2deg); }
.bg-coupe-4 { bottom: 20%; right: 10%; transform: rotate(-3deg); }

.patchwork-foreground-3d {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 40px;
    padding-top: 100px;
}
.patchwork-foreground-3d .scrapbook-item {
    width: 30vw;
    min-width: 300px;
    max-width: 800px;
}
.fg-3d-1 { transform: rotate(1deg); margin-top: -50px; }
.fg-3d-2 { transform: rotate(-2deg); margin-top: 100px; }
.fg-3d-3 { transform: rotate(3deg); margin-top: -20px; }

@media (max-width: 1200px) {
    .scrapbook-grid {
        grid-template-columns: 1fr 1fr;
    }
    .item-large { grid-column: 1 / 3; }
    .patchwork-foreground-3d .scrapbook-item { width: 45vw; }
}

@media (max-width: 768px) {
    .scrapbook-grid {
        grid-template-columns: 1fr;
    }
    .item-large, .item-tilted-right, .item-tilted-left, .item-tilted-right-more {
        grid-column: 1 / 2;
        transform: rotate(0);
        margin: 0;
    }
    .patchwork-foreground-3d {
        flex-direction: column;
        padding-top: 20px;
        gap: 20px;
    }
    .patchwork-foreground-3d .scrapbook-item {
        width: 90vw;
        margin-top: 0;
        transform: rotate(0);
    }
    .patchwork-background-coupes { display: none; /* Hide background on mobile to avoid clutter */ }
}

/* Pagination and Progress */

/* --- PROJECTS PAGE REDESIGN --- */
.project-detail-page {
    background: #111111;
}
.project-detail-page .page-inner {
    max-width: none;
    margin: 0;
    padding: 120px 0 0;
    overflow: visible;
}
.project-detail-page .page-heading,
.project-detail-page .page-intro {
    padding-left: 60px;
    padding-right: 60px;
    max-width: 1200px;
}
.project-detail-page .page-next {
    margin-right: 60px;
}
/* Footer in projects: no negative margins needed since page-inner has no horizontal padding */
.project-detail-page .site-footer {
    margin-left: 0;
    margin-right: 0;
    clear: both;
}

.fortiche-projects-board {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    width: 100%;
}

.fortiche-projects-board .panel-section + .panel-section {
    margin-top: -20px;
}

/* Spacing between tape title and first sticker */
.fortiche-projects-board .projects-board-header {
    padding: 60px 20px 30px;
}

/* Project Description Notebook */
.project-description-notebook {
    max-width: 800px;
    margin: 0 auto 40px;
    padding: 0 30px;
}
.project-desc-sheet {
    position: relative;
    background: #f5f0e8;
    border-radius: 6px;
    padding: 35px 40px 30px;
    box-shadow: 5px 5px 20px rgba(0,0,0,0.3);
}
.project-desc-content {
    position: relative;
    z-index: 1;
}
.project-desc-text {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: #333;
    line-height: 1.8;
    margin-bottom: 12px;
}
.project-desc-annotation {
    font-family: var(--font-body);
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    color: var(--red);
    display: block;
    margin-top: 8px;
}

.panel-section {
    position: relative;
    width: 100%;
    padding: 120px 4vw 80px;   /* FIX: padding top généreux pour le sticker qui dépasse */
    margin-top: 80px;          /* FIX: marge obligatoire entre description et section */
}
.panel-section:first-of-type {
    margin-top: 60px;
}
.panel-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #111111;
    z-index: -1;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 20' preserveAspectRatio='none'%3E%3Cpath d='M 0 12 L 15 11 L 30 12 L 50 13 L 65 14 L 85 14 L 100 12 L 115 9 L 130 6 L 145 3 L 125 7 L 160 8 L 180 8 L 195 10 L 210 12 L 230 13 L 255 14 L 275 14 L 285 12 L 295 10 L 310 10 L 330 11 L 350 11 L 375 11 L 390 10 L 405 10 L 415 13 L 425 16 L 410 15 L 435 15 L 460 14 L 480 13 L 500 12 L 500 20 L 0 20 Z' fill='black'/%3E%3C/svg%3E"), linear-gradient(black, black);
    -webkit-mask-position: top left, 0 20px;
    -webkit-mask-repeat: repeat-x, no-repeat;
    -webkit-mask-size: 500px 20px, 100% calc(100% - 20px);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 20' preserveAspectRatio='none'%3E%3Cpath d='M 0 12 L 15 11 L 30 12 L 50 13 L 65 14 L 85 14 L 100 12 L 115 9 L 130 6 L 145 3 L 125 7 L 160 8 L 180 8 L 195 10 L 210 12 L 230 13 L 255 14 L 275 14 L 285 12 L 295 10 L 310 10 L 330 11 L 350 11 L 375 11 L 390 10 L 405 10 L 415 13 L 425 16 L 410 15 L 435 15 L 460 14 L 480 13 L 500 12 L 500 20 L 0 20 Z' fill='black'/%3E%3C/svg%3E"), linear-gradient(black, black);
    mask-position: top left, 0 20px;
    mask-repeat: repeat-x, no-repeat;
    mask-size: 500px 20px, 100% calc(100% - 20px);
}

.panel-light {
    color: #fff;
}
.panel-light::before {
    background: #1a1a1a;
}
.panel-light .bd-nav-btn { z-index: 20; color: #fff; background: transparent; border: none; }
.panel-light .bd-nav-btn:hover { color: #1a1a1a; background: #fff; }
.panel-light .bd-carousel-pagination { color: #fff; font-weight: bold; }
.panel-light .bd-carousel-progress { background: rgba(255,255,255,0.2); }
.panel-light .filmstrip-note { background: #1a1a1a; color: #fff; border: 2px solid #fff; }

/* Sticker Titles */
.sticker-title-wrap {
    position: absolute;
    left: clamp(20px, 5vw, 60px);
    top: -40px;
    z-index: 10;
}
.sticker-right {
    left: auto !important;
    right: clamp(20px, 5vw, 60px) !important;
}
.sticker-title {
    display: inline-block;
    font-family: var(--font-sketch);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    display: inline-block;
    background: #111;
    background: var(--red);
    color: white;
    padding: 15px 40px;
    transform: rotate(-3deg);
    border: 4px solid #1a1a1a;
    box-shadow: 8px 8px 0px #1a1a1a;
    animation: stickerWobble 4s infinite ease-in-out;
}
@keyframes stickerWobble {
    0%, 100% { transform: rotate(-3deg) scale(1); }
    50% { transform: rotate(-1deg) scale(1.03); }
}

/* Fix bd-carousel-ui width */
.panel-section .bd-carousel-ui {
    z-index: 20;
    position: relative;
    max-width: 1200px;
    width: 100%;
    margin: 30px auto 0;
    padding: 0 10px 60px;
    display: flex;
    align-items: center;
    gap: 20px;
}
/* Carnet de croquis style for viewport */
.carousel-landscape .bd-carousel-viewport {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    aspect-ratio: auto;
    margin: 0 auto;
    border: none;                              /* FIX: retire le bord gris */
    box-shadow: 10px 10px 30px rgba(0,0,0,0.6);
    border-radius: 8px;
    background: white;
    overflow: hidden;
}
.panel-light .bd-carousel-viewport {
    border: none;                              /* FIX: retire le bord gris sur fond clair */
    box-shadow: 8px 8px 24px rgba(0,0,0,0.18);
}
.bd-carousel-container .frame-wrap {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
}
.carousel-landscape .bd-carousel-container .frame-wrap {
    width: 100%;
    max-width: 1200px;
    max-height: 65vh;
    aspect-ratio: 1.414 / 1;
}
/* Professional Document Styling (replaces torn paper) */
.drawing-sheet-wrap {
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: 10px 10px 30px rgba(0,0,0,0.5);
    border: none !important;                   /* FIX: retire le bord gris/blanc */
    position: relative;
}
.panel-light .drawing-sheet-wrap {
    box-shadow: 8px 8px 24px rgba(0,0,0,0.15);
}

/* Fix bd-carousel-container width so arrows aren't at extreme edges */
.panel-section .bd-carousel-container { align-items: center;
    max-width: 1300px;
    margin: 0 auto;
}

/* Quinconce (Staggered) layout for Coupes */
.cut-stack {
    align-items: center; /* fallback */
}
.cut-stack .stack-item {
    width: 85%;
    max-width: 1000px;
    transition: transform 0.3s ease;
}
.cut-stack .stack-item:nth-child(odd) {
    align-self: flex-start;
}
.cut-stack .stack-item:nth-child(even) {
    align-self: flex-end;
}
.cut-stack .stack-item:hover {
    transform: scale(1.02);
}

/* === STICKER PLACEMENT (Cleaned) === */
.sticker-left {
    position: absolute;
    left: clamp(20px, 5vw, 60px);
    top: -40px;
    z-index: 10;
}
/* sticker-right is now handled above via .sticker-title-wrap override */

/* Base Sticker styling (removed inline styles) */
.sticker-title {
    display: inline-block;
    font-family: var(--font-sketch);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    display: inline-block;
    background: #111;
    background: var(--red);
    color: white;
    padding: 15px 40px;
    transform: rotate(-3deg);
    border: 4px solid #1a1a1a;
    box-shadow: 8px 8px 0px #1a1a1a;
    animation: stickerWobble 4s infinite ease-in-out;
}
.sticker-dark {
    background: #1a1a1a;
    color: white;
}

/* Quinconce Layout (Fixed) */
.cut-stack {
    display: flex;
    flex-direction: column;
    gap: 60px;
    width: 100%;
    max-width: 1300px;
    margin: 40px auto 0;
}
.cut-stack .stack-item { width: 85%; max-width: 900px; transition: transform 0.3s ease; margin: 0 !important; }
.cut-stack .stack-item:nth-child(odd) {
    align-self: flex-start;
}
.cut-stack .stack-item:nth-child(even) {
    align-self: flex-end;
}
.cut-stack .stack-item:hover {
    transform: scale(1.02);
}
/* ==========================================================================
   CAROUSEL UI (Pagination & Progress)
   ========================================================================== */
.bd-carousel-ui { z-index: 20; position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.bd-carousel-pagination {
    font-family: var(--font-sketch);
    font-size: 1.5rem;
    color: var(--white);
    letter-spacing: 2px;
}

.bd-carousel-progress {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.1);
    margin-left: 30px;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 0%;
    background: var(--red);
    transition: width 0.1s linear;
}

/* Light Mode Overrides */
.panel-light .bd-carousel-pagination {
    color: #fff;
    font-weight: bold;
}
.panel-light .bd-carousel-progress {
    background: rgba(255,255,255,0.15);
}

/* ==========================================================================
   3D RENDER GRID
   ========================================================================== */
.render3d-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1300px;
    margin: 40px auto 0;
    padding: 0 20px;
}
.render3d-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.render3d-label {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--red);
    letter-spacing: 0.03em;
}
.render3d-item .drawing-sheet-wrap {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 10px 10px 30px rgba(0,0,0,0.5);
    border: 3px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.render3d-item .drawing-sheet-wrap:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 15px 15px 40px rgba(0,0,0,0.7);
}

/* Sticker hover interaction (depth effect) */
.sticker-title {
    cursor: default;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.sticker-title:hover {
    transform: rotate(-1deg) scale(1.05) translateY(-3px);
    box-shadow: 12px 12px 0px #1a1a1a, 0 20px 40px rgba(0,0,0,0.4);
}

/* Cut stack coupe aspect ratio */
.cut-stack .stack-item {
    position: relative;
}
.cut-stack .stack-item .drawing-sheet-wrap {
    aspect-ratio: auto;
    background: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none !important;                   /* FIX: retire bord blanc des coupes */
    position: relative;
    overflow: hidden;
}
.cut-stack .stack-item .drawing-sheet-wrap:hover {
    transform: scale(1.02);
    box-shadow: 15px 15px 40px rgba(0,0,0,0.5);
}
.cut-stack .stack-item .drawing-sheet-wrap .drawing-sheet {
    width: 100%;
    height: auto;
}
.cut-stack .stack-item .drawing-sheet-wrap canvas {
    height: auto !important;
}

/* Stack item labels — overlaid on the image */
.stack-label {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 6px 16px;
    font-size: clamp(0.85rem, 1.6vw, 1.2rem);
    border-radius: 4px;
    letter-spacing: 0.03em;
    backdrop-filter: blur(4px);
}
.stack-label-right {
    left: auto;
    right: 12px;
}

/* Panel carousel nav buttons visible */
.panel-section .bd-nav-btn {
    z-index: 20;
    color: var(--white);
    background: transparent;
    border: none;
    cursor: pointer;
}
.panel-section .bd-nav-btn:hover {
    color: var(--red);
}

/* ==========================================================================
   COUPE LIGHTBOX OVERLAY (click to expand in carousel)
   ========================================================================== */
.coupe-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.coupe-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}
.coupe-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2.5rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    font-family: var(--font-sketch);
}
.coupe-lightbox-close:hover {
    color: var(--red);
}
.coupe-lightbox-content {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 90%;
    max-width: 1200px;
}
.coupe-lightbox-viewport {
    flex: 1;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 2.2/1;
}
.coupe-lightbox-viewport canvas {
    width: 100%;
    height: 100%;
}
.coupe-lightbox-nav {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 10px;
    z-index: 10;
}
.coupe-lightbox-nav svg {
    width: 40px;
    height: 40px;
}
.coupe-lightbox-nav:hover {
    color: var(--red);
}
.coupe-lightbox-ui {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}
.coupe-lightbox-pagination {
    font-family: var(--font-sketch);
    font-size: 1.5rem;
    color: white;
    letter-spacing: 2px;
}
.coupe-lightbox-title {
    font-family: var(--font-sketch);
    font-size: 1.2rem;
    color: var(--red);
}

/* Responsive 3D Grid & Projects page */
@media (max-width: 768px) {
    .render3d-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .sticker-title {
        font-size: clamp(1.5rem, 4vw, 2.5rem) !important;
        padding: 10px 25px !important;
    }
    .cut-stack .stack-item {
        width: 100% !important;
        max-width: 100% !important;
        align-self: center !important;
    }
    .cut-stack .stack-item .drawing-sheet-wrap {
        aspect-ratio: auto;
    }
    .panel-section {
        padding: 80px 20px 40px;
    }
    .carousel-landscape .bd-carousel-container .frame-wrap {
        max-height: 50vh;
    }
    .project-desc-sheet {
        padding: 25px 20px;
    }
}

/* ─────────────────────────────────────
   POINTER-EVENTS — sections hors hero-screen
───────────────────────────────────── */
/* La section contact et les autres sections hors hero-screen doivent rester interactives */
.page.is-active .notebook-section,
.page.is-active .home-contact,
.page.is-active .page-next {
    pointer-events: auto;
}
.page.is-active .notebook-content,
.page.is-active .notebook-hover-zone {
    pointer-events: auto;
    cursor: default;
}

/* ─────────────────────────────────────
   ACTIVE STATE — feedback tactile
───────────────────────────────────── */
.home-projects-shortcut:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}
.showcase-frame:active .showcase-img {
    transform: scale(1.01);
}
.menu-nav-item:active .mn-label {
    color: var(--red);
    transform: translateX(16px);
}

/* ─────────────────────────────────────
   PREFERS-REDUCED-MOTION
   Désactive les animations lourdes continues pour les utilisateurs
   qui préfèrent moins de mouvement (accessibilité + performance)
───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .hero-logo,
    .menu-logo,
    .header-logo-text,
    .shortcut-sub-text,
    .click-hint-text,
    .page-next-arrow,
    .sketch-rect-path {
        animation: none !important;
        filter: none !important;
    }
    .scroll-line {
        animation: none !important;
        opacity: 0.4;
        transform: scaleY(0.7);
    }
    .showcase-img,
    .torn-frame:hover .media-frame-img,
    .frame-wrap:hover .torn-frame .media-frame-img {
        transform: none !important;
        transition: none !important;
    }
    .notebook-bg-sheet {
        transition: none !important;
    }
    .notebook-hover-zone:hover .notebook-text {
        animation: none !important;
    }
}

/* ─────────────────────────────────────
   SCROLL SMOOTHNESS — optimisations finales
───────────────────────────────────── */
/* Évite les repaints inutiles sur les éléments animés par GSAP */
.home-showcase,
.home-projects-shortcut,
.hero-logo-wrap,
.home-contact-inner {
    will-change: opacity, transform;
}
/* Nettoie will-change après entrée (GSAP le fait mais en CSS c'est plus sûr) */
/* Nettoie will-change après entrée (GSAP le fait mais en CSS c'est plus sûr) */
.page.is-active .home-showcase,
.page.is-active .home-projects-shortcut {
    will-change: auto;
}

/* ─────────────────────────────────────
   PDF LOADING SHIMMER
───────────────────────────────────── */
.pdf-shimmer {
    position: relative;
    background: #f0f0f0;
    overflow: hidden;
}
.panel-light .pdf-shimmer {
    background: #2a2a2a;
}
.pdf-shimmer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    animation: shimmer 1.5s infinite linear;
    z-index: 2;
}
.panel-light .pdf-shimmer::before {
    background: linear-gradient(to right, transparent 0%, rgba(255,255,255,0.05) 50%, transparent 100%);
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.pdf-loading {
    opacity: 0 !important;
}

/* ═════════════════════════════════════════════════════════════════
   CORRECTIFS FINAUX — accessibilite clavier et debordements mobile
   Place en fin de fichier : ces regles sont des surcharges, elles
   doivent gagner dans la cascade.
   ═════════════════════════════════════════════════════════════════ */

/* ── Lien d'evitement ──────────────────────────────────────────────
   Invisible tant qu'on ne tabule pas, il apparait au premier Tab et
   permet de sauter le header pour aller droit au contenu. */
.skip-link {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -120%);
    z-index: 200;
    padding: 14px 26px;
    background: var(--red);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.8rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus {
    transform: translate(-50%, 0);
}

/* ── Focus clavier visible ─────────────────────────────────────────
   Uniquement :focus-visible : la bordure n'apparait donc jamais au
   clic souris, seulement lors d'une navigation au clavier. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 4px;
    border-radius: 2px;
}

/* ── FIX R-03 : deux blocs sortaient du cadre ──────────────────────
   .ref-photo-wrap etait epingle a right:-110px et
   .animation-explosion-detail a 285px a gauche du centre : des
   valeurs fixes, calees pour le bureau, qui debordaient sous 992px.
   Le debordement etant masque par overflow-x:hidden, le contenu
   etait rogne SANS barre de defilement — donc invisible au test.
   On rapatrie les deux dans le cadre en gardant le parti pris
   « epingle de travers ». */
@media (max-width: 991px) {
    .ref-photo-wrap {
        right: -18px;
        top: -8px;
        width: 96px;
    }
    /* L'element porte une rotation de 45deg : sa boite englobante depasse
       de largeur x 0,207 de chaque cote (~25px pour 120px). La marge doit
       donc etre superieure a ce debord, sinon il ressort a gauche. */
    .animation-explosion-detail {
        left: 0;
        margin-left: 44px;   /* debord mesure de la boite tournee : 38px par cote */
        width: 120px;
        height: 120px;
    }
    /* La signature manuscrite etait calee a left:95% puis decalee vers la
       droite et agrandie : elle sortait du cadre. On l'ancre a droite, en
       reservant la marge que prend l'agrandissement (scale 1,2). */
    .notebook-signature {
        left: auto !important;
        right: 22px !important;
        transform: translateY(-40px) scale(1.2) !important;
    }
}

@media (max-width: 480px) {
    .ref-photo-wrap {
        right: -6px;
        width: 78px;
    }
    .animation-explosion-detail {
        width: 96px;
        height: 96px;
        margin-left: 36px;   /* debord proportionnel : ~30px par cote */
        bottom: -24px;
    }
    .notebook-signature {
        right: 16px !important;
        transform: translateY(-36px) scale(1) !important;
    }
}

/* ── PLANS EN IMAGE (remplacent les rendus PDF a la volee) ─────────
   .drawing-sheet img applique un zoom de 18% et un recadrage « cover »,
   pensé pour les dessins a main levee dont on coupe les marges blanches.
   Applique a un plan cote, il rognerait les cotations. On neutralise. */
.drawing-sheet img.pdf-img,
.stack-item img.pdf-img {
    transform: none;
    object-fit: contain;
    width: 100%;
    height: 100%;
    display: block;
    background: #fff;
}
