/* 2. L'ouverture (la journée qui passe) et le plan */

.ouverture { position: relative; background: #0f1236; }
.ciel {
  position: relative; display: grid; grid-template: minmax(0, 1fr) auto / minmax(0, 1fr); overflow: clip;
  min-height: min(calc(100svh - var(--entete)), 1000px);
  background: linear-gradient(#9fb4d6, #f1c6ae 48%, #fbe2bd 80%);
}

/* La plaque de rue : émail bleu, filet blanc, quatre vis */
.plaque {
  position: relative; z-index: 2; grid-area: 1 / 1; justify-self: start; align-self: start;
  margin: clamp(10px, 2.6vh, 34px) var(--marge) 0; padding: clamp(10px, 1.6vh, 20px) clamp(22px, 2.4vw, 40px) clamp(12px, 1.7vh, 20px);
  color: #fff; border-radius: 7px;
  background: radial-gradient(130% 160% at 22% 0%, #2a57ad, var(--email) 46%, var(--email-fonce));
  box-shadow: inset 0 0 0 4px var(--email), inset 0 0 0 7px #f3f5fb, 0 2px 0 #0a1d47, 0 14px 26px rgb(30 18 50 / .34);
}
.plaque::before {
  content: ""; position: absolute; inset: 12px; pointer-events: none;
  --vis: radial-gradient(circle at 38% 32%, #fff, #b9bfcc 45%, #5c6476 75%, transparent 78%);
  background: var(--vis) 0 0 / 9px 9px, var(--vis) 100% 0 / 9px 9px, var(--vis) 0 100% / 9px 9px, var(--vis) 100% 100% / 9px 9px;
  background-repeat: no-repeat;
}
.plaque h1 { font: 700 clamp(2.5rem, min(6.6vw, 11vh), 6.3rem)/.95 var(--titre); letter-spacing: -.005em; white-space: nowrap; }
.plaque p { margin-top: clamp(6px, 1vh, 12px); font-size: clamp(1rem, 1.2vw, 1.18rem); line-height: 1.35; }

/* L'heure est derrière les toits, comme un soleil de plus */
.grande-heure {
  position: absolute; z-index: 0; right: var(--marge); top: clamp(2px, 1.5vh, 24px);
  color: #140d22; font: 700 min(15vw, 26svh)/.86 var(--titre); letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
/* Écran bas : la rue garde ses toits, et c'est le bas de la chaussée qui passe sous le trottoir */
.grande-heure.sur-sombre { color: #fff; }
.defile { position: relative; z-index: 1; grid-area: 1 / 1; align-self: safe end; min-height: 0; }
.panorama { position: relative; contain: layout style; }
.panorama > .dessin { display: block; width: 100%; height: auto; overflow: visible; }
.panorama > picture img { width: 100%; height: auto; }

.facades a { position: absolute; display: grid; align-items: end; justify-items: center; text-decoration: none; }
.facades span { margin-bottom: -6px; padding: 5px 10px; background: var(--email-fonce); color: #fff; font-size: .95rem; font-weight: 600; border-radius: 3px; white-space: nowrap; opacity: 0; }
/* Le dernier nom, plus large que sa devanture, se cale au bord droit de la rue */
.facades a:last-child { grid-template-columns: minmax(0, 1fr); justify-items: end; padding-right: 8px; }
.facades a:focus-visible { box-shadow: inset 0 0 0 5px #14123a; outline-offset: -3px; }
.facades a:focus-visible span, .facades .a-cette-heure span { opacity: 1; }
@media (hover: hover) {
  .facades a:hover { box-shadow: inset 0 0 0 3px #fffaf0; }
  .facades a:hover span { opacity: 1; }
}
/* Sans le dessin vivant, les liens gardent une place raisonnable */
.facades a { top: 34%; height: 50%; width: 13%; }
.facades a:nth-child(1) { left: 3.2%; } .facades a:nth-child(2) { left: 16.3%; } .facades a:nth-child(3) { left: 29%; }
.facades a:nth-child(4) { left: 44%; } .facades a:nth-child(5) { left: 57%; } .facades a:nth-child(6) { left: 71.3%; } .facades a:nth-child(7) { left: 84.5%; }

/* Le trottoir porte les commandes */
.trottoir { position: relative; z-index: 2; grid-area: 2 / 1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 30px; padding: 10px var(--marge); background: #221a35; color: #fff3e0; }
.entrer { display: inline-flex; align-items: center; min-height: 46px; padding: 0 20px; background: #ffd466; color: #221a35; font-weight: 600; text-decoration: none; border-radius: 3px; }
.entrer:hover { background: #fff3e0; }
.consigne { flex: 1 1 20ch; font-size: .98rem; }
.volets-commande { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.volets-commande label { display: flex; align-items: center; gap: 10px; font-size: .95rem; }
.volets-commande input { width: 120px; accent-color: #ffd466; }
.volets-commande output { min-width: 4em; font-variant-numeric: tabular-nums; }
@media (hover: hover) { .volets-commande button:hover { background: #fff3e0; color: #221a35; } }

/* Grand écran : la rue reste en place pendant que la journée passe */
@media (min-width: 761px) and (min-height: 520px) {
  [data-motion="full"] .ouverture { height: 250vh; }
  [data-motion="full"] .ciel { position: sticky; top: var(--entete); height: calc(100svh - var(--entete)); min-height: 0; }
}

@media (min-width: 2000px) and (min-height: 1000px) {
  .grande-heure { top: 2px; font-size: min(13vw, 21svh); }
}

/* Écran bas : la plaque et l'heure restent au-dessus des toits */
@media (min-width: 761px) and (max-height: 760px) {
  .plaque h1 { font-size: min(5.2vw, 9.4vh); }
  .grande-heure { font-size: 21svh; }
}
[data-motion="reduce"] .volets-commande, [data-motion="reduce"] .consigne { display: none; }

/* Mouvement réduit : trois images fixes, l'une sous l'autre */
.image-fixe { position: relative; overflow: clip; border-top: 6px solid #221a35; }
.image-fixe img { width: 100%; }
.image-fixe figcaption { position: absolute; left: var(--marge); top: 20px; padding: 6px 14px; background: var(--email-fonce); color: #fff; font-weight: 600; border-radius: 3px; }

/* Téléphone : la rue se parcourt avec le pouce, et l'heure avance avec elle */
@media (max-width: 760px) {
  .ciel { min-height: 0; }
  .plaque { margin: 18px; max-width: none; justify-self: stretch; }
  .plaque h1 { font-size: 11.2vw; }
  .ciel { grid-template-rows: auto auto auto auto; }
  .grande-heure { position: relative; inset: auto; z-index: 2; pointer-events: none; grid-area: 2 / 1; padding: 4px 18px 0; font-size: 27vw; line-height: .9; }
  /* Le dessin reste devant l'écran, la piste est longue comme la rue : le pouce tire la rue, le ciel ne bouge pas */
  .defile { grid-area: 2 / 1; padding-top: 4vw; overflow-x: auto; overflow-y: clip; scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
  .panorama { width: 344.615%; }
  .panorama > .dessin { position: sticky; left: 0; width: 29.018%; aspect-ratio: 390 / 602; }
  .panorama > picture img { width: 100%; }
  /* Sans JavaScript, la rue ne glisse pas : les liens passent dessous, en liste */
  html:not([data-motion]) .panorama { width: 100%; }
  html:not([data-motion]) .panorama > .dessin { position: static; width: 100%; }
  html:not([data-motion]) .facades { display: none; }
  .facades a { scroll-snap-align: center; }
  .trottoir { grid-area: 4 / 1; padding: 12px 18px 16px; }
  .entrer { width: 100%; justify-content: center; }
  .consigne { display: none; }
  .image-fixe img { aspect-ratio: 390 / 602; }
}

/* La devanture qui s'ouvre en fiche */
.voile-page { position: fixed; inset: 0; z-index: 20; opacity: 0; background: var(--haut); }
.volante { position: fixed; z-index: 21; overflow: hidden; border-radius: 4px; box-shadow: 0 18px 50px rgb(20 10 40 / .4); }
.volante svg { width: 100%; height: 100%; }

/* ---------- Le plan : huit bandes, la lumière de chaque heure ---------- */
.plan { padding: clamp(40px, 7vh, 84px) var(--marge) clamp(30px, 5vh, 60px); background: #0f1236; color: #fff3e0; }
.plan h2 { font: 700 clamp(2.6rem, 6vw, 5.6rem)/.95 var(--titre); }
.plan > p { margin: 10px 0 26px; font-size: 1.15rem; }
.plan ol { display: flex; gap: 0; margin-inline: calc(-1 * var(--marge)); }
.plan li { flex: 1 1 0; min-width: 0; }
.plan a { display: flex; flex-direction: column; min-height: clamp(320px, 56vh, 520px); padding: 18px 14px 16px; background: linear-gradient(var(--haut), var(--bas)); color: var(--encre); text-decoration: none; }
/* Un objet par boutique, posé au milieu de la bande */
.plan a img { width: 100%; height: clamp(110px, 20vh, 190px); margin: auto 0; object-fit: contain; }
.plan time { font: 700 clamp(1.9rem, 3vw, 3.2rem)/1 var(--titre); }
.plan b { font: 700 clamp(1.3rem, 1.65vw, 1.75rem)/1.05 var(--titre); overflow-wrap: anywhere; }
.plan a span { margin-top: 6px; font-size: .94rem; line-height: 1.25; color: var(--doux); }
.plan a:focus-visible { outline-offset: -6px; box-shadow: inset 0 0 0 4px #14123a; }
@media (hover: hover) {
  [data-motion="full"] .plan li { transition: flex-grow .35s cubic-bezier(.2, .8, .2, 1); }
  [data-motion="full"] .plan img { transition: translate .35s cubic-bezier(.2, .8, .2, 1); }
  [data-motion="full"] .plan a:hover img { translate: 0 -10px; }
  .plan li:hover { flex-grow: 1.5; }
  .plan a:hover b { text-decoration: underline; text-underline-offset: .15em; }
}
@media (max-width: 1000px) {
  .plan ol { display: grid; }
  .plan a { display: grid; grid-template-columns: 5rem 1fr 64px; min-height: 0; padding: 12px var(--marge); align-items: center; }
  .plan a img { grid-area: 1 / 3 / 3 / 4; width: 64px; height: 58px; }
  .plan a span { grid-column: 2; margin-top: 0; }
  .plan time { grid-row: 1 / 3; font-size: 2rem; }
  .plan b { margin: 0; }
}
