/* ============================================================
   facade.css — styles des modules façade (SÉQ 1), traversée (SÉQ 5), noyade (SÉQ 6)
   Palette : fallbacks locaux si core ne définit pas les variables.
   ============================================================ */

/* ---------- SÉQ 1 : la façade ---------- */

#seq1 .facade-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.facade-scroll {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.facade-wrap {
  position: relative;
  width: min(92%, calc((100svh - 150px) * 0.8)); /* plaque 1600x2000 contenue, marge header+player */
  flex: none;
  align-self: center;
}
.facade-wrap picture,
.facade-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

#facade-windows { position: absolute; inset: 0; }

.fx-window {
  position: absolute;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.fx-window:focus-visible {
  outline: 2px solid var(--ambre, #DCA856);
  outline-offset: 3px;
  border-radius: 2px;
}

.fx-window .halo {
  position: absolute;
  left: -26%; top: -22%;
  width: 152%; height: 144%;
  background: url(../media/img/halo.png) center / 100% 100% no-repeat;
  mix-blend-mode: screen;
  opacity: calc(var(--fx-fl, .5) * .34);
  pointer-events: none;
  transition: opacity .6s cubic-bezier(0.33, 1, 0.68, 1);
}
.fx-window.hot .halo { opacity: calc(var(--fx-fl, .5) * .55); transition-duration: .16s; }
.fx-window.beckon .halo { opacity: calc(var(--fx-fl, .5) * .85); transition-duration: .16s; }
.fx-window.playing .halo { opacity: calc(.20 + var(--rms-bass, 0) * .6); transition: none; }
.fx-window.pulse .halo { animation: fx-pulse 2.1s ease-in-out 1; }
@keyframes fx-pulse {
  0%, 100% { opacity: calc(var(--fx-fl, .5) * .8); }
  25%, 65% { opacity: 1; }
}

/* la 14e — éteinte tant que non découverte */
.fx-window[data-window="all-i-want-is-you"] .halo { opacity: 0; }
.fx-window[data-window="all-i-want-is-you"].lit .halo { opacity: calc(var(--fx-fl, .5) * .45); }
.fx-window[data-window="all-i-want-is-you"].playing .halo { opacity: calc(.30 + var(--rms-bass, 0) * .95); }

.fx-window.knock { animation: fx-knock .15s linear 1; }
@keyframes fx-knock {
  0%, 100% { transform: translate(0, 0); }
  30% { transform: translate(-1px, 1px); }
  60% { transform: translate(1px, -1px); }
}

.facade-legend {
  position: absolute;
  left: 50%;
  bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px) + 64px);
  transform: translateX(-50%);
  margin: 0;
  font-family: Archivo, system-ui, sans-serif;
  font-size: .78rem;
  letter-spacing: .08em;
  color: var(--sable, #F2D692);
  opacity: .85;
  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

/* reduced-motion : pas de travelling, halos posés */
.facade-wrap.reduced .halo,
.facade-wrap.reduced .fx-window.beckon .halo { opacity: .5; transition: none; animation: none; }

/* ---------- fiche-plan (contenu du dialog) ---------- */

.fiche-plan { text-align: left; max-width: 34rem; }
.fiche-plan .fiche-n {
  font-family: Archivo, system-ui, sans-serif;
  font-size: .75rem;
  letter-spacing: .3em;
  color: var(--or-typo, #B8A67E);
  margin: 0 0 .4rem;
}
.fiche-plan h3 {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  color: var(--typo, #F2EFE6);
  margin: 0 0 .5rem;
}
.fiche-plan .fiche-meta {
  font-family: Archivo, system-ui, sans-serif;
  font-size: .82rem;
  letter-spacing: .12em;
  color: var(--sable, #F2D692);
  margin: 0 0 1.2rem;
  font-variant-numeric: tabular-nums;
}
.fiche-plan .fiche-vers {
  display: block;
  background: none;
  border: 0;
  border-left: 2px solid var(--ambre, #DCA856);
  padding: .4rem 0 .4rem 1rem;
  margin: 0 0 1.4rem;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--typo, #F2EFE6);
  text-align: left;
  cursor: pointer;
}
.fiche-plan .fiche-vers:hover,
.fiche-plan .fiche-vers:focus-visible { color: var(--ambre, #DCA856); }
.fiche-plan .fiche-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.fiche-plan .fiche-actions button {
  font-family: Archivo, system-ui, sans-serif;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: lowercase;
  padding: .7rem 1.3rem;
  cursor: pointer;
  border-radius: 2px;
}
.fiche-plan .fiche-play {
  background: var(--ambre, #DCA856);
  border: 1px solid var(--ambre, #DCA856);
  color: #12100A;
}
.fiche-plan .fiche-play:hover { background: var(--ambre-vif, #FFC551); }
.fiche-plan .fiche-close {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--typo, #F2EFE6) 30%, transparent);
  color: var(--typo, #F2EFE6);
}
.fiche-plan .fiche-close:hover { border-color: var(--typo, #F2EFE6); }

/* ---------- SÉQ 5 : la traversée ---------- */

#seq5 { position: relative; }
#seq5 .streaks-slot {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  /* fond pose longue : nuit bleue + points de ville (aucun asset) */
  background:
    radial-gradient(1.5px 1.5px at 12% 30%, rgba(242,214,146,.5), transparent 60%),
    radial-gradient(1px 1px at 34% 62%, rgba(101,148,183,.55), transparent 60%),
    radial-gradient(1.5px 1.5px at 57% 24%, rgba(242,214,146,.35), transparent 60%),
    radial-gradient(1px 1px at 71% 55%, rgba(101,148,183,.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 88% 38%, rgba(242,214,146,.4), transparent 60%),
    linear-gradient(180deg, #08090B 0%, #071336 55%, #08090B 100%);
}
#seq5 .streaks-slot canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.fiches-rail {
  position: relative;
  display: flex;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 0 6vw;
  will-change: transform;
}
.fiche {
  flex: none;
  width: min(68vw, 380px);
  cursor: pointer;
  background: color-mix(in srgb, #071336 55%, transparent);
  border: 1px solid rgba(101, 148, 183, .18);
  border-radius: 3px;
  padding: 1rem;
  transition: transform .35s cubic-bezier(0.22, 1, 0.36, 1), border-color .35s;
  scroll-snap-align: center;
}
.fiche:hover, .fiche:focus-visible { border-color: rgba(101, 148, 183, .5); transform: translateY(-4px); }
.fiche:focus-visible { outline: 2px solid var(--ambre, #DCA856); outline-offset: 3px; }
.fiche.pushed { transform: scale(.98); }
.fiche-img { overflow: hidden; border-radius: 2px; aspect-ratio: 4 / 5; }
.fiche-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fiche-title {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--typo, #F2EFE6);
  margin: .9rem 0 .2rem;
}
.fiche-meta {
  font-family: Archivo, system-ui, sans-serif;
  font-size: .75rem;
  letter-spacing: .12em;
  color: var(--bleu2, #6594B7);
  margin: 0 0 .5rem;
  font-variant-numeric: tabular-nums;
}
.fiche-note {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 1rem;
  color: color-mix(in srgb, var(--typo, #F2EFE6) 80%, transparent);
  margin: 0;
  line-height: 1.45;
}

/* mobile : le rail est son propre scroller natif snap (version par défaut) */
@media (max-width: 767px) {
  .fiches-rail {
    transform: none !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0 16vw 1rem;
    will-change: auto;
  }
}

/* ---------- SÉQ 6 : la noyade ---------- */

#seq6 .drown-stage { position: relative; overflow: hidden; }
.drown-canvas-slot,
.drown-canvas-slot canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.drown-handle {
  position: absolute;
  left: 0;
  width: 100%;
  height: 48px;
  cursor: grab;
  touch-action: none;
  z-index: 4;
}
.drown-handle.grabbing { cursor: grabbing; }

.drown-verses { position: relative; z-index: 2; }
.drown-verses > * { transition: color .3s ease, filter .3s ease, opacity .3s ease; }
.drown-verses > .flooded {
  color: var(--bleu2, #6594B7) !important;
  filter: blur(1px);
}
.drown-verses .verse-reflection {
  transform: scaleY(-1);
  opacity: .25;
  margin-top: .2em;
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 80%);
  mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 80%);
  user-select: none;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .drown-verses .verse-reflection { animation: drown-waver 7s ease-in-out infinite alternate; }
}
@keyframes drown-waver {
  from { transform: scaleY(-1) skewX(0.4deg); }
  to   { transform: scaleY(-1) skewX(-0.6deg); }
}

/* reduced-motion : ligne statique, pas de canvas */
.drown-static .drown-canvas-slot { display: none; }
.drown-static::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 56%;
  border-top: 1px solid rgba(101, 148, 183, .4);
  z-index: 1;
}

/* ── chantier 5 : prolonger la rue (immeubles voisins hors focus) ── */
@media (min-width: 900px) {
  #seq1 .facade-stage::before, #seq1 .facade-stage::after {
    content: ''; position: absolute; top: 0; bottom: 0; width: 30vw; z-index: 0;
    background: url('../media/img/facade-desktop.webp') center / cover no-repeat;
    filter: blur(26px) brightness(.32) saturate(.8); pointer-events: none;
  }
  #seq1 .facade-stage::before { left: 0; transform: scaleX(-1);
    mask-image: linear-gradient(to right, rgba(0,0,0,.9), transparent);
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,.9), transparent); }
  #seq1 .facade-stage::after { right: 0;
    mask-image: linear-gradient(to left, rgba(0,0,0,.9), transparent);
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,.9), transparent); }
  #seq1 .facade-stage { background: radial-gradient(50% 8% at 50% 100%,
    color-mix(in srgb, var(--ambre) 6%, transparent), transparent), var(--noir); }
}
.facade-scroll { position: relative; z-index: 1; }

/* ── chantier 6 : affordance — beckon qui respire, tungstène, légende-invitation ── */
.facade-legend.invite { font-family: var(--serif); font-style: italic; font-size: 1rem; letter-spacing: 0; }
@media (prefers-reduced-motion: no-preference) {
  .fx-window.beckon .halo { animation: beckon-breathe 3.4s cubic-bezier(0.37, 0, 0.63, 1) infinite; }
}
@keyframes beckon-breathe {
  0%, 100% { opacity: calc(var(--fx-fl, .5) * .5); transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}
.facade-wrap.reduced .fx-window.beckon .halo { animation: none; }

/* seq6 : l'eau shader porte la métaphore — le clone CSS du titre disparaît */
.drown-verses .verse-reflection { display: none !important; }
#bb-phone::before { opacity: .35; }
#bb-phone:hover::before, #bb-phone:focus-visible::before, #bb-phone.pulse::before { opacity: 1; }
