/* ============================================================
   BRG — Batiment Renovation General
   style.css  |  Tokens → Reset → Layout → Composants → Sections
   ============================================================ */

/* ========== 1. DESIGN TOKENS ========== */
:root {
  /* --- Couleurs de marque --- */
  --clr-brand:        #3E6E8E;  /* Bleu profond — texte accent, liens */
  --clr-brand-light:  #B9D7E5;  /* Bleu ciel — aplats, boutons        */
  --clr-brand-dark:   #2C5470;  /* Hover / états actifs               */
  --clr-brand-soft:   #E3F0F6;  /* Bleu très pâle — pastilles         */
  --clr-sand:         #EDE4D3;  /* Beige sable                        */
  --clr-sand-light:   #F5F0E6;  /* Beige clair                        */
  --clr-sky:          #E8F4F8;  /* Bleu ciel très clair               */
  --clr-grey:         #F4F4F4;  /* Gris clair doux                    */
  --clr-white:        #FAF9F6;  /* Blanc cassé                        */
  --clr-ink:          #22323D;  /* Bleu ardoise — titres et texte     */
  --clr-ink-soft:     #5A6B76;  /* Texte secondaire                   */
  --clr-line:         #DCE6EC;  /* Bordures                           */
  --clr-dark:         #22323D;  /* Fonds sombres (footer, hero uni)   */

  /* --- Typographie --- */
  --ff-title: 'Poppins', 'Inter', system-ui, sans-serif;
  --ff-body:  'Inter', system-ui, -apple-system, sans-serif;

  --fs-display: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem);
  --fs-h1:      clamp(2rem, 1.4rem + 2.4vw, 3rem);
  --fs-h2:      clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem);
  --fs-h3:      clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  --fs-body:    1.0625rem;
  --fs-small:   0.9375rem;
  --fs-label:   0.8125rem;

  /* --- Espacements (échelle 4px) --- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
  --sp-9: 96px; --sp-10: 128px;

  /* --- Rayons --- */
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-pill: 999px;

  /* --- Ombres douces --- */
  --sh-1: 0 1px 2px rgba(44,44,44,.04), 0 2px 8px rgba(44,44,44,.05);
  --sh-2: 0 4px 12px rgba(44,44,44,.06), 0 12px 28px rgba(44,44,44,.07);
  --sh-3: 0 10px 24px rgba(44,44,44,.08), 0 24px 48px rgba(44,44,44,.10);

  /* --- Layout --- */
  --container: 1200px;
  --gutter: 24px;
  --header-h: 120px;

  /* --- Transitions --- */
  --t-fast: .15s ease;
  --t-std:  .28s cubic-bezier(.22,.61,.36,1);
}

