:root {
  --violet: #2B193D;
  --nuit: #120A1B;
  --blanc: #F4F0F8;
  --lilas: #B58CFF;
  --gris: #BCB0CB;
  --trait: rgba(244, 240, 248, .16);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --marge: clamp(16px, 3.5vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html.is-loading { overflow: hidden; }
body {
  background: var(--nuit);
  color: var(--blanc);
  font: 400 clamp(1rem, .95rem + .25vw, 1.15rem)/1.55 Archivo, system-ui, sans-serif;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
ul { list-style: none; }
i { font-style: normal; color: var(--lilas); }
:focus-visible { outline: 2px solid var(--lilas); outline-offset: 4px; }
::selection { background: var(--lilas); color: var(--nuit); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.display, .hero__title, .logo, .loader__mark, .gallery__head h2, .panel h3, .footer__mark, .ribbon {
  font-stretch: 125%;
  font-weight: 900;
  text-transform: uppercase;
}
.logo, .loader__mark, .footer__mark { text-transform: none; }

/* ---------- Chargement ---------- */
.loader { display: none; }
.js .loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--violet);
  transition: transform .85s var(--ease-in-out);
}
.loader.is-done { transform: translateY(-101%); }
.loader__mark {
  display: grid;
  font-size: clamp(2.2rem, 9vw, 8rem);
  letter-spacing: -.035em; line-height: 1.2;
  transition: transform .6s var(--ease-in-out);
}
.loader__mark > span { grid-area: 1 / 1; }
.loader__ghost { opacity: .12; }
.loader__fill { clip-path: inset(0 calc(100% - var(--p, 0) * 1%) 0 0); }
.loader.is-done .loader__mark { transform: translateY(35vh); }
.loader__fill i { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.loader__meta {
  position: absolute; inset: auto var(--marge) var(--marge);
  display: flex; justify-content: flex-end;
}
.loader__count { font-size: clamp(3rem, 8vw, 7rem); font-weight: 200; line-height: .8; font-variant-numeric: tabular-nums; color: var(--lilas); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 40;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) var(--marge) 28px;
  background: linear-gradient(rgba(18, 10, 27, .88), rgba(18, 10, 27, 0));
}
.logo { font-size: 1.15rem; letter-spacing: -.02em; }
.nav nav { display: flex; gap: clamp(14px, 3vw, 40px); font-size: .92rem; font-weight: 500; }
.nav nav a { padding: 8px 0; background: linear-gradient(var(--lilas), var(--lilas)) left bottom / 0 2px no-repeat; transition: background-size .25s var(--ease-out); }

/* ---------- Accueil ---------- */
.hero { height: 240vh; position: relative; }
.hero__stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: grid; place-items: center;
  overflow: hidden; isolation: isolate;
  background: radial-gradient(ellipse 75% 65% at 50% 50%, var(--violet), var(--nuit) 100%);
  touch-action: pan-y;
  cursor: grab; user-select: none;
}
.hero__stage.is-dragging { cursor: grabbing; }
.hero__title {
  position: relative; z-index: 100;
  text-align: center; pointer-events: none;
  font-size: min(9.8vw, 17vh);
  line-height: .98; letter-spacing: -.035em;
}
.part { display: block; }
.line { display: block; padding: 0 .1em; white-space: nowrap; }
.line > span { display: block; }
.line--accent { color: var(--lilas); font-style: italic; }

.hero__lens { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.hero__foot {
  position: absolute; z-index: 300; inset: auto 0 0;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px;
  padding: 60px var(--marge) max(18px, env(safe-area-inset-bottom));
  font-size: .85rem; line-height: 1.35; font-weight: 500;
  background: linear-gradient(transparent, rgba(18, 10, 27, .92));
  pointer-events: none;
}
.hero__foot p:last-child { text-align: right; }
.hero__hint { display: grid; justify-items: center; gap: 8px; color: var(--gris); }
.hero__hint::after { content: ""; width: 1px; height: 34px; background: var(--lilas); transform-origin: top; animation: drop 1.8s var(--ease-in-out) infinite; }
@keyframes drop { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- Bandeau ---------- */
.ribbon { text-transform: none; background: var(--lilas); color: var(--nuit); overflow: hidden; padding: .35em 0; font-size: clamp(1.8rem, 5vw, 4.5rem); font-style: italic; line-height: 1.2; }
.ribbon__track { display: flex; width: max-content; will-change: transform; }
.ribbon__track span { padding-right: .55em; white-space: nowrap; }
.ribbon__track span::after { content: "/"; padding-left: .55em; font-weight: 200; }

/* ---------- Approche ---------- */
.about {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(48px, 7vw, 110px) 16px;
  padding: clamp(90px, 14vw, 220px) var(--marge);
}
.about__text { grid-column: 1 / 12; font-size: clamp(1.75rem, 4.4vw, 4.4rem); font-weight: 600; line-height: 1.3; letter-spacing: -.025em; text-wrap: pretty; }
.about__text span { opacity: .14; transition: opacity .35s ease; }
.about__text span.is-on { opacity: 1; }
.about__text span.is-key.is-on { color: var(--lilas); }
.signature { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 32px; border-top: 1px solid var(--trait); padding-top: clamp(24px, 3vw, 40px); }
.signature__place { font-stretch: 125%; font-weight: 900; text-transform: uppercase; font-size: clamp(1.5rem, 4.2vw, 4.2rem); line-height: 1.3; letter-spacing: -.025em; }
.signature__coords { color: var(--gris); font-size: .95rem; font-variant-numeric: tabular-nums; }

/* ---------- Galerie ---------- */
.gallery { position: relative; background: var(--violet); }
.gallery__view { display: flex; flex-direction: column; gap: 20px; padding: clamp(72px, 9vw, 130px) 0 clamp(48px, 6vw, 90px); }
.gallery__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 32px; padding: 0 var(--marge); }
.gallery__head h2 { font-size: clamp(1.7rem, 5vw, 4.6rem); font-style: italic; line-height: 1; letter-spacing: -.03em; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { min-height: 44px; padding: 0 20px; border: 1px solid var(--trait); font-size: .9rem; font-weight: 600; transition: background-color .2s ease, color .2s ease, transform .15s var(--ease-out); }
.filters button[aria-pressed="true"] { background: var(--lilas); border-color: var(--lilas); color: var(--nuit); }
.filters button:active, .btn:active, #copy:active { transform: scale(.97); }
/* défilement horizontal natif : au doigt, au pavé tactile, à la souris (glisser) ou avec les flèches */
.gallery__window { height: clamp(360px, 66vh, 660px); height: clamp(360px, 66svh, 660px); overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--marge); scrollbar-width: none; container-type: size; }
.gallery__window::-webkit-scrollbar { display: none; }
.track[hidden], .gallery__empty[hidden] { display: none; }
.track.is-single { margin-inline: auto; }
.gallery__empty { display: grid; place-items: center; height: 100%; margin: 0 var(--marge); border: 1px dashed var(--lilas); padding: 24px; text-align: center; font-weight: 600; }
.gallery__window.is-dragging { scroll-snap-type: none; user-select: none; }
.track { display: flex; align-items: center; gap: clamp(12px, 2vw, 30px); width: max-content; height: 100%; padding: 0 var(--marge); }
.item { --h: 84cqh; height: var(--h); width: min(calc(var(--h) * .8), 82vw); flex: none; scroll-snap-align: start; transform: translateY(var(--y)); }
.folder { position: relative; display: block; width: 100%; height: 100%; text-align: left; animation: rise .7s var(--ease-out) backwards; animation-delay: var(--d); }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } }
.folder img { width: 100%; height: 100%; object-fit: cover; }
.folder__sheet { position: absolute; overflow: hidden; background: var(--nuit); border: 1px solid var(--trait); transform-origin: 50% 100%; transition: transform .35s var(--ease-out); }
.folder__sheet img { filter: brightness(.6); }
.folder__sheet--back { inset: 0 9% 30% 9%; transform: rotate(-3.5deg); }
.folder__sheet--mid { inset: 4% 5% 30% 5%; transform: rotate(2.5deg); }
.folder__tab { position: absolute; left: 0; top: calc(13% - 32px); height: 33px; display: flex; align-items: center; padding: 0 34px 0 16px; background: var(--lilas); color: var(--nuit); font-size: .8rem; font-weight: 800; clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 100%, 0 100%); }
.folder__cover { position: absolute; inset: 13% 0 0; overflow: hidden; background: var(--nuit); border-top: 4px solid var(--lilas); box-shadow: 0 -16px 30px rgba(18, 10, 27, .45); }
.folder__cover img { position: absolute; top: 0; left: -9%; width: 118%; max-width: none; filter: grayscale(1) contrast(1.08) brightness(.85); transition: filter .45s ease; }
.folder:focus-visible img, .item.is-center .folder__cover img { filter: none; }
.item__cap { position: absolute; inset: auto 0 0; display: flex; justify-content: space-between; align-items: end; gap: 12px; padding: 64px 18px 16px; background: linear-gradient(transparent, rgba(18, 10, 27, .92)); }
.item__cap strong { font-stretch: 112%; font-weight: 800; text-transform: uppercase; font-size: clamp(1rem, 1.8vw, 1.6rem); line-height: 1.15; }
.item__cap small { flex: none; font-size: .8rem; color: var(--lilas); font-weight: 600; }
.gallery__nav { display: flex; justify-content: flex-end; gap: 8px; padding: 0 var(--marge); }
.gallery__nav[hidden] { display: none; }
.gallery__nav button { width: 56px; height: 48px; border: 1px solid var(--lilas); color: var(--lilas); font-size: 1.2rem; transition: background-color .2s ease, color .2s ease, opacity .2s ease, transform .15s var(--ease-out); }
.gallery__nav button:active { transform: scale(.97); }
.gallery__nav button[aria-disabled="true"] { opacity: .35; cursor: default; }

