/* Ikigai · Présentation des réalisations — « zoom par scènes »
   Une scène à la fois, en plein écran. Les transitions n'animent que la position, l'échelle et
   l'opacité de quelques éléments (scène, disque de zoom, fiche) : fluide même sur petit téléphone.
   Encre sur papier, un seul accent (vermillon). Playfair Display + Poppins. */

:root {
  --papier: #fcf4e4;
  --papier-carte: #fffaf0;
  --papier-fonce: #f4e8d0;
  --encre: #16130e;
  --encre-2: #3d362b;
  --encre-3: #5e574b;
  --filet: rgba(22, 19, 14, .14);
  --filet-fort: rgba(22, 19, 14, .3);
  --accent: #b5341c;
  --accent-voile: rgba(181, 52, 28, .08);
  --serif: "Playfair Display", "Didot", "Bodoni 72", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Poppins", "Avenir Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --hud-h: 68px;
  --hud-b: 92px;
  --marge: clamp(16px, 4vw, 56px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden;
  background: var(--papier); color: var(--encre);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; font-kerning: normal;
}
img { max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* Grain du papier : fixe, peint une fois */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35  0 0 0 0 .25  0 0 0 0 .12  0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px;
  padding: 0 16px; border-radius: 999px; cursor: pointer;
  background: var(--papier-carte); border: 1px solid var(--filet-fort);
  font-size: 13.5px; font-weight: 500; letter-spacing: .01em; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease);
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn:hover { background: #fff; border-color: var(--encre); }
.btn:active { transform: scale(.96); }
.btn-icone { width: 44px; padding: 0; }
.btn-noir { background: var(--encre); color: var(--papier); border-color: var(--encre); }
.btn-noir:hover { background: #2a251c; border-color: #2a251c; }
.btn[aria-pressed="true"] { background: var(--encre); color: var(--papier); border-color: var(--encre); }

/* ---------------------------------------------------------------- Barres (HUD) */
.hud { position: fixed; z-index: 40; }
.hud-haut {
  top: 0; left: 0; right: 0; height: var(--hud-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: env(safe-area-inset-top, 0) var(--marge) 0; pointer-events: none;
}
.hud-haut > * { pointer-events: auto; }
.marque {
  display: inline-flex; align-items: center; gap: 12px; min-height: 44px; text-decoration: none;
  padding: 6px 14px 6px 12px; border-radius: 999px; background: rgba(252, 244, 228, .92); border: 1px solid var(--filet);
}
.marque img { display: block; height: 24px; width: auto; filter: brightness(0); opacity: .92; }
.marque-sous { font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--encre-3); padding-left: 12px; border-left: 1px solid var(--filet-fort); }
.outils { display: flex; gap: 8px; }
.hud-bas {
  left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 6px; max-width: calc(100vw - 20px);
  background: rgba(255, 250, 240, .96); border: 1px solid var(--filet); border-radius: 999px;
  box-shadow: 0 12px 30px -20px rgba(22, 19, 14, .5);
}
.etape-info { display: flex; align-items: baseline; gap: 12px; min-width: 0; padding: 0 6px; }
.etape-num { font-family: var(--serif); font-size: 20px; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; flex: none; }
.etape-num .sur { font-family: var(--sans); font-size: 12px; font-weight: 400; color: var(--encre-3); }
.etape-titre { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(46vw, 440px); }
.btn-rond { width: 44px; height: 44px; padding: 0; flex: none; }
.progression { position: absolute; left: 26px; right: 26px; bottom: -1px; height: 2px; border-radius: 2px; overflow: hidden; }
.progression span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transition: transform .5s var(--ease); }

/* ---------------------------------------------------------------- Scènes */
.toile { position: fixed; inset: 0; z-index: 1; outline: none; }
.scene {
  position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; touch-action: pan-y pinch-zoom;   /* glissé horizontal : changer d'étape */
  padding: calc(var(--hud-h) + 24px) var(--marge) calc(var(--hud-b) + 28px);
}
.scene:not(.active) { pointer-events: none; }               /* scène qui sort, le temps de la transition */
.scene-int { max-width: 1320px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; justify-content: center; }
.surtitre { font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.titre-scene { font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 5.4vw, 76px); line-height: 1.04; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
.titre-scene em { font-weight: 400; color: var(--accent); }
.chapo { font-size: clamp(16px, 1.5vw, 20px); line-height: 1.6; color: var(--encre-2); max-width: 46em; margin: 18px 0 0; }
.titre-scene:focus { outline: none; }

/* Clients : les logos carrés d'ikigai.tn, entiers, tous à la même taille, coins arrondis */
.logos { list-style: none; margin: clamp(26px, 4.5vh, 48px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(62px, 7.6vw, 112px), 1fr)); gap: clamp(10px, 1.4vw, 20px); }
.logos li { aspect-ratio: 1; transition: transform .3s var(--ease); }
.logos li:hover { transform: translateY(-3px) scale(1.05); }
.logos img { width: 100%; height: 100%; display: block; border-radius: 14px; box-shadow: 0 10px 24px -18px rgba(22, 19, 14, .55); }

/* Fond de la scène des clients : un mur de logos qui défile verticalement, à peine visible */
.scene[data-scene="clients"] { isolation: isolate; }
.mur { position: fixed; inset: 0; z-index: -1; display: flex; gap: 22px; justify-content: center; overflow: hidden; opacity: .3; pointer-events: none; contain: strict; }
.mur::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 55% at 50% 45%, var(--papier) 30%, transparent 100%); }
.mur-col { flex: 0 0 clamp(90px, 11vw, 160px); display: flex; flex-direction: column; animation: mur 80s linear infinite; will-change: transform; }
.mur-col.inverse { animation-direction: reverse; }
.mur-col img { width: 100%; height: auto; display: block; }
@keyframes mur { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@media (prefers-reduced-motion: reduce) { .mur-col { animation: none; } }

/* Agence */
.agence { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 5vw, 80px); align-items: start; }
.liste-num { list-style: none; margin: 26px 0 0; padding: 0; }
.liste-num li { display: flex; gap: 16px; align-items: baseline; padding: 13px 0; border-top: 1px solid var(--filet); font-size: clamp(15px, 1.35vw, 19px); font-weight: 500; }
.liste-num i { font-family: var(--serif); font-size: .95em; color: var(--accent); font-style: italic; min-width: 1.6em; }
.encart { background: var(--papier-carte); border: 1px solid var(--filet-fort); border-radius: 8px; padding: clamp(22px, 3vw, 40px); box-shadow: 0 24px 50px -36px rgba(22, 19, 14, .55); }
.encart h3 { font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.1; margin: 0; }
.encart h3 em { font-weight: 400; color: var(--accent); }
.encart p { color: var(--encre-2); margin: 14px 0 0; font-size: 15px; }