/* ========== 2. RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--clr-ink);
  background: var(--clr-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { display: block; max-width: 100%; }
img { object-fit: cover; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--ff-title); font-weight: 700; line-height: 1.18; letter-spacing: -.015em; }
:focus-visible { outline: 3px solid var(--clr-brand); outline-offset: 3px; border-radius: var(--r-sm); }

/* ========== 3. LAYOUT ========== */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
/* Variante large, utilisée là où deux colonnes denses cohabitent (page Contact). */
.container--wide { max-width: 1360px; }
.section { padding-block: var(--sp-9); }
.section--tight { padding-block: var(--sp-8); }
.section--sand { background: var(--clr-sand-light); }
.section--grey { background: var(--clr-grey); }
.section--sky  { background: var(--clr-sky); }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ========== 4. TYPO UTILITAIRES ========== */
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--ff-title); font-size: var(--fs-label); font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--clr-brand);
  margin-bottom: var(--sp-3);
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--clr-brand-light); }
.section-head { max-width: 680px; margin-bottom: var(--sp-7); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow::before { display: none; }
.section-head h2 { font-size: var(--fs-h2); margin-bottom: var(--sp-3); }
.lead { color: var(--clr-ink-soft); font-size: 1.125rem; }
.muted { color: var(--clr-ink-soft); }

/* ========== 5. BOUTONS ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: 14px 26px; border: 1.5px solid transparent; border-radius: 12px;
  font-family: var(--ff-title); font-size: .9375rem; font-weight: 600;
  cursor: pointer; transition: all var(--t-std); white-space: nowrap;
}
.btn--primary   { background: var(--clr-brand-light); color: var(--clr-ink); box-shadow: var(--sh-1); }
.btn--primary:hover  { background: #A3CADD; box-shadow: var(--sh-2); transform: translateY(-2px); }
.btn--secondary { background: var(--clr-white); color: var(--clr-ink); border-color: var(--clr-line); }
.btn--secondary:hover { background: var(--clr-brand-soft); border-color: var(--clr-brand-light); transform: translateY(-2px); }
.btn--outline   { background: transparent; color: var(--clr-brand); border-color: currentColor; }
.btn--outline:hover  { background: var(--clr-brand); color: #fff; border-color: var(--clr-brand); }
.btn--ghost     { background: transparent; color: var(--clr-ink); padding-inline: var(--sp-3); }
.btn--ghost:hover { color: var(--clr-brand); }
.btn--on-dark   { background: var(--clr-dark); color: #fff; border-color: rgba(255,255,255,.28); }
.btn--on-dark:hover { background: #fff; color: var(--clr-ink); border-color: #fff; transform: translateY(-2px); }
.btn--lg { padding: 17px 34px; font-size: 1rem; }
.btn[disabled], .btn--disabled { opacity: .45; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

/* ========== 6. HEADER STICKY ========== */
/* Réserve la hauteur du header le temps que le composant soit injecté,
   pour éviter que la page sursaute au chargement. */
#header-slot { min-height: var(--header-h); }
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,249,246,.88); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--clr-line);
  transition: box-shadow var(--t-std);
}
.header.is-scrolled { box-shadow: var(--sh-1); }
.header__inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5);
}
.logo { display: flex; align-items: center; gap: var(--sp-3); }
.logo__img { height: 70px; width: auto; object-fit: contain; }
.logo__mark {
  width: 42px; height: 42px; flex: none; border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--clr-brand-light), var(--clr-brand));
  color: #fff; display: grid; place-items: center;
  font-family: var(--ff-title); font-weight: 700; font-size: .9rem; letter-spacing: .02em;
}
.logo__text { display: flex; flex-direction: column; line-height: 1.15; }
.logo__name { font-family: var(--ff-title); font-weight: 700; font-size: 1.05rem; }
.logo__tag  { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--clr-ink-soft); }

.nav { display: flex; align-items: center; gap: var(--sp-2); }
/* Le CTA du menu n'est visible que dans le panneau mobile. */
.nav .btn { display: none; }
.nav a.btn--primary { color: var(--clr-ink); }
.nav a {
  position: relative; padding: 10px 14px; border-radius: var(--r-sm);
  font-size: .9375rem; font-weight: 500; color: var(--clr-ink-soft);
  transition: color var(--t-fast), background var(--t-fast);
}
.nav a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  background: var(--clr-brand); transform: scaleX(0); transform-origin: left;
  transition: transform var(--t-std);
}
.nav a:hover { color: var(--clr-ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--clr-ink); font-weight: 600; }

.burger {
  display: none; width: 44px; height: 44px; border: 1px solid var(--clr-line);
  border-radius: var(--r-sm); background: var(--clr-white); cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.burger span { width: 20px; height: 2px; background: var(--clr-ink); border-radius: 2px; transition: transform var(--t-std), opacity var(--t-fast); }
.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); }

