/* ══════════════════════════════════════════════════════════════
   PERFORM'AGENCEMENT — DA « plan d'exécution »
   Palette : papier / encre / orange chantier / bleu-plan
   Dark mode « ozalid » : fond bleu nuit, traits clairs
   ══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/BricolageGrotesque-200_800.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --papier: #f5f2ea;
  --encre: #171512;
  --orange: #e05e10;
  --bleu: #3a5a78;
  --trait: color-mix(in srgb, var(--bleu) 26%, transparent);
  --trait-fort: color-mix(in srgb, var(--encre) 78%, transparent);
  --sourdine: color-mix(in srgb, var(--encre) 58%, var(--papier));
  --carte: color-mix(in srgb, var(--papier) 92%, white);
  --contraste-fond: color-mix(in srgb, var(--bleu) 7%, var(--papier));
  --display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --cartouche-h: 58px;
  color-scheme: light;
}

/* Ozalid : identité propre, pas une inversion */
[data-tirage="ozalid"] {
  --papier: #101a26;
  --encre: #e9e4d6;
  --orange: #f0762c;
  --bleu: #8fb0cc;
  --trait: color-mix(in srgb, var(--bleu) 22%, transparent);
  --trait-fort: color-mix(in srgb, var(--encre) 72%, transparent);
  --sourdine: color-mix(in srgb, var(--encre) 55%, var(--papier));
  --carte: #16222f;
  --contraste-fond: #0b141d;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tirage]) {
    --papier: #101a26;
    --encre: #e9e4d6;
    --orange: #f0762c;
    --bleu: #8fb0cc;
    --trait: color-mix(in srgb, var(--bleu) 22%, transparent);
    --trait-fort: color-mix(in srgb, var(--encre) 72%, transparent);
    --sourdine: color-mix(in srgb, var(--encre) 55%, var(--papier));
    --carte: #16222f;
    --contraste-fond: #0b141d;
    color-scheme: dark;
  }
}

/* ── Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--cartouche-h) + 16px); }
body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.conteneur { max-width: 1180px; margin-inline: auto; padding-inline: clamp(18px, 4vw, 48px); }

.annotation {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sourdine);
}

h1, h2, h3 {
  font-family: var(--display);
  font-optical-sizing: auto;
  line-height: 1.04;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 700; font-stretch: 90%; }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; max-width: 62ch; }

/* ── Boutons ──────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.85em 1.6em;
  border: 1.5px solid var(--encre);
  color: var(--encre);
  background: transparent;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.btn:hover { border-color: var(--orange); color: var(--orange); }
.btn--plein { background: var(--orange); border-color: var(--orange); color: var(--papier); }
.btn--plein:hover { background: var(--encre); border-color: var(--encre); color: var(--papier); }

/* ── Cartouche (header) ───────────────────────────────────────── */
.cartouche {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: stretch;
  height: var(--cartouche-h);
  background: color-mix(in srgb, var(--papier) 88%, transparent);
  backdrop-filter: blur(9px);
  border-bottom: 1.5px solid var(--trait-fort);
}
.cartouche__cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-inline: 16px;
  border-right: 1px solid var(--trait);
}
.cartouche__brand {
  flex-direction: row;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  border-right: 1.5px solid var(--trait-fort);
}
.cartouche__logo {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--papier);
  background: var(--orange);
  padding: 5px 7px;
  line-height: 1;
}
.cartouche__name {
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
}
.cartouche__name small {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sourdine);
}
.cartouche__nav {
  display: flex;
  align-items: stretch;
  margin-right: auto;
  overflow-x: auto;
}
.cartouche__nav a {
  display: flex;
  align-items: center;
  padding-inline: 14px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--sourdine);
  border-right: 1px solid var(--trait);
  white-space: nowrap;
  transition: color 0.15s, box-shadow 0.15s;
}
.cartouche__nav a:hover { color: var(--encre); }
.cartouche__nav a.est-courant {
  color: var(--orange);
  box-shadow: inset 0 -3px 0 var(--orange);
}
.cartouche__k {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sourdine);
}
.cartouche__v {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--encre);
}
#planche-courante { color: var(--orange); }
.theme-toggle { background: none; border: none; border-right: 1px solid var(--trait); cursor: pointer; text-align: left; }
.theme-toggle:hover .cartouche__v { color: var(--orange); }
.cartouche__lang { text-decoration: none; }
.cartouche__lang:hover .cartouche__v { color: var(--orange); }
.cartouche__burger { display: none; }