/* Méthode : six étapes reliées par un filet */
.methode { list-style: none; margin: clamp(30px, 5vh, 60px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; position: relative; }
.methode::before { content: ""; position: absolute; left: 4%; right: 4%; top: 36px; height: 1.5px; background: var(--encre); transform-origin: 0 50%; }
.methode.trace::before { animation: trace .9s var(--ease) .15s backwards; }
@keyframes trace { from { transform: scaleX(0); } }
.methode li { position: relative; text-align: center; }
.methode .rond { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--papier-carte); border: 1.5px solid var(--encre); font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--accent); }
.methode h3 { font-family: var(--serif); font-weight: 600; font-size: clamp(19px, 1.7vw, 24px); margin: 0 0 6px; }
.methode p { margin: 0 auto; font-size: 14px; line-height: 1.5; color: var(--encre-2); max-width: 17em; }

/* Métiers : six carrés (coins légèrement arrondis) */
.metiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 2.4vw, 36px) clamp(10px, 2vw, 30px); margin: clamp(22px, 4vh, 44px) auto 0; width: min(100%, 1060px, calc((100vh - 360px) * 1.5)); min-width: min(100%, 560px); }   /* les six cercles tiennent dans l'écran */
.cercle {
  position: relative; aspect-ratio: 1; border-radius: 20px; cursor: pointer; padding: 0; container-type: inline-size; overflow: hidden; isolation: isolate;
  display: grid; place-items: end center; text-align: center;
  background: linear-gradient(160deg, #fffaf0 0%, #fbf1dd 62%, #f6e7cb 100%);
  border: 1.5px solid var(--encre); color: var(--encre);
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 30%;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .4s;
  box-shadow: 0 18px 40px -32px rgba(22, 19, 14, .6);
}
.cercle.incline { transition: transform .12s linear, box-shadow .5s var(--ease), border-color .4s; }
.cercle:hover { box-shadow: 0 34px 60px -30px rgba(22, 19, 14, .6), 0 0 0 1px var(--accent); border-color: var(--accent); }
.cercle:active { transform: perspective(900px) scale(.97); }
/* Photo de la réalisation phare : visible en haut, fondue dans le papier sous le texte */
.cercle-fond { position: absolute; inset: 0 0 auto 0; height: 50%; z-index: -2; overflow: hidden; }
.cercle-fond img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); filter: saturate(.9); transition: transform 1.1s var(--ease), filter .6s; }
.cercle-fond::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(22,19,14,.18) 0%, rgba(22,19,14,0) 40%, rgba(252,244,228,0) 62%, #fcf4e4 100%); transition: opacity .6s var(--ease); }
.cercle:hover .cercle-fond img { transform: scale(1.14); filter: saturate(1.08); }
.cercle:hover .cercle-fond::after { opacity: .7; }
/* Grand numéro en filigrane */
.cercle-fantome { position: absolute; top: -.08em; right: .06em; z-index: -1; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 30cqw; line-height: 1;
  color: transparent; -webkit-text-stroke: 1.5px rgba(252, 244, 228, .85); text-shadow: 0 2px 18px rgba(22, 19, 14, .18); transition: transform .8s var(--ease); }
