/* Pare-brise Flash — site stylesheet (static replacement for the
   dc-runtime / React component bundle). Depends on the design tokens
   loaded from _ds/.../styles.css (colors, typography, spacing, effects). */

html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

html, body {
  margin: 0;
  padding: 0;
  /* clip, not hidden — overflow-x:hidden on html/body breaks position:sticky
     on descendants (the sticky header) in every browser. */
  overflow-x: clip;
  max-width: 100vw;
}
body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

/* ---------- Logos marquee (trust band) ---------- */
@keyframes pbf-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.logos-track {
  display: flex;
  align-items: center;
  gap: 32px;
  width: max-content;
  animation: pbf-marquee 34s linear infinite;
}
.logos-track:hover {
  animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
  .logos-track { animation: none; }
}

/* ---------- Cookie consent banner ---------- */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 18px 22px;
  font-family: var(--font-sans);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__text {
  flex: 1 1 320px;
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}
.cookie-banner__actions {
  display: flex;
  gap: 10px;
  flex: none;
}

/* Sticky header is 72px tall — keep anchored sections from hiding under it. */
#autocars, #prestations, #vehicules, #flottes, #realisations, #ateliers, #contact {
  scroll-margin-top: 88px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 100;
  text-decoration: none;
  font-weight: var(--fw-semibold);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: 8px; }

/* Interactive elements fall back to the browser default outline otherwise,
   which reads as visually broken against pill-shaped buttons and cards. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.card--interactive:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: var(--tracking-snug);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  transition: background var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.btn-lg { height: 56px; padding: 0 30px; font-size: var(--text-lg); }
.btn-sm { height: 40px; padding: 0 18px; font-size: var(--text-sm); }
.btn-pill { border-radius: var(--radius-pill); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-accent); transform: translateY(-1px); }
.btn-primary:active { background: var(--accent-active); transform: translateY(0); box-shadow: var(--shadow-xs); }

.btn-secondary {
  background: var(--color-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { background: var(--pf-neutral-50); border-color: var(--pf-neutral-400); }
.btn-secondary:active { background: var(--pf-neutral-100); }

.btn-inverse {
  background: var(--color-surface);
  color: var(--pf-ink);
  box-shadow: var(--shadow-md);
}
.btn-inverse:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-inverse:active { transform: translateY(0); }

/* Outline button on a colored/dark background (e.g. the accent CTA band) */
.btn-ghost-inverse {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.65);
}
.btn-ghost-inverse:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; }
.btn-ghost-inverse:active { background: rgba(255, 255, 255, 0.2); }

/* ---------- Card ---------- */
.card {
  font-family: var(--font-sans);
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.card--interactive:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.01em;
  line-height: 1;
  border-radius: var(--radius-pill);
}
.badge-accent { color: var(--accent-active); background: var(--accent-soft); }

/* ---------- Tag ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  line-height: 1;
  color: var(--text-secondary);
  background: var(--color-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
}
.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  height: 72px;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.site-header__logo { display: flex; align-items: center; flex: none; }
.site-header__logo img { height: 30px; width: auto; display: block; }
.site-header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex: 1;
  flex-wrap: wrap;
}
.site-header__nav a {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
  white-space: nowrap;
  color: var(--text-secondary);
}
.site-header__nav a:hover { color: var(--pf-blue-deep); }
/* Groups phone + CTA into one visually distinct "actions" chunk, separate
   from the nav links, so the header reads as two decisions instead of six
   flat, competing items. */
.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex: none;
  padding-left: var(--space-6);
  border-left: 1px solid var(--border);
}
.site-header__phone {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--pf-ink);
  text-decoration: none;
  white-space: nowrap;
}
.site-header__cta {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  flex: none;
  text-decoration: none;
}
.site-header__cta:hover { background: var(--accent-hover); }
.site-header__burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
}
/* Hamburger morphs into an X when the mobile drawer is open, so closing it
   doesn't require guessing that re-tapping the same icon works. */
.site-header__burger-line {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
.site-header__burger.is-open .site-header__burger-line--top {
  transform: translateY(6px) rotate(45deg);
}
.site-header__burger.is-open .site-header__burger-line--mid {
  opacity: 0;
}
.site-header__burger.is-open .site-header__burger-line--bottom {
  transform: translateY(-6px) rotate(-45deg);
}
@media (prefers-reduced-motion: reduce) {
  .site-header__burger-line { transition: none; }
}
.site-header__drawer {
  display: none;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6) var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--color-surface);
}
.site-header__drawer a {
  font-size: var(--text-base);
  font-weight: var(--fw-medium);
  text-decoration: none;
  color: var(--text-secondary);
}
.site-header__drawer.is-open { display: flex; }

@media (max-width: 1100px) {
  .site-header__nav, .site-header__phone { display: none; }
  .site-header__burger { display: inline-flex; }
  /* Only the CTA remains in the actions group on mobile — the divider and
     its padding were sized for phone + CTA together and look like a stray
     line next to the logo once the phone number drops out. */
  .site-header__actions {
    border-left: none;
    padding-left: 0;
  }
}

