@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
}

:root {
  --velin: #f3f4f1;
  --encre: #14213a;
  --acier: #566370;
  --trait: #cbd1d4;
  --cobalt: #1f4fd8;
  --cobalt-fonce: #173ea8;
  --cobalt-clair: #a9c0ff;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1200px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--velin);
  color: var(--encre);
  font: 400 1.0625rem/1.6 var(--font);
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul, dl, figure { margin: 0; padding: 0; }
li { list-style: none; }

:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }
.dark :focus-visible { outline-color: var(--cobalt-clair); }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--encre); color: #fff; padding: .6rem 1rem; text-decoration: none;
}
.skip:focus { left: 8px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 120px); }
.dark { background: var(--encre); color: var(--velin); }

/* En-tête */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(243, 244, 241, .94);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--trait);
}
.bar-in { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; padding-block: .5rem; }
.brand { display: block; line-height: 0; }
.brand img { height: 38px; width: auto; }
.nav { display: flex; gap: 1.75rem; margin-left: auto; font-size: .95rem; font-weight: 500; }
.nav a { text-decoration: none; padding: .3rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--cobalt); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 1.4rem;
  font: 600 1rem/1 var(--font); text-decoration: none; white-space: nowrap;
  background: var(--cobalt); color: #fff; border: 2px solid var(--cobalt);
}
.btn:hover { background: var(--cobalt-fonce); border-color: var(--cobalt-fonce); }
.btn-line { background: transparent; color: var(--encre); border-color: var(--encre); }
.btn-line:hover { background: var(--encre); border-color: var(--encre); color: #fff; }
.btn-small { min-height: 42px; padding: 0 1.1rem; font-size: .95rem; }

/* Accueil */
.hero { padding-block: clamp(40px, 6vw, 88px) clamp(56px, 8vw, 104px); }
.hero-grid {
  display: grid; grid-template-columns: 7fr 5fr; align-items: end;
  gap: clamp(28px, 5vw, 72px);
}

.cote { display: flex; align-items: center; gap: .85rem; margin: 0 0 1.75rem; font-size: .92rem; font-weight: 500; color: var(--acier); }
.cote-line { position: relative; flex: 1; height: 1px; background: var(--encre); animation: cote 1.1s .15s cubic-bezier(.2, .7, .2, 1) both; }
.cote-a { transform-origin: right center; }
.cote-b { transform-origin: left center; }
.cote-line::before {
  content: ""; position: absolute; top: -5px; border: 5px solid transparent; width: 0; height: 0;
}
.cote-line::after { content: ""; position: absolute; top: -9px; width: 1px; height: 19px; background: var(--encre); }
.cote-a::before { left: 0; border-right: 10px solid var(--encre); border-left-width: 0; }
.cote-a::after { left: 0; }
.cote-b::before { right: 0; border-left: 10px solid var(--encre); border-right-width: 0; }
.cote-b::after { right: 0; }
@keyframes cote { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.hero h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.2rem, 5.2vw, 4.25rem);
  font-weight: 760; font-stretch: 118%;
  line-height: 1.03; letter-spacing: -.015em; text-wrap: balance;
}
.lead { margin: 0 0 2rem; max-width: 34em; font-size: clamp(1.1rem, 1.6vw, 1.3rem); }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; }

.hero-fig img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.hero-fig figcaption { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--trait); font-size: .88rem; color: var(--acier); }

/* Titres de section */
.h2 {
  margin: 0 0 1.1rem;
  font-size: clamp(1.8rem, 3.6vw, 2.9rem);
  font-weight: 740; font-stretch: 112%;
  line-height: 1.08; letter-spacing: -.01em; text-wrap: balance;
}
.intro { margin: 0; max-width: 32em; color: var(--acier); }
.dark .intro { color: rgba(243, 244, 241, .78); }

.split { display: grid; grid-template-columns: 4fr 8fr; gap: clamp(28px, 5vw, 80px); align-items: start; }
.split-photo { grid-template-columns: 5fr 7fr; }

