/* =========================================================
   Page d'accueil OBEA — chargée uniquement sur index.php
   Le bâtiment reste au centre ; autour, un "tableau d'ascenseur" :
   afficheur d'étage sous le bâtiment, panneau de boutons à droite.
   ========================================================= */

body.home {
  --lamp: #f3c74f;           /* lumière des fenêtres */
  --steel: #1a232e;          /* plaque du panneau */
  --steel-edge: #33414f;
  --font-display: "Saira", -apple-system, "Segoe UI", Arial, sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", Arial, sans-serif;
  font-family: var(--font-body);
}
body.home .site-header .logo { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.5px; }

.home-main h1, .home-main h2, .home-main h3 { font-family: var(--font-display); color: var(--text); }
.home-main p { color: var(--text-muted); }
.home-main a:focus-visible,
.home-main .home-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* --- Boutons --- */
.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #06241a;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.home-btn:hover { text-decoration: none; background: #3fd8a3; }
.home-btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--steel-edge);
}
.home-btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.home-btn i { font-size: 18px; }

/* =========================================================
   HERO : texte | bâtiment | panneau
   ========================================================= */
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 530px) minmax(0, 1fr);
  align-items: center;
  column-gap: 40px;
  row-gap: 18px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 32px 48px;
}
/* halo discret derrière le bâtiment */
.home-hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 55%;
  width: min(680px, 100%);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(47,191,143,0.10), rgba(47,191,143,0.03) 55%, transparent);
  pointer-events: none;
  z-index: 0;
}
.home-hero > * { position: relative; z-index: 1; }

/* titre plus petit, centré au-dessus du bâtiment, comme le site d'origine */
.hero-copy { grid-column: 1 / -1; justify-self: center; text-align: center; max-width: 640px; }
.hero-copy h1 {
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin: 0 0 6px;
  text-wrap: balance;
}
.hero-motto {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--accent) !important;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-building { grid-column: 2; }

