/* ============================================================
   Atelier Oïto, proto v1 · concept « l'écrin » (DA 10/07/2026)
   navy #2a3c53 dominant · orange #ec6608 rare · cream #f4f1ea
   ============================================================ */

:root {
  --navy: #2a3c53;
  --navy-deep: #24344a;
  --ink: #141a23;
  --cream: #f4f1ea;
  --orange: #ec6608;
  --on-navy: #eee9df;
  --on-navy-muted: #aebccd;
  --on-cream-muted: #5c6675;
  --frame-shadow: 0 30px 80px rgba(10, 16, 25, .45);
  --ease-out: cubic-bezier(.22, .61, .36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Jost", system-ui, sans-serif;
  background: var(--navy);
  color: var(--on-navy);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

img { display: block; max-width: 100%; height: auto; }

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

::selection { background: var(--orange); color: #fff; }

/* ---------- Loader : le 8 couché = infini ---------- */
.loader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--navy);
  display: grid; place-items: center;
  transition: opacity .45s var(--ease-out), visibility .45s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader img { width: 110px; height: auto; opacity: 0; animation: loader-in 1s var(--ease-out) forwards .1s; }
@keyframes loader-in {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---------- Curseur point orange (desktop précis seulement) ---------- */
.cursor-dot {
  position: fixed; z-index: 999; top: 0; left: 0;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--orange);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width .2s, height .2s, opacity .2s;
  opacity: 0;
}
body.has-cursor .cursor-dot { opacity: .9; }
.cursor-dot.grow { width: 26px; height: 26px; opacity: .45; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 56px);
  background: var(--navy);
}
.page-cream .site-header { background: var(--cream); }
.brand { display: flex; align-items: center; }
.brand-logo { height: 17px; width: auto; }
.site-nav { display: flex; gap: clamp(16px, 2.6vw, 36px); align-items: center; }
.site-nav a {
  font-family: "Dosis", sans-serif; font-weight: 600; font-size: 13px;
  letter-spacing: .22em; text-transform: uppercase;
  padding: 10px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color .2s;
}
.site-nav a .num { color: var(--orange); margin-right: 6px; font-family: "Jost", sans-serif; }
.site-nav a:hover, .site-nav a:focus-visible { border-color: var(--orange); outline: none; }
.site-nav a[aria-current="page"] { border-color: var(--orange); }

/* Header variant on cream pages */
.page-cream { background: var(--cream); color: var(--ink); }
.page-cream .brand .tag { color: var(--on-cream-muted); }

/* ---------- Accueil : bannières rubriques (décision Jo 11/07) ----------
   Une colonne à la largeur de la grille Retouches (1180 px), une bannière
   horizontale par rubrique, espace simple, pas de zoom ni de recadrage. */
.slides {
  padding: 40px clamp(20px, 5vw, 64px) 0;
  display: grid; gap: clamp(48px, 8vh, 100px);
}
.slide {
  position: relative;
  width: 100%; max-width: 1180px; margin: 0 auto;
}
.slide figure {
  margin: 0;
  display: grid; justify-items: start; gap: 14px;
  opacity: 0;
  transition: opacity .7s var(--ease-out);
}
.slide.in-view figure { opacity: 1; }
.slide .slide-link { display: block; width: 100%; }
.slide img {
  width: 100%; height: auto; display: block;
  border-radius: 12px;
  box-shadow: var(--frame-shadow);
}
.slide figcaption {
  display: flex; align-items: baseline; gap: 14px;
  font-family: "Dosis", sans-serif;
}
.slide .sector {
  font-size: 13px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase;
}
.slide .work {
  font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--on-navy-muted);
}
.slide .index-mark {
  position: absolute; top: -14px; left: -8px; transform: translateY(-100%);
  font-family: "Jost", sans-serif; font-weight: 600; font-size: 15px;
  color: var(--orange); letter-spacing: .08em;
}