/* ---------- Bus impact/repair animation (prestations) ---------- */
.pbf-bus-anim-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 60px 24px 100px;
  text-align: center;
}
.pbf-bus-anim-wrap h2 {
  font-size: clamp(26px, 4.5vw, 38px); font-weight: 800;
  line-height: 1.2; margin-bottom: 16px;
  color: #2B2D3A;
  font-family: 'Poppins', sans-serif;
}
.pbf-bus-anim-wrap p.pbf-bus-anim-subtext {
  font-size: 16px; color: #5b5f73; max-width: 480px; margin: 0 auto 50px;
  font-family: 'Poppins', sans-serif;
}
.pbf-bus-anim-scene {
  position: relative;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
}
.pbf-bus-anim-scene img { width: 100%; height: auto; display: block; }
.pbf-bus-anim-scene svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: visible;
  pointer-events: none;
}
.pbf-bus-anim-crack {
  fill: none; stroke: #ffffff; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 220; stroke-dashoffset: 220;
  animation: pbf-draw-crack 6s ease-in-out infinite;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}
.pbf-bus-anim-glow {
  fill: #ffffff; opacity: 0;
  animation: pbf-glow-repair 6s ease-in-out infinite;
}
.pbf-bus-anim-spark { opacity: 0; animation: pbf-spark-pop 6s ease-in-out infinite; }
.pbf-bus-anim-glow, .pbf-bus-anim-spark {
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes pbf-draw-crack {
  0%   { stroke-dashoffset: 220; opacity: 1; }
  28%  { stroke-dashoffset: 0;   opacity: 1; }
  55%  { stroke-dashoffset: 0;   opacity: 1; }
  75%  { stroke-dashoffset: 0;   opacity: 0; }
  100% { stroke-dashoffset: 220; opacity: 0; }
}
@keyframes pbf-glow-repair {
  0%, 50%  { opacity: 0; transform: scale(0.3); }
  62%      { opacity: 0.85; transform: scale(1.3); }
  75%      { opacity: 0; transform: scale(1.7); }
  100%     { opacity: 0; transform: scale(0.3); }
}
@keyframes pbf-spark-pop {
  0%, 58%  { opacity: 0; transform: scale(0.5) rotate(0deg); }
  66%      { opacity: 1; transform: scale(1.1) rotate(15deg); }
  78%      { opacity: 0; transform: scale(1.3) rotate(25deg); }
  100%     { opacity: 0; transform: scale(0.5) rotate(0deg); }
}

.pbf-bus-anim-status {
  margin-top: 28px; font-size: 13px; font-weight: 600;
  color: #8a8ea3; letter-spacing: .3px;
  font-family: 'Poppins', sans-serif;
}
.pbf-bus-anim-status .word { display: inline-block; animation: pbf-status-fade 6s ease-in-out infinite; }
@keyframes pbf-status-fade {
  0%, 58%   { color: #c0454d; }
  62%, 100% { color: #3fa66a; }
}

/* This loop is a deliberate brand moment (client request): unlike the
   parallax/tilt/scroll-reveal effects below, it keeps looping regardless
   of prefers-reduced-motion instead of freezing on a resting frame. */

/* ==========================================================================
   Immersive effects: scroll reveal, hero parallax, 3D card tilt, gallery zoom
   All effects are progressive enhancement: only active once .has-js is set
   on <html> (inline script in <head>, runs before first paint), and fully
   neutralised under prefers-reduced-motion so nothing here is required to
   read or use the page.
   ========================================================================== */

/* ---------- Scroll reveal (per section) ---------- */
.has-js main > section {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.has-js main > section.hero,
.has-js main > section.is-revealed {
  opacity: 1;
  transform: none;
}

/* ---------- Hero: scroll + pointer parallax ---------- */
.hero-shape-parallax {
  transition: transform 0.1s linear;
  will-change: transform;
}
.hero-image-tilt {
  perspective: 1200px;
}
.hero-image-tilt img {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

/* ---------- 3D tilt on interactive cards ---------- */
.card--interactive {
  transform-style: preserve-3d;
  will-change: transform;
  transition: box-shadow var(--dur-base) var(--ease-out), transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Réalisations gallery: hover zoom ---------- */
.gallery-item {
  overflow: hidden;
}
.gallery-item img {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-item:hover img,
.gallery-item:focus-within img {
  transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
  .has-js main > section {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-shape-parallax,
  .hero-image-tilt img,
  .card--interactive,
  .gallery-item img {
    transition: none !important;
    transform: none !important;
  }
}

/* Pointer-only: don't engage tilt/parallax on touch devices (no hover, imprecise input) */
@media (hover: none), (pointer: coarse) {
  .hero-image-tilt img,
  .card--interactive {
    transition: box-shadow var(--dur-base) var(--ease-out) !important;
  }
}
