/* =========================================================
   Garage Bulliard Sàrl — Feuille de style
   Style : sobre, moderne, automobile (Motion-Driven)
   ========================================================= */

:root {
  /* Couleurs — toute la palette du site part d'ici : aucune couleur n'est
     écrite en dur dans les règles plus bas. */
  --color-primary:      #1E293B;
  --color-primary-dark: #0B1424;  /* survol des boutons sombres */
  --color-secondary:    #334155;
  --color-accent:       #DC2626;
  --color-accent-700:   #B91C1C;
  --color-accent-soft:  rgba(220, 38, 38, 0.12);   /* voiles teintés */
  --color-bg:           #F8FAFC;
  --color-bg-glass:     rgba(248, 250, 252, 0.9);  /* navbar au scroll */
  --color-fg:           #0F172A;
  --color-muted:        #E9EDF1;
  --color-border:       #E2E8F0;
  --color-text-soft:    #475569;
  --color-on-dark:      #E2E8F0;
  --color-white:        #FFFFFF;

  /* Typo */
  --font-head: 'Poppins', system-ui, sans-serif;
  --font-body: 'Open Sans', system-ui, sans-serif;

  /* Échelle d'espacement (8pt) */
  --space-section: clamp(4rem, 9vw, 7.5rem);
  --radius:    14px;
  --radius-sm: 10px;
  --container: 1180px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 28px -12px rgba(15, 23, 42, 0.22);
  --shadow-lg: 0 30px 60px -25px rgba(15, 23, 42, 0.35);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--color-fg);
  background: var(--color-bg);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, iframe { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.15; font-weight: 600; }

::selection { background: var(--color-accent); color: #fff; }

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.section { padding-block: var(--space-section); }

.section__head { max-width: 750px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section__eyebrow {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}
.section__title { font-size: clamp(1.75rem, 4vw, 2.6rem); color: var(--color-primary); }
.section__intro { margin-top: 1rem; color: var(--color-text-soft); font-size: 1.05rem; }

/* ---------- Boutons ---------- */
.btn {
  --btn-bg: var(--color-primary);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
              box-shadow 0.25s var(--ease), color 0.25s var(--ease);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn--lg { padding: 1.05rem 1.9rem; font-size: 1rem; }

.btn--accent { --btn-bg: var(--color-accent); }
.btn--accent:hover { background: var(--color-accent-700); }

.btn--dark { --btn-bg: var(--color-primary); }
.btn--dark:hover { background: var(--color-primary-dark); }

.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(2px);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; }

/* =========================================================
   HEADER / NAV
   ========================================================= */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease),
              padding 0.35s var(--ease);
  padding-block: 1.15rem;
}
.site-header.is-scrolled {
  background: var(--color-bg-glass);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--color-border);
  padding-block: 0.7rem;
}
.header__inner { display: flex; align-items: center; justify-content: space-between; }

.brand { display: inline-flex; align-items: center; }
.brand__logo { height: 51px; width: auto; transition: height 0.35s var(--ease); }
.site-header.is-scrolled .brand__logo { height: 44px; }
.brand__logo--dark { display: none; }
.site-header.is-scrolled .brand__logo--light { display: none; }
.site-header.is-scrolled .brand__logo--dark { display: block; }

