/* ==========================================================================
   HANGAR 414 — Feuille de styles
   Sommaire :
     01. Reset & base
     02. Utilitaires de layout
     03. Typographie
     04. Boutons & liens
     05. Header / Navigation
     06. Hero
     07. Section « Le Lieu »
     08. Section « Contact » + formulaire
     09. Footer
     10. Animations d'apparition
     11. Impression
   Toutes les valeurs de couleur/typo viennent de tokens.css.
   ========================================================================== */

/* == 01. Reset & base ===================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Décale les ancres pour ne pas passer sous le header fixe */
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden; /* garde-fou : aucun scroll horizontal */
}

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

/* Focus visible partout (accessibilité clavier) */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* Masqué visuellement mais lu par les lecteurs d'écran */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Lien d'évitement clavier */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: 999;
  background: var(--c-black);
  color: var(--c-white);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-small);
  transition: top var(--dur) var(--ease-out);
}
.skip-link:focus {
  top: var(--sp-4);
}

/* == 02. Utilitaires de layout ============================================ */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

/* Variante fond noir (inverse tous les rôles de couleur) */
.section--inverse {
  background: var(--bg-inv);
  color: var(--fg-inv);
  --fg: var(--fg-inv);
  --fg-muted: var(--fg-inv-muted);
  --line: var(--line-inv);
  --bg: var(--bg-inv);
}

.section__head {
  display: grid;
  gap: var(--sp-6);
  margin-bottom: var(--sp-16);
  max-width: 62ch;
}

/* Filet horizontal fin, signature graphique du site */
.rule {
  height: var(--border-w);
  background: var(--line);
  border: 0;
  margin: 0;
}

/* == 03. Typographie ====================================================== */

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 500;
  letter-spacing: var(--ls-heading);
  line-height: var(--lh-heading);
  text-wrap: balance;
}

p {
  margin: 0;
}

/* Micro-label en capitales espacées (eyebrow) */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--fg-muted);
}
.eyebrow::before {
  content: "";
  width: 32px;
  height: var(--border-w);
  background: currentColor;
}

.display {
  font-size: var(--fs-display);
  font-weight: 300;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  text-transform: uppercase;
}

.h2 {
  font-size: var(--fs-h2);
  font-weight: 300;
  text-transform: uppercase;
}

.h3 {
  font-size: var(--fs-h3);
  font-weight: 500;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--fg-muted);
  max-width: 46ch; /* mesure de lecture confortable */
}

.text-muted {
  color: var(--fg-muted);
}

/* Placeholders à compléter par le client : [ ... ] */
.ph {
  font-style: normal;
  border-bottom: 1px dashed currentColor;
  opacity: 0.85;
  white-space: nowrap;
}

/* == 04. Boutons & liens ================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  min-height: 52px; /* > 44px : cible tactile confortable */
  padding: var(--sp-4) var(--sp-8);
  border: var(--border-w) solid currentColor;
  border-radius: var(--radius);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  color: inherit;
  font-family: inherit;
  transition: background-color var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}

/* Bouton plein : contraste maximal, une seule action primaire par écran */
.btn--primary {
  background: var(--fg);
  color: var(--bg);
}
.btn--primary:hover {
  background: transparent;
  color: var(--fg);
}

.btn--ghost:hover {
  background: var(--fg);
  color: var(--bg);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn__arrow {
  transition: transform var(--dur) var(--ease-out);
}
.btn:hover .btn__arrow {
  transform: translateX(4px);
}

/* Lien texte avec soulignement animé */
.link {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 2px;
  transition: background-size var(--dur) var(--ease-out);
}
.link:hover {
  background-size: 0% 1px;
}

/* == 05. Header / Navigation ============================================== */

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-header);
  height: var(--header-h);
  display: flex;
  align-items: center;
  color: var(--c-white);
  transition: background-color var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
  border-bottom: var(--border-w) solid transparent;
}

/* État « scrollé » : fond blanc, texte noir (classe posée par main.js) */
.header.is-scrolled {
  background: var(--c-white);
  color: var(--c-black);
  border-bottom-color: var(--c-gray-200);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  width: 100%;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5ch;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
}
.logo span {
  font-weight: 300;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
}

.nav__link {
  position: relative;
  color: inherit;
  text-decoration: none;
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  padding: var(--sp-3) 0;
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease-out);
}
.nav__link:hover::after,
.nav__link[aria-current="true"]::after {
  transform: scaleX(1);
}