@media (max-width: 860px) {
  .cartouche { flex-wrap: wrap; height: auto; min-height: var(--cartouche-h); }
  .cartouche__meta { display: none; }
  .cartouche__brand { flex: 1; height: var(--cartouche-h); }
  .theme-toggle { height: var(--cartouche-h); }
  .cartouche__burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: var(--cartouche-h);
    height: var(--cartouche-h);
    background: none;
    border: none;
    border-left: 1px solid var(--trait);
    cursor: pointer;
    padding: 0 16px;
  }
  .cartouche__burger span { height: 1.5px; background: var(--encre); transition: transform 0.2s, opacity 0.2s; }
  .cartouche__nav {
    order: 10;
    flex-basis: 100%;
    flex-direction: column;
    display: none;
    border-top: 1px solid var(--trait);
  }
  .cartouche.est-ouvert .cartouche__nav { display: flex; }
  .cartouche.est-ouvert .cartouche__burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .cartouche.est-ouvert .cartouche__burger span:nth-child(2) { opacity: 0; }
  .cartouche.est-ouvert .cartouche__burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .cartouche__nav a { padding-block: 13px; border-right: none; border-bottom: 1px solid var(--trait); }
}

/* ── Planches (sections) ──────────────────────────────────────── */
.planche { padding-block: clamp(64px, 9vw, 120px); border-bottom: 1.5px solid var(--trait-fort); position: relative; }
.planche--contraste { background: var(--contraste-fond); }
.planche__tete { margin-bottom: clamp(28px, 4vw, 52px); }
.planche__num {
  display: inline-block;
  color: var(--orange);
  border: 1px solid var(--orange);
  padding: 3px 10px;
  margin-bottom: 16px;
}
.planche__chapo { margin-top: 14px; font-size: 1.1rem; color: var(--sourdine); }

.deux-colonnes { display: grid; gap: clamp(28px, 4vw, 56px); align-items: start; }
@media (min-width: 820px) {
  .deux-colonnes { grid-template-columns: 1.15fr 0.85fr; }
  .deux-colonnes--inverse { grid-template-columns: 0.85fr 1.15fr; }
}

/* ── Héro ─────────────────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--cartouche-h) + clamp(24px, 5vw, 64px));
  overflow: clip;
}
.hero__grid { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__inner { position: relative; width: 100%; }
.hero__annotation { margin-bottom: clamp(16px, 3vw, 28px); color: var(--bleu); }
.hero__titre {
  font-size: clamp(2.9rem, 9.5vw, 7.2rem);
  font-weight: 780;
  font-stretch: 82%;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 0.94;
  display: flex;
  flex-direction: column;
}
.hero__titre em { font-style: normal; color: var(--orange); }
.hero__chapo { margin-top: clamp(18px, 3vw, 30px); font-size: clamp(1.02rem, 1.6vw, 1.22rem); max-width: 52ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }

/* Cotations (chiffres clés en style cote de plan) */
.cotations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0;
  margin: clamp(40px, 6vw, 72px) 0 0;
  border-block: 1.5px solid var(--trait-fort);
}
.cotation { padding: 18px 20px 16px; border-right: 1px solid var(--trait); position: relative; }
.cotation:last-child { border-right: none; }
.cotation::before, .cotation::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 1.5px;
  height: 9px;
  background: var(--trait-fort);
}
.cotation::before { left: 0; }
.cotation::after { right: -1px; }
.cotation dt { margin-bottom: 6px; color: var(--bleu); }
.cotation dd { margin: 0; font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 750; font-stretch: 88%; line-height: 1; font-variant-numeric: tabular-nums; }
.cotation__note { padding-top: 6px; }
.cotation dd.cotation__note { font-size: 0.72rem; font-weight: 400; }