.cercle:hover .cercle-fantome { transform: translate(-3%, 4%) scale(1.06); }
/* Halo qui suit la souris */
.cercle-lueur { position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(60% 60% at var(--mx) var(--my), rgba(255, 255, 255, .55), transparent 70%); mix-blend-mode: soft-light; }
.cercle.incline .cercle-lueur { opacity: 1; }
.cercle-int { width: 88%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding-bottom: 6cqw; transform: translateZ(0); transition: transform .5s var(--ease); }
.cercle:hover .cercle-int { transform: translateY(-2cqw); }
.cercle .num { font-family: var(--serif); font-style: italic; font-size: 7cqw; color: var(--accent); }
.cercle .nom { font-family: var(--serif); font-weight: 600; font-size: 8.6cqw; line-height: 1.05; letter-spacing: -.01em; text-wrap: balance; }
.cercle .sous { font-size: max(9px, 3.7cqw); font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--encre-3); line-height: 1.35; }
.cercle .n { font-size: max(10.5px, 4.8cqw); font-weight: 600; color: var(--accent); margin-top: 2px; }
.cercle .n::after { content: " →"; display: inline-block; transition: transform .4s var(--ease); }
.cercle:hover .n::after { transform: translateX(4px); }
/* Vignettes en éventail au survol */
.pastilles { display: flex; justify-content: center; margin-top: 2.4cqw; }
.pastilles img { width: 12cqw; height: 12cqw; border-radius: 3cqw; object-fit: cover; border: 2px solid var(--papier-carte); margin-left: -8px; background: var(--papier-fonce);
  box-shadow: 0 6px 14px -8px rgba(22,19,14,.5); transition: transform .5s var(--ease), margin .5s var(--ease); }