/* Bouton burger (mobile) */
.burger {
  display: none;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
  padding: 0;
}
.burger__bars,
.burger__bars::before,
.burger__bars::after {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--dur) var(--ease-out),
    opacity var(--dur-fast) linear;
}
.burger__bars::before,
.burger__bars::after {
  content: "";
  position: absolute;
}
.burger__bars::before {
  transform: translateY(-7px);
}
.burger__bars::after {
  transform: translateY(7px);
}
.burger[aria-expanded="true"] .burger__bars {
  transform: rotate(45deg);
}
.burger[aria-expanded="true"] .burger__bars::before {
  opacity: 0;
}
.burger[aria-expanded="true"] .burger__bars::after {
  transform: rotate(-90deg);
}

/* Panneau de navigation mobile (plein écran, noir) */
@media (max-width: 899px) {
  .burger {
    display: inline-flex;
    position: relative;
  }

  .nav {
    position: fixed;
    inset: 0;
    z-index: var(--z-menu);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--sp-6);
    padding: var(--sp-24) var(--gutter) var(--sp-16);
    background: var(--c-black);
    color: var(--c-white);
    transform: translateY(-100%);
    visibility: hidden;
    transition: transform var(--dur-slow) var(--ease-out),
      visibility var(--dur-slow);
  }
  .nav.is-open {
    transform: translateY(0);
    visibility: visible;
  }
  .nav__link {
    font-size: 1.5rem;
    letter-spacing: 0.12em;
    padding: var(--sp-3) 0;
  }
  .nav .btn {
    margin-top: var(--sp-4);
  }
}

/* Le burger doit rester au-dessus du panneau ouvert */
.header:has(.nav.is-open) .burger {
  position: relative;
  z-index: calc(var(--z-menu) + 1);
  color: var(--c-white);
}

@media (min-width: 900px) {
  .nav__cta {
    margin-left: var(--sp-2);
  }
}

/* == 06. Hero ============================================================= */

.hero {
  position: relative;
  min-height: 100svh; /* svh : évite le saut de la barre d'URL mobile */
  display: flex;
  align-items: center;
  background: var(--c-black);
  color: var(--c-white);
  /* top = header + gouttière : le bloc reste optiquement centré sous le header */
  padding-top: calc(var(--header-h) + var(--sp-8));
  padding-bottom: var(--sp-8);
  overflow: hidden;
}

/* Photo de fond : désaturée pour respecter la palette noir & blanc */
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%; /* garde les voitures dans le cadrage */
  filter: grayscale(1) contrast(1.1) brightness(0.72);
}

/* Voile sombre + trame verticale : garantit la lisibilité du titre
   (contraste texte blanc / fond >= 4.5:1 sur toute la zone de texte) */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.8) 0%,
      rgba(0, 0, 0, 0.86) 45%,
      rgba(0, 0, 0, 0.7) 100%
    ),
    /* renfort central, sous le bloc de texte */
      radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0.5) 0%,
        transparent 70%
      ),
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 12.5% 100%;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: var(--sp-8);
}

.hero__title {
  max-width: 16ch;
  margin-inline: auto;
}

/* Second niveau du titre en contour uniquement — effet « concept-car » */
.hero__title em {
  font-style: normal;
  color: transparent;
  -webkit-text-stroke: 1px var(--c-white);
}

/* Sur photo, le chapô est éclairci (contraste >= 4.5:1) */
.hero .lead {
  color: #ededed;
}

.hero__aside {
  display: grid;
  justify-items: center;
  gap: var(--sp-8);
}

.hero .lead {
  max-width: 42ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-4);
}

/* Bandeau de chiffres clés en bas du hero */
.hero__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-6);
  padding-top: var(--sp-8);
  border-top: var(--border-w) solid var(--line-inv);
}
/* Ordre du DOM : dt (libellé) puis dd (valeur) — inversé visuellement */
.fact {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--sp-2);
}
.fact__value {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 300;
  letter-spacing: var(--ls-heading);
  font-variant-numeric: tabular-nums;
}
.fact__label {
  display: block;
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--fg-inv-muted);
}

@media (min-width: 900px) {
  .hero__inner {
    gap: var(--sp-10);
  }
  .hero__facts {
    grid-column: 1 / -1;
    margin-top: var(--sp-8);
  }
}

/* == 07. Section « Le Lieu » ============================================== */

.lieu__text {
  max-width: 60ch;
}
.lieu__text > * + * {
  margin-top: var(--sp-6);
}

/* Liste des prestations : filets fins, numérotation */
.features {
  list-style: none;
  margin: var(--sp-16) 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: var(--border-w) solid var(--line);
  counter-reset: feature;
}

.feature {
  counter-increment: feature;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-4) var(--sp-6);
  padding: var(--sp-8) 0;
  border-bottom: var(--border-w) solid var(--line);
}