.nav { display: flex; align-items: center; gap: 2rem; }
.nav__link {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.92);
  position: relative;
  transition: color 0.3s var(--ease);
}
.site-header.is-scrolled .nav__link { color: var(--color-secondary); }
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--color-accent);
  transition: width 0.3s var(--ease);
}
.nav__link:hover::after { width: 100%; }
.nav__cta { padding: 0.7rem 1.15rem; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  background: transparent; border: 0; cursor: pointer;
}
.nav-toggle span {
  display: block; width: 26px; height: 2px;
  background: #fff; border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.is-scrolled .nav-toggle span { background: var(--color-primary); }

/* Menu mobile ouvert : la navbar prend le fond du menu (slate) */
.site-header.is-menu-open {
  background: var(--color-primary);
  box-shadow: none;
  border-bottom-color: transparent;
}
.site-header.is-menu-open .brand__logo--light { display: block; }
.site-header.is-menu-open .brand__logo--dark { display: none; }
.site-header.is-menu-open .nav-toggle span { background: #fff; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem clamp(1.25rem, 4vw, 2.5rem) 1.5rem;
  background: var(--color-primary);
}
.mobile-nav:not([hidden]) { display: flex; }
.mobile-nav__link {
  font-family: var(--font-head);
  font-weight: 500;
  color: #fff;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.mobile-nav .btn { margin-top: 0.75rem; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: #fff;
}
.hero__media { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
/* Calque parallaxé : contient les paliers vidéo, qui glissent donc ensemble. */
.hero__videos { position: absolute; inset: 0; }
.hero__video {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  /* 112 % de haut : la marge basse nourrit le parallax sans jamais exposer de vide. */
  height: 112%;
  object-fit: cover;
  border: 0;
  pointer-events: none;
  background: var(--color-primary);
}
/* Palier haute définition : superposé au palier léger, révélé en fondu une
   fois qu'il est réellement lisible (voir le script dans partials/hero.php). */
.hero__video--hd { opacity: 0; transition: opacity 0.7s var(--ease); }
.hero__video--hd.is-ready { opacity: 1; }
.hero__overlay {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.55) 0%, rgba(15, 23, 42, 0.35) 35%, rgba(15, 23, 42, 0.8) 100%),
    radial-gradient(120% 80% at 50% 0%, rgba(15, 23, 42, 0) 40%, rgba(15, 23, 42, 0.4) 100%);
}
.hero__content { position: relative; z-index: 2; padding-block: 8rem 6rem; max-width: 760px; }
.hero__eyebrow {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1.25rem;
}
.hero__title {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.hero__title span { display: block; }
.hero__title em { font-style: normal; color: var(--color-accent); }
.hero__lead {
  margin-top: 1.5rem;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  max-width: 36ch;
  color: rgba(255, 255, 255, 0.9);
}
.hero__actions { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: 1rem; }

.hero__scroll {
  position: absolute;
  left: 50%; bottom: 2rem;
  transform: translateX(-50%);
  z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-head);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.hero__scroll-line {
  width: 1.5px; height: 46px;
  background: linear-gradient(180deg, #fff, transparent);
  animation: scrollPulse 2s var(--ease) infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(0.4); opacity: 0.4; transform-origin: top; }
  50%      { transform: scaleY(1);   opacity: 1;   transform-origin: top; }
}

/* =========================================================
   PRESTATIONS — onglets + galerie photo (mobile-first)
   ========================================================= */
.services { background: var(--color-bg); }

/* --- Onglets --- */
.services__tabs {
  display: flex; gap: 0.6rem;
  /* Mobile : la rangée déborde et se fait défiler du doigt. */
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}
.services__tabs::-webkit-scrollbar { display: none; }
.services__tab {
  flex: none;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  font-family: var(--font-head); font-weight: 600; font-size: 0.95rem;
  color: var(--color-secondary);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.services__tab:hover { border-color: var(--color-secondary); }
.services__tab.is-active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* --- Panneaux --- */
.services__panel {
  display: none;
  overflow: hidden;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.services__panel.is-active { display: grid; }
.services__content { padding: 1.8rem 1.7rem; }
.services__ico {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--color-accent);
  color: #fff;
  margin-bottom: 1rem;
}
.services__title { font-size: 1.4rem; color: var(--color-primary); margin-bottom: 0.5rem; }
.services__text { color: var(--color-text-soft); }

/* --- Galerie photo --- */
.gal { position: relative; overflow: hidden; background: var(--color-muted); }
.gal__track {
  display: flex;
  height: 240px;
  overflow-x: auto;
  /* Le swipe est porté par le défilement natif : fluide, interruptible,
     et fidèle au geste sur mobile. Le JS ne fait que le piloter. */
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.gal__track::-webkit-scrollbar { display: none; }
.gal__img {
  flex: none;
  width: 100%; height: 100%;
  object-fit: cover;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}
.gal__nav {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border: 0; border-radius: 50%;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  transition: background 0.25s var(--ease), opacity 0.25s var(--ease);
}
.gal__nav:hover { background: #fff; }
.gal__nav--prev { left: 0.6rem; }
.gal__nav--next { right: 0.6rem; }
.gal__dots {
  position: absolute; left: 50%; bottom: 0.7rem;
  transform: translateX(-50%);
  z-index: 2;
  display: flex; gap: 0.4rem;
}
.gal__dot {
  width: 7px; height: 7px;
  padding: 0; border: 0; border-radius: 50%;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.25);
  transition: background 0.25s var(--ease), width 0.25s var(--ease);
}
.gal__dot.is-active { width: 18px; border-radius: 999px; background: #fff; }

@media (min-width: 760px) {
  .services__panel.is-active { grid-template-columns: 1fr 1fr; align-items: stretch; }
  /* La colonne photo épouse la hauteur du texte (jamais moins de 340px).
     La piste est sortie du flux : les photos sont en portrait, et sans cela
     leur ratio imposerait au panneau une hauteur démesurée. */
  .gal { height: 100%; min-height: 340px; }
  .gal__track { position: absolute; inset: 0; height: auto; }
  .services__content { padding: 2.6rem 2.4rem; align-self: center; }
  .services__title { font-size: 1.7rem; }
}

/* =========================================================
   À PROPOS
   ========================================================= */
.about { background: var(--color-white); }
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.about__photo {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(150deg, var(--color-accent-soft), transparent 55%),
    linear-gradient(320deg, var(--color-primary), var(--color-secondary));
  box-shadow: var(--shadow-lg);
}
.about__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.about__badge {
  position: absolute;
  left: 1.25rem; bottom: 1.25rem;
  z-index: 1;
  background: var(--color-white);
  color: var(--color-primary);
  font-family: var(--font-head);
  font-size: 0.85rem;
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}
.about__badge strong { color: var(--color-accent); font-size: 1.05rem; }
.about__body > p { color: var(--color-text-soft); margin-top: 1.1rem; max-width: 56ch; }
.about__points { list-style: none; padding: 0; margin: 1.75rem 0; display: grid; gap: 0.7rem; }
.about__points li { display: flex; align-items: center; gap: 0.7rem; font-weight: 500; color: var(--color-secondary); }
.about__points span {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  flex: none;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.75rem;
}

/* =========================================================
   CONTACT
   ========================================================= */
.contact__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
.contact__list { list-style: none; padding: 0; display: grid; gap: 1.5rem; margin-bottom: 2.5rem; }
.contact__list li { display: flex; gap: 1rem; }
.contact__ico {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  flex: none;
  border-radius: 11px;
  background: var(--color-muted);
  color: var(--color-accent);
}
.contact__list h3 { font-family: var(--font-head); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-soft); margin-bottom: 0.2rem; }
.contact__list a { font-weight: 600; color: var(--color-primary); transition: color 0.25s var(--ease); }
.contact__list a:hover { color: var(--color-accent); }

.hours__title { display: flex; align-items: center; gap: 0.75rem; font-size: 1.05rem; color: var(--color-primary); margin-bottom: 1rem; }
.hours__table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.hours__table th, .hours__table td { padding: 0.7rem 0; text-align: left; border-bottom: 1px solid var(--color-border); }
.hours__table th { font-family: var(--font-head); font-weight: 500; color: var(--color-secondary); }
.hours__table td { color: var(--color-text-soft); text-align: right; font-variant-numeric: tabular-nums; }
.hours__table tr.is-closed td { color: var(--color-accent); font-weight: 600; }

/* Formulaire */
.contact__form-wrap {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-md);
}
.contact__form-title { font-size: 1.3rem; color: var(--color-primary); }
.contact__form-sub { color: var(--color-text-soft); font-size: 0.95rem; margin: 0.4rem 0 1.5rem; }

.contact-form { display: grid; gap: 1.1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field { display: grid; gap: 0.4rem; }
.field label {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--color-secondary);
}
.field label span { color: var(--color-accent); }
.field input,
.field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-fg);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.95rem;
  width: 100%;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  background: var(--color-white);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.contact-form .btn { justify-self: start; }
/* Le plafond de 640px du .section__head sert à garder une longueur de ligne
   lisible. Le titre du contact tient sur une ligne en 750px, et le conteneur
   en offre 1180 : ici le plafond ne protégeait rien, il coupait juste le
   titre en deux. Les autres sections le conservent. */
.contact .section__head { max-width: none; }

.contact-form__note { margin: 0; font-size: 0.9rem; font-weight: 600; color: var(--color-accent); min-height: 1.2em; }
.contact-form__note.is-ok    { color: #15803D; }
.contact-form__note.is-error { color: var(--color-accent); }
/* Retour affiché sans JavaScript : il précède le formulaire, on l'espace. */
.contact-form__note.is-ok:not(.js-form-note),
.contact-form__note.is-error:not(.js-form-note) { margin-bottom: 1.25rem; }

/* Piège à robots : hors de l'écran plutôt que display:none, que certains
   robots savent détecter pour ignorer le champ. Aucun impact visuel. */
.contact-form__trap {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.contact-form button[type="submit"]:disabled { opacity: 0.6; cursor: progress; }

/* Carte (pleine largeur sous la grille) */
.contact__map {
  margin-top: clamp(2rem, 4vw, 3rem);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  min-height: 380px;
}
.contact__map iframe { width: 100%; height: 100%; min-height: 380px; border: 0; filter: grayscale(0.25) contrast(1.05); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { background: var(--color-primary); color: var(--color-on-dark); padding-block: 3rem; }
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.footer-logo { height: 64px; width: auto; }
.site-footer__brand p { font-size: 0.9rem; opacity: 0.7; margin-top: 0.75rem; }
.site-footer__links { display: flex; gap: 1.5rem; }
.site-footer__links a { font-weight: 500; opacity: 0.85; transition: opacity 0.25s var(--ease), color 0.25s var(--ease); }
.site-footer__links a:hover { opacity: 1; color: #fff; }
.social-link { display: inline-flex; align-items: center; gap: 0.5rem; }
.site-footer__copy { width: 100%; padding-top: 1.5rem; margin-top: 0.5rem; border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.85rem; opacity: 0.7; }
.site-footer__made { display: block; margin-top: 0.35rem; opacity: 0.85; }
.nickel-link { font-weight: 600; color: inherit; transition: color 0.25s var(--ease); }
.nickel-link:hover { color: #F286AA; }

/* =========================================================
   ANIMATIONS (état initial avant GSAP)
   ========================================================= */
[data-reveal], [data-anim] { will-change: transform, opacity; }

.js [data-reveal] { opacity: 0; transform: translateY(28px); }
.js [data-anim="hero"], .js [data-anim="hero-line"] { opacity: 0; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__media { max-width: 420px; }
  .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
}

@media (min-width: 769px) {
  .mobile-nav { display: none !important; }
}

/* =========================================================
   REPÈRE DE DÉVELOPPEMENT (variantes de prestations)
   À supprimer une fois la variante choisie.
   ========================================================= */
/* =========================================================
   PRÉFÉRENCE : MOUVEMENT RÉDUIT
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-reveal], .js [data-anim], .js [data-anim="hero"], .js [data-anim="hero-line"] {
    opacity: 1 !important;
    transform: none !important;
  }
}
