/* ==========================================================================
   ECH HABITAT - Feuille de style principale
   Palette tirée du logo : terracotta + ardoise
   Typographie : Bricolage Grotesque (titres) + Instrument Sans (corps)
   ========================================================================== */

:root {
  /* Couleurs de marque */
  --terre: #C06C48;
  --terre-fonce: #9E5233;
  --terre-clair: #DBB6A5;
  --ardoise: #313F47;
  --ardoise-fonce: #232D33;
  --ardoise-clair: #46565F;

  /* Neutres */
  --creme: #F7F3EE;
  --sable: #EDE4D9;
  --blanc: #FFFFFF;
  --gris-700: #4A5258;
  --gris-500: #6E777D;
  --gris-300: #C9CDCF;

  /* Typographie */
  --police-titre: "Bricolage Grotesque", Georgia, serif;
  --police-corps: "Instrument Sans", "Segoe UI", sans-serif;

  /* Échelle (ratio 1.25) */
  --t-xs: 0.8rem;
  --t-s: 0.9rem;
  --t-base: 1rem;
  --t-m: 1.25rem;
  --t-l: 1.563rem;
  --t-xl: 1.953rem;
  --t-2xl: 2.441rem;
  --t-3xl: 3.052rem;

  /* Espacements (pas de 8) */
  --e-1: 8px;
  --e-2: 16px;
  --e-3: 24px;
  --e-4: 32px;
  --e-6: 48px;
  --e-8: 64px;
  --e-12: 96px;

  --rayon: 6px;
  --transition: 200ms ease-out;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--police-corps);
  font-size: var(--t-base);
  line-height: 1.6;
  color: var(--ardoise);
  background: var(--creme);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--police-titre);
  line-height: 1.15;
  font-weight: 700;
  color: var(--ardoise);
}

h1 { font-size: clamp(var(--t-xl), 5.5vw, var(--t-3xl)); }
h2 { font-size: clamp(var(--t-l), 4vw, var(--t-2xl)); }
h3 { font-size: var(--t-m); }

p { max-width: 65ch; }

a { color: var(--terre-fonce); }

.conteneur {
  width: min(1160px, 100% - var(--e-6));
  margin-inline: auto;
}

.section { padding-block: var(--e-12); }
.section--serree { padding-block: var(--e-8); }
.section--sable { background: var(--sable); }
.section--ardoise { background: var(--ardoise); }
.section--ardoise h2, .section--ardoise h3, .section--ardoise p { color: var(--creme); }

.surtitre {
  display: inline-block;
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terre-fonce);
  margin-bottom: var(--e-2);
}
.surtitre::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 2px;
  background: var(--terre);
  vertical-align: middle;
  margin-right: var(--e-1);
}
.section--ardoise .surtitre { color: var(--terre-clair); }
.section--ardoise .surtitre::before { background: var(--terre-clair); }

.entete-section { margin-bottom: var(--e-6); }
.entete-section p { margin-top: var(--e-2); color: var(--gris-700); }
.section--ardoise .entete-section p { color: var(--gris-300); }

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--e-1);
  padding: 14px 28px;
  min-height: 48px;
  font-family: var(--police-corps);
  font-size: var(--t-base);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--rayon);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}
.btn:focus-visible { outline: 3px solid var(--terre); outline-offset: 3px; }

.btn--primaire { background: var(--terre); color: var(--blanc); }
.btn--primaire:hover { background: var(--terre-fonce); transform: translateY(-2px); }

.btn--contour { background: transparent; color: var(--ardoise); border-color: var(--ardoise); }
.btn--contour:hover { background: var(--ardoise); color: var(--creme); }

.btn--contour-clair { background: transparent; color: var(--creme); border-color: rgba(247, 243, 238, 0.6); }
.btn--contour-clair:hover { background: var(--creme); color: var(--ardoise); }