/* ---------- Clubs et athlètes ---------- */
.offer { padding: clamp(90px, 12vw, 180px) var(--marge) 0; }
.display { font-size: clamp(2rem, 7.4vw, 7.6rem); line-height: .98; letter-spacing: -.035em; text-wrap: balance; }
.offer__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: clamp(36px, 5vw, 72px); }
.panel { position: relative; display: flex; align-items: end; min-height: clamp(440px, 72vh, 700px); overflow: hidden; isolation: isolate; }
.panel img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease-out); }
.panel::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(rgba(43, 25, 61, .15) 20%, rgba(18, 10, 27, .95) 85%); }
.panel__body { padding: clamp(20px, 3vw, 44px); display: grid; gap: 16px; justify-items: start; }
.panel h3 { font-size: clamp(2rem, 4vw, 3.8rem); font-style: italic; line-height: 1; }
.panel p { max-width: 42ch; }
.btn { display: inline-flex; align-items: center; min-height: 50px; padding: 8px 26px; background: var(--blanc); color: var(--nuit); font-weight: 700; font-size: .95rem; transition: background-color .2s ease, transform .15s var(--ease-out); }

/* ---------- Contact ---------- */
.contact { padding: clamp(110px, 16vw, 240px) var(--marge) clamp(70px, 9vw, 130px); }
.contact h2 em { color: var(--lilas); }
.contact__lead { max-width: 46ch; margin-top: 28px; color: var(--gris); }
.contact__links { margin-top: clamp(40px, 6vw, 80px); border-bottom: 1px solid var(--trait); }
.contact__links li { display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--trait); }
.contact__links a { flex: 1; min-width: 0; display: grid; grid-template-columns: clamp(90px, 14vw, 220px) 1fr; align-items: baseline; gap: 4px 16px; padding: clamp(22px, 3vw, 42px) 0; }
.contact__links a span { color: var(--gris); font-size: .9rem; }
.contact__links strong { font-size: clamp(1.15rem, 3.6vw, 3.4rem); font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; line-height: 1.15; transition: color .2s ease, transform .3s var(--ease-out); }
#copy { min-height: 44px; min-width: 96px; border: 1px solid var(--trait); font-size: .85rem; font-weight: 600; transition: border-color .2s ease, transform .15s var(--ease-out); }