/* ========== 7. HERO ========== */
.hero { position: relative; min-height: 640px; display: grid; align-items: center; isolation: isolate; }
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { width: 100%; height: 100%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(26,40,50,.86) 0%, rgba(26,40,50,.62) 48%, rgba(26,40,50,.28) 100%);
}
.hero__content { max-width: 720px; color: #fff; padding-block: var(--sp-9); }
.hero__content .eyebrow { color: var(--clr-brand-light); }
.hero__content .eyebrow::before { background: var(--clr-brand-light); }
/* Titre calibré pour tenir sur deux lignes en desktop. */
.hero h1 { font-size: clamp(1.9rem, 1.1rem + 2vw, 2.5rem); margin-bottom: var(--sp-4); max-width: 18ch; }
@media (min-width: 900px) {
  .hero__content { max-width: 1040px; }
  .hero h1 { max-width: none; }
  .hero p { max-width: 64ch; }
}
.hero p { font-size: 1.15rem; color: rgba(255,255,255,.88); margin-bottom: var(--sp-6); max-width: 58ch; }
.hero__stats { display: flex; flex-wrap: wrap; gap: var(--sp-7); margin-top: var(--sp-8); padding-top: var(--sp-5); border-top: 1px solid rgba(255,255,255,.22); }
.hero__stat b { display: block; font-family: var(--ff-title); font-size: 2rem; line-height: 1; }
.hero__stat span { font-size: var(--fs-small); color: rgba(255,255,255,.75); }


/* Hero secondaire (pages internes) */
.page-hero { position: relative; isolation: isolate; padding-block: var(--sp-9); text-align: center; color: #fff; }
.page-hero__media { position: absolute; inset: 0; z-index: -2; }
.page-hero__media img { width: 100%; height: 100%; }
.page-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(26,40,50,.80), rgba(26,40,50,.68)); }
.page-hero h1 { font-size: var(--fs-h1); margin-bottom: var(--sp-3); }
.page-hero p { color: rgba(255,255,255,.85); max-width: 62ch; margin-inline: auto; }
.page-hero .eyebrow { color: var(--clr-brand-light); justify-content: center; }
.page-hero .eyebrow::before { display: none; }
.breadcrumb { font-size: var(--fs-small); color: rgba(255,255,255,.7); margin-top: var(--sp-4); }
.breadcrumb a:hover { color: #fff; text-decoration: underline; }

/* Hero des pages légales : pas de photo, fond sombre uni. */
.page-hero--plain { background: var(--clr-dark); }
.page-hero--plain::after { display: none; }

/* ========== 7 bis. PAGES LÉGALES ========== */
.legal-card {
  max-width: 900px; margin-inline: auto;
  background: #fff; border: 1px solid var(--clr-line); border-radius: var(--r-lg);
  padding: var(--sp-8) var(--sp-7); box-shadow: var(--sh-2);
}
.legal-card h2 {
  font-size: 1.35rem; color: var(--clr-ink);
  margin: var(--sp-7) 0 var(--sp-4);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--clr-brand-light);
}
.legal-card h2:first-of-type { margin-top: 0; }
.legal-card h3 { font-size: 1.05rem; color: var(--clr-brand-dark); margin: var(--sp-5) 0 var(--sp-2); }
.legal-card p, .legal-card ul { color: var(--clr-ink-soft); font-size: var(--fs-small); line-height: 1.85; margin-bottom: var(--sp-4); }
.legal-card ul { padding-left: var(--sp-5); list-style: disc; }
.legal-card li { margin-bottom: var(--sp-2); }
.legal-card strong { color: var(--clr-ink); }
.legal-card a { color: var(--clr-brand); font-weight: 600; }
.legal-card a:hover { color: var(--clr-brand-dark); text-decoration: underline; }

@media (max-width: 720px) {
  .legal-card { padding: var(--sp-6) var(--sp-4); }
}

