/* Gacem & Fils · maquette de la page d'accueil (mobile uniquement). */

:root {
  --marine: #000073;
  --or: #cbaa5c;
  --blanc-casse: #f9f9f9;
  --texte: #333333;
  --fond-bureau: #e6e4df;
  --ciel: #4f7fbd; /* couleur d'attente de la scène, prise dans le ciel de l'image 0 */
  --voile-couleur: 10, 10, 14;
  --voile-marge: 160px; /* hauteur du dégradé au-delà du texte */

  --colonne: 430px;
  --marge: 24px;
  --entete: calc(env(safe-area-inset-top) + 60px);
  --barre-h: 48px;
  --barre-bas: max(14px, env(safe-area-inset-bottom));
  --bas-chapitre: calc(var(--barre-h) + var(--barre-bas) + 28px);

  --courbe: cubic-bezier(0.25, 0.1, 0.25, 1);
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Questrial", "Avenir Next", "Century Gothic", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--fond-bureau);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0 auto;
  max-width: var(--colonne);
  min-height: 100vh;
  background: var(--blanc-casse);
  color: var(--texte);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

html.menu-ouvert { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; }
.bouton:focus-visible, .barre__appel:focus-visible { outline-color: var(--or); }
h1, h2, p, dl, dd, ul { margin: 0; padding: 0; }
ul { list-style: none; }

.masque {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Éléments fixes, alignés sur la colonne centrale sur ordinateur. */
.fixe {
  position: fixed;
  left: 50%;
  width: min(100%, var(--colonne));
  transform: translateX(-50%);
}

.label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* --- Progression ---------------------------------------------------------- */

.progression {
  top: 0;
  height: 2px;
  z-index: 40;
  pointer-events: none;
}
.progression span {
  display: block;
  height: 100%;
  background: var(--or);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* --- En-tête ------------------------------------------------------------- */

.entete {
  top: 0;
  z-index: 30;
  height: var(--entete);
  padding: env(safe-area-inset-top) 8px 0 var(--marge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}
/* Léger voile pour que « Menu » reste lisible sur un plafond blanc. */
.entete::before {
  content: "";
  position: absolute;
  inset: 0 0 -40px;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(var(--voile-couleur), 0.34), rgba(var(--voile-couleur), 0));
  pointer-events: none;
  transition: opacity 0.5s var(--courbe);
}
.est-au-pied .entete::before { opacity: 0; }

.entete__logo {
  display: block;
  width: 112px;
  padding: 7px 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--courbe), visibility 0s linear 0.5s;
}
.avec-logo .entete__logo {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.entete__menu {
  min-width: 64px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  background: none;
  color: inherit;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}

/* Au-dessus du pied de page blanc cassé, l'en-tête passe en bleu marine. */
.est-au-pied .entete { color: var(--marine); }
.est-au-pied .entete__logo { opacity: 0; visibility: hidden; }

/* --- Menu ------------------------------------------------------------------ */

.menu {
  top: 0;
  bottom: 0;
  z-index: 50;
  padding: env(safe-area-inset-top) var(--marge) calc(env(safe-area-inset-bottom) + 32px);
  display: flex;
  flex-direction: column;
  background: var(--blanc-casse);
  color: var(--marine);
}
.menu[hidden] { display: none; }

.menu__haut {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-right: -16px;
}
.menu__haut img { width: 112px; }
.menu__fermer {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  background: none;
  color: inherit;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
}

.menu__liens {
  margin-top: 12vh;
  display: grid;
  gap: 6px;
}
.menu__liens a {
  display: block;
  padding: 6px 0;
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.2;
  text-decoration: none;
}
.menu__liens a:hover, .menu__liens a:focus-visible { font-style: italic; }

.menu__contact {
  margin-top: auto;
  display: grid;
  gap: 4px;
  font-size: 15px;
}
.menu__contact a {
  display: inline-block;
  padding: 10px 0;
  text-decoration: none;
  color: var(--texte);
}

/* --- Visite (scrub au scroll) ---------------------------------------------- */

.visite {
  position: relative;
  height: 1000vh; /* remplacé par main.js selon le réglage du scroll */
  background: #111;
}

.scene {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  background: var(--ciel);
}

.scene__affiche,
.scene__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.scene__affiche { object-fit: cover; }

.chapitres {
  position: absolute;
  inset: 0 0 auto;
  height: 100vh;
  height: 100svh; /* jamais sous la barre d'adresse de Safari */
  pointer-events: none;
}

.chapitre {
  position: absolute;
  inset: 0;
}

.chapitre__texte {
  position: absolute;
  left: 0;
  right: 0;
  padding: 0 var(--marge);
  isolation: isolate;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition:
    opacity 0.5s var(--courbe),
    transform 0.5s var(--courbe),
    visibility 0s linear 0.5s;
}
.chapitre.est-actif .chapitre__texte {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition-delay: 0s;
}

/* Dégradé sombre derrière le texte, du bord de l'écran jusqu'au-delà du texte. */
.chapitre__texte::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: -1;
  pointer-events: none;
}
.chapitre--bas .chapitre__texte { bottom: var(--bas-chapitre); }
.chapitre--bas .chapitre__texte::before {
  top: calc(-1 * var(--voile-marge));
  bottom: calc(-1 * var(--bas-chapitre));
  background: linear-gradient(to top,
    rgba(var(--voile-couleur), var(--voile)) 0%,
    rgba(var(--voile-couleur), var(--voile)) 70%,
    rgba(var(--voile-couleur), calc(var(--voile) * 0.55)) 86%,
    rgba(var(--voile-couleur), 0) 100%);
}
.chapitre--haut .chapitre__texte { top: calc(var(--entete) + 20px); }
.chapitre--haut .chapitre__texte::before {
  top: calc(-1 * (var(--entete) + 20px));
  bottom: calc(-1 * var(--voile-marge));
  background: linear-gradient(to bottom,
    rgba(var(--voile-couleur), var(--voile)) 0%,
    rgba(var(--voile-couleur), var(--voile)) 70%,
    rgba(var(--voile-couleur), calc(var(--voile) * 0.55)) 86%,
    rgba(var(--voile-couleur), 0) 100%);
}

.chapitre .label { color: rgba(255, 255, 255, 0.92); }

.titre {
  margin-top: 14px;
  max-width: 13em;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.titre em { font-style: italic; }

.texte {
  margin-top: 14px;
  max-width: 31em;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.94);
  text-wrap: pretty;
}

/* Accueil : petite ligne et invitation à faire défiler. */
.chapitre--accueil { --voile-marge: 110px; }
.indice {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}
.indice__trait {
  position: relative;
  width: 1px;
  height: 34px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.35);
}
.indice__trait::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 14px;
  background: #fff;
  transform: translateY(-14px);
  animation: indice 2.4s var(--courbe) infinite;
}
@keyframes indice {
  0% { transform: translateY(-14px); }
  60%, 100% { transform: translateY(34px); }
}