/* ── A-01 : services, pièce jointe ────────────────────────────── */
.services {
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0;
  border: 1px solid var(--trait);
}
.services li {
  padding: 11px 14px;
  border-bottom: 1px solid var(--trait);
  border-right: 1px solid var(--trait);
  color: var(--encre);
  position: relative;
  padding-left: 30px;
}
.services li::before { content: "▸"; position: absolute; left: 12px; color: var(--orange); }
.piece-jointe { margin: 0; position: relative; }
.piece-jointe img { border: 1.5px solid var(--trait-fort); }
.piece-jointe::before {
  content: "";
  position: absolute;
  inset: 10px -10px -10px 10px;
  border: 1px dashed var(--trait);
  z-index: -1;
}
.piece-jointe figcaption { margin-top: 10px; }

/* ── A-02 : nomenclature ──────────────────────────────────────── */
.nomenclature {
  list-style: none;
  counter-reset: nom;
  margin: 0;
  padding: 0;
  border-top: 1.5px solid var(--trait-fort);
}
.nomenclature li {
  counter-increment: nom;
  padding: 13px 8px 13px 64px;
  border-bottom: 1px solid var(--trait);
  position: relative;
  font-weight: 550;
  font-size: 1.06rem;
}
.nomenclature li::before {
  content: "M." counter(nom, decimal-leading-zero);
  position: absolute;
  left: 6px;
  top: 50%;
  translate: 0 -50%;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--orange);
}

/* ── A-03 : frise de phases ───────────────────────────────────── */
.phases {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  counter-reset: ph;
  border-top: 1.5px solid var(--trait-fort);
}
@media (min-width: 900px) { .phases { grid-template-columns: repeat(5, 1fr); } }
.phase {
  padding: 22px 20px 26px;
  border-bottom: 1px solid var(--trait);
  position: relative;
}
@media (min-width: 900px) {
  .phase { border-bottom: none; border-right: 1px solid var(--trait); }
  .phase:last-child { border-right: none; }
  .phase::before { content: ""; position: absolute; top: -5px; left: 0; width: 1.5px; height: 9px; background: var(--trait-fort); }
}
.phase__num {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--papier);
  background: var(--bleu);
  padding: 3px 8px;
  display: inline-block;
  margin-bottom: 14px;
}
.phase h3 { margin-bottom: 8px; min-height: 2.3em; }
.phase p { font-size: 0.92rem; color: var(--sourdine); margin: 0; }

/* ── A-04 : galerie ───────────────────────────────────────────── */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filtre {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--trait-fort);
  color: var(--sourdine);
  padding: 7px 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.filtre:hover { color: var(--orange); border-color: var(--orange); }
.filtre.est-actif { background: var(--encre); border-color: var(--encre); color: var(--papier); }

.galerie {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 18px;
}
.projet.est-masque { display: none; }
.projet__ouvrir {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--carte);
  border: 1px solid var(--trait);
  padding: 0;
  cursor: zoom-in;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s, translate 0.15s;
}
.projet__ouvrir:hover { border-color: var(--orange); translate: 0 -3px; }
.projet__ouvrir img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; filter: saturate(0.92); }
.projet__cartouche {
  display: block;
  padding: 10px 13px 2px;
  color: var(--encre);
}
.projet__cartouche b { color: var(--orange); font-weight: 500; margin-right: 6px; }
.projet__desc {
  display: block;
  padding: 0 13px 13px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--sourdine);
}
.galerie__note { margin-top: 26px; max-width: none; }

/* ── Lightbox ─────────────────────────────────────────────────── */
.lightbox {
  border: 1.5px solid var(--trait-fort);
  background: var(--papier);
  color: var(--encre);
  padding: 14px;
  max-width: min(920px, 92vw);
}
.lightbox::backdrop { background: color-mix(in srgb, var(--encre) 72%, transparent); backdrop-filter: blur(3px); }
.lightbox figure { margin: 0; }
.lightbox img { width: 100%; max-height: 72vh; object-fit: contain; }
.lightbox figcaption { margin-top: 10px; }
.lightbox__fermer {
  background: none;
  border: 1px solid var(--trait-fort);
  color: var(--encre);
  padding: 6px 14px;
  cursor: pointer;
  margin-bottom: 12px;
}
.lightbox__fermer:hover { color: var(--orange); border-color: var(--orange); }