.footer { background: var(--violet); padding: clamp(40px, 6vw, 80px) var(--marge) max(24px, env(safe-area-inset-bottom)); overflow: hidden; }
.footer__mark { font-size: 12.4vw; line-height: 1.15; letter-spacing: -.045em; text-align: center; white-space: nowrap; }
.footer div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--trait); font-size: .82rem; color: var(--gris); }
.footer a { color: var(--blanc); }

/* ---------- Dossier ouvert ---------- */
.album { width: 100%; height: 100%; max-width: 100%; max-height: 100%; border: 0; background: var(--nuit); color: var(--blanc); overflow-y: auto; overscroll-behavior: contain; opacity: 0; transition: opacity .25s var(--ease-out), overlay .25s allow-discrete, display .25s allow-discrete; }
.album[open] { opacity: 1; }
@starting-style { .album[open] { opacity: 0; } }
.album::backdrop { background: var(--nuit); }
.album__head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: max(18px, env(safe-area-inset-top)) var(--marge) 18px; background: rgba(18, 10, 27, .96); border-bottom: 1px solid var(--trait); }
.album__head h3 { font-stretch: 125%; font-weight: 900; font-style: italic; text-transform: uppercase; font-size: clamp(1.3rem, 4vw, 3.2rem); line-height: 1.1; }
.album__head p { color: var(--lilas); font-size: .85rem; font-weight: 600; }
.album__head button { flex: none; min-height: 48px; padding: 0 20px; border: 1px solid var(--trait); font-weight: 600; }
.album__grid { columns: 4 240px; column-gap: 14px; padding: 24px var(--marge) 60px; }
.album__grid li { break-inside: avoid; margin-bottom: 14px; animation: rise .6s var(--ease-out) backwards; animation-delay: var(--d); }
.album__grid button { display: block; width: 100%; overflow: hidden; background: var(--violet); min-height: 120px; }
.album__grid img { width: 100%; height: auto; transition: transform .5s var(--ease-out); }

