/* L'heure bleue (10 novembre 2026).
   1. La lumière du héros : un ciel, froid en haut, chaud à l'horizon.
   2. Le film de la rue, sous le titre : les sept commerces des démos ferment, leurs sites restent ouverts.
   3. La même lumière en tête des sections sombres.
   4. L'horizon de la rue, posé sur le pied de page.
   Rien ne bouge en mouvement réduit : le film est remplacé par son image de fin. */

/* ---------- 1. Héros ---------- */
html body .v-hero.dm-hero-centre::before {
  left: 0; width: 100%;
  background:
    radial-gradient(56% 64% at 50% -8%, rgba(110, 155, 255, .34), rgba(110, 155, 255, 0) 72%),
    radial-gradient(44% 34% at 50% 108%, rgba(255, 190, 132, .3), rgba(255, 190, 132, 0) 72%);
}

/* ---------- 2. Le film ---------- */
html body .hb-rue { position: relative; padding-block: clamp(4px, 1vw, 16px) 0; }
html body .hb-film { display: grid; gap: clamp(18px, 2vw, 28px); margin: 0; }
html body .hb-film__cadre {
  position: relative; isolation: isolate; overflow: hidden;
  aspect-ratio: 12 / 5; border-radius: clamp(16px, 2vw, 28px);
  background: linear-gradient(#2b4a8f, #f3c3a0 62%, #6f6a70 62%);
  box-shadow:
    0 0 0 1px rgba(22, 28, 34, .1),
    0 2px 6px rgba(11, 21, 48, .1),
    0 28px 56px -24px rgba(11, 21, 48, .42),
    0 70px 120px -60px rgba(12, 93, 254, .4);
}
html body .hb-film__cadre :is(picture, img, video) { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
html body .hb-film__cadre :is(img, video) { object-fit: cover; }
html body .hb-film__video { opacity: 0; transition: opacity .45s var(--ease); }
html body .hb-film__video.est-pret { opacity: 1; }

/* un grain très léger par-dessus l'image, sur grand écran seulement */
@media (hover: hover) and (width >= 900px) {
  html body .hb-film__cadre::after {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .5; mix-blend-mode: soft-light;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5  0 0 0 0 .5  0 0 0 0 .5  0 0 0 .7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}

html body .hb-film__rejouer {
  position: absolute; right: clamp(12px, 1.6vw, 22px); bottom: clamp(12px, 1.6vw, 22px); z-index: 2;
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 13px;
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px;
  background: rgba(9, 16, 36, .58); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #fff; font: 600 .875rem/1 var(--f-studio); letter-spacing: .005em; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s .3s, background-color var(--t-survol, .18s) var(--ease);
}
html body .hb-film__rejouer svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html body .hb-film.est-fini .hb-film__rejouer { opacity: 1; visibility: visible; transform: none; transition-delay: .5s, .5s, 0s, 0s; }
html body .hb-film__rejouer:is(:hover, :focus-visible) { background: var(--cobalt); }
html body .hb-film__rejouer:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- 2 bis. La rue cliquable ----------
   Quand le film s'arrête (.est-vivant), la scène vient par-dessus : une image fixe de la rue fermée, et un
   lien par commerce. Au survol, au clavier, au toucher (.est-ouvert) ou, au téléphone, quand on fait glisser la rue
   et que le commerce arrive devant soi (.est-devant), le rideau du commerce se relève :
   l'image du commerce rouvert est dévoilée de bas en haut dans chaque baie, une barre suit le bord (le bas du
   rideau), et sa lumière revient autour. Un clic ouvre la démo dans la fenêtre du site.
   Écran étroit (.est-etroit) : la scène est la rue entière, plus large que le cadre, que l'on fait glisser. */
html body .hb-film__cadre { container-type: inline-size; }
html body .hb-scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility 0s .35s; }
html body .hb-film.est-vivant .hb-scene { opacity: 1; visibility: visible; transition-delay: 0s; }
html body .hb-scene__piste { position: absolute; inset: 0; background: var(--hb-fond, none) 0 0 / 100% 100% no-repeat; }
html body .hb-commerce { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); z-index: 1; border-radius: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; -webkit-user-drag: none; }
html body .hb-commerce:focus-visible { outline: 2px solid #fff; outline-offset: -5px; }
html body .hb-jour { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); pointer-events: none; }
html body .hb-jour > i { position: absolute; inset: 0; background: var(--img, none) 0 0 / 100% 100% no-repeat; }
html body .hb-jour > .hb-jour__lueur {
  opacity: 0; transition: opacity .3s linear;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent), linear-gradient(transparent, #000 18%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent), linear-gradient(transparent, #000 18%, #000 94%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
html body .hb-jour > .hb-jour__baie { clip-path: inset(calc(100% - var(--b)) var(--r) var(--b) var(--l)); transition: clip-path .4s cubic-bezier(.5, 0, .8, .5) var(--d); }
html body .hb-jour > .hb-jour__barre {
  inset: auto var(--r) auto var(--l); top: calc(100% - var(--b)); height: 3px; margin-top: -3px; opacity: 0;
  background: linear-gradient(#4a5874 0 1px, #131a29 1px);
  transition: top .4s cubic-bezier(.5, 0, .8, .5) var(--d), margin-top .4s linear var(--d), opacity .08s linear calc(var(--d) + .38s);
}
html body .hb-commerce:is(:focus-visible, .est-ouvert, .est-devant) + .hb-jour > .hb-jour__lueur { opacity: 1; transition: opacity .5s var(--ease) .14s; }
html body .hb-commerce:is(:focus-visible, .est-ouvert, .est-devant) + .hb-jour > .hb-jour__baie { clip-path: inset(var(--t) var(--r) var(--b) var(--l)); transition: clip-path .6s cubic-bezier(.3, .02, .16, 1) var(--d); }
html body .hb-commerce:is(:focus-visible, .est-ouvert, .est-devant) + .hb-jour > .hb-jour__barre { top: var(--t); margin-top: 0; opacity: 1; transition: top .6s cubic-bezier(.3, .02, .16, 1) var(--d), margin-top .6s linear var(--d), opacity .06s linear var(--d); }
@media (hover: hover) {
  html body .hb-commerce:hover + .hb-jour > .hb-jour__lueur { opacity: 1; transition: opacity .5s var(--ease) .14s; }
  html body .hb-commerce:hover + .hb-jour > .hb-jour__baie { clip-path: inset(var(--t) var(--r) var(--b) var(--l)); transition: clip-path .6s cubic-bezier(.3, .02, .16, 1) var(--d); }
  html body .hb-commerce:hover + .hb-jour > .hb-jour__barre { top: var(--t); margin-top: 0; opacity: 1; transition: top .6s cubic-bezier(.3, .02, .16, 1) var(--d), margin-top .6s linear var(--d), opacity .06s linear var(--d); }
}

/* l'invitation, en bas à gauche du cadre : elle s'efface une fois qu'on a essayé */
html body .hb-film__aide {
  position: absolute; left: clamp(12px, 1.6vw, 22px); bottom: clamp(12px, 1.6vw, 22px); z-index: 2;
  max-width: calc(100% - 160px); margin: 0; padding: 12px 16px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 22px;
  background: rgba(9, 16, 36, .58); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: #fff; font: 500 .875rem/1.3 var(--f-studio); letter-spacing: .005em; text-wrap: balance; pointer-events: none;
  opacity: 0; transform: translateY(6px); transition: opacity .3s var(--ease), transform .3s var(--ease);
}
html body .hb-film.est-vivant:not(.a-compris) .hb-film__aide { opacity: 1; transform: none; transition-delay: .5s; }

/* écran étroit : la rue entière, à faire glisser ; deux boutons pour avancer sans glisser */
html body .hb-film.est-etroit .hb-scene { overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; cursor: grab; }
html body .hb-film.est-etroit .hb-scene::-webkit-scrollbar { display: none; }
/* la bande fait 3812 × 1350 et le cadre 4:5 : à hauteur égale elle est 3,53 fois plus large que lui */
html body .hb-film.est-etroit .hb-scene__piste { inset: 0 auto 0 0; width: 352.963%; }
html body .hb-film.est-etroit :is(.hb-commerce, .hb-jour) { left: var(--mx); top: var(--my); width: var(--mw); height: var(--mh); }
html body .hb-scene__pas {
  position: absolute; top: 50%; z-index: 2; display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin-top: -22px; padding: 0; border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%;
  background: rgba(9, 16, 36, .58); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; cursor: pointer;
  opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility 0s .25s, background-color var(--t-survol, .18s) var(--ease);
}
html body .hb-scene__pas svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html body .hb-scene__pas--avant { left: 12px; }
html body .hb-scene__pas--apres { right: 12px; }
/* en bas du cadre, sur la chaussée : [‹] l'invitation [›] ; « Revoir » monte en haut à droite */
html body .hb-film.est-etroit .hb-scene__pas { display: inline-flex; top: auto; bottom: 12px; margin-top: 0; }
html body .hb-film.est-etroit .hb-film__aide { left: 66px; right: 66px; bottom: 12px; max-width: none; min-height: 44px; padding: 7px 12px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: .8125rem; line-height: 1.25; border-radius: 16px; }
html body .hb-film.est-etroit .hb-film__rejouer { top: 12px; right: 12px; bottom: auto; min-height: 40px; }
html body .hb-film.est-etroit.est-vivant .hb-scene__pas.est-utile { opacity: 1; visibility: visible; transition-delay: 0s; }
html body .hb-scene__pas:is(:hover, :focus-visible) { background: var(--cobalt); }
html body .hb-scene__pas:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* l'heure du film, redessinée par-dessus la rue qui glisse (dans le film du téléphone elle est dans l'image) */
html body .hb-film__heure {
  position: absolute; left: 5%; top: 8.296%; z-index: 1; display: none; color: #fff; pointer-events: none;
  font: 600 5.74vw/1 var(--f-studio); font-size: 5.74cqw; letter-spacing: .01em; text-shadow: 0 .05em .3em rgba(5, 13, 36, .9);
  transform: translateY(-90%); opacity: 0; transition: opacity .35s var(--ease);   /* -90 % : la ligne de base tombe à 8,3 % du cadre, comme dans le film */
}
html body .hb-film.est-etroit .hb-film__heure { display: block; }
html body .hb-film.est-etroit.est-vivant .hb-film__heure { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  html body .hb-jour > i, html body .hb-scene, html body .hb-film__aide, html body .hb-film__heure { transition-duration: .01s !important; transition-delay: 0s !important; }
}

/* la légende, au milieu, juste sous le film : la phrase, puis la mention et ses deux liens */
html body .hb-film__legende { display: grid; justify-items: center; gap: clamp(10px, 1.2vw, 16px); padding-top: clamp(4px, .8vw, 12px); text-align: center; }
html body .hb-film__phrase { max-width: 36ch; margin: 0; color: var(--pierre-douce); font: 500 clamp(1.25rem, .95rem + 1.05vw, 1.8rem)/1.24 var(--f-studio); letter-spacing: -.018em; text-wrap: balance; }
html body .hb-film__phrase strong { color: var(--pierre); font-weight: 650; }
html body .hb-film__note { max-width: 40rem; margin: 0; color: var(--pierre-douce); font-size: .9375rem; line-height: 1.5; text-wrap: balance; }
html body .hb-film__liens { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; margin-top: 8px; }
html body .hb-film__note a { color: var(--pierre); white-space: nowrap; }
/* la rue remplace la pile de démos : un peu d'air avant la section suivante */
html body .hb-rue[id] { padding-bottom: clamp(40px, 6vw, 88px); scroll-margin-top: 88px; }

@media (width < 720px) {
  html body .hb-film__cadre { aspect-ratio: 4 / 5; border-radius: 20px; }
}

/* le cadre s'installe pendant qu'il entre dans l'écran */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    html body .hb-film__cadre { animation: hb-pose linear both; animation-timeline: view(); animation-range: entry 5% entry 95%; }
    @keyframes hb-pose { from { transform: translateY(28px) scale(.945); } to { transform: none; } }
  }
}