/* ========== 8. CARTES ========== */
.card {
  background: #fff; border: 1px solid var(--clr-line); border-radius: var(--r-md);
  box-shadow: var(--sh-1); overflow: hidden;
  transition: transform var(--t-std), box-shadow var(--t-std), border-color var(--t-std);
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--sh-3); border-color: var(--clr-brand-light); }
.card__body { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; }
.card__body h3 { font-size: var(--fs-h3); }
.card__body p { color: var(--clr-ink-soft); font-size: var(--fs-small); flex: 1; }
.card__media { aspect-ratio: 4 / 3; overflow: hidden; }
.card__media img { width: 100%; height: 100%; transition: transform .6s cubic-bezier(.22,.61,.36,1); }
.card:hover .card__media img { transform: scale(1.06); }
.card__link { font-family: var(--ff-title); font-weight: 600; font-size: .9rem; color: var(--clr-brand); display: inline-flex; gap: 6px; align-items: center; transition: gap var(--t-std); }
.card__link:hover { gap: 12px; }

.icon-badge {
  width: 52px; height: 52px; border-radius: var(--r-md); flex: none;
  background: var(--clr-brand-soft); color: var(--clr-brand);
  display: grid; place-items: center; transition: background var(--t-std), color var(--t-std);
}
.card:hover .icon-badge { background: var(--clr-brand); color: #fff; }
.icon-badge svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ========== 9. SECTION À PROPOS (texte + image) ========== */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8); align-items: stretch; }
.split__media { position: relative; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-2); min-height: 340px; }
.split__media img { width: 100%; height: 100%; object-fit: cover; }
.split__badge {
  position: absolute; left: var(--sp-5); bottom: var(--sp-5);
  background: rgba(250,249,246,.95); backdrop-filter: blur(8px);
  border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5); box-shadow: var(--sh-2);
}
.split__badge b { display: block; font-family: var(--ff-title); font-size: 1.8rem; color: var(--clr-brand); line-height: 1; }
.split__badge span { font-size: var(--fs-small); color: var(--clr-ink-soft); }
.value-list { display: grid; gap: var(--sp-4); margin-top: var(--sp-5); }
.value-list li { display: flex; gap: var(--sp-3); align-items: flex-start; }
.check {
  width: 24px; height: 24px; flex: none; border-radius: 50%; margin-top: 4px;
  background: var(--clr-brand); color: #fff; display: grid; place-items: center; font-size: 13px;
}
.value-list strong { font-family: var(--ff-title); display: block; font-size: 1rem; }
.value-list p { font-size: var(--fs-small); color: var(--clr-ink-soft); }

/* ========== 10. POURQUOI BRG ========== */
.why-card { background: #fff; border-radius: var(--r-md); padding: var(--sp-6); border: 1px solid var(--clr-line); box-shadow: var(--sh-1); transition: transform var(--t-std), box-shadow var(--t-std); }
.why-card:hover { transform: translateY(-4px); box-shadow: var(--sh-2); }
.why-card__num { font-family: var(--ff-title); font-size: 2rem; font-weight: 700; color: var(--clr-brand-light); line-height: 1; margin-bottom: var(--sp-3); }
.why-card h3 { font-size: 1.1rem; margin-bottom: var(--sp-2); }
.why-card p { font-size: var(--fs-small); color: var(--clr-ink-soft); }

/* ========== 11. CTA FINAL ========== */
.cta {
  border-radius: var(--r-lg); overflow: hidden; position: relative; isolation: isolate;
  padding: var(--sp-9) var(--sp-6); text-align: center; color: #fff;
}
.cta__media { position: absolute; inset: 0; z-index: -2; }
.cta__media img { width: 100%; height: 100%; }
.cta::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(115deg, rgba(34,50,61,.80) 0%, rgba(62,110,142,.78) 32%, rgba(92,78,68,.78) 68%, rgba(74,59,50,.82) 100%); }
.cta h2 { font-size: var(--fs-h2); margin-bottom: var(--sp-3); }
.cta p { color: rgba(255,255,255,.88); max-width: 56ch; margin: 0 auto var(--sp-6); }
.cta .btn-row { justify-content: center; }

