/* Gidesol — feuille de style
   Palette : indigo d'encre + vert Gidesol, sur papier calque froid. */

:root {
  --ink-900: #14173a;
  --ink-800: #1c2050;
  --ink-700: #2a3170;
  --ink-500: #4b55a8;
  --ink-300: #9ba4dd;
  --ink-200: #c9ceee;
  --ink-100: #e4e7f6;
  --paper: #f3f5fb;
  --white: #ffffff;
  --lime-300: #d9ee7c;
  --lime-400: #c3de4c;
  --lime-800: #4d6410;
  --text: #23274a;
  --muted: #565b80;
  --rule: #cdd2ea;

  --display: "Barlow Condensed", "Arial Narrow", "Inter Display", "Helvetica Neue", Arial, sans-serif;
  --body: "Barlow", "Inter", "Segoe UI", Roboto, Arial, sans-serif;

  --wrap: 1180px;
  --gutter: clamp(18px, 4vw, 40px);
  --section: clamp(64px, 9vw, 120px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--ink-700); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink-500); }

:focus-visible { outline: 3px solid var(--ink-500); outline-offset: 3px; border-radius: 2px; }
.on-ink :focus-visible, .site-footer :focus-visible { outline-color: var(--lime-400); }

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.05; margin: 0; color: var(--ink-900); letter-spacing: 0.005em; }
h1 { font-size: clamp(2.6rem, 6.2vw, 4.75rem); line-height: 0.98; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.5rem; line-height: 1.15; }
p { margin: 0 0 1em; max-width: 64ch; }
p:last-child { margin-bottom: 0; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink-900); color: #fff; padding: 10px 16px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- En-tête ---------- */

.site-header { background: var(--white); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; padding-block: 10px; }

.brand { display: flex; align-items: center; text-decoration: none; margin-right: auto; color: var(--ink-900); }
.brand-logo { width: 150px; height: 70px; object-fit: cover; object-position: center; }
.brand-text { font-family: var(--display); font-weight: 600; font-size: 1.9rem; letter-spacing: 0.04em; line-height: 70px; }
.brand-text[hidden] { display: none; }

.nav { display: flex; gap: 4px 6px; flex-wrap: wrap; }
.nav a { font-weight: 500; font-size: 1.0625rem; text-decoration: none; color: var(--ink-800); padding: 10px 14px; border-radius: 4px; }
.nav a:hover { background: var(--ink-100); color: var(--ink-900); }
.nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--lime-400); color: var(--ink-900); }