/* --------------------------------------------------------------------------
   En-tête
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 243, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.site-header.est-scrolle {
  border-bottom-color: var(--sable);
  box-shadow: 0 2px 16px rgba(35, 45, 51, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-3);
  min-height: 80px;
}

.logo img { height: 52px; width: auto; }

.nav-principale { display: flex; align-items: center; gap: var(--e-3); }

.nav-principale a:not(.btn) {
  font-size: var(--t-s);
  font-weight: 600;
  text-decoration: none;
  color: var(--ardoise);
  padding: var(--e-1) 4px;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.nav-principale a:not(.btn):hover { color: var(--terre-fonce); }
.nav-principale a:not(.btn).actif { color: var(--terre-fonce); border-bottom-color: var(--terre); }
.nav-principale a:focus-visible { outline: 3px solid var(--terre); outline-offset: 3px; }
.nav-principale .btn { padding: 10px 20px; min-height: 44px; }

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px;
}
.burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ardoise);
  transition: transform var(--transition), opacity var(--transition);
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.burger:focus-visible { outline: 3px solid var(--terre); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Héros (accueil)
   -------------------------------------------------------------------------- */
.heros {
  position: relative;
  min-height: min(88vh, 780px);
  display: flex;
  align-items: flex-end;
  color: var(--creme);
  overflow: hidden;
  background: var(--ardoise-fonce);
}
.heros video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.heros::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(35, 45, 51, 0.88) 0%, rgba(35, 45, 51, 0.35) 55%, rgba(35, 45, 51, 0.25) 100%);
}
.heros-contenu {
  position: relative;
  z-index: 2;
  padding-block: var(--e-12) var(--e-8);
}
.heros h1 { color: var(--blanc); max-width: 17ch; }
.heros .accent { color: var(--terre-clair); }
.heros p {
  margin-top: var(--e-3);
  font-size: var(--t-m);
  color: rgba(247, 243, 238, 0.9);
  max-width: 52ch;
}
.heros-actions { display: flex; flex-wrap: wrap; gap: var(--e-2); margin-top: var(--e-4); }

.heros-bandeau {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(247, 243, 238, 0.25);
  margin-top: var(--e-6);
  padding-block: var(--e-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--e-2) var(--e-6);
  font-size: var(--t-s);
  font-weight: 600;
}
.heros-bandeau span { display: inline-flex; align-items: center; gap: var(--e-1); }
.heros-bandeau svg { flex: none; }

/* --------------------------------------------------------------------------
   Médias temporaires (placeholders)
   -------------------------------------------------------------------------- */
.media-ph {
  position: relative;
  border-radius: var(--rayon);
  background:
    repeating-linear-gradient(-45deg, rgba(192, 108, 72, 0.06) 0 14px, transparent 14px 28px),
    linear-gradient(150deg, var(--sable), #E2D5C6);
  border: 1px dashed var(--terre-clair);
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.media-ph--large { aspect-ratio: 16 / 9; }
.media-ph--portrait { aspect-ratio: 3 / 4; }
.media-ph::after {
  content: attr(data-label);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--terre-fonce);
  background: rgba(247, 243, 238, 0.85);
  padding: 6px 14px;
  border-radius: 999px;
}

/* --------------------------------------------------------------------------
   Cartes services
   -------------------------------------------------------------------------- */
.grille-services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--e-3);
}
.carte-service {
  display: flex;
  flex-direction: column;
  background: var(--blanc);
  border-radius: var(--rayon);
  overflow: hidden;
  text-decoration: none;
  color: var(--ardoise);
  box-shadow: 0 1px 3px rgba(35, 45, 51, 0.08);
  transition: transform var(--transition), box-shadow var(--transition);
}
.carte-service:hover { transform: translateY(-6px); box-shadow: 0 16px 32px rgba(35, 45, 51, 0.14); }
.carte-service:focus-visible { outline: 3px solid var(--terre); outline-offset: 3px; }
.carte-service .media-ph { border-radius: 0; border: none; border-bottom: 3px solid var(--terre); }
.carte-service .photo-service {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  border-bottom: 3px solid var(--terre);
  transition: transform var(--transition);
}
.carte-service-corps { padding: var(--e-3); display: flex; flex-direction: column; gap: var(--e-2); flex: 1; }
.carte-service .numero {
  font-family: var(--police-titre);
  font-size: var(--t-s);
  font-weight: 700;
  color: var(--terre);
}
.carte-service ul { list-style: none; display: grid; gap: 6px; }
.carte-service li {
  position: relative;
  padding-left: var(--e-3);
  font-size: var(--t-s);
  color: var(--gris-700);
}
.carte-service li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 12px;
  height: 2px;
  background: var(--terre);
}
.carte-service .lien-carte {
  margin-top: auto;
  font-weight: 600;
  font-size: var(--t-s);
  color: var(--terre-fonce);
}
.carte-service:hover .lien-carte { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Section "pourquoi nous" / arguments
   -------------------------------------------------------------------------- */
.grille-arguments {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--e-3);
}
.argument { display: grid; gap: var(--e-1); }
.argument .icone {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--rayon);
  background: rgba(192, 108, 72, 0.16);
  color: var(--terre-clair);
  margin-bottom: var(--e-1);
}
.argument h3 { font-size: var(--t-base); color: var(--creme); }
.argument p { font-size: var(--t-s); color: var(--gris-300); }