/* ── A-05 : garanties ─────────────────────────────────────────── */
.garanties {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.garantie {
  border: 1px solid var(--trait);
  border-top: 3px solid var(--orange);
  background: var(--carte);
  padding: 20px 22px 22px;
}
.garantie__num { display: block; color: var(--orange); margin-bottom: 12px; }
.garantie h3 { margin-bottom: 8px; }
.garantie p { margin: 0; font-size: 0.94rem; color: var(--sourdine); }
.service-tarif { display: inline-block; margin-top: 12px; color: var(--bleu); border: 1px solid var(--trait); padding: 3px 9px; }
p.service-tarif { font-size: 0.66rem; }

/* ── A-06 : contact ───────────────────────────────────────────── */
.coordonnees { margin: 0 0 30px; border-top: 1.5px solid var(--trait-fort); }
.coordonnees > div { display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--trait); }
.coordonnees dt { padding-top: 3px; }
.coordonnees dd { margin: 0; font-weight: 550; }
.coordonnees a { text-decoration-color: var(--orange); text-underline-offset: 3px; }

.carte-paca { width: 100%; max-width: 430px; margin-top: 8px; }
.carte-paca__cote { stroke: var(--bleu); stroke-width: 1.5; stroke-dasharray: 6 5; }
.carte-paca__ville path, .carte-paca__ville circle { stroke: var(--encre); stroke-width: 1.3; }
.carte-paca__ville text {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-anchor: middle;
  fill: var(--sourdine);
}
.carte-paca__ville--siege path, .carte-paca__ville--siege circle { stroke: var(--orange); stroke-width: 1.8; }
.carte-paca__ville--siege text { fill: var(--orange); font-weight: 500; }

.formulaire { background: var(--carte); border: 1px solid var(--trait); padding: clamp(20px, 3vw, 32px); }
.champ { margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px; }
.champ input, .champ textarea {
  font-family: var(--display);
  font-size: 1rem;
  color: var(--encre);
  background: var(--papier);
  border: 1px solid var(--trait-fort);
  padding: 10px 12px;
  resize: vertical;
}
.champ input:focus, .champ textarea:focus { outline: 2px solid var(--orange); outline-offset: 0; border-color: transparent; }
.formulaire .btn { width: 100%; }
.formulaire__note { margin: 12px 0 0; text-transform: none; letter-spacing: 0.02em; }
.formulaire__titre { margin: 0 0 18px; font-size: 1.05rem; }
.formulaire__etat {
  margin: 12px 0 0; padding: 10px 12px;
  border-left: 3px solid var(--orange);
  background: color-mix(in srgb, var(--orange) 8%, transparent);
  text-transform: none; letter-spacing: 0.02em;
}
.formulaire__etat--ok { border-color: var(--bleu); background: color-mix(in srgb, var(--bleu) 8%, transparent); }

/* ── Pied ─────────────────────────────────────────────────────── */
.pied { border-top: 1.5px solid var(--trait-fort); }
.pied__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  justify-content: space-between;
  padding-block: 26px;
}
.pied a { color: var(--orange); }

/* ── Révélations au scroll ────────────────────────────────────── */
.reveal { opacity: 0; translate: 0 22px; transition: opacity 0.65s ease, translate 0.65s ease; }
.reveal.est-visible { opacity: 1; translate: 0 0; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .planche .reveal {
      opacity: 1;
      translate: none;
      transition: none;
      animation: apparition both;
      animation-timeline: view();
      animation-range: entry 0% entry 42%;
    }
  }
}
@keyframes apparition {
  from { opacity: 0; translate: 0 26px; }
  to { opacity: 1; translate: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; translate: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Mentions légales (page secondaire) ───────────────────────── */
.page-legale { padding-top: calc(var(--cartouche-h) + clamp(40px, 6vw, 72px)); padding-bottom: 80px; }
.page-legale h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 720; font-stretch: 88%; margin-bottom: 34px; }
.page-legale h2 { font-size: 1.2rem; margin: 34px 0 10px; }
.page-legale h2::before { content: attr(data-n) " · "; font-family: var(--mono); font-size: 0.78rem; color: var(--orange); }
.page-legale .retour { display: inline-block; margin-bottom: 28px; }