/* ========== 12. FILTRES ========== */
.filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; margin-bottom: var(--sp-7); }
.filter {
  padding: 10px 20px; border-radius: var(--r-pill); border: 1.5px solid var(--clr-line);
  background: #fff; font-size: .9rem; font-weight: 500; cursor: pointer; transition: all var(--t-std);
}
.filter:hover { border-color: var(--clr-brand-light); background: var(--clr-brand-soft); }
.filter[aria-pressed="true"] { background: var(--clr-brand-light); border-color: var(--clr-brand-light); color: var(--clr-ink); font-weight: 600; }

/* ========== 13. PROJETS ========== */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.project {
  position: relative; border-radius: var(--r-md); overflow: hidden; cursor: pointer;
  aspect-ratio: 4 / 3; box-shadow: var(--sh-1); border: 0; padding: 0; background: var(--clr-grey);
  transition: transform var(--t-std), box-shadow var(--t-std);
}
.project:hover { transform: translateY(-6px); box-shadow: var(--sh-3); }
.project img { width: 100%; height: 100%; transition: transform .7s cubic-bezier(.22,.61,.36,1); }
.project:hover img { transform: scale(1.08); }
.project__overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--sp-5); text-align: left; color: #fff;
  background: linear-gradient(to top, rgba(20,32,40,.9) 0%, rgba(20,32,40,.45) 45%, rgba(20,32,40,0) 75%);
}
.project__tag {
  align-self: flex-start; font-size: var(--fs-label); font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; background: var(--clr-brand-light); color: var(--clr-ink);
  padding: 4px 12px; border-radius: var(--r-pill); margin-bottom: var(--sp-2);
}
.project__overlay h3 { font-size: 1.15rem; }
.project__meta { font-size: var(--fs-small); color: rgba(255,255,255,.78); }
.project__desc {
  font-size: var(--fs-small); color: rgba(255,255,255,.88);
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height var(--t-std), opacity var(--t-std), margin-top var(--t-std);
}
.project:hover .project__desc, .project:focus-visible .project__desc { max-height: 140px; opacity: 1; margin-top: var(--sp-2); }
.project.is-hidden { display: none; }

/* ========== 14. LIGHTBOX ========== */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(20,32,40,.82); backdrop-filter: blur(6px);
  padding: var(--sp-5); overflow-y: auto;
}
.lightbox.is-open { display: grid; place-items: center; }
.lightbox__panel {
  width: min(960px, 100%); background: var(--clr-white); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--sh-3); display: grid; grid-template-columns: 1.25fr 1fr;
}
.lightbox__panel img { width: 100%; height: 100%; min-height: 380px; }
.lightbox__info { padding: var(--sp-7) var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-3); }
.lightbox__info h3 { font-size: var(--fs-h3); }
.lightbox__info dl { display: grid; gap: var(--sp-2); margin-top: var(--sp-2); font-size: var(--fs-small); }
.lightbox__info dt { color: var(--clr-ink-soft); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .08em; }
.lightbox__close {
  position: fixed; top: var(--sp-5); right: var(--sp-5); width: 44px; height: 44px;
  border-radius: 50%; border: 0; background: rgba(255,255,255,.92); cursor: pointer; font-size: 20px;
  transition: transform var(--t-std);
}
.lightbox__close:hover { transform: rotate(90deg); }

/* ========== 15. FORMULAIRE & CONTACT ========== */
.contact-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--sp-8); align-items: start; }
.info-card { background: var(--clr-brand-soft); border-radius: var(--r-lg); padding: var(--sp-7); border: 1px solid var(--clr-line); }
.info-list { display: grid; gap: var(--sp-5); margin-top: var(--sp-5); }
.info-list li { display: flex; gap: var(--sp-4); align-items: flex-start; }
.info-list strong { font-family: var(--ff-title); display: block; font-size: .95rem; }
.info-list span, .info-list a { font-size: var(--fs-small); color: var(--clr-ink-soft); }
.info-list a:hover { color: var(--clr-brand); }
.map { margin-top: var(--sp-5); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-1); border: 1px solid var(--clr-line); }
.map iframe { display: block; width: 100%; height: 340px; border: 0; }