/* --- Image de l'étage, fondue dans le fond, à gauche du bâtiment --- */
.floor-cards { grid-column: 1; justify-self: end; align-self: stretch; position: relative; width: 100%; max-width: 380px; min-height: 420px; }
.floor-card {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  text-align: center;
  padding: 0 16px 80px;   /* le texte se pose à la hauteur du sol du bâtiment */
  color: var(--text-muted);
  opacity: 0; pointer-events: none;
  transition: opacity .7s ease;
}
.floor-card.is-active { opacity: 1; pointer-events: auto; }
.floor-card:hover { text-decoration: none; }
.floor-card img, .fc-icon {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: -1;
  /* fondu très progressif : l'image se perd dans le fond de la page, sans bord visible */
  -webkit-mask-image: radial-gradient(closest-side at 50% 45%, #000 0%, #000 42%, rgba(0,0,0,.8) 60%, rgba(0,0,0,.45) 76%, rgba(0,0,0,.15) 90%, transparent 100%);
          mask-image: radial-gradient(closest-side at 50% 45%, #000 0%, #000 42%, rgba(0,0,0,.8) 60%, rgba(0,0,0,.45) 76%, rgba(0,0,0,.15) 90%, transparent 100%);
  opacity: 1;
}
.floor-card { isolation: isolate; }
.fc-icon { display: grid; place-items: center; opacity: .5; }
.fc-icon i { font-size: 150px; color: var(--accent); opacity: .35; }
.fc-floor { font: 600 13px var(--font-display); color: var(--accent); text-shadow: 0 1px 8px #0f1620; }
.fc-title { margin: 2px 0 6px; font: 700 24px/1.15 var(--font-display); color: var(--text); text-shadow: 0 2px 14px #0f1620, 0 0 2px #0f1620; }
.fc-text { font-size: 14px; line-height: 1.5; color: #c4ccd2; max-width: 32ch; text-shadow: 0 1px 10px #0f1620, 0 0 2px #0f1620; }

/* --- Bâtiment (structure existante, recalée dans la colonne centrale) --- */
.hero-building { width: 100%; }
body.home .elevator-hero { padding: 0; }
body.home .building-stage { max-width: 550px; margin: 0 auto; }
body.home .fullwidth-triggers {
  /* les zones de survol couvrent le bâtiment seulement, plus toute la largeur de l'écran */
  left: 0;
  top: 0;
  width: 100%;
  transform: none;
}
body.home .window-light.lit { filter: drop-shadow(0 0 10px rgba(243,199,79,0.55)); }

/* --- Nom de l'étage sous le bâtiment (effet glitch d'origine) --- */
body.home .elevator-hero { align-items: center; }
body.home .lift-display .lift-floor { display: none; }
body.home .label-zone { margin-top: 18px; min-height: 44px; }
body.home .label-zone #labelZoneText {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 800;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

/* =========================================================
   Boîte à boutons d'ascenseur (écran HD + boutons ronds)
   ========================================================= */
.cop {
  grid-column: 3;
  justify-self: start;
  zoom: .52;            /* boîte discrète à côté du logo */
  margin-left: 110px;   /* un peu décalée vers la droite (≈ 57 px à l'écran) */
  width: 224px;
  padding: 18px;
  border-radius: 20px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(165deg, #1b232c, #090d11 60%);
  box-shadow: 0 0 0 1px #2f3a45, 0 0 0 4px #10161c, 0 0 0 5px #3b4652, 0 40px 60px -30px #000;
}
.cop::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.08), transparent 35%); pointer-events: none; }

.cop-bezel { position: relative; width: 184px; margin: 0 auto; padding: 7px; border-radius: 12px; background: #040507; box-shadow: 0 0 0 2px #2a333d, inset 0 0 0 1px #000; }
.cop-bezel::after { content: ""; position: absolute; inset: 7px; border-radius: 6px; background: linear-gradient(125deg, rgba(255,255,255,.10), transparent 32%); pointer-events: none; }
.cop-screen { width: 170px; height: 110px; border-radius: 6px; overflow: hidden; display: flex; background: linear-gradient(180deg, #101a26, #070b10); }
.cop-left { width: 66px; display: flex; align-items: center; justify-content: center; gap: 5px; }
.cop-num { font: 800 44px/1 var(--font-display); color: #fff; letter-spacing: -1px; text-shadow: 0 0 12px rgba(255,255,255,.25); min-width: 26px; text-align: center; }
.cop-arrows { display: flex; flex-direction: column; gap: 2px; }
.cop-arrows svg { display: block; width: 13px; height: 8px; }
.cop-arrows path { fill: var(--accent); opacity: .14; }
.cop-arrows.up path, .cop-arrows.down path { animation: copChev .9s linear infinite; }
.cop-arrows.down { flex-direction: column-reverse; }
.cop-arrows.down svg { transform: rotate(180deg); }
.cop-arrows svg:nth-child(3) path { animation-delay: 0s; }
.cop-arrows svg:nth-child(2) path { animation-delay: .3s; }
.cop-arrows svg:nth-child(1) path { animation-delay: .6s; }
@keyframes copChev { 0% { opacity: .14; } 20% { opacity: 1; } 60%, 100% { opacity: .14; } }
.cop-door { flex: 1; display: flex; align-items: flex-end; }
.cop-door svg { display: block; }

.cop-floors { display: grid; grid-template-columns: 1fr 1fr; justify-items: center; row-gap: 12px; margin-top: 20px; }
.cop-btn {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #2d3a48, #121920);
  border: 2px solid #3a4856;
  font: 700 20px var(--font-display); color: #9aa5ad;
  transition: border-color .25s ease, color .25s ease, box-shadow .25s ease, transform .08s ease;
}
.cop-btn:hover { text-decoration: none; }
.cop-btn:active { transform: scale(.96); }
.cop-btn:hover { border-color: #5a6b7c; color: #c7d0d6; }
.cop-btn.is-lit, .cop-btn:focus-visible {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47,191,143,.16), 0 0 18px rgba(47,191,143,.6);
}
.home-main .cop-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 50%; }
.cop-rule { height: 1px; background: #222c36; margin: 20px 4px 16px; }
.cop-func { display: grid; grid-template-columns: 1fr 1fr; justify-items: center; }
.cop-func .cop-btn { width: 56px; height: 56px; color: #c7d0d6; }
.cop-func .cop-alarm:hover, .cop-func .cop-alarm:focus-visible, .cop-func .cop-alarm.is-on {
  border-color: #f3c74f; color: #c7d0d6;
  box-shadow: 0 0 0 4px rgba(243,199,79,.16), 0 0 18px rgba(243,199,79,.65);
}
.cop-logo { margin-top: 14px; text-align: center; font: 800 12px var(--font-display); letter-spacing: 3px; color: #33404c; }

/* =========================================================
   Sections
   ========================================================= */
.home-section { padding: 72px 0; }
.home-wrap { max-width: 1080px; margin: 0 auto; padding: 0 32px; }
.home-section h2 {
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.3px;
  margin: 0 0 32px;
  max-width: 30ch;
}

/* --- Métiers --- */
.trades { border-top: 1px solid var(--border); }
.trade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.trade-photo {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 14px;
  margin-bottom: 18px;
  background: var(--surface);
}
.trade-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.trade:hover .trade-photo img { transform: scale(1.03); }
.trade-floor {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent) !important;
}
.trade h3 { font-size: 26px; font-weight: 700; margin: 0 0 8px; line-height: 1.2; }
.trade h3 a { color: inherit; }
.trade > p:not(.trade-floor) { margin: 0 0 16px; max-width: 46ch; line-height: 1.55; }
.trade-list { list-style: none; margin: 0 0 18px; padding: 0; }
.trade-list li {
  padding: 9px 0;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
}
.trade-list li:last-child { border-bottom: 1px solid var(--border); }
.trade-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
}
.trade-link::after { content: ""; width: 7px; height: 7px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s ease; }
.trade-link:hover { text-decoration: none; }
.trade-link:hover::after { transform: translateX(3px) rotate(45deg); }

.trade-next {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 40px 0 0;
  padding: 14px 18px;
  border: 1px dashed var(--steel-edge);
  border-radius: 12px;
  font-size: 15px;
}
.trade-next i { font-size: 20px; color: var(--text-dim); }

/* --- Parcours --- */
.story { background: var(--bg-alt); }
.story .story-statement {
  max-width: 30ch;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 48px;
}
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-bottom: 36px; }
.value { border-top: 2px solid var(--accent); padding-top: 16px; }
.value h3 { font-size: 19px; margin: 0 0 6px; font-weight: 700; }
.value p { margin: 0; line-height: 1.55; font-size: 15px; }

/* --- Appel à l'action --- */
.call { padding: 64px 0 72px; }
.call-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.call h2 { margin: 0 0 6px; }
.call p { margin: 0; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1040px) {
  .home-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 22px;
    padding: 24px 20px 44px;
  }
  .home-hero::before { top: 45%; }
  .hero-copy, .hero-building, .cop { grid-column: 1; }
  .floor-cards { display: none; }
  .hero-building { max-width: 484px; width: 100%; }
  .cop { justify-self: center; zoom: .8; margin-left: 0; }
}
@media (max-width: 720px) {
  .home-section { padding: 52px 0; }
  .home-wrap { padding: 0 20px; }
  .trade-grid, .values { grid-template-columns: 1fr; }
  .trade-grid { gap: 48px; }
  .values { gap: 24px; }
  .call-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  body.home .building-stage { max-width: 352px; }

}

/* --- Entrée de page : un seul moment orchestré --- */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy, .hero-building, .cop { animation: heroIn .8s cubic-bezier(.2,.7,.2,1) both; }
  .hero-building { animation-delay: .1s; }
  .cop { animation-delay: .25s; }
  @keyframes heroIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  .cop-arrows path { animation: none !important; }
  body.home .label-zone #labelZoneText .glitch-letter { opacity: 1; animation: none; }
  .trade-photo img, body.home .cabin-marker { transition: none; }
}
