/* Voltéo — feuille de style unique
   Couleurs : anthracite, blanc chaud, gris clair, jaune électrique en accent ponctuel.
   Le jaune n'est jamais utilisé comme couleur de texte sur fond clair (contraste insuffisant). */

@font-face {
  font-family: 'Instrument Sans';
  src: url('../fonts/instrument-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono.woff2') format('woff2');
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --ink: #202326;          /* anthracite */
  --ink-2: #2c3033;
  --ink-3: #3a3f43;
  --paper: #f6f3ee;        /* blanc chaud */
  --paper-2: #ece8e1;      /* gris clair chaud */
  --white: #fbfaf7;
  --line: #d5d0c7;
  --line-strong: #8d8a84;  /* bordures de champs : ≥ 3:1 sur --white */
  --muted: #595c60;        /* texte secondaire : ≥ 4,5:1 sur --paper et --paper-2 */
  --on-dark: #f3f0ea;
  --on-dark-muted: #b4b2ad;
  --volt: #f2c200;         /* jaune électrique */
  --error: #a3261b;
  --ok: #2f6b3f;

  --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --header-h: 72px;
  --section-y: clamp(4.5rem, 10vw, 8.5rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
figure { margin: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.section-dark :focus-visible, .site-footer :focus-visible { outline-color: var(--volt); }
::selection { background: var(--volt); color: var(--ink); }

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

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--ink); color: var(--white); padding: .75rem 1rem; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 48px; padding: .75rem 1.35rem;
  border: 1px solid var(--ink); border-radius: 2px;
  font-weight: 600; font-size: 1rem; line-height: 1.2; text-decoration: none;
  cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn-primary { background: var(--ink); color: var(--white); position: relative; }
.btn-primary::after {
  content: ''; width: 7px; height: 7px; background: var(--volt); flex: none;
  transition: transform .25s var(--ease);
}
.btn-primary:hover { background: var(--ink-3); border-color: var(--ink-3); }
.btn-primary:hover::after { transform: translateX(3px); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--white); }
.btn:active { transform: translateY(1px); }
.btn-text {
  display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: 0;
  background: none; border: 0; font-weight: 600; cursor: pointer; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: .3em; text-decoration-color: var(--line-strong);
  transition: text-decoration-color .2s, gap .2s var(--ease);
}
.btn-text:hover { text-decoration-color: var(--ink); gap: .7rem; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 243, 238, .94);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s;
}
.site-header.is-compact { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 2rem; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; flex: none; }
.brand-mark { width: 32px; height: 32px; }
.brand-mark rect { fill: var(--ink); }
.brand-mark path { fill: none; stroke: var(--paper); stroke-width: 2.6; stroke-linecap: square; }
.brand-mark circle { fill: var(--volt); }
.brand-name { font-weight: 700; font-size: 1.3rem; letter-spacing: -.03em; }
.brand-tag {
  font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  padding-left: .7rem; border-left: 1px solid var(--line); line-height: 1.2;
}
.brand-light .brand-mark rect { fill: var(--paper); }
.brand-light .brand-mark path { stroke: var(--ink); }