/* ---------- Visionneuse ---------- */
.viewer { width: 100%; height: 100%; max-width: 100%; max-height: 100%; border: 0; background: var(--nuit); color: var(--blanc); opacity: 0; transition: opacity .25s var(--ease-out), overlay .25s allow-discrete, display .25s allow-discrete; }
.viewer[open] { opacity: 1; display: grid; place-items: center; }
@starting-style { .viewer[open] { opacity: 0; } }
.viewer::backdrop { background: transparent; }
.viewer figure { display: grid; gap: 14px; justify-items: center; padding: 70px 16px 90px; width: 100%; }
.viewer img { max-height: calc(100vh - 220px); max-height: calc(100svh - 220px); max-width: min(100%, 1400px); object-fit: contain; }
.viewer figcaption { display: flex; gap: 20px; align-items: baseline; text-transform: uppercase; }
.viewer figcaption span { color: var(--lilas); font-size: .85rem; }
.viewer button { position: absolute; min-width: 52px; min-height: 48px; padding: 0 16px; border: 1px solid var(--trait); font-weight: 600; }
.viewer__close { top: 16px; right: 16px; }
.viewer__prev { bottom: 20px; left: calc(50% - 68px); }
.viewer__next { bottom: 20px; left: calc(50% + 8px); }
html:has(dialog[open]) { overflow: hidden; }

/* ---------- Curseur ---------- */
.cursor { display: none; }

