/* Switzer (Fontshare, licence gratuite usage commercial) — auto-hébergée, remplace Forma DJR. */
@font-face { font-family: "Switzer"; src: url("fonts/Switzer-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("fonts/Switzer-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --sage: #A7AE8A;
  --ink: #1f1f1f;
  --grey: #8a8a8a;
  --paper: #e6e6e6;
  --font: "Switzer", "Helvetica Neue", Arial, sans-serif;
  --pad: 28px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img, video { display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- Loader (repris de stinkfilms.com) — une seule fois par visite ---------- */
.changing { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.changing__top, .changing__bottom { position: absolute; left: 0; right: 0; height: 50%; background: #000; transition: transform .5s ease-in; }
.changing__top { top: 0; } .changing__bottom { bottom: 0; }
.changing__top.loading3 { transform: translateY(-100%); }
.changing__bottom.loading3 { transform: translateY(100%); }
.changing__bar { position: absolute; top: 0; left: 0; width: 0; height: 8px; background: #fff; }
.changing__bar.loading { width: 100%; transition: width 2s cubic-bezier(1,-0.04,1,1), left .6s cubic-bezier(1,-0.04,1,1); }
.changing__bar.loading2 { left: 100%; transition: width 1s cubic-bezier(1,-0.04,1,1), left .6s cubic-bezier(1,-0.04,1,1); }
.changing__logo { position: relative; z-index: 9; opacity: 0; transition: opacity .5s; }
.changing__logo.loading { opacity: 1; }
.changing__logo.loading2 { opacity: 0; transition: opacity .5s .4s; }
.changing__logo img { width: 73px; height: auto; }
@media (min-width: 1024px) { .changing__logo img { width: 91px; } }

/* ---------- Accueil ---------- */
html:has(body.home) { background: #000; }
body.home { background: #000; overflow: hidden; height: 100lvh; }
.hero { position: fixed; top: 0; left: 0; width: 100vw; height: 100lvh; }
.hero video { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 2.4s ease, filter .6s ease; }
body.ready .hero video { transform: scale(1); }
body.instant .hero video { transition: filter .6s ease; }
body.dim .hero video { filter: brightness(.5); }
.corner { position: fixed; top: env(safe-area-inset-top, 0px); z-index: 10; color: #fff; padding: var(--pad) 32px; }
.corner.tl { left: 0; } .corner.tr { right: 0; }
.corner.bc { top: auto; bottom: env(safe-area-inset-bottom, 0px); left: 50%; transform: translateX(-50%); }
.home-logo { position: fixed; z-index: 10; left: 50%; top: calc(22px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); width: 104px; height: auto; }

/* Liens blancs posés sur l'image (accueil + barre des pages intérieures) */
.corner a, .ov { font-weight: 700; text-transform: uppercase; letter-spacing: .16em; font-size: 16px; color: #fff;
  text-shadow: 0 0 14px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.35); transition: color .3s; white-space: nowrap; }
.corner a:hover, .ov:hover { color: var(--sage); }

/* ---------- Barre posée sur l'image (pages intérieures) ---------- */
html:has(body.inner) { background: #000; }
body.inner { background: #000; min-height: 100svh; display: flex; flex-direction: column; }
header.bar { position: fixed; top: 0; left: 0; right: 0; z-index: 85; display: flex; align-items: center; gap: 32px;
  padding: calc(var(--pad) + env(safe-area-inset-top, 0px)) 32px var(--pad); pointer-events: none; }
header.bar > * { pointer-events: auto; }
header.bar nav { display: none; }
header.bar .brand { margin-right: auto; }
header.bar .brand img { width: 104px; height: auto; filter: drop-shadow(0 0 10px rgba(0,0,0,.35)); }

/* Zone cliquable élargie (invisible) : un doigt un peu à côté ouvre quand même Contacto / le logo, pas la vidéo dessous */
header.bar .ov, header.bar .brand, .corner a { display: inline-block; position: relative; padding: 22px 26px; margin: -22px -26px; }
header.bar .brand { margin-right: auto; line-height: 0; }

/* ---------- Grilles (vidéo + photo) ---------- */
.grid { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(calc(100vw / 3 * 2 / 3), 1fr); }
.grid.photos { grid-template-columns: repeat(5, 1fr); grid-auto-rows: minmax(calc(100vw / 5 * 3 / 2), 1fr); }
.tile { position: relative; overflow: hidden; background: #111; cursor: pointer; }
.grid.photos .tile { cursor: zoom-in; }
.tile img, .tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile video { opacity: 0; transition: opacity .5s ease; }
.tile.playing video { opacity: 1; }
.tile .name { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; color: #fff;
  font-weight: 700; text-transform: uppercase; letter-spacing: .16em; font-size: 12px; text-shadow: 0 1px 14px rgba(0,0,0,.45);
  opacity: 0; transition: opacity .35s ease; }
@media (hover: hover) { .tile:hover .name { opacity: 1; } }

/* ---------- Visionneuse (noire, cinéma) ---------- */
#lb { position: fixed; inset: 0; z-index: 90; background: #000; display: none; place-items: center; }
#lb.open { display: grid; }
body.lb-open { overflow: hidden; }
#lb .stage video, #lb .stage img, #lb .stage iframe { max-width: 94vw; max-height: 86svh; }
#lb.cine .stage video, #lb.cine .stage iframe { width: 100vw; height: 100svh; max-width: none; max-height: none; object-fit: contain; border: 0; background: #000; }
#lb .x { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 18px; padding: 8px 10px; font-size: 18px; line-height: 1; color: #bbb; z-index: 2; }
#lb .x:hover { color: #fff; }
#lb .cap { position: absolute; top: calc(24px + env(safe-area-inset-top, 0px)); left: 32px; z-index: 2; color: #fff; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  :root { --pad: 18px; }
  .corner, header.bar { padding-left: var(--pad); padding-right: var(--pad); }
  .corner { padding-top: 22px; padding-bottom: 22px; }
  .corner a, .ov { font-size: 13px; letter-spacing: .14em; }
  .home-logo { top: calc(16px + env(safe-area-inset-top, 0px)); width: 84px; }
  header.bar { gap: 20px; }
  header.bar .brand img { width: 84px; }
  .grid { grid-template-columns: 1fr; grid-auto-rows: minmax(calc(100vw * 2 / 3), 1fr); }
  .grid.photos { grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(calc(100vw / 2 * 3 / 2), 1fr); }
  #lb .stage img { max-width: 100vw; max-height: 80svh; }
  #lb .cap { left: var(--pad); }
}
@media (max-width: 360px) {
  .corner a, .ov { font-size: 12px; letter-spacing: .12em; }
  header.bar { gap: 14px; }
  header.bar .brand img { width: 74px; }
  .home-logo { width: 64px; }
}

/* Titre pour Google et lecteurs d'écran, invisible à l'écran */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Fondu entre les pages (Chrome, Safari récents) */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .5s; }
