/* Ideal Body — couche UX v2 (ib-ux.css)
   À charger après design-system.css et responsive.css. Ne modifie aucun jeton du design system. */

/* ---------- Transitions entre les pages (Chrome, Edge, Safari récents ; ignoré ailleurs) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: ibx-out 160ms ease both; }
::view-transition-new(root) { animation: ibx-in 260ms cubic-bezier(.2,.7,.2,1) both; }
.ibx-header { view-transition-name: ibx-header; }
@keyframes ibx-out { to { opacity: 0; } }
@keyframes ibx-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Base ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 96px; overflow-x: clip; -webkit-text-size-adjust: 100%; }
html.ibx-lock { overflow: hidden; }
::selection { background: #E11414; color: #fff; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #E11414; outline-offset: 3px; border-radius: 2px; }
#contenu:focus { outline: none; }

.ibx-skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: #0b0b0c; color: #fff; padding: 12px 18px;
  font: 700 14px/1 var(--font-heading, sans-serif); letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  border-radius: 4px; transition: top .2s ease; }
.ibx-skip:focus { top: 12px; }

/* ---------- En-tête ---------- */
.ibx-header { position: sticky; top: 0; z-index: 40; }
.ibx-topbar { background: var(--ib-black); color: var(--ib-chrome-300); font: var(--role-kicker); font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; max-height: 40px; overflow: hidden; transition: max-height .3s ease; }
.ibx-topbar-in { max-width: var(--container-wide); margin: 0 auto; padding: 7px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.ibx-topbar-item { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.ibx-topbar-tel { color: #fff; text-decoration: none; }
.ibx-topbar-tel:hover { color: var(--ib-red-300); }
.ibx-mainbar { background: var(--grad-chrome-h); border-bottom: 3px solid var(--ib-red-500); box-shadow: var(--shadow-md); }
.ibx-mainbar-in { max-width: var(--container-wide); margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; transition: padding .3s ease; }
.ibx-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.ibx-brand img { height: 46px; width: auto; transition: height .3s ease; }
.ibx-brand-txt { display: flex; flex-direction: column; line-height: 1; }
.ibx-brand-name { font-family: var(--font-display); font-size: 28px; color: var(--ib-black); letter-spacing: -.01em; text-transform: uppercase; transition: font-size .3s ease; }
.ibx-brand-tag { font: var(--role-kicker); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ib-ink-700); margin-top: 2px; }
html.ibx-scrolled .ibx-topbar { max-height: 0; }
html.ibx-scrolled .ibx-mainbar-in { padding-top: 7px; padding-bottom: 7px; }
html.ibx-scrolled .ibx-brand img { height: 38px; }
html.ibx-scrolled .ibx-brand-name { font-size: 24px; }

.ibx-nav { display: flex; align-items: center; gap: 2px; }
.ibx-nav a { position: relative; font: var(--role-kicker); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ib-black); padding: 10px 11px; text-decoration: none; white-space: nowrap; transition: color .18s ease; }
.ibx-nav a::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 3px; height: 2px; background: var(--ib-red-500);
  transform: scaleX(0); transform-origin: left; transition: transform .28s cubic-bezier(.2,.7,.2,1); }
.ibx-nav a:hover, .ibx-nav a[aria-current] { color: var(--ib-red-600); }
.ibx-nav a:hover::after, .ibx-nav a[aria-current]::after { transform: scaleX(1); }
.ibx-burger { display: none; background: var(--ib-black); color: #fff; border: none; width: 46px; height: 46px; border-radius: var(--r-sm);
  cursor: pointer; align-items: center; justify-content: center; }

/* Menu mobile : glisse depuis la droite */
.ibx-drawer-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(11,11,12,0); visibility: hidden; pointer-events: none;
  transition: background .3s ease, visibility 0s linear .3s; }
.ibx-drawer-wrap.is-open { background: rgba(11,11,12,.62); visibility: visible; pointer-events: auto; transition: background .3s ease; }
.ibx-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 86vw); background: var(--ib-ink-900); padding: 18px 20px 28px;
  display: flex; flex-direction: column; gap: 2px; overflow-y: auto; transform: translateX(100%); transition: transform .32s cubic-bezier(.2,.7,.2,1);
  box-shadow: -18px 0 40px rgba(0,0,0,.35); }