.pastilles img:first-child { margin-left: 0; }
.cercle:hover .pastilles img { margin-left: 4px; }
.cercle:hover .pastilles img:nth-child(1) { transform: rotate(-8deg) translateY(2px); }
.cercle:hover .pastilles img:nth-child(2) { transform: translateY(-5px) scale(1.08); }
.cercle:hover .pastilles img:nth-child(3) { transform: rotate(8deg) translateY(2px); }
/* Reflet qui balaie la carte à l'arrivée */
.cercle::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%); transform: translateX(-120%); }
.scene.active .cercle::before { animation: ik-reflet 1.4s var(--ease) both; }
.scene.active .cercle:nth-child(2)::before { animation-delay: .12s } .scene.active .cercle:nth-child(3)::before { animation-delay: .24s }
.scene.active .cercle:nth-child(4)::before { animation-delay: .36s } .scene.active .cercle:nth-child(5)::before { animation-delay: .48s }
.scene.active .cercle:nth-child(6)::before { animation-delay: .6s }
@keyframes ik-reflet { from { transform: translateX(-120%); } to { transform: translateX(120%); } }

/* Disque du zoom (cercle → scène du métier) */
.disque {
  position: fixed; z-index: 0; border-radius: 18px; pointer-events: none;      /* sous les scènes : la scène du métier apparaît par-dessus */
  background: linear-gradient(160deg, #fffaf0 0%, #fbf1dd 62%, #f6e7cb 100%);
  border: 1px solid rgba(22, 19, 14, .35); will-change: transform; transform-origin: 50% 50%;
}

/* Métier (ou secteur) : en-tête et cartes */
.metier-tete { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 0 clamp(16px, 2.4vw, 34px); align-items: end; margin-bottom: clamp(22px, 4vh, 40px); }
.metier-tete .grand-num { font-family: var(--serif); font-style: italic; font-size: clamp(56px, 9vw, 140px); line-height: .8; color: var(--accent); grid-row: span 2; }
.metier-tete .titre-scene { font-size: clamp(34px, 5vw, 72px); }
.metier-tete .infos { margin: 10px 0 0; font-size: 12.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--encre-3); }
.metier-tete .grand-num { position: relative; }
.metier-tete .grand-num::before {                 /* l'anneau du cercle d'où l'on vient */
  content: ""; position: absolute; left: 50%; top: 50%; width: 1.4em; height: 1.4em; transform: translate(-50%, -58%);
  border: 1.5px solid var(--filet-fort); border-radius: .14em; pointer-events: none;
}
.scene-metier .scene-int { justify-content: flex-start; }
.grille { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: clamp(14px, 1.6vw, 22px); }
/* Une carte est un bouton : sans largeur imposée, un bouton prend la largeur de son contenu
   (un nom de client long sur une ligne l'élargissait et il débordait sur la carte voisine). */