.main-nav { display: flex; align-items: center; gap: 2rem; margin-left: auto; }
.main-nav ul { display: flex; gap: .25rem; list-style: none; }
.main-nav ul a {
  position: relative; display: inline-flex; align-items: baseline; gap: .35rem;
  padding: .6rem .7rem; font-weight: 500; text-decoration: none; font-size: .98rem;
}
.nav-num { font-family: var(--mono); font-size: .65rem; color: var(--muted); }
.main-nav ul a::after {
  content: ''; position: absolute; left: .7rem; right: .7rem; bottom: .3rem; height: 1px; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.main-nav ul a:hover::after, .main-nav ul a[aria-current="true"]::after { transform: scaleX(1); }
.nav-cta { min-height: 44px; padding: .6rem 1.1rem; font-size: .95rem; }

.menu-toggle {
  display: none; align-items: center; gap: .6rem; margin-left: auto;
  min-height: 44px; padding: .5rem .25rem .5rem .75rem; background: none; border: 0; cursor: pointer; font-weight: 600;
}
.menu-toggle-bars { position: relative; width: 22px; height: 12px; }
.menu-toggle-bars::before, .menu-toggle-bars::after {
  content: ''; position: absolute; left: 0; right: 0; height: 2px; background: var(--ink);
  transition: transform .3s var(--ease), top .3s var(--ease);
}
.menu-toggle-bars::before { top: 0; }
.menu-toggle-bars::after { top: 10px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { top: 5px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after { top: 5px; transform: rotate(-45deg); }

@media (max-width: 1080px) {
  .menu-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 1.5rem;
    padding: 1rem var(--gutter) 2rem; margin: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    max-height: calc(100svh - var(--header-h)); overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s .3s;
  }
  .main-nav.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity .3s var(--ease), transform .3s var(--ease); }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav ul li { border-bottom: 1px solid var(--line); }
  .main-nav ul a { display: flex; gap: .9rem; padding: 1rem 0; font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; }
  .main-nav ul a::after { display: none; }
  .nav-num { font-size: .75rem; }
  .nav-cta { min-height: 52px; font-size: 1rem; }
}
@media (max-width: 480px) { .brand-tag { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(3rem, 6vw, 5rem); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 5vw, 5rem);
  align-items: stretch; min-height: min(calc(100svh - var(--header-h) - 3rem), 820px);
}
.hero-text { display: flex; flex-direction: column; justify-content: center; padding-block: 1rem; }
.hero-kicker {
  display: flex; align-items: center; gap: .75rem;
  font-family: var(--mono); font-size: .78rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink); margin-bottom: 1.6rem;
}
.hero-kicker::before { content: ''; width: 28px; height: 1px; background: var(--ink); flex: none; }
.hero-title {
  display: block; font-size: clamp(3rem, min(7.4vw, 12.5vh), 7rem); line-height: .94; letter-spacing: -.045em; font-weight: 600;
}
.hero-title > span { display: block; }
.hero-title > span:nth-child(2) { padding-left: .9em; }
.hero-title > span:nth-child(3) { padding-left: 1.8em; }
.hero-title > span:nth-child(3)::after {
  content: ''; display: inline-block; width: .15em; height: .15em; margin-left: .05em; background: var(--volt);
}
.hero-title > span:nth-child(3) { white-space: nowrap; }
.hero-lead { max-width: 34rem; margin: 2rem 0 0; font-size: clamp(1.05rem, 1.3vw, 1.2rem); color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.hero-sheet {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: clamp(2rem, 4vh, 3rem) 0 0;
  border-top: 1px solid var(--ink); max-width: 40rem;
}
.hero-sheet div { padding: .8rem 1rem .2rem 0; }
.hero-sheet div + div { padding-left: 1rem; border-left: 1px solid var(--line); }
.hero-sheet dt { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hero-sheet dd { margin: .2rem 0 0; font-size: .9rem; line-height: 1.35; }

.hero-media { position: relative; display: flex; flex-direction: column; margin-right: calc(-1 * var(--gutter)); }
.hero-frame { position: relative; flex: 1; min-height: 360px; }
.hero-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 40% 50%; }
.crop { position: absolute; width: 18px; height: 18px; border-color: var(--ink); border-style: solid; border-width: 0; }
.crop-tl { top: -10px; left: -10px; border-top-width: 1px; border-left-width: 1px; }
.crop-tr { top: -10px; right: 12px; border-top-width: 1px; border-right-width: 1px; }
.crop-bl { bottom: -10px; left: -10px; border-bottom-width: 1px; border-left-width: 1px; }
.crop-br { bottom: -10px; right: 12px; border-bottom-width: 1px; border-right-width: 1px; }
.hero-media figcaption, .expertise-media figcaption, .zone-map figcaption {
  margin-top: 1.1rem; font-size: .82rem; color: var(--ink-2); padding-right: var(--gutter);
}
.fig-ref {
  font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
  padding: .15rem .4rem; margin-right: .5rem; border: 1px solid var(--ink);
}

/* Entrée du hero (désactivée si mouvement réduit) */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-title > span, .js .hero-kicker, .js .hero-lead, .js .hero-actions, .js .hero-sheet {
    animation: rise .7s var(--ease) both;
  }
  .js .hero-title > span:nth-child(1) { animation-delay: .06s; }
  .js .hero-title > span:nth-child(2) { animation-delay: .12s; }
  .js .hero-title > span:nth-child(3) { animation-delay: .18s; }
  .js .hero-lead { animation-delay: .26s; }
  .js .hero-actions { animation-delay: .32s; }
  .js .hero-sheet { animation-delay: .38s; }
  .js .hero-frame { animation: unveil .9s var(--ease) .1s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes unveil { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }

/* ---------- Sections ---------- */
.section { padding-block: var(--section-y); }
.section-grey { background: var(--paper-2); }
.section-dark { background: var(--ink); color: var(--on-dark); }

.section-head {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(2rem, 5vw, 5rem);
  margin-bottom: clamp(3rem, 6vw, 5rem);
}
.section-index {
  grid-column: 1 / -1; display: flex; align-items: center; gap: .9rem;
  margin: 0 0 clamp(1.5rem, 3vw, 2.5rem); padding-top: .9rem; border-top: 1px solid currentColor;
  font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em;
}
.section-index span { display: inline-grid; place-items: center; min-width: 2.2rem; height: 1.5rem; background: var(--ink); color: var(--paper); }
.section-dark .section-index span { background: var(--volt); color: var(--ink); }
.section-head h2 { font-size: clamp(2.2rem, 4.6vw, 4rem); letter-spacing: -.035em; }
.section-intro { align-self: end; margin: 0; color: var(--muted); max-width: 32rem; }
.section-dark .section-intro { color: var(--on-dark-muted); }
.section-head-compact { grid-template-columns: 1fr; margin-bottom: 2.5rem; }
.section-head-compact .section-intro { margin-top: 1.25rem; }

/* ---------- Prestations ---------- */
.services-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: clamp(2rem, 5vw, 5rem); }
.services-toc { position: sticky; top: calc(var(--header-h) + 2rem); align-self: start; }
.toc-title { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .75rem; }
.services-toc ol { list-style: none; border-left: 1px solid var(--line); }
.services-toc a {
  display: flex; gap: .75rem; padding: .55rem 0 .55rem 1rem; margin-left: -1px;
  border-left: 2px solid transparent; text-decoration: none; color: var(--muted); font-weight: 500;
  transition: color .2s, border-color .2s;
}
.services-toc a span { font-family: var(--mono); font-size: .75rem; padding-top: .2rem; }
.services-toc a:hover { color: var(--ink); }
.services-toc a.is-active { color: var(--ink); border-left-color: var(--volt); }

.service {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(1.5rem, 4vw, 4rem);
  padding-block: clamp(2.5rem, 5vw, 4rem); border-top: 1px solid var(--line);
}
.service:first-child { border-top: 1px solid var(--ink); padding-top: clamp(2rem, 4vw, 3rem); }
.service:nth-child(even) .service-media { order: -1; }
.service-num { font-family: var(--mono); font-size: .8rem; color: var(--muted); margin-bottom: .9rem; }
.service h3 { font-size: clamp(1.6rem, 2.6vw, 2.25rem); margin-bottom: 1.1rem; }
.service h4 {
  margin: 1.6rem 0 .7rem; font-family: var(--mono); font-weight: 500; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}
.needs { list-style: none; display: grid; gap: .1rem; }
.needs li { position: relative; padding: .45rem 0 .45rem 1.5rem; border-bottom: 1px dashed var(--line); font-size: .98rem; }
.needs li::before { content: ''; position: absolute; left: 0; top: 1.05rem; width: .8rem; height: 1px; background: var(--ink); }
.service-link {
  display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.6rem; min-height: 44px;
  font-weight: 600; text-decoration-color: var(--line-strong); transition: gap .2s var(--ease), text-decoration-color .2s;
}
.service-link:hover { gap: .8rem; text-decoration-color: var(--ink); }
.service-media { align-self: start; position: sticky; top: calc(var(--header-h) + 2rem); }
.service-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--paper-2); }
.service-media figcaption { margin-top: .7rem; font-size: .82rem; color: var(--muted); }
.note {
  margin-top: 1.4rem; padding: .9rem 1rem; font-size: .9rem; line-height: 1.5;
  background: var(--white); border-left: 3px solid var(--volt);
}