/* --------------------------------------------------------------------------
   Méthode (étapes)
   -------------------------------------------------------------------------- */
.grille-etapes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--e-3);
  counter-reset: etape;
}
.etape {
  background: var(--blanc);
  border-radius: var(--rayon);
  padding: var(--e-3);
  border-top: 3px solid var(--terre);
  counter-increment: etape;
}
.etape::before {
  content: "0" counter(etape);
  font-family: var(--police-titre);
  font-size: var(--t-l);
  font-weight: 700;
  color: var(--terre-clair);
  display: block;
  margin-bottom: var(--e-1);
}
.etape h3 { font-size: var(--t-base); margin-bottom: 6px; }
.etape p { font-size: var(--t-s); color: var(--gris-700); }

/* --------------------------------------------------------------------------
   Réalisations
   -------------------------------------------------------------------------- */
.grille-realisations {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--e-3);
}
.realisation { display: grid; gap: var(--e-1); }
.photo-realisation,
.photo-bloc {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  border-radius: var(--rayon);
}

.realisation figcaption { font-size: var(--t-s); font-weight: 600; }
.realisation .lieu { font-size: var(--t-xs); color: var(--gris-500); font-weight: 400; display: block; }

/* --------------------------------------------------------------------------
   Bande d'appel à l'action
   -------------------------------------------------------------------------- */
.bande-cta {
  background: linear-gradient(120deg, var(--terre) 0%, var(--terre-fonce) 100%);
  color: var(--blanc);
  padding-block: var(--e-8);
}
.bande-cta .conteneur {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-3);
}
.bande-cta h2 { color: var(--blanc); max-width: 22ch; }
.bande-cta p { color: rgba(255, 255, 255, 0.88); margin-top: var(--e-1); }
.bande-cta .btn--primaire { background: var(--ardoise); }
.bande-cta .btn--primaire:hover { background: var(--ardoise-fonce); }

/* --------------------------------------------------------------------------
   Pages services
   -------------------------------------------------------------------------- */
.heros-page {
  background: var(--ardoise);
  color: var(--creme);
  padding-block: var(--e-8);
  position: relative;
  overflow: hidden;
}
.heros-page::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 420px;
  height: 420px;
  border: 60px solid rgba(192, 108, 72, 0.18);
  transform: rotate(45deg);
}
.heros-page .conteneur { position: relative; z-index: 2; }
.heros-page h1 { color: var(--blanc); max-width: 20ch; }
.heros-page p { margin-top: var(--e-2); color: var(--gris-300); font-size: var(--t-m); max-width: 55ch; }
.fil-ariane {
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terre-clair);
  margin-bottom: var(--e-2);
}
.fil-ariane a { color: inherit; text-decoration: none; }
.fil-ariane a:hover { text-decoration: underline; }

.deux-colonnes {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--e-6);
  align-items: center;
}
.deux-colonnes h2 { margin-bottom: var(--e-2); }
.deux-colonnes p + p { margin-top: var(--e-2); }
.deux-colonnes p { color: var(--gris-700); }

.grille-prestations {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--e-3);
}
.prestation {
  background: var(--blanc);
  border-radius: var(--rayon);
  padding: var(--e-3);
  border-left: 3px solid var(--terre);
}
.prestation h3 { font-size: var(--t-base); margin-bottom: var(--e-1); }
.prestation p { font-size: var(--t-s); color: var(--gris-700); }