.grille > li { min-width: 0; }
.carte {
  position: relative; display: flex; flex-direction: column; width: 100%; min-width: 0; height: 100%; overflow: hidden; cursor: pointer; text-align: left; padding: 0;
  background: var(--papier-carte); border: 1px solid rgba(22, 19, 14, .16); border-radius: 6px;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.carte { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 30%; transform: perspective(800px) rotateX(var(--rx)) rotateY(var(--ry)); position: relative; }
.carte.incline { transition: transform .12s linear, box-shadow .4s, border-color .4s; }
.carte:hover { border-color: var(--accent); box-shadow: 0 26px 44px -26px rgba(22, 19, 14, .65); }
.carte .c-img img { transition: transform .9s var(--ease), filter .5s; }
.carte:hover .c-img img { transform: scale(1.08); filter: saturate(1.08); }
.carte::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(55% 55% at var(--mx) var(--my), rgba(255,255,255,.45), transparent 70%); mix-blend-mode: soft-light; }
.carte.incline::after { opacity: 1; }
.carte .c-titre { transition: color .3s; }
.carte:hover .c-titre { color: var(--accent); }
.grille > li.a-voir { opacity: 0; transform: translateY(26px) scale(.97); transition: opacity .6s var(--ease), transform .7s var(--ease); }
.grille > li.a-voir.vu { opacity: 1; transform: none; }
.secteur { transition: transform .45s var(--ease), box-shadow .45s var(--ease), background .3s; }
.secteur:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -28px rgba(22,19,14,.6); }
.carte .c-img { display: block; aspect-ratio: 4 / 3; background: var(--papier-fonce); overflow: hidden; border-bottom: 1px solid var(--filet); }
.carte .c-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carte .c-corps { display: block; padding: 12px 14px 15px; }
.carte .c-client { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--encre-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carte .c-titre { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 5px; font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.18; }
.carte .c-sceau {
  position: absolute; top: 10px; left: 10px; padding: 4px 10px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #fff; background: var(--accent);
}

/* Secteurs */
.secteurs { list-style: none; margin: clamp(24px, 4vh, 44px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.secteur {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; cursor: pointer;
  padding: clamp(18px, 2.4vw, 30px); border-radius: 8px; background: var(--papier-carte); border: 1px solid var(--filet-fort);
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}
.secteur:hover { transform: translateY(-3px); border-color: var(--encre); }
.secteur b { font-family: var(--serif); font-size: clamp(40px, 5vw, 68px); line-height: 1; color: var(--accent); font-weight: 600; }
.secteur span { font-family: var(--serif); font-size: clamp(18px, 1.8vw, 24px); font-weight: 600; line-height: 1.2; }
.secteur small { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--encre-3); font-weight: 500; }

/* Contact */
.contact { background: var(--encre); color: var(--papier); border-radius: 10px; padding: clamp(26px, 5vw, 64px); box-shadow: 0 40px 80px -50px rgba(22, 19, 14, .9); }
.contact .surtitre { color: #e58f73; }
.contact h2 { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(32px, 5vw, 70px); line-height: 1.05; margin: 0; }
.contact h2 b { font-style: normal; font-weight: 600; display: block; }
.contact-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 40px; margin-top: clamp(24px, 4vh, 44px); }
.contact h3 { font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: rgba(252, 244, 228, .6); margin: 0 0 8px; }
.contact p, .contact address { margin: 0; font-style: normal; font-size: 16px; line-height: 1.7; }
.contact .grand { font-family: var(--serif); font-size: clamp(22px, 2.4vw, 30px); }
.contact a { text-decoration-color: rgba(252, 244, 228, .4); text-underline-offset: 4px; }

/* ---------------------------------------------------------------- Fiche (carte dépliée) */
.voile-fiche { position: fixed; inset: 0; z-index: 25; background: rgba(22, 19, 14, .38); opacity: 0; pointer-events: none; }
.voile-fiche.on { pointer-events: auto; }
.fiche {
  position: fixed; z-index: 26;
  top: calc(var(--hud-h) + 6px); bottom: calc(var(--hud-b) + 6px); left: 50%; width: min(1180px, calc(100vw - 40px)); margin-left: max(-590px, calc(-50vw + 20px));
  transform-origin: 0 0;
}
.fiche-fond { position: absolute; inset: 0; background: var(--papier-carte); border: 1px solid var(--filet-fort); border-radius: 10px; box-shadow: 0 40px 90px -40px rgba(22, 19, 14, .7); transform-origin: 0 0; }
.fiche-contenu { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; border-radius: 10px; }
/* Galerie en haut, images entières au format 4:3, côte à côte ; une image seule reste de taille raisonnable,
   sur un fond flouté tiré d'elle-même : jamais d'espace vide, jamais de recadrage */
.f-galerie { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 3px; background: #1b1812; }
.f-galerie.n1 { grid-template-columns: minmax(0, 760px); justify-content: center; }
.f-galerie::before { content: ""; position: absolute; inset: -60px; z-index: -1; background: var(--fond) center / cover no-repeat; filter: blur(34px) saturate(1.15); opacity: .6; }
.f-galerie figure { margin: 0; aspect-ratio: 4 / 3; }
.f-galerie img { width: 100%; height: 100%; object-fit: contain; display: block; }
.f-texte { max-width: 860px; margin: 0 auto; padding: clamp(24px, 3vw, 44px) clamp(20px, 3vw, 44px) 36px; }
.f-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.f-meta .m { color: var(--accent); }
.f-meta .s { color: var(--encre-3); }
.f-client { margin: 0 0 4px; font-size: 15px; font-weight: 500; color: var(--encre-2); }
.f-titre { font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.1; margin: 0; letter-spacing: -.01em; text-wrap: balance; padding-right: 48px; }
.f-titre:focus { outline: none; }
.f-sous { margin: 10px 0 18px; font-size: 14px; line-height: 1.5; color: var(--encre-3); padding-bottom: 18px; border-bottom: 1px solid var(--filet); }
.f-corps h3 { font-family: var(--serif); font-weight: 600; font-size: 22px; margin: 22px 0 8px; display: flex; align-items: center; gap: 12px; }
.f-corps h3:first-child { margin-top: 0; }
.f-corps h3::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.f-corps h4, .f-corps h5 { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--encre-3); margin: 14px 0 6px; }
.f-corps p, .f-corps li { font-size: 15.5px; line-height: 1.62; color: var(--encre-2); }
.f-corps p { margin: 0 0 10px; }
.f-corps ul { margin: 4px 0 12px; padding-left: 0; list-style: none; }
.f-corps li { position: relative; padding-left: 20px; margin: 0 0 7px; }
.f-corps li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 8px; height: 1.5px; background: var(--accent); }
.f-corps li strong { color: var(--encre); font-weight: 600; }
.f-tags { list-style: none; margin: 22px 0 0; padding: 14px 0 0; border-top: 1px solid var(--filet); display: flex; flex-wrap: wrap; gap: 6px; }
.f-tags li { margin: 0; padding: 3px 10px; border: 1px solid var(--filet-fort); border-radius: 999px; font-size: 12px; color: var(--encre-2); }
.f-tags li::before { display: none; }
.f-lien { margin: 20px 0 0; font-weight: 500; }
.f-lien a { color: var(--accent); text-underline-offset: 3px; }
.f-fermer {
  position: absolute; top: 14px; right: 14px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--filet-fort); background: var(--papier-carte); display: grid; place-items: center;
}
.f-fermer:hover { background: #fff; border-color: var(--encre); }
.f-fermer svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; }

