/* ecran.css — mise en page, couleurs, réactivité, transitions du clic, brillance des portes.
   Une seule responsabilité : comment ça se voit et comment ça se place.
   Aucun calcul 3D ici (c'est js/scene.js, js/boule.js, js/sol.js, js/mot.js). */

:root {
  --fond: #06060a;
  --fond2: #0b0c12;
  --verre: #0f1117;
  --or: #c8a44d;
  --or-clair: #f0d98a;
  --ivoire: #ede9e0;
  --faible: #8a8578;
  --trait: #23252c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: radial-gradient(120% 90% at 50% -10%, #1a1408 0%, var(--fond2) 48%, var(--fond) 100%);
  color: var(--ivoire);
  font-family: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  overflow: hidden;
}

/* Titre lu par les moteurs de recherche et les lecteurs d'écran, invisible à l'écran. */
.invisible {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- la salle (canvas three.js) ---------- */
#scene { position: fixed; inset: 0; z-index: 0; }
#scene canvas { display: block; }

/* ---------- secours : la 3D n'est pas disponible ---------- */
.secours {
  position: fixed;
  top: 26%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}
.secours-mot {
  font-weight: 700;
  font-size: 54px;
  letter-spacing: 15px;
  background: linear-gradient(92deg, #e9b44c, #f0c75e 55%, #c9972b);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- l'habillage : phrase + trois portes ---------- */
/* Empilé en colonne (phrase PUIS portes) : les deux se suivent dans le flux, donc ils ne peuvent
   pas se chevaucher, quelle que soit la taille de l'écran. Avant, chacun était posé en % du bas
   et se recouvraient sur téléphone. */
.habillage {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: clamp(16px, 3.4vh, 40px);
  padding: 0 16px clamp(26px, 7vh, 64px);
  transition: opacity .5s ease, transform .5s ease;
}

.phrase {
  margin: 0;
  font-size: clamp(16px, 1.6vw, 22px);
  letter-spacing: .5px;
  color: var(--ivoire);
  text-shadow: 0 0 26px rgba(200, 164, 77, .40);
  text-align: center;
  white-space: nowrap;
}

/* de droite à gauche : la première porte du HTML est posée à droite */
.choix {
  display: flex;
  flex-direction: row-reverse;
  gap: clamp(10px, 1.4vw, 20px);
  pointer-events: auto;
  max-width: 100%;
}

/* Les portes brillent : bordure qui respire + lumière qui traverse, en boucle. */
.porte {
  position: relative;
  overflow: hidden;
  min-width: clamp(118px, 12vw, 186px);
  padding: 18px 30px;
  background: rgba(15, 17, 23, .55);
  color: var(--ivoire);
  border: 1px solid var(--trait);
  border-radius: 2px;
  font: inherit;
  font-size: clamp(13px, 1.2vw, 16px);
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: border-color .25s, color .25s, transform .25s, background .25s;
  animation: lueur 4.2s ease-in-out infinite;
}
.porte:nth-of-type(2) { animation-delay: 1.4s; }
.porte:nth-of-type(3) { animation-delay: 2.8s; }

/* la lumière qui traverse la porte */
.porte::after {
  content: "";
  position: absolute;
  top: -30%; bottom: -30%;
  left: -80%;
  width: 55%;
  background: linear-gradient(100deg, rgba(255, 244, 214, 0), rgba(255, 244, 214, .42), rgba(255, 244, 214, 0));
  transform: skewX(-18deg);
  animation: balayage 4.2s linear infinite;
  pointer-events: none;
}
.porte:nth-of-type(2)::after { animation-delay: 1.4s; }
.porte:nth-of-type(3)::after { animation-delay: 2.8s; }

.porte:hover, .porte:focus-visible {
  border-color: var(--or);
  color: var(--or-clair);
  background: rgba(26, 21, 10, .7);
  transform: translateY(-3px);
  outline: none;
}

@keyframes lueur {
  0%, 100% { box-shadow: 0 0 0 1px rgba(200, 164, 77, .30), 0 0 18px rgba(200, 164, 77, .10) inset; }
  50%      { box-shadow: 0 0 0 1px rgba(240, 217, 138, .70), 0 0 34px rgba(200, 164, 77, .26) inset, 0 0 46px rgba(200, 164, 77, .18); }
}

@keyframes balayage {
  0%        { left: -80%; }
  55%, 100% { left: 130%; }
}

/* ---------- la transition du clic ---------- */
body.vers-forme .habillage { opacity: 0; transform: translateY(14px); pointer-events: none; }
body.vers-forme #scene { animation: embrasement 900ms ease forwards; }

@keyframes embrasement {
  0%   { filter: none; }
  35%  { filter: brightness(1.55) saturate(1.25); }
  100% { filter: brightness(.7) blur(1.6px); }
}

/* ---------- le formulaire ---------- */
.devis {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity .45s ease;
}
.devis[hidden] { display: none; }
.devis.visible { opacity: 1; }

.devis-cadre {
  position: relative;
  width: min(560px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px 26px 22px;
  background: linear-gradient(180deg, rgba(15, 17, 23, .96), rgba(11, 12, 18, .97));
  border: 1px solid var(--trait);
  border-top-color: rgba(200, 164, 77, .55);
  border-radius: 3px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65), 0 0 60px rgba(200, 164, 77, .07);
}
.devis-retour {
  position: absolute;
  top: 14px; right: 14px;
  background: none;
  border: 1px solid var(--trait);
  color: var(--faible);
  width: 32px; height: 32px;
  border-radius: 2px;
  cursor: pointer;
  font: inherit;
  transition: color .2s, border-color .2s;
}
.devis-retour:hover { color: var(--or-clair); border-color: var(--or); }

.devis h2 {
  margin: 0 0 6px;
  font-size: clamp(18px, 1.8vw, 23px);
  font-weight: 600;
  letter-spacing: .3px;
}
.devis-etat { margin: 0 0 18px; color: var(--faible); font-size: 13px; }

.devis label {
  display: block;
  margin: 14px 0 6px;
  font-size: 12px;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--faible);
}
.devis input, .devis select, .devis textarea {
  width: 100%;
  padding: 11px 12px;
  background: #0a0b10;
  border: 1px solid var(--trait);
  border-radius: 2px;
  color: var(--ivoire);
  font: inherit;
  font-size: 15px;
}
.devis input:focus, .devis select:focus, .devis textarea:focus {
  outline: none;
  border-color: var(--or);
  box-shadow: 0 0 0 1px rgba(200, 164, 77, .3);
}
.envoi {
  width: 100%;
  margin-top: 20px;
  padding: 14px;
  background: linear-gradient(180deg, var(--or-clair), var(--or));
  color: #14100a;
  border: 0;
  border-radius: 2px;
  font: inherit;
  font-weight: 700;
  letter-spacing: .6px;
  cursor: pointer;
  transition: filter .2s, transform .2s;
}
.envoi:hover { filter: brightness(1.08); transform: translateY(-1px); }
.devis-ok {
  margin: 16px 0 0;
  color: var(--or-clair);
  font-size: 14px;
  text-align: center;
}

/* Masquage réel dans le formulaire : .devis label impose display:block, qui gagnerait
   contre le [hidden] par défaut → sans cette règle, l'étiquette restait visible. */
.devis [hidden] { display: none !important; }

/* ---------- la porte discrète : « vous n'avez pas encore de commerce ? » ---------- */
.lien-projet {
  display: block;
  width: 100%;
  margin: 18px 0 0;
  padding: 14px 0 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--trait);
  color: var(--faible);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: color .2s;
}
.lien-projet:hover { color: var(--or-clair); }
.bloc-projet { margin-top: 2px; }

@media (max-width: 680px) {
  .habillage { gap: 26px; padding: 0 14px 24px; }
  .phrase { white-space: normal; width: 92%; }
  .choix { flex-direction: column-reverse; width: 92%; gap: 10px; }
  .porte { width: 100%; padding: 14px 18px; }
  .secours-mot { font-size: 34px; letter-spacing: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  body.vers-forme #scene { animation: none; }
  .porte, .porte::after { animation: none; }
}

/* (entrée « Direction » retirée le 17/09/26 : l'écran interne n'est plus lié depuis le site) */