.form { background: #fff; border: 1px solid var(--clr-line); border-radius: var(--r-lg); padding: var(--sp-7) var(--sp-6); box-shadow: var(--sh-2); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field label { font-family: var(--ff-title); font-size: var(--fs-label); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--clr-ink-soft); }
.field input, .field select, .field textarea {
  min-width: 0;
  padding: 13px 15px; border: 1.5px solid var(--clr-line); border-radius: var(--r-sm);
  background: var(--clr-white); font-size: var(--fs-small);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--clr-brand-light); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; border-color: var(--clr-brand); background: #fff;
  box-shadow: 0 0 0 4px rgba(185,215,229,.55);
}
.field textarea { resize: vertical; min-height: 140px; }
.field label { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }

/* Compteur de caractères du message */
.field__counter { font-size: var(--fs-label); font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--clr-ink-soft); }
.field__counter.is-ok { color: var(--clr-brand); }

/* Champ actif (classe posée par contact.js) */
.field.focused label { color: var(--clr-brand); }

/* États du bouton d'envoi */
.btn-submit-icon { display: inline-block; font-size: 1.05em; line-height: 1; }
.btn-submit-icon.spin { animation: brg-spin 1s linear infinite; }
@keyframes brg-spin { to { transform: rotate(360deg); } }
.btn.loading { opacity: .85; cursor: progress; }
.btn.success { background: #2F7D5B; border-color: #2F7D5B; }
.btn.success:hover { background: #2F7D5B; transform: none; }
.btn.error   { background: #C0563F; border-color: #C0563F; }
.btn.error:hover { background: #A8452F; }

/* État d'erreur */
.field__error { font-size: var(--fs-label); color: #9E3B2E; }
.field__error:empty { display: none; }
.field--error input, .field--error select, .field--error textarea { border-color: #C0563F; background: #FDF6F4; }
.field--error input:focus, .field--error select:focus, .field--error textarea:focus { box-shadow: 0 0 0 4px rgba(192,86,63,.18); }

/* Pot de miel anti-spam : masqué sans display:none (les robots l'ignorent moins) */
.field--honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__note { font-size: var(--fs-label); color: var(--clr-ink-soft); margin-top: var(--sp-3); }
.form__success {
  display: none; margin-top: var(--sp-4); padding: var(--sp-4);
  border-radius: var(--r-sm); background: var(--clr-sky); border: 1px solid #BFE0EC;
  font-size: var(--fs-small);
}
.form__success.is-visible { display: block; }
.form__error-box {
  display: none; margin-top: var(--sp-4); padding: var(--sp-4);
  border-radius: var(--r-sm); background: #FDF6F4; border: 1px solid #E8C4BA;
  font-size: var(--fs-small); color: #8C3324;
}
.form__error-box a { color: inherit; text-decoration: underline; }
.form__error-box.is-visible { display: block; }

/* ========== 16. FOOTER ========== */
.footer { background: var(--clr-dark); color: rgba(255,255,255,.72); padding-block: var(--sp-8) var(--sp-5); margin-top: auto; }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: var(--sp-7); }
.logo__img--footer { height: 100px; margin-bottom: var(--sp-3); }
.footer .logo__name { color: #fff; }
.footer .logo__tag { color: rgba(255,255,255,.55); }
.footer h4 { font-family: var(--ff-title); font-size: .95rem; color: #fff; margin-bottom: var(--sp-4); }
.footer ul { display: grid; gap: var(--sp-3); font-size: var(--fs-small); }
.footer a:hover { color: var(--clr-brand-light); }
.footer p { font-size: var(--fs-small); margin-top: var(--sp-4); }
.socials { display: flex; gap: var(--sp-2); margin-top: var(--sp-5); }
.socials a {
  width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: rgba(255,255,255,.08); transition: background var(--t-std), transform var(--t-std);
}
.socials a:hover { background: var(--clr-brand); transform: translateY(-3px); color: #fff; }
.socials svg { width: 18px; height: 18px; fill: currentColor; }
.footer__bottom {
  margin-top: var(--sp-7); padding-top: var(--sp-5); border-top: 1px solid rgba(255,255,255,.12);
  font-size: var(--fs-label);
}
/* Une seule ligne continue : mentions, liens et crédit se suivent. */
.footer__bottom p {
  margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: var(--fs-label); line-height: 1.6;
}
.footer__bottom a { text-decoration: underline; text-underline-offset: 2px; }
.footer__bottom .sep { opacity: .35; }
.powered-by { display: inline-flex; align-items: center; gap: 8px; }
.powered-by img { height: 22px; width: auto; object-fit: contain; }

/* ========== 18. DESIGN SYSTEM (page de documentation) ========== */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--sp-4); }
.swatch { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--clr-line); background: #fff; box-shadow: var(--sh-1); }
.swatch__chip { height: 92px; }
.swatch__meta { padding: var(--sp-3) var(--sp-4); }
.swatch__meta b { display: block; font-family: var(--ff-title); font-size: .9rem; }
.swatch__meta code { font-size: var(--fs-label); color: var(--clr-ink-soft); }
.ds-block { background: #fff; border: 1px solid var(--clr-line); border-radius: var(--r-md); padding: var(--sp-6); box-shadow: var(--sh-1); }
.ds-row { display: flex; flex-wrap: wrap; gap: var(--sp-4); align-items: center; }
.ds-label { font-family: var(--ff-title); font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .1em; color: var(--clr-ink-soft); margin-bottom: var(--sp-3); }
.ds-stack { display: grid; gap: var(--sp-5); }

/* ========== 19. ANIMATIONS ========== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.22,.61,.36,1); }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ========== 20. RESPONSIVE ========== */
@media (max-width: 1024px) {
  :root { --gutter: 20px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .projects { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  :root { --header-h: 84px; }
  .burger { display: flex; }
  .header__inner > .btn--primary { display: none; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--clr-white); border-bottom: 1px solid var(--clr-line);
    padding: var(--sp-4) var(--gutter) var(--sp-6);
    box-shadow: var(--sh-2);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: transform var(--t-std), opacity var(--t-std);
    max-height: calc(100dvh - var(--header-h)); overflow-y: auto;
  }
  .nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 15px 4px; border-bottom: 1px solid var(--clr-line); border-radius: 12px; font-size: 1rem; }
  .nav a::after { display: none; }
  .nav .btn { display: inline-flex; margin-top: var(--sp-5); width: 100%; }
  .logo__img { height: 60px; }
}

@media (max-width: 720px) {
  .section { padding-block: var(--sp-8); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: var(--sp-6); }
  .split--reverse .split__media { order: -1; }
  .projects { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .lightbox__panel { grid-template-columns: 1fr; }
  .lightbox__panel img { min-height: 220px; aspect-ratio: 16/10; }
  .hero { min-height: 560px; }
  .hero__stats { gap: var(--sp-5); }
  .hero__stat b { font-size: 1.6rem; }
  .form { padding: var(--sp-5) var(--sp-4); }
  .footer__grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .footer__bottom p { gap: 6px; }
  .filters { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: var(--sp-2); }
  .filter { flex: none; }
  .cta { padding: var(--sp-8) var(--sp-4); }
}

/* ========== 21. GALERIE PHOTOS (page Chantiers) ========== */
.card__gallery-btn { align-self: flex-start; margin-top: var(--sp-2); }

.gallery {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(16, 26, 33, .94);
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "bar bar bar" "prev stage next" "thumbs thumbs thumbs";
  gap: var(--sp-3);
  padding: var(--sp-4);
}
.gallery[hidden] { display: none; }

.gallery__bar {
  grid-area: bar; display: flex; align-items: center; gap: var(--sp-4);
  color: #fff; padding-inline: var(--sp-2);
}
.gallery__title { font-size: 1.05rem; margin-right: auto; }
.gallery__count { font-size: var(--fs-small); color: rgba(255,255,255,.7); }
.gallery__close {
  width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.14); color: #fff; font-size: 18px;
  transition: background var(--t-fast), transform var(--t-std);
}
.gallery__close:hover { background: rgba(255,255,255,.28); transform: rotate(90deg); }

.gallery__stage { grid-area: stage; display: grid; place-items: center; min-height: 0; margin: 0; overflow: hidden; }
/* Hauteur bornée explicitement : dans une grille en 1fr, max-height:100%
   ne se résout pas et une photo en portrait déborde de l'écran. */
.gallery__img {
  max-width: 100%; max-height: calc(100dvh - 230px); width: auto; height: auto;
  object-fit: contain; border-radius: var(--r-md); box-shadow: var(--sh-3);
}

.gallery__nav {
  align-self: center; width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; font-size: 30px; line-height: 1;
  cursor: pointer; transition: background var(--t-fast);
}
.gallery__nav:hover { background: rgba(255,255,255,.3); }
.gallery__nav--prev { grid-area: prev; }
.gallery__nav--next { grid-area: next; }

.gallery__thumbs {
  grid-area: thumbs; display: flex; gap: var(--sp-2); justify-content: center;
  flex-wrap: wrap; padding-top: var(--sp-2);
}
.gallery__thumbs img {
  width: 76px; height: 56px; object-fit: cover; border-radius: var(--r-sm);
  cursor: pointer; opacity: .5; border: 2px solid transparent;
  transition: opacity var(--t-fast), border-color var(--t-fast);
}
.gallery__thumbs img:hover { opacity: .85; }
.gallery__thumbs img[aria-current="true"] { opacity: 1; border-color: var(--clr-brand-light); }

@media (max-width: 720px) {
  .gallery {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "bar bar" "stage stage" "prev next" "thumbs thumbs";
    padding: var(--sp-3);
  }
  .gallery__nav { width: 100%; height: 46px; border-radius: var(--r-sm); }
  .gallery__thumbs img { width: 58px; height: 44px; }
  .gallery__img { max-height: calc(100dvh - 260px); }
}

/* Variante compacte : cartes plus basses (liste des tâches, page Chantiers) */
/* grid-auto-rows: 1fr => toutes les rangees ont la meme hauteur */
.grid--compact { gap: var(--sp-4); grid-auto-rows: 1fr; }
.grid--compact .card__media { aspect-ratio: 16 / 10; }
.grid--compact .card__body { padding: var(--sp-4); gap: var(--sp-2); }
.grid--compact .card__body h3 { font-size: 1.02rem; }
.grid--compact .card__body p { font-size: .875rem; line-height: 1.6; }
.grid--compact .icon-badge { width: 42px; height: 42px; border-radius: var(--r-sm); }
.grid--compact .icon-badge svg { width: 21px; height: 21px; }
.grid--compact .card__gallery-btn { padding: 9px 16px; font-size: .82rem; }

/* ========== 22. CARTES À PHOTO (page Chantiers) ==========
   La photo occupe le haut de la carte, teintée du même dégradé
   bleu → brun que le bloc d'appel à l'action. */
.card--photo .card__media { position: relative; }
.card--photo .card__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg,
    rgba(34,50,61,.62) 0%, rgba(62,110,142,.55) 32%,
    rgba(92,78,68,.55) 68%, rgba(74,59,50,.64) 100%);
  transition: opacity var(--t-std);
}
.card--photo:hover .card__media::after { opacity: .7; }