/* Terrasse : la barre du bas est masquée, les boutons prennent sa place. */
.chapitre--terrasse { --bas-chapitre: calc(max(20px, env(safe-area-inset-bottom)) + 4px); }
.villes {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.94);
  text-wrap: balance;
}
.villes span { white-space: nowrap; }
.actions {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}
.instagram {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
}
.instagram a {
  display: inline-block;
  padding: 12px 0;
  color: rgba(255, 255, 255, 0.94);
  text-decoration: none;
}
.instagram span {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* --- Boutons --------------------------------------------------------------- */

.bouton {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 2px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.bouton--or {
  background: var(--or);
  color: var(--marine);
}
.bouton--contour {
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: #fff;
  letter-spacing: 0.12em;
}

/* --- Barre du bas ----------------------------------------------------------- */

.barre {
  bottom: 0;
  z-index: 20;
  display: flex;
  gap: 10px;
  padding: 0 16px var(--barre-bas);
  transition: opacity 0.3s var(--courbe), visibility 0s linear 0s;
}
.barre .bouton { flex: 1; }
.barre__appel {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--barre-h);
  height: var(--barre-h);
  border-radius: 50%;
  background: var(--marine);
  color: #fff;
}
.sans-barre .barre {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--courbe), visibility 0s linear 0.3s;
}

/* --- Pied de page ------------------------------------------------------------ */

.pied {
  position: relative;
  padding: 72px var(--marge) calc(var(--barre-h) + var(--barre-bas) + 40px);
  background: var(--blanc-casse);
  color: var(--texte);
}
.pied__logo { width: 210px; }
.pied__intro { margin-top: 28px; color: var(--texte); }
.pied__contacts {
  margin-top: 40px;
  display: grid;
  gap: 14px;
}
.pied__contacts dt { color: #5c5c5c; }
.pied__contacts dd a {
  display: inline-block;
  padding: 10px 0;
  font-size: 17px;
  color: var(--marine);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.pied__bas {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: #5c5c5c;
}
.pied__bas a {
  display: inline-block;
  padding: 13px 0;
  margin: -13px 0;
  color: inherit;
}

.mesure {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 100vh;
  height: 100svh;
  visibility: hidden;
  pointer-events: none;
}

/* --- Petits écrans (iPhone SE) ---------------------------------------------- */

@media (max-height: 700px) {
  .titre { font-size: 28px; }
  .texte { font-size: 15px; }
  .chapitre--haut .chapitre__texte { top: calc(var(--entete) + 8px); }
  .actions { margin-top: 16px; }
  .villes, .titre, .texte { margin-top: 10px; }
}

/* --- Réduire les animations : les 6 images d'arrêt l'une sous l'autre ------ */

.mode-reduit .visite { height: auto !important; background: none; }
.mode-reduit .scene { position: static; height: auto; background: none; }
.mode-reduit .scene__affiche,
.mode-reduit .scene__canvas { display: none; }
.mode-reduit .chapitres { position: static; height: auto; pointer-events: auto; }
.mode-reduit .chapitre {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  background: var(--ciel) center / cover no-repeat;
  background-image: var(--image);
}
.mode-reduit .chapitre__texte,
.mode-reduit .chapitre.est-actif .chapitre__texte {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: none;
}
.mode-reduit .logo-ciel {
  position: absolute;
  left: 12.5%;
  width: 75%;
  top: 28%;
  transform: translateY(-50%);
}
.mode-reduit .entete__logo,
.mode-reduit .entete::before,
.mode-reduit .barre { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .indice__trait::after { animation: none; transform: none; }
}