/* ---------- 3. Sections sombres : la lumière vient d'en haut ---------- */
html body :is(.dm-ecrans, #contact).v-section--stone {
  background-image: radial-gradient(64% 52% at 50% -14%, rgba(70, 118, 235, .24), rgba(70, 118, 235, 0) 72%);
  background-repeat: no-repeat;
}

/* ---------- 4. L'horizon ---------- */
html body #contact.v-section--stone:has(.hb-horizon) { padding-bottom: 0; }
html body .hb-horizon {
  aspect-ratio: 1920 / 244; margin-top: clamp(40px, 5vw, 72px);
  background: url("/assets/hb/horizon.svg?v=0ba28b3d") no-repeat 50% 100% / 100% auto;
  -webkit-mask-image: linear-gradient(#000 30%, rgba(0, 0, 0, .35)); mask-image: linear-gradient(#000 30%, rgba(0, 0, 0, .35));
}
@media (width < 720px) {
  html body .hb-horizon { aspect-ratio: 960 / 244; background-size: 200% auto; background-position: 84% 100%; }
}

/* ---------- 5. Menu boards : deux écrans dans le même téléviseur ----------
   Par-dessus l'écran HITOKUCHI (du HTML animé), une couche pour l'écran de la boulangerie (un film de la vraie TV).
   Deux boutons sous le téléviseur choisissent ; ils n'apparaissent que si le script tourne (.est-pret). */
html body .hb-chaine { position: absolute; inset: 0; z-index: 3; background: #131b30; opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility 0s .35s; }
html body [data-hb-ecrans][data-chaine="grigne"] .hb-chaine { opacity: 1; visibility: visible; transition-delay: 0s; }
html body [data-hb-ecrans][data-chaine="grigne"] .mb { display: none; }   /* retiré, donc à l'arrêt : il repart du début quand on y revient */
html body .hb-chaine :is(video, img) { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
html body .hb-chaines { display: none; width: max-content; max-width: 100%; margin: 18px auto 0; padding: 4px; gap: 4px; border: 1px solid rgba(244, 245, 242, .16); border-radius: 999px; background: rgba(244, 245, 242, .06); }
html body [data-hb-ecrans].est-pret .hb-chaines { display: flex; }
html body .hb-chaines__b {
  min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  color: rgba(244, 245, 242, .74); font: 600 .9375rem/1 var(--f-studio); letter-spacing: .005em;
  transition: background-color var(--t-survol, .18s) var(--ease), color var(--t-survol, .18s) var(--ease);
}
html body .hb-chaines__b:hover { color: #fff; }
html body .hb-chaines__b[aria-pressed="true"] { background: var(--chaux, #f4f5f2); color: var(--pierre, #161c22); }
html body .hb-chaines__b:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
html body [data-hb-ecrans].est-pret .dm-ecrans__legende { margin-top: 12px; }

@media print { html body .hb-rue, html body .hb-horizon, html body .hb-chaines { display: none; } }