/* hero d'ouverture */
.hero {
  min-height: 100dvh;
  display: grid; place-items: center; text-align: center;
  padding: 120px 24px 80px;
  position: relative;
}
.hero-logo {
  width: clamp(200px, 26vw, 330px); height: auto;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.scroll-hint {
  font-family: "Dosis", sans-serif; font-size: 11px; font-weight: 600;
  letter-spacing: .3em; text-transform: uppercase; color: var(--on-navy-muted);
  display: inline-block; padding: 8px;
}
.hero .scroll-hint { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); }
.scroll-hint::after {
  content: ""; display: block; width: 1px; height: 34px;
  background: var(--orange); margin: 10px auto 0;
  animation: drip 1.8s var(--ease-out) infinite;
  transform-origin: top;
}
.scroll-hint-cream { margin-top: 26px; }
@keyframes drip { 0% { transform: scaleY(0); } 45% { transform: scaleY(1); } 100% { transform: scaleY(0); opacity: 0; } }

/* compteur fixe */
.counter {
  position: fixed; right: clamp(20px, 4vw, 56px); bottom: 28px; z-index: 90;
  font-weight: 600; font-size: 15px; letter-spacing: .1em;
  color: var(--on-navy-muted);
  opacity: 0; transition: opacity .3s;
}
.counter.visible { opacity: 1; }
.counter .current { color: var(--orange); font-size: 19px; }

/* ---------- Bandeau de fin + footer ---------- */
.endcap {
  min-height: 72dvh; display: grid; place-items: center; text-align: center;
  padding: 80px 24px;
}
.endcap h2 { font-size: clamp(26px, 4vw, 44px); font-weight: 600; letter-spacing: .04em; max-width: 22ch; }
.endcap .cta {
  display: inline-block; margin-top: 34px;
  font-family: "Dosis", sans-serif; font-weight: 700; font-size: 14px;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--on-navy); border: 1px solid var(--orange);
  padding: 16px 34px;
  transition: background .25s, color .25s;
}
.endcap .cta:hover, .endcap .cta:focus-visible { background: var(--orange); color: #fff; outline: none; }

.site-footer {
  background: var(--navy);
  color: var(--on-navy);
  border-top: 1px solid rgba(238, 233, 223, .12);
  padding: 54px clamp(20px, 4vw, 56px) 34px;
  display: grid; gap: 26px;
}
.site-footer .row { display: flex; flex-wrap: wrap; gap: 18px 42px; justify-content: space-between; align-items: baseline; }
.site-footer .contact { display: flex; flex-wrap: wrap; gap: 10px 32px; font-size: 15px; }
.site-footer .contact a { border-bottom: 1px solid var(--orange); padding-bottom: 2px; }
.site-footer .legal {
  font-family: "Dosis", sans-serif; font-size: 11.5px; line-height: 1.7;
  letter-spacing: .05em; color: #8b95a5; max-width: 900px;
}
.site-footer .mailing { display: grid; gap: 10px; }
.site-footer .mailing label {
  font-family: "Dosis", sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase; color: #8b95a5;
}
.site-footer .mailing-row { display: flex; gap: 0; }
.site-footer .mailing input {
  background: transparent; border: 1px solid #3a4557; border-right: none;
  color: var(--on-navy); font-family: "Jost", sans-serif; font-size: 15px;
  padding: 12px 16px; min-width: 230px; min-height: 44px;
}
.site-footer .mailing input:focus { outline: none; border-color: var(--orange); }
.site-footer .mailing button {
  background: var(--orange); color: #fff; border: none; cursor: pointer;
  font-family: "Dosis", sans-serif; font-weight: 700; font-size: 13px;
  letter-spacing: .18em; padding: 12px 20px; min-height: 44px;
  transition: opacity .2s;
}
.site-footer .mailing button:hover { opacity: .85; }

/* ---------- Page grille éditoriale (concept B) ---------- */
.grid-page { padding: 140px clamp(20px, 5vw, 64px) 90px; }
.grid-intro { max-width: 640px; margin-bottom: 64px; }
.grid-intro h1 { font-size: clamp(38px, 5.4vw, 62px); font-weight: 600; letter-spacing: .02em; color: var(--navy); }
.grid-intro p { margin-top: 22px; color: #51627a; font-size: 17px; line-height: 1.9; max-width: 54ch; }
.grid-intro p strong { color: var(--navy); font-weight: 600; }
.grid-intro.intro-center { margin: 0 auto 72px; text-align: center; }
.grid-intro.intro-center p { margin-left: auto; margin-right: auto; }

/* Filtres par rubrique */
.filtres {
  display: flex; flex-wrap: wrap; gap: 6px 22px;
  justify-content: center;
  max-width: 1180px; margin: 0 auto 44px;
}
.filtre {
  background: none; border: none; cursor: pointer;
  font-family: "Dosis", sans-serif; font-weight: 600; font-size: 13px;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--on-cream-muted);
  padding: 10px 2px; border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.filtre:hover, .filtre:focus-visible { color: var(--navy); }
.filtre.actif { color: var(--navy); border-color: var(--orange); }

/* Rangées calées : chaque rangée est un bloc, les images se répartissent dedans */
.masonry {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
}
.m-row { display: flex; gap: 14px; width: 100%; }
.m-item {
  border: none; padding: 0; background: none; cursor: pointer;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  height: 100%;
  flex-basis: 0;
  min-width: 0;
  opacity: 0; transform: translateY(16px);
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out);
}
.m-item.in-view { opacity: 1; transform: none; }
.m-item img {
  width: 100%; height: 100%; display: block;
  object-fit: cover;
  transition: transform .35s var(--ease-out);
}
.m-item:hover img, .m-item:focus-visible img { transform: scale(1.02); }

/* Le nom qui apparaît au survol (voile clair, comme le site d'origine) */
.m-nom {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(244, 241, 234, .82);
  color: var(--navy);
  font-family: "Dosis", sans-serif; font-weight: 600; font-size: 15px;
  letter-spacing: .34em; text-transform: uppercase; text-align: center;
  padding: 12px;
  opacity: 0;
  transition: opacity .3s var(--ease-out);
  pointer-events: none;
}
.m-item:hover .m-nom, .m-item:focus-visible .m-nom { opacity: 1; }
@media (hover: none) { .m-nom { display: none; } }

/* Vignettes vidéo (Animations / IA) : triangle de lecture comme le site d'origine */
.m-item.has-video::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-left: 30px solid rgba(255, 255, 255, .92);
  border-top: 19px solid transparent; border-bottom: 19px solid transparent;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, .38));
  pointer-events: none;
  transition: opacity .3s var(--ease-out);
}
/* au survol, le nom prend la place : le triangle s'efface pour ne pas passer dessus */
.m-item.has-video:hover::after, .m-item.has-video:focus-visible::after { opacity: 0; }