/* ---------- Apparitions ---------- */
.js .reveal { opacity: 0; transform: translateY(48px); transition: opacity .7s var(--ease-out), transform .9s var(--ease-out); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .offer__grid .reveal + .reveal { transition-delay: 80ms; }

@media (hover: hover) and (pointer: fine) {
  .nav nav a:hover { background-size: 100% 2px; }
  .filters button:not([aria-pressed="true"]):hover { background: rgba(181, 140, 255, .18); }
  .folder:hover .folder__cover img { filter: none; }
  .folder:hover .folder__sheet--back { transform: translateY(-3%) rotate(-7deg); }
  .folder:hover .folder__sheet--mid { transform: translateY(-2%) rotate(6deg); }
  .has-viewfinder .folder { cursor: none; }
  .gallery__nav button:not([aria-disabled="true"]):hover { background: var(--lilas); color: var(--nuit); }
  .album__grid button:hover img { transform: scale(1.04); }
  .album__head button:hover { border-color: var(--lilas); }
  .panel:hover img { transform: scale(1.05); }
  .btn:hover { background: var(--lilas); }
  #copy:hover, .viewer button:hover { border-color: var(--lilas); }
  .contact__links a:hover strong { color: var(--lilas); transform: translateX(10px); }
  /* viseur autofocus : quatre coins et un point, centrés sur la souris */
  .cursor {
    display: block; position: fixed; left: 0; top: 0; z-index: 60;
    width: 68px; height: 52px; margin: -26px 0 0 -34px;
    pointer-events: none; opacity: 0; scale: 1.35;
    filter: drop-shadow(0 0 3px rgba(18, 10, 27, .8));
    transition: opacity .15s var(--ease-out), scale .2s var(--ease-out);
  }
  .cursor.is-on { opacity: 1; scale: 1; }
  .cursor b { position: absolute; width: 15px; height: 15px; border: 0 solid var(--lilas); transition: transform .15s var(--ease-out); }
  .cursor b:nth-child(1) { left: 0; top: 0; border-width: 3px 0 0 3px; }
  .cursor b:nth-child(2) { right: 0; top: 0; border-width: 3px 3px 0 0; }
  .cursor b:nth-child(3) { left: 0; bottom: 0; border-width: 0 0 3px 3px; }
  .cursor b:nth-child(4) { right: 0; bottom: 0; border-width: 0 3px 3px 0; }
  .cursor u { position: absolute; left: 31px; top: 23px; width: 6px; height: 6px; border-radius: 50%; background: var(--lilas); }
  .cursor.is-down b:nth-child(1) { transform: translate(8px, 6px); }
  .cursor.is-down b:nth-child(2) { transform: translate(-8px, 6px); }
  .cursor.is-down b:nth-child(3) { transform: translate(8px, -6px); }
  .cursor.is-down b:nth-child(4) { transform: translate(-8px, -6px); }
}

/* accueil sur téléphone : « ouverture », titre étroit en haut et en bas, objectif au milieu
   (la taille des lignes est ajustée à la largeur de l'écran par main.js) */
@media (max-width: 759.98px) {
  .hero__title { position: absolute; inset: 0; font-size: 13vw; letter-spacing: -.02em; }
  .part { position: absolute; left: 0; right: 0; display: grid; justify-items: center; font-stretch: 62%; line-height: .92; }
  .part:first-child { top: 10%; }
  .part:last-child { bottom: 18%; }
  .part .line { padding: 0 .04em; }
}

@media (max-width: 760px) {
  .about__text { grid-column: 1 / -1; }
  .offer__grid { grid-template-columns: 1fr; }
  .contact__links a { grid-template-columns: 1fr; }
  .item { --h: 86cqh; }
  .gallery__view { gap: 12px; padding: 72px 0 32px; }
  .gallery__window { height: 54vh; height: 54svh; min-height: 320px; }
}
@media (max-width: 400px) {
  .nav nav a[href="#approche"] { display: none; }
  .logo { font-size: 1rem; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .loader { transition: opacity .2s ease; }
  .loader.is-done { transform: none; opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s .2s; }
  .loader.is-done .loader__mark { transform: none; }
  .loader__fill i, .hero__hint::after { animation: none; }
  .hero { height: auto; }
  .js .reveal { transform: none; transition: opacity .3s ease; }
  .folder, .album__grid li { animation: none; }
  .folder__sheet, .album__grid img { transition: none; }
  .panel img, .contact__links strong { transition: color .2s ease; }
  .panel:hover img, .contact__links a:hover strong { transform: none; }
}