/* Pendant une transition : calque temporaire, sinon rien */
.anime { will-change: transform, opacity; }

/* ---------------------------------------------------------------- Écrans */
@media (max-width: 1100px) {
  .btn .btn-txt { display: none; }
  .btn:not(.btn-noir) { width: 44px; padding: 0; }
  .methode { grid-template-columns: repeat(3, 1fr); row-gap: 30px; }
  .methode::before { display: none; }
}
@media (max-width: 760px) {
  :root { --hud-h: 62px; --hud-b: 84px; }
  .marque-sous { display: none; }
  .agence { grid-template-columns: 1fr; }
  .metiers { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100%, 520px); }
  .cercle .sous { display: none; }
  .secteurs { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .carte .c-corps { padding: 9px 10px 11px; }
  .carte .c-titre { font-size: 15px; }
  .carte .c-client { font-size: 9.5px; letter-spacing: .1em; }
  .carte .c-sceau { font-size: 9px; padding: 3px 8px; top: 6px; left: 6px; }
  .metier-tete { grid-template-columns: 1fr; }
  .metier-tete .grand-num { grid-row: auto; font-size: 54px; margin: 14px 0 10px 14px; justify-self: start; }
  .contact-grille { grid-template-columns: 1fr; }
  .etape-titre { max-width: 36vw; }
  /* Fiche : plein écran, une seule colonne qui défile */
  .fiche { top: 0; bottom: 0; left: 0; width: 100%; margin-left: 0; }
  .fiche-fond { border-radius: 0; border: 0; }
  .fiche-contenu { border-radius: 0; padding-bottom: calc(var(--hud-b) + 20px); }
  .f-galerie, .f-galerie.n1 { display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; gap: 2px; }
  .f-galerie figure { flex: 0 0 100%; scroll-snap-align: start; }
  .f-texte { padding: 20px 18px 24px; }
  .f-fermer { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; background: rgba(255, 250, 240, .95); }
  .fiche-ouverte .hud-haut { visibility: hidden; }
}
@media (max-width: 420px) {
  .scene { padding-left: 14px; padding-right: 14px; }
  .methode { grid-template-columns: 1fr 1fr; }
  .cercle .n { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
  :root { --hud-h: 54px; --hud-b: 66px; }
  .metiers { grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; }
  .titre-scene { font-size: clamp(26px, 4.4vw, 40px); }
  .scene-int > .chapo { display: none; }
  .metiers { margin-top: 14px; }
  .cercle .sous, .cercle .n, .pastilles { display: none; }
  .hud-bas { bottom: max(6px, env(safe-area-inset-bottom)); padding: 4px; }
  .fiche { top: 6px; bottom: 6px; }
  .fiche-ouverte .hud { visibility: hidden; }
}

/* Mouvement réduit : fondus courts seulement (gérés par le script), pas d'effets au survol */
@media (prefers-reduced-motion: reduce) {
  .cercle, .carte, .secteur, .btn, .progression span { transition: none; }
  .cercle::before { display: none; } .cercle { transform: none; }
  .cercle:hover, .carte:hover, .secteur:hover { transform: none; }
  .grille > li.a-voir { opacity: 1; transform: none; }
  .carte:hover .c-img img { transform: none; }
  .methode.trace::before { animation: none; }
}
@media print {
  .hud, .voile-fiche { display: none !important; }
  body { overflow: visible; }
  .toile, .scene { position: static; overflow: visible; }
  .scene:not(.active) { visibility: visible; }
}

/* Actualisation du catalogue : mêmes matières et polices que la présentation. */
.solutions-prez{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:30px;margin-top:28px}.solutions-prez article{min-width:0}.solutions-prez img{display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:cover;mask-image:linear-gradient(#000 75%,transparent)}.solutions-prez h3{font-family:var(--serif);font-size:clamp(25px,2.3vw,38px);line-height:1.15;margin:20px 0 12px}.solutions-prez p{font-size:17px;line-height:1.55}.solutions-prez a{white-space:normal;font-size:15px}.acces-catalogue{font-size:14px}
@media(max-width:720px){.solutions-prez{grid-template-columns:1fr;gap:32px}.hud-haut{flex-wrap:wrap;gap:8px;padding:10px 12px}.hud-haut .outils{gap:5px}.acces-catalogue{padding:9px 10px;font-size:12px}.toile .scene{padding-top:110px}.hud-haut .marque{max-width:100px}html .hud-haut .marque img{width:88px}}
@media(max-width:380px){.hud-haut{justify-content:center}.hud-haut .marque{display:none}.hud-haut .outils{width:100%;justify-content:center}.toile .scene{padding-top:84px}}

@media(max-width:720px){html .hud-haut{justify-content:center}html .hud-haut .outils{width:100%;justify-content:center}html .hud-haut .acces-catalogue{width:auto;padding:9px 12px;font-size:12px}html .solutions-prez a.btn{width:auto;max-width:100%;padding:12px 18px;min-height:44px;height:auto}html .toile .scene{padding-top:140px}}
@media(max-width:380px){html .toile .scene{padding-top:94px}}