/* La place de l'ascenseur est réservée en permanence : sans ça, le contenu
   centré saute de ~15px entre une page longue (Retouches) et une page courte */
html { scrollbar-gutter: stable; }

/* L'écrin : vue série plein écran (navy) */
.ecrin {
  position: fixed; inset: 0; z-index: 500;
  background: var(--navy-deep);
  display: grid; place-items: center;
  padding: 48px clamp(56px, 7vw, 96px) 64px;
  opacity: 0; transition: opacity .3s var(--ease-out);
}
.ecrin[hidden] { display: none; }
.ecrin.open { opacity: 1; }
.ecrin figure { display: grid; gap: 16px; justify-items: start; max-width: 100%; }
/* Fondu enchaîné sans casser la mise en page : l'image COURANTE est dans le flux
   (hauteur pleine, la légende se cale dessus, à gauche), l'ancienne se superpose
   en absolu (.calque) juste le temps de s'effacer. */
.ecrin .visu { position: relative; max-width: 100%; }
.ecrin .visu img {
  display: block;
  max-height: min(82vh, 1200px); max-width: 100%; width: auto; height: auto;
  border-radius: 12px;
  box-shadow: var(--frame-shadow);
  opacity: 0; transition: opacity .7s var(--ease-out);
  cursor: pointer;
}
.ecrin .visu img.visible { opacity: 1; }
.ecrin .visu img.calque { position: absolute; top: 0; left: 50%; transform: translateX(-50%); }
.ecrin video {
  display: block;
  max-height: min(82vh, 1200px); max-width: 100%; width: auto; height: auto;
  border-radius: 12px;
  box-shadow: var(--frame-shadow);
}
.ecrin video[hidden] { display: none; }
.ecrin .visu.mode-video img { display: none; }
.ecrin figcaption { display: flex; gap: 14px; align-items: baseline; font-family: "Dosis", sans-serif; color: var(--on-navy); }
.ecrin .sector { font-size: 13px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; }
.ecrin .work { font-size: 13px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--on-navy-muted); }
.ecrin-close, .ecrin-prev, .ecrin-next {
  position: fixed; z-index: 510;
  background: none; border: none; cursor: pointer;
  color: var(--on-navy); font-size: 30px; line-height: 1;
  width: 52px; height: 52px; display: grid; place-items: center;
  transition: color .2s;
}
/* orange au survol (souris seulement : au doigt, le survol « colle » après un tap et le
   bouton restait orange) et au focus CLAVIER ; le focus posé par script va au dialogue */