/* ---------- Méthode : schéma unifilaire ---------- */
.method { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.method::before {
  content: ''; position: absolute; left: 0; right: 0; top: 9px; height: 1px; background: var(--on-dark-muted);
  transform-origin: left;
}
.method li { position: relative; padding: 2.6rem 1.5rem 0 0; }
.method-node {
  position: absolute; top: 0; left: 0; width: 19px; height: 19px; border-radius: 50%;
  background: var(--ink); border: 1px solid var(--on-dark);
}
.method-node::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--volt); }
.method-num { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--volt); margin-bottom: .6rem; }
.method h3 { font-size: 1.3rem; margin-bottom: .8rem; color: var(--on-dark); }
.method p:last-child { color: var(--on-dark-muted); font-size: .96rem; margin: 0; }

@media (prefers-reduced-motion: no-preference) {
  .js .method::before { transform: scaleX(0); transition: transform .7s var(--ease) .1s; }
  .js .method.is-visible::before { transform: scaleX(1); }
  .js .method li { opacity: 0; transform: translateY(12px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
  .js .method.is-visible li { opacity: 1; transform: none; }
  .js .method.is-visible li:nth-child(2) { transition-delay: .1s; }
  .js .method.is-visible li:nth-child(3) { transition-delay: .2s; }
  .js .method.is-visible li:nth-child(4) { transition-delay: .3s; }
  .js .method.is-visible li:nth-child(5) { transition-delay: .4s; }
}

/* ---------- Projets ---------- */
.projects {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: auto auto;
  gap: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 4vw, 3.5rem);
}
.project-lead { grid-row: 1 / span 2; }
.project-media { position: relative; overflow: hidden; background: var(--paper-2); }
.project-media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .7s var(--ease); }
.project-lead .project-media img { aspect-ratio: 5 / 4; }
.project:hover .project-media img { transform: scale(1.03); }
.tag {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  background: var(--paper); color: var(--ink); padding: .3rem .5rem;
}
.project-body { padding-top: 1.2rem; border-top: 1px solid var(--ink); margin-top: 1rem; }
.project-cat { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .5rem; }
.project h3 { font-size: clamp(1.35rem, 2vw, 1.75rem); margin-bottom: .6rem; }
.project-lead h3 { font-size: clamp(1.6rem, 2.8vw, 2.4rem); }
.project-body > p:not(.project-cat) { color: var(--muted); margin-bottom: .6rem; max-width: 36rem; }