.btn { display: inline-block; font: 600 1.0625rem/1.2 var(--body); text-decoration: none; padding: 14px 22px; border-radius: 4px; border: 2px solid transparent; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.btn-lime { background: var(--lime-400); color: var(--ink-900); }
.btn-lime:hover { background: var(--lime-300); color: var(--ink-900); }
.btn-ink { background: var(--ink-800); color: #fff; }
.btn-ink:hover { background: var(--ink-700); color: #fff; }
.btn-line { border-color: var(--ink-300); color: #fff; }
.btn-line:hover { border-color: #fff; color: #fff; }
.btn-line-dark { border-color: var(--ink-700); color: var(--ink-800); }
.btn-line-dark:hover { background: var(--ink-800); border-color: var(--ink-800); color: #fff; }
.site-header .btn { padding: 11px 18px; }

/* ---------- Feuille d'ouverture (accueil) ---------- */

.sheet { background: var(--ink-900); color: var(--ink-200); position: relative; overflow: hidden; }
.sheet::before { content: ""; position: absolute; inset: 0; background-image:
    linear-gradient(to right, rgba(155,164,221,.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(155,164,221,.09) 1px, transparent 1px);
  background-size: 40px 40px; pointer-events: none; }
.sheet .wrap { position: relative; }
.sheet-frame { border: 1px solid rgba(155,164,221,.45); margin-block: clamp(18px, 3vw, 36px); display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); position: relative; }
.sheet-copy { padding: clamp(28px, 5vw, 64px) clamp(20px, 4vw, 52px); align-self: center; }
.sheet h1 { color: #fff; max-width: 13em; }
.sheet .lead { font-size: 1.25rem; line-height: 1.5; color: var(--ink-200); margin: 26px 0 32px; max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.sheet-drawing { display: flex; flex-direction: column; justify-content: flex-end; border-left: 1px solid rgba(155,164,221,.45); min-width: 0; }
.sheet-drawing .pid { padding: clamp(14px, 2.4vw, 30px); flex: 1; display: flex; align-items: center; }
.pid svg { width: 100%; height: auto; }

/* Cartouche : le bloc d'identification d'un plan */
.cartouche { display: grid; grid-template-columns: repeat(4, auto); border-top: 1px solid rgba(155,164,221,.45); margin: 0; }
.cartouche div { padding: 12px 16px 14px; border-left: 1px solid rgba(155,164,221,.45); }
.cartouche div:first-child { border-left: 0; }
.cartouche dt { font-size: .8125rem; color: var(--ink-300); line-height: 1.3; }
.cartouche dd { margin: 2px 0 0; font-family: var(--display); font-weight: 500; font-size: 1.3rem; line-height: 1.15; color: #fff; }

/* Tracé du schéma */
.pid .eq, .pid .inst { fill: none; stroke: var(--ink-300); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.pid .proc { fill: none; stroke: var(--lime-400); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.pid .sig { fill: none; stroke: var(--ink-300); stroke-width: 1.2; stroke-dasharray: 5 5; }
.pid .util { fill: none; stroke: var(--ink-300); stroke-width: 1.5; }
.pid .arrow { fill: var(--lime-400); }
.pid .arrow-u { fill: var(--ink-300); }
.pid text { font-family: var(--body); font-size: 12.5px; fill: var(--ink-200); }
.pid text.tag { font-weight: 600; fill: #fff; font-size: 13px; }
.pid text.b { font-size: 10.5px; font-weight: 500; text-anchor: middle; fill: #fff; }

@media (prefers-reduced-motion: no-preference) {
  .pid .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.5s cubic-bezier(.6,.1,.2,1) forwards; animation-delay: var(--d, 0s); }
  .pid .fade { opacity: 0; animation: fade .6s ease forwards; animation-delay: var(--d, 2.2s); }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes fade { to { opacity: 1; } }
}

/* ---------- Bandeau de page intérieure ---------- */

.page-head { background: var(--ink-900); color: var(--ink-200); position: relative; }
.page-head::before { content: ""; position: absolute; inset: 0; background-image:
    linear-gradient(to right, rgba(155,164,221,.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(155,164,221,.09) 1px, transparent 1px);
  background-size: 40px 40px; pointer-events: none; }
.page-head .wrap { position: relative; padding-block: clamp(44px, 7vw, 88px); }
.page-head h1 { color: #fff; font-size: clamp(2.4rem, 5.4vw, 4rem); max-width: 16em; }
.page-head p { font-size: 1.25rem; line-height: 1.5; margin-top: 20px; max-width: 40em; }

/* ---------- Sections ---------- */

.section { padding-block: var(--section); }
.section-white { background: var(--white); border-block: 1px solid var(--rule); }
.section-tint { background: var(--ink-100); }
.section-head { margin-bottom: clamp(28px, 4vw, 48px); max-width: 46em; }
.section-head p { margin-top: 16px; color: var(--muted); }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 72px); align-items: start; }

/* Liste réglée : les atouts */
.ruled { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.ruled li { padding: 16px 0 16px 34px; border-bottom: 1px solid var(--rule); position: relative; font-weight: 500; color: var(--ink-900); }
.ruled li::before { content: ""; position: absolute; left: 4px; top: 1.55em; width: 14px; height: 8px; border-left: 3px solid var(--lime-800); border-bottom: 3px solid var(--lime-800); transform: translateY(-70%) rotate(-45deg); }

/* Grille de prestations : cases contiguës, comme une nomenclature */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); background: var(--white); list-style: none; margin: 0; padding: 0; }
.grid > li { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: clamp(22px, 2.6vw, 34px); }
.grid svg { width: 60px; height: 60px; color: var(--ink-700); margin-bottom: 20px; }
.grid svg .hl { stroke: var(--lime-800); }
.grid h3 { margin-bottom: 8px; }
.grid p { color: var(--muted); font-size: 1.0625rem; line-height: 1.5; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.more { margin-top: 32px; }

/* Phases d'un projet : une cote, de la faisabilité à la construction */
.phases { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; counter-reset: ph; }
.phases li:not(:last-child)::after { content: ""; position: absolute; left: 36px; right: 0; top: 17px; height: 2px; background: var(--ink-700); }
.phases li { position: relative; padding: 48px 18px 0 0; counter-increment: ph; }
.phases li::before { content: counter(ph); position: absolute; top: 0; left: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--ink-800); color: #fff; font: 600 1.125rem/36px var(--display); text-align: center; }
.phases li:last-child::before { background: var(--lime-400); color: var(--ink-900); }
.phases strong { display: block; font-family: var(--display); font-weight: 600; font-size: 1.5rem; line-height: 1.1; color: var(--ink-900); }
.phases span { display: block; color: var(--muted); font-size: 1rem; line-height: 1.4; margin-top: 4px; }

.atout { margin-top: clamp(32px, 5vw, 56px); border-left: 4px solid var(--lime-400); padding: 6px 0 6px 24px; font-size: 1.3rem; line-height: 1.45; color: var(--ink-900); max-width: 44em; }
.atout strong { font-weight: 600; }

/* Liste des réalisations (tableau) */
.listing { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--rule); }
.listing th, .listing td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.listing thead th { font-size: .9375rem; font-weight: 500; color: var(--muted); background: var(--paper); }
.listing td:first-child { font-family: var(--display); font-weight: 600; font-size: 1.4rem; line-height: 1.2; color: var(--ink-700); white-space: nowrap; width: 1%; }
.listing td:last-child { color: var(--muted); white-space: nowrap; }
.listing tr:last-child td { border-bottom: 0; }

/* Normes */
.norms { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.norms li { border: 1.5px solid var(--ink-700); color: var(--ink-800); background: var(--white); padding: 8px 16px; border-radius: 4px; font-weight: 600; }
.norms li small { font-weight: 400; font-size: .9375rem; color: var(--muted); }

/* ---------- Réalisations ---------- */

.group + .group { margin-top: clamp(56px, 8vw, 104px); }
.group > h2 { padding-bottom: 18px; border-bottom: 2px solid var(--ink-800); margin-bottom: clamp(24px, 4vw, 40px); }
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); }
.project { background: var(--white); border: 1px solid var(--rule); margin: 0; display: flex; flex-direction: column; }
.project.wide { grid-column: 1 / -1; }
.shots { display: grid; gap: 1px; background: var(--rule); border-bottom: 1px solid var(--rule); }
.shots.n2 { grid-template-columns: 1fr 1fr; }
.shots.n3 { grid-template-columns: 1fr 1.78fr 1fr; }
.shot { all: unset; box-sizing: border-box; display: block; cursor: zoom-in; background: var(--ink-100); aspect-ratio: 4 / 3; position: relative; overflow: hidden; }
.project.wide .shot { aspect-ratio: auto; height: clamp(220px, 34vw, 420px); }
.shot:focus-visible { outline: 3px solid var(--ink-500); outline-offset: -3px; }
.shot img { width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .3s; }
.shot img.ok { opacity: 1; }
.shot.missing { cursor: default; background:
    repeating-linear-gradient(135deg, transparent 0 13px, rgba(42,49,112,.10) 13px 14px), var(--ink-100); }
.shot.missing::after { content: "Illustration à venir"; position: absolute; inset: auto 0 12px 0; text-align: center; font-size: .9375rem; color: var(--muted); }
.project figcaption { display: grid; grid-template-columns: auto 1fr; flex: 1; }
.project .year { font-family: var(--display); font-weight: 600; font-size: 2rem; line-height: 1; color: var(--ink-700); padding: 18px 20px; border-right: 1px solid var(--rule); }
.project .what { padding: 16px 20px 18px; }
.project .what h3 { font-family: var(--body); font-weight: 600; font-size: 1.125rem; line-height: 1.4; }
.project .what p { color: var(--muted); font-size: 1rem; margin-top: 4px; }
.project.text-only .what { padding-block: 22px; }

dialog.zoom { border: 0; padding: 0; background: transparent; max-width: min(96vw, 1400px); max-height: 94vh; }
dialog.zoom::backdrop { background: rgba(20,23,58,.88); }
dialog.zoom img { max-width: 96vw; max-height: 86vh; width: auto; height: auto; background: #fff; }
dialog.zoom form { text-align: right; margin-bottom: 8px; }
dialog.zoom button { font: 600 1rem var(--body); background: #fff; color: var(--ink-900); border: 0; border-radius: 4px; padding: 8px 14px; cursor: pointer; }

/* ---------- Contact ---------- */

.contact { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.form { display: grid; gap: 18px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form label { display: block; font-weight: 600; font-size: 1rem; color: var(--ink-900); margin-bottom: 6px; }
.form label span { font-weight: 400; color: var(--muted); }
.form input, .form textarea { width: 100%; font: inherit; color: var(--text); background: var(--white); border: 1.5px solid #8f96c4; border-radius: 4px; padding: 12px 14px; }
.form textarea { min-height: 170px; resize: vertical; }
.form input:focus, .form textarea:focus { outline: 3px solid var(--ink-300); outline-offset: 0; border-color: var(--ink-700); }
.form .hp { position: absolute; left: -9999px; }
.form .note { color: var(--muted); font-size: 1rem; }

.coords { background: var(--white); border: 1px solid var(--rule); margin: 0; }
.coords div { padding: 18px 22px; border-bottom: 1px solid var(--rule); }
.coords div:last-child { border-bottom: 0; }
.coords dt { font-size: .9375rem; color: var(--muted); }
.coords dd { margin: 2px 0 0; font-weight: 500; color: var(--ink-900); overflow-wrap: anywhere; }
.coords dd.big { font-family: var(--display); font-weight: 600; font-size: 1.7rem; line-height: 1.2; }
.coords dd a { text-decoration: none; }
.coords dd a:hover { text-decoration: underline; }

/* ---------- Appel de fin de page ---------- */

.cta { background: var(--lime-400); color: var(--ink-900); }
.cta .wrap { padding-block: clamp(40px, 6vw, 72px); display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: center; justify-content: space-between; }
.cta h2 { max-width: 16em; }
.cta p { margin-top: 10px; font-size: 1.2rem; }
.cta a.tel { font-weight: 600; color: var(--ink-900); white-space: nowrap; }

/* ---------- Pied de page ---------- */

.site-footer { background: var(--ink-900); color: var(--ink-200); font-size: 1.0625rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: #fff; }
.foot { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; border: 1px solid rgba(155,164,221,.45); margin-block: clamp(28px, 4vw, 48px) 0; }
.foot > div { padding: 22px 24px; border-left: 1px solid rgba(155,164,221,.45); }
.foot > div:first-child { border-left: 0; }
.foot .name { font-family: var(--display); font-weight: 600; font-size: 2rem; letter-spacing: .04em; color: #fff; line-height: 1; margin-bottom: 10px; }
.foot h2 { font-family: var(--body); font-size: .9375rem; font-weight: 400; color: var(--ink-300); margin-bottom: 6px; line-height: 1.4; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { padding: 2px 0; }
.legal { padding-block: 18px 26px; color: var(--ink-300); font-size: .9375rem; display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; }

/* ---------- Message simple (merci, 404) ---------- */
.plain { padding-block: clamp(72px, 12vw, 160px); }
.plain h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.plain p { margin-top: 18px; font-size: 1.2rem; }
.plain .actions { margin-top: 30px; }

/* ---------- Adaptation aux écrans ---------- */

@media (max-width: 960px) {
  .sheet-frame { grid-template-columns: 1fr; }
  .sheet-drawing { border-left: 0; border-top: 1px solid rgba(155,164,221,.45); }
  .split, .contact { grid-template-columns: 1fr; }
  .grid, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot { grid-template-columns: 1fr 1fr; }
  .foot > div:nth-child(3) { border-left: 0; }
  .foot > div:nth-child(n+3) { border-top: 1px solid rgba(155,164,221,.45); }
  .phases { grid-template-columns: 1fr; }
  .phases li:not(:last-child)::after { left: 17px; right: auto; top: 36px; bottom: 0; width: 2px; height: auto; }
  .phases li { padding: 2px 0 26px 56px; }
  .phases li:last-child { padding-bottom: 0; }
}

@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .site-header { position: static; }
  .site-header .wrap { padding-block: 8px 6px; gap: 4px 12px; }
  .brand-logo { width: 120px; height: 56px; }
  .brand-text { line-height: 56px; font-size: 1.7rem; }
  .nav { order: 3; width: calc(100% + 16px); margin-inline: -8px; gap: 0; justify-content: space-between; flex-wrap: nowrap; }
  .nav a { padding: 9px 8px; font-size: .9375rem; }
  .sheet .lead, .page-head p { font-size: 1.125rem; }
  .cartouche { grid-template-columns: 1fr 1fr; }
  .cartouche div:nth-child(3) { border-left: 0; }
  .cartouche div:nth-child(n+3) { border-top: 1px solid rgba(155,164,221,.45); }
  .grid, .grid-2, .grid-4, .projects { grid-template-columns: 1fr; }
  .form .row { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr; }
  .foot > div { border-left: 0; }
  .foot > div + div { border-top: 1px solid rgba(155,164,221,.45); }
  .shots.n3 { grid-template-columns: 1fr 1fr; }
  .shots.n3 .shot:nth-child(2) { grid-column: 1 / -1; grid-row: 1; }
  .project.wide .shot { height: auto; aspect-ratio: 4 / 3; }
  .project.wide .shots.n3 .shot:not(:nth-child(2)) { aspect-ratio: 3 / 4; }
  .listing thead { display: none; }
  .listing, .listing tbody, .listing tr, .listing td { display: block; width: auto; }
  .listing tr { padding: 14px 16px; border-bottom: 1px solid var(--rule); }
  .listing tr:last-child { border-bottom: 0; }
  .listing td, .listing td:first-child { padding: 0; border: 0; white-space: normal; width: auto; }
  .btn { padding: 13px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