.ibx-drawer-wrap.is-open .ibx-drawer { transform: none; }
.ibx-drawer-close { align-self: flex-end; background: none; border: none; color: #fff; cursor: pointer; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; }
.ibx-drawer > a:not(.ibx-drawer-tel) { font: var(--role-h3); font-size: 22px; text-transform: uppercase; color: #fff; text-decoration: none;
  padding: 14px 4px; border-bottom: 1px solid var(--ib-ink-700); transition: color .15s ease, padding-left .2s ease; }
.ibx-drawer > a:not(.ibx-drawer-tel):hover { padding-left: 10px; }
.ibx-drawer > a[aria-current] { color: var(--ib-red-500); }
.ibx-drawer-tel { margin-top: 18px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; color: #fff; text-decoration: none;
  font: var(--role-kicker); font-size: 16px; font-weight: 700; letter-spacing: .08em; padding: 12px; border: 1px solid var(--ib-ink-700); border-radius: var(--r-sm); }

/* ---------- Accueil : vidéo moins haute et séparation marquée avec la section suivante ---------- */
/* La vidéo occupe 60 % de l'écran : le titre de la section suivante apparaît sans défiler. */
@media (min-width: 641px) { .ib-hv { height: min(56.25vw, 60svh) !important; } }
/* Bande chromée épaisse puis filet rouge, comme sous l'en-tête. La section suivante passe devant la vidéo. */
.ib-hv { border-bottom: 28px solid #c9ccd1; border-image: var(--grad-chrome-h) 1; }
.ib-hv + section { border-top: 6px solid var(--ib-red-500); box-shadow: 0 -14px 28px rgba(0,0,0,.35); z-index: 1; }
@media (max-width: 640px) { .ib-hv { border-bottom-width: 18px; } .ib-hv + section { border-top-width: 5px; } }

/* ---------- Apparition au défilement ---------- */
.ibx-r { opacity: 0; transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
  transition-delay: calc(var(--ibx-i, 0) * 75ms); will-change: opacity, transform; }
.ibx-r.ibx-in { opacity: 1; transform: none; }

/* ---------- Micro-interactions sur l'existant ---------- */
footer a { transition: color .15s ease, border-color .15s ease, background .15s ease; }
footer a:hover { color: #fff !important; }
footer a[target="_blank"]:hover { border-color: var(--ib-red-500) !important; background: var(--ib-red-500); }
main figure img { transition: transform .7s cubic-bezier(.2,.7,.2,1); }
figure.ibx-zoom { cursor: zoom-in; transition: box-shadow .25s ease, transform .25s ease; }
figure.ibx-zoom:hover { box-shadow: var(--shadow-md) !important; transform: translateY(-3px); }
figure.ibx-zoom:hover img { transform: scale(1.05); }
.ibx-linkish { cursor: pointer; text-decoration: underline; text-decoration-color: rgba(225,20,20,.45); text-underline-offset: 4px; transition: text-decoration-color .15s ease; }
.ibx-linkish:hover { text-decoration-color: #E11414; }
main a[href$=".html"] h3, main a:not([href]) h3 { transition: color .15s ease; }
main a:not([href]) { cursor: pointer; }

/* ---------- Progression, retour en haut, barre d'action mobile ---------- */
.ibx-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 90; background: #E11414; transform: scaleX(0); transform-origin: left; pointer-events: none; }
.ibx-top { position: fixed; right: 20px; bottom: 20px; z-index: 45; width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
  background: #0b0b0c; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(0,0,0,.28);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s ease, transform .25s ease, background .15s ease; }
.ibx-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.ibx-top:hover { background: #E11414; }
.ibx-mbar { display: none; }

/* ---------- Formulaires, modale, page Contact ---------- */
.ibx-stack { display: flex; flex-direction: column; gap: 14px; }
.ibx-row { display: flex; gap: 14px; flex-wrap: wrap; }
.ibx-field { display: flex; flex-direction: column; gap: 6px; }
.ibx-label { font: var(--role-kicker); text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); }
.ibx-textarea { font-family: var(--font-body); font-size: 16px; line-height: 1.5; color: var(--text-strong); padding: 12px 14px; background: #fff;
  border: 2px solid var(--border-default); border-radius: var(--r-sm); outline: none; resize: vertical; min-height: 96px;
  transition: border-color .15s ease, box-shadow .15s ease; }
.ibx-textarea:focus { border-color: var(--color-primary); box-shadow: var(--ring); }
.ibx-textarea.is-error { border-color: #E11414; }
.ibx-error { font: var(--role-small); font-size: 13px; color: #B80F0F; }
.ibx-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ibx-alert { font: var(--role-small); line-height: 1.5; color: #7A0B0B; background: var(--ib-red-50); border: 1px solid rgba(225,20,20,.35);
  border-left: 4px solid #E11414; border-radius: var(--r-sm); padding: 12px 14px; }
.ibx-alert a { color: #B80F0F; font-weight: 700; }
.ibx-fine { font: var(--role-small); font-size: 12px; color: var(--text-faint); margin: 0; text-align: center; }
.ibx-muted { font: var(--role-small); color: var(--text-muted); }
.ibx-h3 { font: var(--role-h2); font-size: clamp(24px, 4vw, 30px); text-transform: uppercase; letter-spacing: -.02em; color: var(--text-strong); }
.ibx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ibx-chip { font: var(--role-kicker); font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 9px 14px; min-height: 40px;
  border-radius: var(--r-sm); cursor: pointer; border: 2px solid var(--border-default); background: var(--surface-card); color: var(--text-body);
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease; }
.ibx-chip:hover { border-color: var(--ib-red-500); }
.ibx-chip:active { transform: scale(.97); }
.ibx-chip.is-on { background: var(--ib-red-500); border-color: var(--ib-red-500); color: #fff; }
.ibx-success { text-align: center; padding: 24px 0; animation: ibx-pop .4s cubic-bezier(.2,.7,.2,1) both; }
.ibx-success-ico { width: 64px; height: 64px; margin: 0 auto 18px; background: var(--ib-red-50); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.ibx-success p { margin: 10px 0 24px; font: var(--role-body); }
.ibx-bar { height: 4px; background: var(--ib-red-500); }

.ibx-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(11,11,12,.72); backdrop-filter: blur(3px); display: flex; align-items: center;
  justify-content: center; padding: 20px; animation: ibx-fade .2s ease both; }
.ibx-modal { position: relative; width: min(560px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain; background: var(--surface-card);
  border-radius: var(--r-md); box-shadow: var(--shadow-xl); animation: ibx-pop .32s cubic-bezier(.2,.7,.2,1) both; }
.ibx-modal-body { padding: 28px; }
.ibx-close { position: absolute; top: 14px; right: 14px; background: var(--ib-mist); border: none; width: 40px; height: 40px; border-radius: var(--r-sm);
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s ease; z-index: 1; }
.ibx-close:hover { background: var(--ib-chrome-300); }
@keyframes ibx-fade { from { opacity: 0; } }
@keyframes ibx-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.ibx-contact-grid { max-width: var(--container-max); margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 40px; align-items: start; }
.ibx-info { display: flex; gap: 14px; align-items: flex-start; padding: 10px; margin: -4px -10px; border-radius: var(--r-md); text-decoration: none; color: inherit; }
.ibx-info.is-link { transition: background .15s ease, transform .15s ease; }
.ibx-info.is-link:hover { background: var(--surface-card); transform: translateX(3px); }
.ibx-info-ico { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--ib-red-50); border-radius: var(--r-sm); }
.ibx-info-l1 { font: var(--role-body); font-size: 15px; font-weight: 600; color: var(--text-strong); margin-top: 6px; overflow-wrap: anywhere; }
.ibx-info-l2 { font: var(--role-body); font-size: 15px; color: var(--text-strong); margin-top: 2px; }
.ibx-map { margin-top: 6px; height: 240px; border-radius: var(--r-md); border: 1px solid var(--border-soft); overflow: hidden; background: var(--grad-chrome); box-shadow: var(--shadow-sm); }
.ibx-map iframe { width: 100%; height: 100%; border: 0; display: block; }
.ibx-maplink { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font: var(--role-kicker); font-size: 13px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-strong); text-decoration: none; padding: 8px 0; transition: color .15s ease, gap .2s ease; }
.ibx-maplink:hover { color: var(--ib-red-600); gap: 12px; }
.ibx-card { background: var(--surface-card); border: 1px solid var(--border-soft); border-radius: var(--r-md); box-shadow: var(--shadow-md); overflow: hidden; }
.ibx-card-body { padding: clamp(22px, 4vw, 36px); }

/* ---------- Visionneuse ---------- */
.ibx-lb { position: fixed; inset: 0; z-index: 100; background: rgba(11,11,12,.94); display: none; align-items: center; justify-content: center; padding: 56px 12px 20px; }
.ibx-lb.is-open { display: flex; animation: ibx-fade .2s ease both; }
.ibx-lb figure { margin: 0; max-width: min(1200px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ibx-lb img { max-width: 100%; max-height: calc(100dvh - 150px); object-fit: contain; border-radius: 4px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.ibx-lb figcaption { width: 100%; display: flex; justify-content: space-between; gap: 16px; color: #fff; font: 700 13px/1.3 var(--font-heading, sans-serif); letter-spacing: .08em; text-transform: uppercase; }
.ibx-lb-count { color: rgba(255,255,255,.6); white-space: nowrap; }
.ibx-lb button { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.2); cursor: pointer; border-radius: 50%; width: 48px; height: 48px;
  font-size: 28px; line-height: 1; display: flex; align-items: center; justify-content: center; flex: none; transition: background .15s ease; }
.ibx-lb button:hover { background: #E11414; border-color: #E11414; }
.ibx-lb-x { position: absolute; top: 12px; right: 12px; }
.ibx-lb-nav { margin: 0 12px; }

/* ---------- Mobile et tablette ---------- */
@media (max-width: 1080px) {
  .ibx-burger { display: flex; }
}
@media (max-width: 880px) {
  html { scroll-padding-top: 76px; }
  .ibx-contact-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .ibx-contact-grid > .ibx-card { order: -1; }
  body { padding-bottom: 68px; background: #0b0b0c; }
  .ibx-mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 44; display: flex; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(11,11,12,.96); backdrop-filter: blur(8px); border-top: 2px solid #E11414;
    transform: translateY(110%); transition: transform .3s cubic-bezier(.2,.7,.2,1); }
  .ibx-mbar.is-on { transform: none; }
  html.ibx-lock .ibx-mbar { transform: translateY(110%); }
  .ibx-mbar a, .ibx-mbar button { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 4px; cursor: pointer;
    font: 700 14px/1 var(--font-heading, sans-serif); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
  .ibx-mbar-tel { flex: 0 0 34%; color: #fff; border: 1px solid rgba(255,255,255,.3); background: transparent; }
  .ibx-mbar-cta { flex: 1; color: #fff; background: #E11414; border: none; }
  .ibx-top { bottom: 80px; right: 12px; }
  .ibx-lb-nav { position: absolute; bottom: 16px; margin: 0; }
  .ibx-lb-nav.is-prev { left: 16px; } .ibx-lb-nav.is-next { right: 16px; }
  .ibx-lb { padding-bottom: 84px; }
}
@media (max-width: 640px) {
  .ibx-topbar-in, .ibx-mainbar-in { padding-left: 16px; padding-right: 16px; }
  .ibx-topbar-item:first-child { overflow: hidden; text-overflow: ellipsis; }
  .ibx-brand img { height: 40px; } .ibx-brand-name { font-size: 24px; } .ibx-brand-tag { font-size: 9px; letter-spacing: .14em; }
  .ibx-modal-body { padding: 22px 18px; }
  .ibx-overlay { padding: 10px; align-items: flex-end; }
  .ibx-modal { max-height: calc(100dvh - 20px); border-radius: var(--r-md) var(--r-md) 0 0; }
  /* Le cube décoratif des bannières ne doit pas passer sous le titre. */
  main > section:first-child > img[alt=""] { opacity: .06 !important; right: -50px !important; }
  /* Sur iOS, un champ sous 16 px déclenche un zoom automatique. */
  input, textarea, select { font-size: 16px !important; }
}

/* ---------- Respect des préférences et impression ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .ibx-r { opacity: 1; transform: none; transition: none; }
  .ibx-drawer, .ibx-drawer-wrap, .ibx-mbar, .ibx-top, .ibx-modal, .ibx-overlay, .ibx-success { transition: none !important; animation: none !important; }
}
@media print {
  .ibx-progress, .ibx-top, .ibx-mbar, .ibx-skip, .ibx-lb { display: none !important; }
  .ibx-r { opacity: 1 !important; transform: none !important; }
  .ibx-header { position: static; }
}