@media (hover: hover) { .ecrin-close:hover, .ecrin-prev:hover, .ecrin-next:hover { color: var(--orange); } }
.ecrin-close:focus-visible, .ecrin-prev:focus-visible, .ecrin-next:focus-visible { color: var(--orange); }
.ecrin:focus { outline: none; }
.ecrin-close { top: 18px; right: 18px; font-size: 40px; }
.ecrin-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.ecrin-next { right: 8px; top: 50%; transform: translateY(-50%); }
.ecrin-counter {
  position: fixed; right: clamp(20px, 4vw, 56px); bottom: 24px;
  font-weight: 600; font-size: 15px; letter-spacing: .1em; color: var(--on-navy-muted);
}
.ecrin-counter .current { color: var(--orange); font-size: 19px; }
/* La loupe : l'image de l'écrin à 100 % (clic souris, double tap au doigt), elle glisse
   sous le pointeur. Au-dessus de l'écrin (505) mais sous les boutons (510), qui restent actifs. */
.ecrin .visu { touch-action: manipulation; }
.ecrin .visu img.visible { cursor: zoom-in; }
.loupe {
  position: fixed; inset: 0; z-index: 505;
  background: var(--navy-deep);
  overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y;
  scrollbar-width: none; cursor: zoom-out;
}
.loupe::-webkit-scrollbar { display: none; }
.loupe[hidden] { display: none; }
/* le cadre fait au moins l'écran et au moins l'image : l'image se centre quand elle est
   plus petite que l'écran dans un sens, et rien n'est hors de portée du défilement sinon */
.loupe .cadre { min-width: 100%; min-height: 100%; width: max-content; display: flex; align-items: center; justify-content: center; }
.loupe img { display: block; max-width: none; max-height: none; height: auto; border-radius: 0; box-shadow: none; }
.ecrin.zoomed figure, .ecrin.zoomed .ecrin-counter { visibility: hidden; }

@media (max-width: 640px) {
  .ecrin { padding: 64px 16px 84px; }
  /* Mobile : on garde le calage validé (les flèches sont en bas, la légende doit rester visible) */
  .ecrin .visu img, .ecrin video { max-height: min(76vh, 760px); }
  .ecrin-prev, .ecrin-next { bottom: 14px; top: auto; transform: none; }
  .ecrin-prev { left: 16px; }
  .ecrin-next { left: 76px; right: auto; }
}

/* ---------- Page mentions légales ---------- */
.legal-page { max-width: 820px; margin: 0 auto; }
.legal-page section { margin-bottom: 42px; }
.legal-page h2 {
  font-size: 15px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  color: var(--navy); margin-bottom: 14px;
  font-family: "Dosis", sans-serif;
}
.legal-page p { color: #495669; font-size: 15.5px; line-height: 1.8; }
.legal-page p strong { color: var(--navy); }
.legal-page a { color: var(--navy); border-bottom: 1px solid var(--orange); }

/* ---------- Accessibilité & divers ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 12px; z-index: 2000;
  background: var(--orange); color: #fff; padding: 10px 18px;
  font-family: "Dosis", sans-serif; letter-spacing: .1em;
}
.skip-link:focus { left: 12px; }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loader svg { animation: none; }
  .slide figure, .ed-item { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero .scroll-hint::after { animation: none; }
  .cursor-dot { display: none; }
}

@media (max-width: 640px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px 20px; }
  .site-nav { gap: 14px; }
  .site-nav a { font-size: 11px; letter-spacing: .14em; padding: 8px 2px; }
  .brand-logo { height: 14px; }
  .counter { bottom: 18px; }
  .hero { padding-top: 130px; }
  .hero .sub { letter-spacing: .18em; font-size: 11px; }
}