/* Savoir-faire */
.trades { border-bottom: 1px solid var(--encre); }
.trade { display: grid; grid-template-columns: minmax(150px, 1fr) 2fr; gap: 1.5rem; padding: 1.5rem 0; border-top: 1px solid var(--encre); }
.trade h3 { margin: 0; font-size: 1.5rem; font-weight: 700; font-stretch: 112%; line-height: 1.2; }
.trade p { margin: 0; color: var(--acier); max-width: 36em; }
.series { margin: 1.5rem 0 0; font-size: 1.15rem; font-weight: 600; }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 48px); margin-top: clamp(48px, 6vw, 88px); }
.pillar { padding-top: 1.1rem; border-top: 4px solid var(--cobalt); }
.pillar h3 { margin: 0 0 .5rem; font-size: 1.25rem; font-weight: 700; font-stretch: 112%; }
.pillar p { margin: 0; color: var(--acier); }

/* Parc machines */
.groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3vw, 48px); margin: 2.5rem 0 3.5rem; }
.group h3 { margin: 0 0 .5rem; padding-bottom: .7rem; font-size: 1.1rem; font-weight: 600; border-bottom: 1px solid rgba(243, 244, 241, .4); }
.group li { padding: .6rem 0; border-bottom: 1px solid rgba(243, 244, 241, .16); }

.grid-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 12px; }
.photo { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; cursor: zoom-in; line-height: 0; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: rgba(255, 255, 255, .08); }
.photo:hover img { filter: brightness(1.08); }
.grid-photos figcaption { padding-top: .5rem; font-size: .86rem; line-height: 1.35; color: rgba(243, 244, 241, .82); }

.side-fig { margin-top: 2rem; max-width: 26rem; }
.side-fig img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.side-fig figcaption { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--trait); font-size: .88rem; color: var(--acier); }

/* Métrologie */
.split-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.spec { width: 100%; margin-top: 1.75rem; border-collapse: collapse; }
.spec th, .spec td { padding: .85rem 0; border-top: 1px solid var(--trait); text-align: left; vertical-align: baseline; }
.spec th { width: 52%; padding-right: 1rem; font-weight: 500; color: var(--acier); }
.spec td { font-weight: 600; }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 1px solid var(--trait); }
.note { margin: 1.5rem 0 0; }

/* Réalisations */
.work { columns: 3; column-gap: 12px; }
.work li { break-inside: avoid; margin-bottom: 12px; }
.work .photo { color: var(--encre); }
.work img { aspect-ratio: auto; background: var(--trait); }

/* Contact */
.contact-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 clamp(36px, 5vw, 64px); }
.cartouche { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--encre); border: 2px solid var(--encre); }
.cell { padding: 1rem 1.2rem; background: var(--velin); }
.cell dt { margin: 0 0 .25rem; font-size: .82rem; color: var(--acier); }
.cell dd { margin: 0; font-size: 1.08rem; font-weight: 600; }
.cell dd a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.role { display: block; margin-top: .1rem; font-size: .92rem; font-weight: 400; color: var(--acier); }

/* Pied de page */
.foot { padding-block: 2rem; font-size: .92rem; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; color: rgba(243, 244, 241, .78); }

/* Visionneuse */
.lb { width: 100%; height: 100%; max-width: 100vw; max-height: 100vh; padding: 0; border: 0; background: transparent; color: #fff; }
.lb::backdrop { background: rgba(10, 16, 30, .94); }
.lb[open] { display: grid; place-items: center; }
.lb-fig { display: grid; justify-items: center; gap: .75rem; padding: 64px 16px; }
.lb-img { max-width: min(94vw, 1400px); max-height: calc(100vh - 170px); width: auto; height: auto; object-fit: contain; }
.lb-cap { min-height: 1.4em; font-size: .95rem; }
.lb-btn {
  position: fixed; min-height: 44px; padding: 0 1.1rem; font: 600 .95rem/1 var(--font);
  color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .45); cursor: pointer;
}
.lb-btn:hover { background: rgba(255, 255, 255, .24); }
.lb-btn:focus-visible { outline-color: var(--cobalt-clair); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; bottom: 14px; }
.lb-next { right: 14px; bottom: 14px; }

