:root {
  --bg: #0b0b0b;
  --fg: #fff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--fg); overflow: hidden;
  font-family: "Helvetica Neue", Arial, sans-serif; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Navigation */
.nav { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 20;
  display: flex; gap: 32px; }
.nav button { white-space: nowrap; font-weight: 900; font-size: clamp(16px, 2vw, 24px); letter-spacing: .04em;
  text-shadow: 0 1px 8px rgba(0,0,0,.5); opacity: .75; transition: opacity .2s; }
.nav button:hover, .nav button.active { opacity: 1; }

/* Vues */
.view { position: fixed; inset: 0; opacity: 0; pointer-events: none; transition: opacity .6s ease; }
.view.active { opacity: 1; pointer-events: auto; }

/* Scènes (fonds provisoires : remplacés par ta propre image) */
.scene { position: absolute; inset: 0; background-size: cover; background-position: center; }
.scene--house {
  background:
    radial-gradient(ellipse at 70% 40%, rgba(255,255,255,.18), transparent 55%),
    linear-gradient(160deg, #1d2a24, #0b0f0d 70%);
}
.scene--work {
  width: 220vw; /* scène plus large que l'écran, défilement latéral */
  background:
    radial-gradient(ellipse at 60% 50%, rgba(255,255,255,.12), transparent 50%),
    linear-gradient(120deg, #26211c, #0d0c0b 75%);
  transition: transform .8s cubic-bezier(.2,.7,.2,1);
}

/* Scène LAB AGENCY : image 16:9 en "cover", les points restent ancrés à l'image */
.stage { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: max(100vw, 100vh * var(--r, 1.7917)); height: max(100vh, 100vw / var(--r, 1.7917)); }
.stage-bg { width: 100%; height: 100%; display: block; user-select: none; }

.enter { position: absolute; left: var(--x, 54%); top: var(--y, 52%); transform: translate(-50%, -50%); padding: 6px 16px; border-radius: 999px;
  background: #fff; color: #000; font-weight: 800; font-size: 13px; letter-spacing: .03em;
  transition: transform .2s; }
.enter:hover { transform: translate(-50%, -50%) scale(1.1); }

/* Points cliquables */
.hotspot { position: absolute; left: var(--x); top: var(--y); display: flex; align-items: center; gap: 8px; transform: translate(-6px, -6px); }
.hotspot i { width: 12px; height: 12px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 0 rgba(255,255,255,.7); animation: pulse 2s infinite; }
.hotspot span { background: #fff; color: #000; border-radius: 999px; padding: 5px 12px;
  font-weight: 800; font-size: 12px; letter-spacing: .02em; white-space: nowrap; }
.hotspot:hover span { background: #000; color: #fff; outline: 1px solid #fff; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }

.arrow { position: absolute; bottom: 24px; font-size: 26px; opacity: .7; z-index: 5; }
.arrow:hover { opacity: 1; }
.arrow--left { left: 24px; }
.arrow--right { right: 24px; }

/* À propos */
.about { height: 100%; display: grid; place-content: center; text-align: center; gap: 20px; padding: 24px; }
.about h1 { font-weight: 900; font-size: clamp(36px, 7vw, 96px); line-height: .95; }
.about p { opacity: .7; }

/* Lecteur */
.player { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; }
.player[hidden] { display: none; }
.player video { max-height: 82vh; max-width: 100%; border-radius: 6px; background: #000; }
.player p { font-weight: 900; letter-spacing: .02em; font-size: clamp(18px, 2.6vw, 36px); line-height: 1.1; text-align: center; text-transform: uppercase; max-width: 90vw; margin-top: 6px; }
.close { position: absolute; top: 18px; right: 24px; font-size: 24px; }

.about-logo { width: clamp(140px, 18vw, 240px); margin: 0 auto -30px; mix-blend-mode: screen; }
.about p { font-weight: 800; font-size: clamp(14px, 1.6vw, 20px); letter-spacing: .18em; text-transform: uppercase; opacity: 1; }

#about { background: #000; }
.about-logo { position: relative; overflow: hidden; width: clamp(110px, 12vw, 160px); aspect-ratio: 1; margin: 0 auto -10px; }
.about-logo img { position: absolute; left: 50%; top: 50%; width: 270%; max-width: none; transform: translate(-50%, -50%); }

.about-link { justify-self: center; margin-top: 8px; padding: 6px 18px; border-radius: 999px; background: #fff; color: #000;
  font-weight: 800; font-size: 13px; letter-spacing: .06em; text-decoration: none; transition: transform .2s; }
.about-link:hover { transform: scale(1.08); }

/* ===== Version smartphone / portrait : scène pleine hauteur, défilement latéral au doigt ===== */
.swipe-hint { display: none; }
@media (max-aspect-ratio: 1/1) {
  .view { overflow: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .view::-webkit-scrollbar { display: none; }
  .stage { position: relative; left: 0; top: 0; transform: none;
    height: 100vh; height: 100dvh; width: calc(100dvh * var(--r, 1.7917)); }
  .nav { gap: 16px; top: 14px; }
  .nav button { font-size: 14px; }
  .enter { padding: 10px 20px; font-size: 15px; }
  .hotspot span { padding: 8px 14px; font-size: 13px; }
  .hotspot i { width: 16px; height: 16px; }
  .about { height: 100%; }
  .swipe-hint { display: block; position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 15;
    font-weight: 800; font-size: 12px; letter-spacing: .2em; padding: 8px 16px; border-radius: 999px;
    background: rgba(0,0,0,.55); backdrop-filter: blur(6px); transition: opacity .6s; pointer-events: none; }
  .swipe-hint.hide { opacity: 0; }
  #about { overflow: hidden; }
}

/* LAB AGENCY sur smartphone : image portrait dédiée (768x1376), ENTER repositionné sur la porte */
@media (max-aspect-ratio: 1/1) {
  #lab-agency .stage { width: max(100vw, 100dvh * 0.5581); height: max(100dvh, 100vw / 0.5581); }
  #lab-agency .enter { --x: 56%; --y: 71%; }
}

/* STUDIO sur smartphone : image portrait dédiée (768x1376), points repositionnés */
@media (max-aspect-ratio: 1/1) {
  #studio .stage, #editing-room .stage { width: max(100vw, 100dvh * 0.5581); height: max(100dvh, 100vw / 0.5581); }
  .hotspot { left: var(--mx, var(--x)); top: var(--my, var(--y)); }
  .hotspot--flip { flex-direction: row-reverse; transform: translate(calc(-100% + 6px), -6px); }
  .swipe-hint { display: none; }
}


/* ===== WORK : tous les projets, grille plein écran sans fond (comme spyders.world/all-projects) ===== */
#work { background: #000; overflow-y: auto; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.tile { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #0b0b0b; display: block; }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.tile:hover img, .tile:hover video { transform: scale(1.04); }
.tile i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; transform: translate(-50%, -50%);
  border: 3px solid rgba(255,255,255,.85); border-radius: 50%; transition: transform .2s; }
.tile i::after { content: ""; position: absolute; left: 20px; top: 14px; border-style: solid; border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent rgba(255,255,255,.9); }
.tile:hover i { transform: translate(-50%, -50%) scale(1.12); }
@media (max-aspect-ratio: 1/1) { .grid { grid-template-columns: 1fr; } }

/* Titre visible sur chaque vignette de la page WORK, avant le clic */
.tile span { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 14px; text-align: left; pointer-events: none;
  font-weight: 900; font-size: clamp(13px, 1.4vw, 20px); letter-spacing: .03em; text-transform: uppercase; line-height: 1.1;
  background: linear-gradient(to top, rgba(0,0,0,.75), transparent); }

/* Smartphone : les longs titres passent sur 2 lignes pour rester dans l'écran */
@media (max-aspect-ratio: 1/1) {
  .hotspot { width: max-content; }
  .hotspot i { flex: none; }
  .hotspot span { white-space: normal; max-width: 52vw; line-height: 1.15; text-align: center; border-radius: 16px; padding: 6px 12px; font-size: 12px; }
}

/* Photo dans le lecteur */
.player #photo { max-height: 82vh; max-width: 100%; border-radius: 6px; object-fit: contain; }
.player video[hidden], .player #photo[hidden] { display: none; }

/* Label à gauche du point (partout, y compris sur ordinateur) pour les points proches du bord droit */
.hotspot--left { flex-direction: row-reverse; transform: translate(calc(-100% + 6px), -6px); }

/* ===== WORK : onglets VIDEOS / PHOTOS ===== */
.grid[hidden], .gallery[hidden] { display: none; }
.work-tabs { position: fixed; top: 54px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; gap: 22px; }
.work-tabs button { font-weight: 800; font-size: clamp(12px, 1.3vw, 16px); letter-spacing: .06em; opacity: .6;
  text-shadow: 0 1px 8px rgba(0,0,0,.7); transition: opacity .2s; }
.work-tabs button:hover, .work-tabs button.active { opacity: 1; }
.work-tabs button.active { text-decoration: underline; text-underline-offset: 5px; }
@media (max-aspect-ratio: 1/1) { .work-tabs { top: 46px; } .work-tabs button { font-size: 12px; } }

/* Galerie photos : mosaïque (colonnes) plein écran sur fond noir */
.gallery { display: flex; gap: 14px; align-items: flex-start; padding: 104px 14px 48px; background: #000; }
.gallery .col { flex: 1; min-width: 0; }
.shot { position: relative; display: block; width: 100%; margin: 0 0 14px; overflow: hidden; break-inside: avoid; background: #0b0b0b; }
.shot img { width: 100%; height: auto; display: block; transition: transform .7s cubic-bezier(.2,.7,.2,1), filter .4s; }
.shot:hover img { transform: scale(1.04); filter: brightness(.75); }
.shot b { position: absolute; left: 14px; bottom: 12px; font-weight: 900; font-size: 13px; letter-spacing: .12em; opacity: 0; transform: translateY(6px);
  transition: opacity .3s, transform .3s; text-shadow: 0 1px 10px rgba(0,0,0,.8); }
.shot:hover b { opacity: 1; transform: none; }
@media (max-aspect-ratio: 1/1) { .gallery { gap: 8px; padding: 90px 8px 40px; } .shot { margin-bottom: 8px; } .shot b { opacity: 1; transform: none; left: 8px; bottom: 6px; font-size: 11px; } }

/* Flèches précédente / suivante dans le lecteur de photos */
.nav-photo { position: absolute; top: 50%; transform: translateY(-50%); font-size: 26px; padding: 16px; opacity: .75; z-index: 2; }
.nav-photo:hover { opacity: 1; }
.nav-photo[hidden] { display: none; }
.nav-photo.prev { left: 10px; }
.nav-photo.next { right: 10px; }
.player p:empty { display: none; }

/* Lecteur YouTube */
.player #yt { border: 0; border-radius: 6px; background: #000; max-height: 82vh; }
.player #yt[hidden] { display: none; }

/* WORK : espace en haut pour que le menu et les onglets VIDEOS / PHOTOS ne cachent pas la 1re vignette */
.grid { padding-top: 104px; background: #000; }
@media (max-aspect-ratio: 1/1) { .grid { padding-top: 92px; } }

/* ===== Menu de LAB AGENCY : liste de salles au milieu de l'écran, sur fond assombri (comme spyders.world) ===== */
.subnav { position: fixed; inset: 0; z-index: 15; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(10px, 2.4vh, 22px);
  background: rgba(0,0,0,.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .35s ease, visibility 0s linear .35s; }
.subnav.open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .35s ease; }
.subnav button { font-weight: 900; font-size: clamp(26px, 4.6vw, 64px); letter-spacing: .05em; line-height: 1; text-transform: uppercase; white-space: nowrap;
  opacity: .55; transform: translateY(14px); transition: opacity .25s, transform .45s cubic-bezier(.2,.7,.2,1); }
.subnav.open button { transform: none; }
.subnav.open button:nth-child(2) { transition-delay: .04s; }
.subnav.open button:nth-child(3) { transition-delay: .08s; }
.subnav.open button:nth-child(4) { transition-delay: .12s; }
.subnav button:hover, .subnav button.active { opacity: 1; }
.subnav button.active { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 8px; }
@media (max-aspect-ratio: 1/1) { .subnav button { font-size: clamp(24px, 8vw, 40px); } }

/* ===== Salles : flèches en bas à gauche / à droite pour passer à la salle précédente / suivante (comme spyders.world/office) ===== */
.pan-arrow { display: none; position: fixed; bottom: 28px; z-index: 10; height: 52px; padding: 0 22px; align-items: center; gap: 14px; border-radius: 999px; color: #fff;
  border: 1.5px solid rgba(255,255,255,.7); background: rgba(0,0,0,.38); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-weight: 900; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  transition: background .25s, color .25s, border-color .25s, transform .25s; }
.pan-left { left: 28px; }
.pan-right { right: 28px; }
body.has-room .pan-arrow { display: flex; }
.pan-arrow .mark { height: 30px; width: auto; flex: none; transition: filter .25s; }
.pan-arrow:hover .mark { filter: invert(1); } /* le logo blanc passe en noir quand la pastille devient blanche */
.pan-arrow svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.pan-arrow:hover { background: #fff; color: #000; border-color: #fff; }
.pan-left:hover svg { transform: translateX(-5px); }
.pan-right:hover svg { transform: translateX(5px); }
.pan-arrow:active { transform: scale(.96); }
@media (max-aspect-ratio: 1/1) {
  .pan-arrow { height: 44px; padding: 0 14px; gap: 8px; justify-content: center; bottom: 22px; }
  .pan-arrow .mark { height: 24px; }
  .pan-arrow svg { width: 18px; height: 18px; }
  .pan-arrow span { display: none; }
  .pan-left { left: 16px; }
  .pan-right { right: 16px; }
}

/* Onglet vide (ex. PHOTO TRAINING avant l'ajout des photos) */
.gallery .empty { width: 100%; margin: 28vh 0 0; text-align: center; font-weight: 900; font-size: clamp(16px, 2.2vw, 28px); letter-spacing: .12em; opacity: .55; }