.feature__icon {
  width: 28px;
  height: 28px;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.25;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature__body > * + * {
  margin-top: var(--sp-2);
}

.feature__title {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
}
.feature__title::before {
  content: "0" counter(feature);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

.feature__text {
  color: var(--fg-muted);
  max-width: 58ch;
}

@media (min-width: 700px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
    column-gap: var(--sp-16);
  }
}

/* == 08. Contact & formulaire ============================================= */

.contact__grid {
  display: grid;
  gap: var(--sp-16);
}

@media (min-width: 900px) {
  .contact__grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--sp-24);
  }
}

.form {
  display: grid;
  gap: var(--sp-8);
}

.field {
  display: grid;
  gap: var(--sp-2);
}

.field label {
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--fg-muted);
}

.field .req {
  color: inherit;
}

/* Champs en soulignement simple — cohérent avec l'esprit épuré */
.field input,
.field textarea {
  width: 100%;
  min-height: 48px; /* cible tactile */
  padding: var(--sp-3) 0;
  background: transparent;
  border: 0;
  border-bottom: var(--border-w) solid var(--line);
  border-radius: var(--radius);
  color: var(--fg);
  font-family: inherit;
  font-size: var(--fs-body);
  line-height: 1.5;
  transition: border-color var(--dur) var(--ease-out);
}
.field textarea {
  resize: vertical;
  min-height: 132px;
}
.field input:hover,
.field textarea:hover {
  border-bottom-color: var(--fg-muted);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--fg);
  border-bottom-width: 2px;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--c-gray-300);
}

/* État d'erreur : bordure + icône texte (jamais la couleur seule) */
.field.has-error input,
.field.has-error textarea {
  border-bottom-color: var(--fg);
  border-bottom-width: 2px;
  border-bottom-style: dashed;
}

.field__hint,
.field__error {
  font-size: var(--fs-small);
  line-height: 1.4;
}
.field__hint {
  color: var(--fg-muted);
}
.field__error {
  display: none;
  color: var(--fg);
  font-weight: 500;
}
.field__error::before {
  content: "! ";
  font-weight: 700;
}
.field.has-error .field__error {
  display: block;
}

.form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-6);
}

.form__note {
  font-size: var(--fs-small);
  color: var(--fg-muted);
  max-width: 42ch;
}

/* Message de statut après soumission (aria-live) */
.form__status {
  font-size: var(--fs-small);
  border-left: 2px solid currentColor;
  padding-left: var(--sp-4);
}
.form__status:empty {
  display: none;
}

/* Coordonnées directes */
.contact__details {
  display: grid;
  gap: var(--sp-8);
  align-content: start;
}

.detail {
  display: grid;
  gap: var(--sp-2);
  padding-bottom: var(--sp-6);
  border-bottom: var(--border-w) solid var(--line);
}
.detail__label {
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--fg-muted);
}
.detail__value {
  font-size: var(--fs-h3);
  font-weight: 300;
}

/* == 09. Footer =========================================================== */

.footer {
  background: var(--c-black);
  color: var(--c-white);
  padding-block: var(--sp-16) var(--sp-8);
}

.footer__top {
  display: grid;
  gap: var(--sp-12);
  padding-bottom: var(--sp-12);
  border-bottom: var(--border-w) solid var(--line-inv);
}

@media (min-width: 700px) {
  .footer__top {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
}

.footer__brand {
  display: grid;
  gap: var(--sp-4);
}
.footer__tagline {
  color: var(--fg-inv-muted);
  max-width: 34ch;
  font-size: var(--fs-small);
}

.social {
  display: flex;
  gap: var(--sp-2);
  list-style: none;
  margin: 0;
  padding: 0;
}
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px; /* cible tactile 48px */
  border: var(--border-w) solid var(--line-inv);
  color: inherit;
  transition: background-color var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out);
}
.social a:hover {
  background: var(--c-white);
  color: var(--c-black);
}
.social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-top: var(--sp-8);
  font-size: var(--fs-small);
  color: var(--fg-inv-muted);
}
.footer__bottom a {
  color: inherit;
}

/* == 10. Animations d'apparition ========================================== */

/* Éléments révélés au scroll (classe posée par main.js via IntersectionObserver).
   Sans JS, le contenu reste visible : l'état initial n'est appliqué
   que lorsque <html> porte la classe .js */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Respect de prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* == 11. Impression ======================================================= */

@media print {
  .header,
  .burger,
  .hero::before,
  .btn {
    display: none !important;
  }
  body {
    color: #000;
    background: #fff;
  }
}