.liste-signaux { list-style: none; display: grid; gap: var(--e-2); }
.liste-signaux li {
  display: flex;
  gap: var(--e-2);
  align-items: flex-start;
  background: var(--blanc);
  padding: var(--e-2) var(--e-3);
  border-radius: var(--rayon);
  font-size: var(--t-s);
  color: var(--gris-700);
}
.liste-signaux svg { flex: none; margin-top: 2px; color: var(--terre); }

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */
.grille-contact {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--e-6);
  align-items: start;
}
.bloc-coordonnees { display: grid; gap: var(--e-3); }
.coordonnee { display: flex; gap: var(--e-2); align-items: flex-start; }
.coordonnee .icone {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: var(--rayon);
  background: rgba(192, 108, 72, 0.14);
  color: var(--terre-fonce);
}
.coordonnee h3 { font-size: var(--t-base); }
.coordonnee p, .coordonnee a { font-size: var(--t-s); color: var(--gris-700); }

.formulaire {
  background: var(--blanc);
  border-radius: var(--rayon);
  padding: var(--e-4);
  box-shadow: 0 1px 3px rgba(35, 45, 51, 0.08);
  display: grid;
  gap: var(--e-3);
}
.champ { display: grid; gap: 6px; }
.champ label { font-size: var(--t-s); font-weight: 600; }
.champ input, .champ select, .champ textarea {
  font-family: var(--police-corps);
  font-size: var(--t-base);
  padding: 12px 14px;
  min-height: 48px;
  border: 1px solid var(--gris-300);
  border-radius: var(--rayon);
  background: var(--creme);
  color: var(--ardoise);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.champ textarea { min-height: 140px; resize: vertical; }
.champ input:focus, .champ select:focus, .champ textarea:focus {
  outline: none;
  border-color: var(--terre);
  box-shadow: 0 0 0 3px rgba(192, 108, 72, 0.2);
}
.champ-double { display: grid; grid-template-columns: 1fr 1fr; gap: var(--e-3); }
.note-form { font-size: var(--t-xs); color: var(--gris-500); }

/* --------------------------------------------------------------------------
   Pied de page
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--ardoise-fonce);
  color: var(--gris-300);
  padding-block: var(--e-8) var(--e-3);
  font-size: var(--t-s);
}
.footer-grille {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--e-6);
  padding-bottom: var(--e-6);
  border-bottom: 1px solid var(--ardoise-clair);
}
.site-footer .logo-footer img { height: 64px; width: auto; margin-bottom: var(--e-2); }
.site-footer h3 { color: var(--creme); font-size: var(--t-s); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--e-2); }
.site-footer ul { list-style: none; display: grid; gap: var(--e-1); }
.site-footer a { color: var(--gris-300); text-decoration: none; }
.site-footer a:hover { color: var(--terre-clair); text-decoration: underline; }
.footer-bas {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--e-2);
  padding-top: var(--e-3);
  font-size: var(--t-xs);
  color: var(--gris-500);
}

/* --------------------------------------------------------------------------
   Révélations au défilement
   -------------------------------------------------------------------------- */
.revele {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 500ms ease-out, transform 500ms ease-out;
}
.revele.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .revele { opacity: 1; transform: none; transition: none; }
  .btn, .carte-service { transition: none; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .grille-services, .grille-realisations, .grille-prestations { grid-template-columns: 1fr 1fr; }
  .grille-arguments, .grille-etapes { grid-template-columns: 1fr 1fr; }
  .deux-colonnes, .grille-contact { grid-template-columns: 1fr; }
  .footer-grille { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .section { padding-block: var(--e-8); }
  .grille-services, .grille-realisations, .grille-prestations,
  .grille-arguments, .grille-etapes, .champ-double, .footer-grille { grid-template-columns: 1fr; }

  .burger { display: flex; }
  .nav-principale {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--creme);
    border-bottom: 1px solid var(--sable);
    box-shadow: 0 16px 32px rgba(35, 45, 51, 0.12);
    padding: var(--e-2) var(--e-3) var(--e-3);
    display: none;
  }
  .nav-principale.ouverte { display: flex; }
  .nav-principale a:not(.btn) { padding: 14px 4px; border-bottom: 1px solid var(--sable); }
  .nav-principale .btn { margin-top: var(--e-2); justify-content: center; }

  .logo img { height: 44px; }
}
