@font-face { font-family: "Archivo"; src: url("/fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("/fonts/source-sans-3.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }

:root {
  --ink: #17324d;        /* bleu encre : titres, en-tête, confiance */
  --ink-soft: #2b4a69;
  --yellow: #ffc72c;     /* jaune mètre ruban : signature et actions */
  --yellow-deep: #f2b200;
  --bg: #edf1f4;         /* gris catalogue */
  --surface: #ffffff;
  --sunk: #f5f7f9;
  --line: #d3dbe2;
  --text: #1c2833;
  --muted: #5a6876;
  --ok: #2e6b4f;
  --link: #1257a6;
  --r: 8px;
  --head: "Archivo", "Arial Narrow", Arial, sans-serif;
  --body: "Source Sans 3", "Segoe UI", Roboto, Arial, sans-serif;
  --maxw: 1160px;
  color-scheme: light;
  --tape: repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 10px),
          repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 50px);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 30; background: var(--yellow); color: var(--ink); font-weight: 700; padding: 10px 14px; border-radius: 6px; }
.skip:focus { top: 10px; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 18px/1.55 var(--body); }
a { color: var(--link); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--head); color: var(--ink); line-height: 1.15; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); font-weight: 800; margin: .15em 0 .35em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); font-weight: 750; margin: 2em 0 .6em; }
h3 { font-size: 1.15rem; font-weight: 700; margin: 1.6em 0 .4em; }
p, ul, ol { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.pic { width: 32px; height: 32px; flex: none; }

/* ---------- En-tête + bande mètre ruban ---------- */
.site-header { background: var(--ink); color: #fff; }
.site-header .wrap { display: flex; align-items: center; gap: 12px 24px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 800 1.2rem/1 var(--head); letter-spacing: -0.01em; }
.brand svg { width: 34px; height: 34px; flex: none; }
.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: #d6e2ee; text-decoration: none; font: 600 .98rem/1 var(--body); padding: 10px 10px; border-radius: 6px; }
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--yellow); border-radius: 0; }
.list-link { background: var(--yellow); color: var(--ink); display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 6px; font: 700 .98rem/1 var(--body); text-decoration: none; white-space: nowrap; }
.list-link:hover { background: var(--yellow-deep); }
.list-count { min-width: 1.4em; padding: 2px .35em; border-radius: 99px; background: var(--ink); color: #fff; font-size: .78rem; text-align: center; }
.list-count:empty { display: none; }
.tape { height: 14px; background: var(--tape), var(--yellow); background-size: 100% 6px, 100% 10px, auto; background-repeat: no-repeat; }
@media (max-width: 760px) {
  .site-header .wrap { padding-top: 10px; padding-bottom: 4px; }
  .site-header .list-link { margin-left: auto; }
  .nav { order: 3; margin-left: -10px; width: calc(100% + 20px); overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-right: 40px; -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
  .nav a { white-space: nowrap; }
}

.page-static { padding-top: 28px; }
.crumbs { font-size: .9rem; color: var(--muted); margin: 0 0 6px; }
.crumbs a { color: var(--muted); }
main { padding-bottom: 56px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 58ch; }

/* ---------- Boutons, champs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 6px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink); font: 700 1rem/1 var(--body); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--sunk); }
.btn-primary { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.btn-primary:hover { background: var(--yellow-deep); border-color: var(--yellow-deep); }
.btn-ghost { border: 2px dashed var(--line); color: var(--ink-soft); background: transparent; min-height: 40px; padding: 6px 14px; }
.btn-icon { min-width: 44px; padding: 8px; border-color: var(--line); color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--yellow-deep); outline-offset: 2px; }

/* ---------- Page calculateur : en-tête ---------- */
.page-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 28px 0 8px; }
.page-head .photo { border-radius: var(--r); overflow: hidden; aspect-ratio: 3 / 2; background: var(--line); border: 1px solid var(--line); }
.page-head .photo img { width: 100%; height: 100%; object-fit: cover; }
.page-head .facts { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 14px 0 0; color: var(--ink-soft); font-weight: 600; font-size: .95rem; }
.page-head .facts li { display: flex; align-items: center; gap: 6px; }
.page-head .facts .pic { width: 20px; height: 20px; color: var(--ok); }
@media (max-width: 820px) { .page-head { grid-template-columns: 1fr; gap: 16px; } .page-head .photo { aspect-ratio: 16 / 7; order: -1; } }

/* ---------- Calculateur ---------- */
.calc-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px; align-items: start; margin: 20px 0 8px; }
@media (max-width: 900px) { .calc-grid { grid-template-columns: 1fr; } }
.calc-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 22px 22px; counter-reset: step; }
.calc-form > h2 { display: none; }
fieldset { border: 0; padding: 20px 0 4px; margin: 0; border-bottom: 1px solid var(--line); counter-increment: step; }
fieldset:last-of-type { border-bottom: 0; }
fieldset fieldset { counter-increment: none; border: 0; padding: 0; }
legend { display: flex; align-items: center; gap: 10px; float: left; width: 100%; margin-bottom: 14px; padding: 0; font: 750 1.12rem/1.2 var(--head); color: var(--ink); }
legend::before { content: counter(step); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--yellow); font-size: .95rem; flex: none; }
legend + * { clear: both; }
.field { margin-bottom: 14px; }
.field > label, .label { display: block; font-weight: 650; font-size: .98rem; margin-bottom: 5px; }
.hint { display: block; font-size: .86rem; color: var(--muted); margin-top: 4px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
input[type="number"], input[type="text"], select {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid #b9c6d2; border-radius: 6px;
  background: var(--surface); color: var(--text); font: 600 1.05rem/1.2 var(--body);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
input:hover, select:hover { border-color: var(--ink-soft); }
input[aria-invalid="true"] { border-color: #b42318; background: #fff5f4; }
.field-error { display: block; color: #b42318; font-size: .86rem; font-weight: 600; margin-top: 4px; }
.result-error { color: #b42318; font-weight: 600; margin: 0; }
input:focus, select:focus { border-color: var(--ink); }
.unit-input { position: relative; }
.unit-input input { padding-right: 70px; }
.unit-input span { position: absolute; right: 1px; top: 1.5px; bottom: 1.5px; display: grid; place-items: center; min-width: 52px; padding: 0 8px; border-left: 1px solid var(--line); border-radius: 0 5px 5px 0; background: var(--sunk); color: var(--muted); font-weight: 600; font-size: .9rem; pointer-events: none; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--ink); flex: none; }
.zones { display: grid; gap: 8px; margin-bottom: 8px; }
.zone { display: grid; grid-template-columns: 1fr auto 1fr 44px; gap: 8px; align-items: center; }
.zone .x { color: var(--muted); font-weight: 700; }
.zones + .btn-ghost { margin-bottom: 4px; }
.calc-form > .actions { display: none; }

/* ---------- Résultat : bon de commande ---------- */
.result { position: sticky; top: 14px; background: var(--surface); border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; }
@media (max-width: 900px) { .result { position: static; scroll-margin-top: 12px; } }
.result-head { background: var(--ink); color: #fff; padding: 14px 20px 16px; position: relative; }
.result-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--tape), var(--yellow); background-size: 100% 4px, 100% 6px, auto; background-repeat: no-repeat; }
.result-head h2 { margin: 0; color: #fff; font-size: 1.15rem; }
.result-head p { margin: 2px 0 0; color: #c9d7e4; font-size: .95rem; }
.result-body { padding: 18px 20px 20px; }
.placeholder { color: var(--muted); margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 18px; }
.kpi { padding: 12px 14px; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; background: #fff8df; }
.kpi b { display: block; font: 800 1.65rem/1.1 var(--head); color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi span { font-size: .9rem; color: var(--muted); }
.lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.line-name { font-weight: 700; color: var(--text); }
.line-note { display: block; font-size: .86rem; color: var(--muted); font-weight: 400; }
.line-qty { text-align: right; font: 800 1.3rem/1.1 var(--head); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.line-qty small { display: block; font: 600 .8rem/1.2 var(--body); color: var(--muted); }
.line-tools { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.line-tools a { font-size: .9rem; font-weight: 650; }
.price { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; color: var(--muted); }
.price input { width: 92px; min-height: 36px; padding: 5px 8px; font-size: .95rem; }
.line-total { margin-left: auto; font-weight: 700; color: var(--ok); font-variant-numeric: tabular-nums; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 0; font: 800 1.15rem/1.2 var(--head); color: var(--ink); }
.total b { color: var(--ok); }
.notes { margin: 16px 0 0; padding: 12px 14px 12px 32px; background: var(--sunk); border-radius: 6px; font-size: .92rem; color: var(--ink-soft); }
.notes li { margin-bottom: 4px; }
.disclosure { font-size: .82rem; color: var(--muted); margin: 10px 0 0; }
.toast { position: fixed; left: 50%; bottom: 80px; transform: translate(-50%, 8px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 6px; font-weight: 600; opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-bar { display: none; }
@media (max-width: 900px) {
  .mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--ink); align-items: center; gap: 12px; color: #fff; box-shadow: 0 -4px 14px rgba(23,50,77,.18); }
  .mobile-bar[hidden] { display: none; }
  .mobile-bar span { flex: 1; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-bar .btn { min-height: 42px; }
  body.has-bar { padding-bottom: 72px; }
}

/* ---------- Contenu éditorial ---------- */
.guide { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start; margin-top: 24px; }
.guide-aside { position: sticky; top: 16px; display: grid; gap: 16px; padding-top: 2.2em; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; font-size: .95rem; }
.toc b { display: block; font: 750 1rem/1.2 var(--head); color: var(--ink); padding-bottom: 8px; margin-bottom: 6px; border-bottom: 3px solid var(--yellow); }
.toc ol, .toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: flex; align-items: center; gap: 10px; padding: 6px 0; color: var(--ink-soft); text-decoration: none; font-weight: 600; line-height: 1.3; }
.toc a:hover { color: var(--link); text-decoration: underline; }
.toc .pic { width: 24px; height: 24px; color: var(--ink); }
.prose h2[id] { scroll-margin-top: 16px; }
@media (max-width: 980px) { .guide { grid-template-columns: 1fr; gap: 8px; } .guide-aside { position: static; padding-top: 0; order: 2; } .guide-aside .toc:not(.related) { display: none; } }
.prose { max-width: 74ch; }
.prose h2 { padding-top: .2em; border-top: 3px solid var(--ink); display: inline-block; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.3em; background: var(--surface); font-size: .97rem; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--ink); color: #fff; font-weight: 650; border-color: var(--ink); }
.prose tbody tr:nth-child(even) td { background: var(--sunk); }
.prose li { margin-bottom: .35em; }
.formula { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--yellow); padding: 12px 16px; border-radius: 0 6px 6px 0; margin: 0 0 1.2em; font-weight: 600; color: var(--ink); overflow-x: auto; }
.table-scroll { overflow-x: auto; }
details { border-bottom: 1px solid var(--line); padding: 14px 0; }
details summary { cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; font: 700 1.4rem/1 var(--head); color: var(--ink); }
details[open] summary::after { content: "–"; }
details p { margin: 10px 0 0; }

/* ---------- Cartes chantiers ---------- */
.projects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 16px 0 8px; }
@media (max-width: 900px) { .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .projects { grid-template-columns: 1fr; } .project-img { aspect-ratio: 2 / 1; } }
.project { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; color: var(--text); }
.project:hover { border-color: var(--ink); }
.project:hover .project-go { background: var(--yellow); }
.project-img { aspect-ratio: 3 / 2; background: var(--sunk); overflow: hidden; }
.project-img img { width: 100%; height: 100%; object-fit: cover; }
.project-body { padding: 14px 16px 16px; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; flex: 1; }
.project-body .pic { grid-row: span 2; color: var(--ink); width: 34px; height: 34px; margin-top: 2px; }
.project-body b { font: 750 1.12rem/1.2 var(--head); color: var(--ink); }
.project-body span { font-size: .95rem; color: var(--muted); }
.project-go { margin: 0 16px 16px; padding: 9px 12px; border-radius: 6px; background: var(--sunk); font-weight: 700; color: var(--ink); text-align: center; font-size: .95rem; }
.projects.compact .project-img { display: none; }

/* ---------- Accueil ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: center; padding: 40px 0 24px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
.hero-photo { position: relative; }
.hero-photo .photo { border-radius: var(--r); overflow: hidden; aspect-ratio: 4 / 3.2; background: var(--line); }
.hero-photo .photo img { width: 100%; height: 100%; object-fit: cover; }
.ticket { position: absolute; left: -28px; bottom: -22px; width: min(300px, 80%); background: var(--surface); border: 2px solid var(--ink); border-radius: 6px; padding: 12px 14px 10px; box-shadow: 0 10px 24px rgba(23,50,77,.18); font-size: .92rem; }
.ticket b { font: 800 1rem/1.2 var(--head); color: var(--ink); display: block; padding-bottom: 6px; margin-bottom: 4px; border-bottom: 3px solid var(--yellow); }
.ticket div { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.ticket div:last-child { border-bottom: 0; }
.ticket strong { font-family: var(--head); color: var(--ink); white-space: nowrap; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.quick { gap: 4px 20px !important; }
.quick a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--yellow-deep); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.quick a:hover { text-decoration-color: var(--ink); }
.quick .pic { width: 22px; height: 22px; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; padding-top: 24px; } .ticket { left: 12px; bottom: -18px; } .hero-photo { margin-bottom: 18px; } }
.assure { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; background: var(--ink); color: #dbe6f0; border-radius: var(--r); margin: 40px 0 8px; overflow: hidden; }
.assure div { padding: 18px 20px; border-left: 1px solid rgba(255,255,255,.12); display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; }
.assure div:first-child { border-left: 0; }
.assure .pic { color: var(--yellow); grid-row: span 2; }
.assure b { color: #fff; font: 750 1.05rem/1.2 var(--head); }
.assure span { font-size: .95rem; }
.steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; padding: 0; }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--yellow); color: var(--ink); font: 800 1rem/1 var(--head); margin-bottom: 8px; }
.steps b { display: block; font: 750 1.08rem/1.2 var(--head); color: var(--ink); margin-bottom: 2px; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--ink); color: #c9d7e4; font-size: .95rem; }
.site-footer .tape { margin-bottom: 30px; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; padding-bottom: 20px; }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr; } }
.site-footer b { color: #fff; font-family: var(--head); }
.site-footer a { color: #c9d7e4; }
.site-footer ul { list-style: none; padding: 0; margin: 8px 0 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer .legal { border-top: 1px solid rgba(255,255,255,.12); padding: 16px; font-size: .85rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-header, .tape, .site-footer, .actions, .crumbs, .no-print, .calc-form, .guide, .page-head .photo, .page-head .facts, .mobile-bar { display: none !important; }
  body { background: #fff; }
  .calc-grid { display: block; }
  .result { border: 0; }
}

.sources { font-size: .92rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 2em; padding-top: 1em; }
.sources b { color: var(--ink); }