@media (max-width: 980px) {
  .grid-photos { grid-template-columns: repeat(3, 1fr); }
  .work { columns: 2; }
}

@media (max-width: 800px) {
  .bar-in { flex-wrap: wrap; gap: .5rem 1rem; }
  .bar-in .btn { margin-left: auto; }
  .nav { order: 3; width: 100%; margin-left: 0; gap: 1.4rem; overflow-x: auto; padding-bottom: .35rem; white-space: nowrap; }
  html { scroll-padding-top: 120px; }
  .hero-grid, .split, .split-photo { grid-template-columns: 1fr; }
  .hero-fig img { aspect-ratio: 4 / 3; }
  .trade { grid-template-columns: 1fr; gap: .5rem; }
  .pillars, .groups { grid-template-columns: 1fr; }
  .grid-photos { grid-template-columns: repeat(2, 1fr); }
  .cartouche { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
}

@media (max-width: 480px) {
  .work { columns: 1; }
  .btn { white-space: normal; text-align: center; }
  .hero-cta .btn, .contact-cta .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cote-line { animation: none; }
}

/* ===== Parc machines : poste de pilotage ===== */
.deck { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); margin-top: 2.5rem; align-items: start; }
.stage-frame { position: relative; aspect-ratio: 4 / 3; background: #0b1426; overflow: hidden; border: 1px solid rgba(243,244,241,.22); cursor: crosshair; touch-action: pan-y; }
.stage-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage-front { clip-path: inset(0 100% 0 0); }
.stage-frame.go .stage-front { animation: reveal .85s cubic-bezier(.65, 0, .25, 1) forwards; }
.stage-frame.go .sweep { animation: sweep .85s cubic-bezier(.65, 0, .25, 1) forwards; }
.stage-frame.go .trace rect { animation: trace 1.1s ease-out forwards; }
@keyframes reveal { to { clip-path: inset(0 0 0 0); } }
@keyframes sweep { 0% { left: 0; opacity: 1; } 95% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes trace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.sweep { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--cobalt-clair); box-shadow: 0 0 18px 3px rgba(169,192,255,.75); opacity: 0; pointer-events: none; }
.trace { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.trace rect { fill: none; stroke: var(--cobalt-clair); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; }
.hud i { position: absolute; width: 22px; height: 22px; border: 2px solid var(--velin); pointer-events: none; opacity: .9; }
.hud i:nth-child(1) { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.hud i:nth-child(2) { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.hud i:nth-child(3) { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.hud i:nth-child(4) { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }
.xhair { position: absolute; background: rgba(169,192,255,.7); pointer-events: none; opacity: 0; transition: opacity .2s; }
.xhair-x { left: 0; right: 0; height: 1px; top: 0; }
.xhair-y { top: 0; bottom: 0; width: 1px; left: 0; }
.stage-frame.live .xhair { opacity: 1; }
.dro { position: absolute; left: 14px; bottom: 14px; display: grid; gap: 2px; padding: .45rem .7rem; background: rgba(11,20,38,.82); border: 1px solid rgba(169,192,255,.5); font: 600 .95rem/1.2 ui-monospace, "JetBrains Mono", Consolas, monospace; color: var(--cobalt-clair); letter-spacing: .04em; pointer-events: none; }
.dro span { display: flex; justify-content: space-between; gap: 1rem; }
.dro b { font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.stage-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-top: 1rem; }
.stage-type { margin: 0 0 .15rem; font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--cobalt-clair); }
.stage-name { margin: 0; font: 800 clamp(1.5rem, 3.2vw, 2.4rem)/1.05 var(--font); font-stretch: 112%; letter-spacing: -.01em; color: #fff; }
.stage-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.views { display: flex; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.views button { width: 46px; height: 34px; padding: 0; border: 2px solid rgba(243,244,241,.3); background: none; cursor: pointer; overflow: hidden; }
.views button[aria-pressed="true"] { border-color: var(--cobalt-clair); }
.views img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zoom { font: 600 .9rem/1 var(--font); padding: .7rem 1rem; background: transparent; color: var(--velin); border: 2px solid rgba(243,244,241,.5); cursor: pointer; }
.zoom:hover { background: var(--velin); color: var(--encre); }
.rail { display: grid; gap: 1.4rem; }
.grp h3 { display: flex; justify-content: space-between; margin: 0 0 .5rem; padding-bottom: .5rem; border-bottom: 1px solid rgba(243,244,241,.28); font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: rgba(243,244,241,.7); }
.picks { list-style: none; margin: 0; padding: 0; }
.picks li { border-bottom: 1px solid rgba(243,244,241,.12); }
.pick, .picks .plain { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .85rem; width: 100%; padding: .5rem .6rem; color: var(--velin); text-align: left; }
.picks .plain { grid-template-columns: 1fr auto; padding-block: .75rem; opacity: .7; }
.pick { background: none; border: 0; border-left: 3px solid transparent; font: inherit; cursor: pointer; transition: background .2s, border-color .2s; }
.pick:hover { background: rgba(243,244,241,.07); }
.pick[aria-pressed="true"] { background: rgba(31,79,216,.35); border-left-color: var(--cobalt-clair); }
.pick img { width: 72px; height: 54px; object-fit: cover; display: block; filter: grayscale(.6); transition: filter .25s; }
.pick:hover img, .pick[aria-pressed="true"] img { filter: none; }
.pick-name { display: grid; line-height: 1.25; font-weight: 600; font-size: 1rem; }
.pick-name b { font-size: .72rem; font-weight: 700; letter-spacing: .12em; color: var(--cobalt-clair); }
.picks em { font-style: normal; font-size: .8rem; color: rgba(243,244,241,.6); white-space: nowrap; }
.rail-note { margin: 1.5rem 0 0; font-size: .92rem; color: rgba(243,244,241,.65); }
@media (max-width: 880px) { .deck { grid-template-columns: 1fr; } .pick img { width: 60px; height: 45px; } }
@media (prefers-reduced-motion: reduce) {
  .stage-frame.go .stage-front, .stage-frame.go .sweep, .stage-frame.go .trace rect { animation: none; }
  .stage-front { clip-path: none; }
  .xhair { transition: none; }
}
@media (min-width: 881px) { .stage { position: sticky; top: 96px; } }

/* ===== extras v5 : langue, filtres, dock mobile ===== */
.lang { font: 700 .8rem/1 var(--font); letter-spacing: .1em; text-decoration: none; color: inherit; border: 1px solid var(--trait); padding: .5rem .6rem; }
.lang:hover { border-color: var(--encre); }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1.75rem; }
.chip { font: 600 .95rem/1 var(--font); padding: .75rem 1.1rem; background: transparent; color: var(--encre); border: 2px solid var(--encre); cursor: pointer; transition: background .2s, color .2s; }
.chip span { margin-left: .35rem; font-weight: 500; opacity: .6; font-variant-numeric: tabular-nums; }
.chip:hover { background: rgba(20, 33, 58, .08); }
.chip[aria-pressed="true"] { background: var(--encre); color: #fff; }
.work li[hidden] { display: none; }
.work li.in { animation: pop .55s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.dock { display: none; }
@media (max-width: 720px) {
  .dock { display: grid; grid-template-columns: 1fr 1.5fr; gap: .6rem; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: .6rem var(--gutter) calc(.6rem + env(safe-area-inset-bottom)); background: var(--encre); box-shadow: 0 -6px 24px rgba(0, 0, 0, .25); transition: transform .3s; }
  .dock.off { transform: translateY(110%); }
  .dock a { display: flex; align-items: center; justify-content: center; min-height: 48px; font: 700 1rem/1 var(--font); text-decoration: none; border: 2px solid #fff; color: #fff; }
  .dock .dock-quote { background: var(--cobalt); border-color: var(--cobalt); }
  body { padding-bottom: 76px; }
  .lang { padding: .45rem .5rem; }
}
@media (prefers-reduced-motion: reduce) { .work li.in { animation: none; } .dock { transition: none; } }