/* ---------- Fenêtres de projet ---------- */
.project-dialog {
  width: min(920px, calc(100vw - 2rem)); max-height: calc(100svh - 2rem); padding: 0;
  border: 0; border-radius: 2px; background: var(--paper); color: var(--ink);
  box-shadow: 0 30px 80px rgba(20, 22, 24, .35);
}
.project-dialog::backdrop { background: rgba(24, 26, 28, .72); }
.project-dialog[open] { animation: dialog-in .45s var(--ease); }
.project-dialog[open]::backdrop { animation: fade .45s var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes fade { from { opacity: 0; } }
.dialog-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .5rem .5rem clamp(1.25rem, 4vw, 2.5rem); background: var(--paper); border-bottom: 1px solid var(--line);
}
.dialog-bar .project-cat { margin: 0; }
.dialog-close {
  width: 48px; height: 48px; display: grid; place-items: center; background: none; border: 1px solid transparent;
  font-size: 1.8rem; line-height: 1; cursor: pointer; transition: border-color .2s;
}
.dialog-close:hover { border-color: var(--ink); }
.dialog-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.dialog-content { padding: clamp(1.5rem, 4vw, 2.5rem); }
.dialog-content h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); letter-spacing: -.03em; margin-bottom: 1.5rem; }
.fiche { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 2rem; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.fiche div { padding: .75rem 1rem .75rem 0; }
.fiche div + div { padding-left: 1rem; border-left: 1px solid var(--line); }
.fiche dt { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.fiche dd { margin: .2rem 0 0; font-size: .95rem; line-height: 1.35; }
.dialog-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: clamp(1.5rem, 4vw, 2.5rem); }
.dialog-cols h3 { font-size: 1.1rem; margin: 0 0 .5rem; }
.dialog-cols p + h3 { margin-top: 1.5rem; }
.dialog-cols p { color: var(--ink-2); }
.dialog-cols figure img { width: 100%; }
.dialog-cols figcaption { margin-top: .6rem; font-size: .82rem; color: var(--muted); }
.dialog-note { margin: 1.5rem 0; padding: .8rem 1rem; font-size: .88rem; background: var(--paper-2); border-left: 3px solid var(--volt); }
.dialog-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

.dialog-schema { background: var(--white); border: 1px solid var(--line); padding: 1rem; align-self: start; }
.dialog-schema svg { width: 100%; height: auto; }
.schema-lines path { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.schema-box { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.schema-hub { fill: var(--ink); }
.schema-nodes circle { fill: var(--volt); stroke: var(--ink); stroke-width: 1.5; }
.schema-text text { font-family: var(--mono); font-size: 12px; fill: var(--ink); }
.schema-text .schema-small { fill: var(--muted); font-size: 11px; }

/* ---------- Expertise ---------- */
.expertise { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.expertise-media { position: sticky; top: calc(var(--header-h) + 2rem); }
.expertise-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.expertise-media figcaption { padding-right: 0; }
.principles { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.principles li { padding: 1.75rem 1.75rem 1.75rem 0; border-bottom: 1px solid var(--line); }
.principles li:nth-child(even) { padding-left: 1.75rem; padding-right: 0; border-left: 1px solid var(--line); }
.principle-num {
  display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; margin-bottom: 1rem;
  border: 1px solid var(--ink); font-family: var(--mono); font-size: .8rem;
}
.principles h3 { font-size: 1.25rem; margin-bottom: .6rem; }
.principles p:last-child { margin: 0; color: var(--muted); font-size: .98rem; }
.expertise .note { margin-top: 2rem; }

/* ---------- Zone ---------- */
.zone { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.zone-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.zone-lists h3 { font-family: var(--mono); font-weight: 500; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: .75rem; }
.zone-lists ul { list-style: none; border-top: 1px solid var(--ink); }
.zone-lists li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.zone-lists li:first-child { font-weight: 600; }
.zone-more { margin-top: 1.75rem; color: var(--muted); }
.zone-map svg { width: 100%; height: auto; background: var(--white); border: 1px solid var(--line); }
.map-grid path { stroke: var(--paper-2); stroke-width: 1; fill: none; }
.map-links path { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 4 4; }
.map-links .map-trunk { stroke-dasharray: none; stroke-width: 2; }
.map-nodes circle { fill: var(--white); stroke: var(--ink); stroke-width: 1.5; }
.map-hubs rect { fill: var(--volt); stroke: var(--ink); stroke-width: 1.5; }
.map-labels text { font-family: var(--mono); font-size: 13px; fill: var(--ink); }
.map-labels .hub-label { font-family: var(--font); font-size: 18px; font-weight: 600; }
.map-meta path { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.map-meta text { font-family: var(--mono); font-size: 12px; fill: var(--muted); }
.zone-map figcaption { padding-right: 0; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.next-steps { list-style: none; counter-reset: step; border-top: 1px solid var(--ink); margin-bottom: 2rem; }
.next-steps li { counter-increment: step; display: flex; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); font-size: .98rem; }
.next-steps li::before { content: '0' counter(step); font-family: var(--mono); font-size: .75rem; color: var(--muted); padding-top: .2rem; }
.contact-card { padding: 1.25rem 1.25rem .5rem; background: var(--ink); color: var(--on-dark); margin-bottom: 1rem; }
.contact-card-title { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--volt); margin-bottom: .8rem; }
.contact-card a { font-weight: 600; font-size: 1.05rem; }
.contact-card .muted { color: var(--on-dark-muted); font-size: .88rem; }
.contact-card :focus-visible { outline-color: var(--volt); }
.demo-box { padding: 1rem 1.1rem; border: 1px solid var(--ink); border-left: 4px solid var(--volt); font-size: .92rem; line-height: 1.55; background: var(--white); }
.demo-box p { margin: 0; }

.contact-form-wrap { background: var(--white); border: 1px solid var(--line); padding: clamp(1.25rem, 4vw, 2.75rem); position: relative; }
.contact-form-wrap::before { content: ''; position: absolute; top: -1px; left: -1px; width: 56px; height: 3px; background: var(--ink); }
.quote-form { display: grid; gap: 1.35rem; }
.form-row { display: grid; gap: 1.35rem; }
.form-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; gap: .45rem; align-content: start; }
.field label { font-weight: 600; font-size: .95rem; }
.req { color: var(--error); }
.opt { font-weight: 400; color: var(--muted); font-size: .85rem; margin-left: .25rem; }
.field input:not([type="checkbox"]), .field select, .field textarea {
  width: 100%; min-height: 50px; padding: .75rem .9rem;
  background: var(--white); border: 1px solid var(--line-strong); border-radius: 2px;
  font-size: 1rem; /* ≥ 16px : pas de zoom automatique sur iOS */
  transition: border-color .2s, box-shadow .2s;
}
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 2.6rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23202326' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
}
.field textarea { resize: vertical; min-height: 150px; line-height: 1.5; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: none; border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink);
}
.field [aria-invalid="true"] { border-color: var(--error) !important; box-shadow: 0 0 0 1px var(--error); }
.field-hint { display: flex; justify-content: space-between; gap: 1rem; margin: 0; font-size: .85rem; color: var(--muted); }
.count { font-family: var(--mono); font-size: .75rem; white-space: nowrap; }
.field-error { display: none; margin: 0; font-size: .88rem; color: var(--error); font-weight: 500; }
.field-error.is-visible { display: flex; gap: .45rem; }
.field-error.is-visible::before { content: '!'; display: inline-grid; place-items: center; flex: none; width: 1.1rem; height: 1.1rem; margin-top: .1rem; border-radius: 50%; background: var(--error); color: #fff; font-size: .72rem; font-weight: 700; }
.field-check { grid-template-columns: auto 1fr; column-gap: .8rem; align-items: start; }
.field-check input { width: 22px; height: 22px; margin: .1rem 0 0; accent-color: var(--ink); cursor: pointer; }
.field-check label { font-weight: 400; font-size: .92rem; line-height: 1.5; }
.field-check .field-error { grid-column: 1 / -1; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-alert { display: none; padding: 1rem 1.1rem; border: 1px solid var(--error); border-left-width: 4px; background: #fbf0ee; color: var(--ink); font-size: .95rem; }
.form-alert.is-visible { display: block; }
.form-alert:focus { outline: none; }
.form-alert ul { margin: .5rem 0 0 1.1rem; }
.form-alert a { color: var(--error); font-weight: 500; }

.form-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; padding-top: .5rem; }
.form-legal { margin: 0; font-size: .85rem; color: var(--muted); }
.btn-submit { min-width: 15rem; }
.btn-submit .spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: var(--volt); border-radius: 50%; animation: spin .8s linear infinite; }
.btn-submit.is-loading .spinner { display: inline-block; }
.btn-submit.is-loading::after { display: none; }
.btn-submit:disabled { cursor: progress; opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-success h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 1rem; }
.form-success h3:focus { outline: none; }
.success-mark { width: 44px; height: 44px; margin-bottom: 1.25rem; border: 1px solid var(--ink); position: relative; }
.success-mark::after { content: ''; position: absolute; left: 15px; top: 9px; width: 10px; height: 18px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.success-mark::before { content: ''; position: absolute; right: -4px; top: -4px; width: 8px; height: 8px; background: var(--volt); }
.recap { margin: 1.5rem 0; border-top: 1px solid var(--ink); }
.recap div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.recap dt { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding-top: .2rem; }
.recap dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--ink); color: var(--on-dark); padding: clamp(3rem, 6vw, 5rem) 0 2rem; }
.footer-demo { margin: 0 0 3rem; padding: .9rem 1rem; border: 1px solid var(--ink-3); border-left: 3px solid var(--volt); color: var(--on-dark); font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 4fr) repeat(3, minmax(0, 2.6fr)); gap: 2.5rem; padding-bottom: 3rem; }
.footer-brand p { color: var(--on-dark-muted); margin-top: 1rem; max-width: 22rem; font-size: .95rem; }
.footer-title { font-family: var(--mono); font-weight: 500; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--volt); margin-bottom: 1rem; }
.site-footer ul { list-style: none; display: grid; gap: .1rem; }
.site-footer ul a, .site-footer ul li { display: inline-block; padding: .45rem 0; color: var(--on-dark); font-size: .95rem; }
.site-footer ul a { text-decoration-color: var(--ink-3); }
.site-footer ul a:hover { text-decoration-color: var(--volt); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; padding-top: 1.5rem; border-top: 1px solid var(--ink-3); font-size: .88rem; color: var(--on-dark-muted); }
.footer-bottom p { margin: 0; }
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.footer-bottom ul a { color: var(--on-dark-muted); font-size: .88rem; }

/* ---------- Pages légales ---------- */
.page-head { padding: clamp(3rem, 7vw, 6rem) 0 clamp(2rem, 4vw, 3rem); }
.page-head h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); letter-spacing: -.04em; margin-top: 1rem; }
.page-head p { color: var(--muted); max-width: 40rem; margin-top: 1.25rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.breadcrumb li + li::before { content: '/'; margin-right: .5rem; }
.breadcrumb a { color: var(--ink); }
.prose { max-width: 46rem; padding-bottom: var(--section-y); }
.prose h2 { font-size: 1.5rem; margin: 2.5rem 0 .8rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.prose ul { padding-left: 1.2rem; margin-bottom: 1em; }
.prose li { margin-bottom: .4rem; }
.placeholder { background: var(--paper-2); border: 1px dashed var(--line-strong); padding: 0 .3rem; font-family: var(--mono); font-size: .88em; }
.prose .note { margin: 0 0 1rem; }

/* ---------- Apparitions au défilement ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .services-layout { grid-template-columns: 1fr; }
  .services-toc { position: static; }
  .services-toc ol { display: flex; flex-wrap: wrap; gap: .25rem .5rem; border-left: 0; }
  .services-toc a { border: 1px solid var(--line); margin: 0; padding: .45rem .75rem; font-size: .92rem; }
  .services-toc a.is-active { border-color: var(--ink); }
  .method { grid-template-columns: 1fr; gap: 0; padding-left: 2.5rem; }
  .method::before { left: 9px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; transform-origin: top; }
  @media (prefers-reduced-motion: no-preference) {
    .js .method::before { transform: scaleY(0); }
    .js .method.is-visible::before { transform: scaleY(1); }
  }
  .method li { padding: 0 0 2.5rem; }
  .method li:last-child { padding-bottom: 0; }
  .method-node { left: -2.5rem; }
  .method p:last-child { max-width: 36rem; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  :root { --header-h: 64px; }
  .hero { padding-top: 1.5rem; }
  /* Mobile : la photo remonte entre les boutons et le cartouche pour apparaître dès l'ouverture */
  .hero-grid { grid-template-columns: 1fr; min-height: 0; gap: 0; }
  .hero-text { display: contents; }
  .hero-media { order: 4; margin-top: 2rem; }
  .hero-sheet { order: 5; }
  .hero-title { font-size: clamp(2.9rem, 14vw, 4.5rem); }
  .hero-title > span:nth-child(2) { padding-left: .6em; }
  .hero-title > span:nth-child(3) { padding-left: 1.2em; }
  .hero-lead { margin-top: 1.5rem; }
  .hero-actions { margin-top: 1.5rem; }
  .hero-actions .btn { flex: 1 1 12rem; }
  .hero-sheet { grid-template-columns: 1fr; margin-top: 2rem; }
  .hero-sheet div, .hero-sheet div + div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding: .6rem 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .hero-sheet dd { margin: 0; }
  .hero-media { margin-inline: calc(-1 * var(--gutter)); }
  .hero-frame { flex: none; aspect-ratio: 4 / 3; min-height: 0; }
  .crop { display: none; }
  .hero-media figcaption { padding-inline: var(--gutter); }

  .section-head { grid-template-columns: 1fr; }
  .section-intro { margin-top: 1.25rem; }

  .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-lead { grid-row: auto; grid-column: 1 / -1; }
  .project-lead .project-media img { aspect-ratio: 3 / 2; }

  .expertise, .zone, .contact { grid-template-columns: 1fr; }
  .expertise-media { position: static; }
  .expertise-media img { aspect-ratio: 4 / 3; object-position: 50% 45%; }
  .zone-map { order: 1; }

  .dialog-cols { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .service, .service:first-child { grid-template-columns: 1fr; gap: 1.5rem; padding-block: 2.5rem; }
  .service-media, .service:nth-child(even) .service-media { position: static; order: -1; }
  .projects { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 1rem; }
  .principles { grid-template-columns: 1fr; }
  .principles li, .principles li:nth-child(even) { padding: 1.5rem 0; border-left: 0; }
  .zone-lists { grid-template-columns: 1fr; gap: 1.5rem; }
  /* Schéma réduit : les communes restent listées au-dessus, seules les deux villes sont nommées */
  .map-labels text:not(.hub-label), .map-meta text { display: none; }
  .map-labels .hub-label { font-size: 26px; }
  .form-row-2 { grid-template-columns: 1fr; }
  .btn-submit { width: 100%; min-width: 0; }
  .fiche { grid-template-columns: 1fr; }
  .fiche div, .fiche div + div { padding: .6rem 0; border-left: 0; }
  .fiche div + div { border-top: 1px solid var(--line); }
  .project-dialog { width: 100vw; max-width: 100vw; height: 100svh; max-height: 100svh; margin: 0; }
  .dialog-nav .btn { width: 100%; }
  .recap div { grid-template-columns: 1fr; gap: .1rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
