/* =====================================================================
   METRATHON — Site vitrine
   Système de design d'après la Charte graphique v1.0 (Août 2026)
   ===================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Couleurs charte */
  --bleu-profond: #173047;   /* 70% des surfaces */
  --bleu-metrathon: #0360F5; /* éléments actifs, liens, boutons */
  --bleu-petrole: #18628E;
  --ardoise: #485F78;        /* texte secondaire */
  --blanc: #FFFFFF;
  --gris-technique: #EEF1F4; /* fonds, tableaux */
  --jaune-signal: #EBFE04;   /* accent, max 5% */
  --vert-signal: #22EE45;    /* accent, max 10% */

  /* Dérivés utilitaires */
  --profond-90: #1d3a53;
  --profond-line: rgba(255, 255, 255, .12);
  --texte: #173047;
  --texte-doux: #485F78;
  --bordure: #dfe5ea;

  /* Typo */
  --font-titre: "Chivo", "Arial Black", Arial, Helvetica, sans-serif;
  --font-texte: "Source Sans 3", Arial, Helvetica, sans-serif;

  /* Rythme */
  --max: 1180px;
  --pad: clamp(20px, 5vw, 64px);
  --radius: 4px;
}

/* ---------- Reset léger ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-texte);
  font-size: 17px;
  line-height: 1.6;
  color: var(--texte);
  background: var(--blanc);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--bleu-metrathon); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 {
  font-family: var(--font-titre);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.4rem); }
p { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.15rem; }
li { margin-bottom: .35rem; }

/* ---------- SPA : vues ---------- */
.view { display: none; }
.view.active { display: block; animation: viewfade .28s ease both; }
@keyframes viewfade { from { opacity: .35; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view.active { animation: none; } }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: clamp(56px, 9vw, 110px); }
.section--gris { background: var(--gris-technique); }
.section--profond { background: var(--bleu-profond); color: var(--blanc); }
.section--profond h2, .section--profond h3 { color: var(--blanc); }
.section--profond p { color: #c7d2dc; }
.narrow { max-width: 760px; }
.center { text-align: center; margin-inline: auto; }

.eyebrow {
  font-family: var(--font-texte);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .72rem;
  color: var(--bleu-metrathon);
  margin: 0 0 .9rem;
  display: block;
}
.section--profond .eyebrow { color: var(--vert-signal); }
.lead { font-size: 1.18rem; color: var(--texte-doux); }
.section--profond .lead { color: #d6dee6; }

/* ---------- Barre signal (élément signature : vert / jaune / bleu = 2/1/3) ---------- */
.signal { display: flex; overflow: hidden; border-radius: 2px; }
.signal--h { width: 128px; height: 8px; }
.signal--v { flex-direction: column; width: 8px; height: 128px; }
.signal i { display: block; }
.signal--h i:nth-child(1) { flex: 2; background: var(--vert-signal); }
.signal--h i:nth-child(2) { flex: 1; background: var(--jaune-signal); }
.signal--h i:nth-child(3) { flex: 3; background: var(--bleu-metrathon); }
.signal--v i:nth-child(1) { flex: 2; background: var(--vert-signal); }
.signal--v i:nth-child(2) { flex: 1; background: var(--jaune-signal); }
.signal--v i:nth-child(3) { flex: 3; background: var(--bleu-metrathon); }

/* ---------- Trame technique (diagonales sur fonds neutres) ---------- */
.trame {
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(72, 95, 120, .10) 0,
    rgba(72, 95, 120, .10) 1px,
    transparent 1px,
    transparent 11px
  );
}
.section--profond .trame,
.trame--dark {
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, .06) 0,
    rgba(255, 255, 255, .06) 1px,
    transparent 1px,
    transparent 11px
  );
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-texte); font-weight: 700;
  font-size: .95rem; letter-spacing: .01em;
  padding: .8rem 1.5rem; border-radius: var(--radius);
  border: 2px solid transparent; cursor: pointer;
  transition: transform .12s ease, background .15s ease, color .15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--bleu-metrathon); color: #fff; }
.btn--primary:hover { background: #0450d0; }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn--ghost:hover { border-color: #fff; }
.btn--dark { background: var(--bleu-profond); color: #fff; }
.btn--dark:hover { background: #24425c; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bleu-profond);
  border-bottom: 1px solid var(--profond-line);
}
.nav {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 74px; padding-inline: var(--pad);
  max-width: 1320px; margin-inline: auto;
}
.brand { display: flex; align-items: center; gap: .7rem; margin-right: auto; }
.brand img { width: 46px; height: 46px; border-radius: 50%; background: #fff; object-fit: cover; flex: 0 0 auto; }
.brand__name {
  font-family: var(--font-titre); font-weight: 900; text-transform: uppercase;
  letter-spacing: -0.02em; color: #fff; font-size: 1.35rem; line-height: 1;
}
.brand__tag {
  display: block; font-family: var(--font-texte); font-weight: 700;
  text-transform: uppercase; letter-spacing: .16em; font-size: .52rem;
  color: #8ea3b6; margin-top: 3px;
}
.nav__links { display: flex; align-items: center; gap: 1.35rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  color: #d6dee6; font-weight: 600; font-size: .95rem;
  text-decoration: none; padding: .3rem 0; position: relative;
}
.nav__links a:hover { color: #fff; }
.nav__links a.is-active { color: #fff; }
.nav__links a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 3px; background: var(--bleu-metrathon);
}
.nav__toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 42px; height: 42px; padding: 8px;
}
.nav__toggle span { display: block; height: 2px; background: #fff; margin: 5px 0; transition: .25s; }

/* ---------- Hero ---------- */
.hero { background: var(--bleu-profond); color: #fff; position: relative; overflow: hidden; }
.hero__grid {
  display: grid; grid-template-columns: 1.05fr .95fr; min-height: 560px;
}
.hero__left { padding: clamp(48px, 7vw, 96px) var(--pad); display: flex; flex-direction: column; justify-content: center; position: relative; }
.hero__left::before {
  content: ""; position: absolute; left: 0; top: 12%; bottom: 12%; width: 8px;
  background: linear-gradient(var(--bleu-metrathon) 0 50%, var(--jaune-signal) 50% 66%, var(--vert-signal) 66% 100%);
}
.hero__right { position: relative; background: #10273b; }
.hero__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__right::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(23,48,71,.55) 0%, rgba(23,48,71,.15) 35%, transparent 60%);
}
.hero__right .ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #4a6076; font-family: var(--font-texte); font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; font-size: .7rem; text-align: center; padding: 2rem;
}

/* ---------- Bande média (photo pleine largeur + légende) ---------- */
.media { position: relative; overflow: hidden; }
.media img { width: 100%; height: clamp(280px, 42vw, 520px); object-fit: cover; display: block; }
.media__cap {
  position: absolute; left: 0; bottom: 0; max-width: 640px;
  padding: 1.4rem clamp(20px, 5vw, 48px); color: #fff;
  background: linear-gradient(0deg, rgba(23,48,71,.92), rgba(23,48,71,0));
}
.media__cap .signal { margin-bottom: .8rem; }
.media__cap h3 { color: #fff; margin: 0 0 .2rem; }
.media__cap p { color: #d6dee6; margin: 0; font-size: 1rem; }

/* ---------- Galerie ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.gallery figure { margin: 0; border-radius: 6px; overflow: hidden; background: #10273b; }
.gallery img { width: 100%; height: 230px; object-fit: cover; display: block; transition: transform .3s ease; }
.gallery figure:hover img { transform: scale(1.04); }
.hero h1 { color: #fff; max-width: 12ch; }
.hero p { color: #c7d2dc; max-width: 46ch; font-size: 1.2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

/* Hero secondaire (pages internes) */
.subhero { background: var(--bleu-profond); color: #fff; position: relative; }
.subhero .container { padding-block: clamp(56px, 8vw, 96px); position: relative; }
.subhero::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px;
  background: linear-gradient(var(--bleu-metrathon) 0 50%, var(--jaune-signal) 50% 66%, var(--vert-signal) 66% 100%);
}
.subhero h1 { color: #fff; }
.subhero p { color: #c7d2dc; max-width: 60ch; }

/* ---------- Grilles de cartes ---------- */
.grid { display: grid; gap: 1.4rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--bordure); border-radius: 6px;
  padding: 1.8rem; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -22px rgba(23,48,71,.5); border-color: #c6d0da; }
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--texte-doux); font-size: 1rem; }
.card__more { margin-top: auto; font-weight: 700; color: var(--bleu-metrathon); display: inline-flex; gap: .4rem; }

/* Carte activité (accueil) — fond profond */
.activity {
  position: relative; background: var(--bleu-profond); color: #fff;
  border-radius: 8px; padding: 2rem; overflow: hidden;
  display: flex; flex-direction: column; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.activity:hover { transform: translateY(-4px); box-shadow: 0 24px 50px -26px rgba(23,48,71,.7); text-decoration: none; }
.activity .signal { margin-bottom: 1.2rem; }
.activity h3 { color: #fff; }
.activity p { color: #b9c6d2; font-size: 1rem; }
.activity .card__more { color: #fff; }
.activity .num {
  position: absolute; right: 1rem; top: .4rem; font-family: var(--font-titre);
  font-weight: 900; font-size: 4.5rem; color: rgba(255,255,255,.06); letter-spacing: -.04em;
}

/* Cartes services numérotées (style charte "Nos métiers") */
.services { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--bordure); border: 1px solid var(--bordure); border-radius: 6px; overflow: hidden; }
.service { background: #fff; padding: 1.6rem 1.3rem; display: flex; flex-direction: column; gap: .6rem; min-height: 170px; }
.service .n { font-family: var(--font-titre); font-weight: 900; color: var(--bleu-metrathon); font-size: .9rem; letter-spacing: 0; }
.service h4 { font-family: var(--font-titre); text-transform: uppercase; letter-spacing: -.02em; font-size: 1rem; margin: 0; }
.service p { font-size: .9rem; color: var(--texte-doux); margin: 0; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.stat { background: #fff; border-radius: 6px; padding: 1.8rem; border: 1px solid var(--bordure); }
.section--profond .stat { background: #1d3a53; border-color: var(--profond-line); }
.stat b { font-family: var(--font-titre); font-weight: 900; font-size: 3rem; display: block; letter-spacing: -.03em; line-height: 1; color: var(--bleu-profond); }
.section--profond .stat b { color: #fff; }
.stat.is-green b { color: var(--vert-signal); }
.stat span { display: block; margin-top: .5rem; color: var(--texte-doux); font-size: .95rem; }
.section--profond .stat span { color: #9fb0c0; }

/* ---------- Listes en colonnes / features ---------- */
.cols2 { columns: 2; column-gap: 2.4rem; }
.feature { display: flex; gap: .9rem; align-items: flex-start; }
.feature .dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 2px; background: var(--bleu-metrathon); margin-top: .5rem; }
.feature h3 { margin-bottom: .25rem; }
.feature p { color: var(--texte-doux); font-size: 1rem; margin: 0; }

.tags { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.tags li {
  background: #fff; border: 1px solid var(--bordure); border-radius: 999px;
  padding: .4rem .9rem; font-size: .85rem; font-weight: 600; color: var(--ardoise); margin: 0;
}
.section--profond .tags li { background: #1d3a53; border-color: var(--profond-line); color: #cdd8e2; }

/* Bloc valeurs */
.chips { display: flex; flex-wrap: wrap; gap: .6rem; }
.chip {
  display: inline-flex; align-items: center; gap: .5rem; font-weight: 700;
  padding: .55rem 1rem; border-radius: 999px; background: #fff;
  border: 1px solid var(--bordure); color: var(--bleu-profond); font-size: .9rem;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--vert-signal); }

/* Étapes (réalisations) */
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.steps li { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.steps .k {
  font-family: var(--font-titre); font-weight: 900; color: #fff; background: var(--bleu-metrathon);
  width: 40px; height: 40px; border-radius: 6px; display: grid; place-items: center; font-size: .95rem;
}

/* ---------- CTA band ---------- */
.cta { background: var(--bleu-metrathon); color: #fff; }
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,.9); }
.cta .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: clamp(40px, 6vw, 64px); }

/* ---------- Références / logos texte ---------- */
.refs { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }
.ref {
  font-family: var(--font-titre); text-transform: uppercase; letter-spacing: -.01em;
  font-weight: 900; color: var(--ardoise); font-size: 1.05rem; opacity: .85;
  padding: .5rem .9rem; border: 1px solid var(--bordure); border-radius: 4px; background: #fff;
}
.section--profond .ref { background: transparent; border-color: var(--profond-line); color: #aebccb; }

/* ---------- Formulaire ---------- */
.form { display: grid; gap: 1rem; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 700; font-size: .9rem; color: var(--bleu-profond); }
.field input, .field select, .field textarea {
  font-family: var(--font-texte); font-size: 1rem; padding: .75rem .9rem;
  border: 1px solid var(--bordure); border-radius: var(--radius); background: #fff; color: var(--texte);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--bleu-metrathon); outline-offset: 1px; border-color: var(--bleu-metrathon); }

.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); }
.contact-info dt { font-family: var(--font-titre); text-transform: uppercase; font-size: .8rem; letter-spacing: .05em; color: var(--ardoise); margin-top: 1.2rem; }
.contact-info dd { margin: .2rem 0 0; font-size: 1.15rem; font-weight: 600; color: var(--bleu-profond); }
.note { font-size: .85rem; color: var(--ardoise); background: var(--gris-technique); border-left: 3px solid var(--jaune-signal); padding: .8rem 1rem; border-radius: 4px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bleu-profond); color: #c7d2dc; padding-block: clamp(48px, 7vw, 72px) 2rem; }
.site-footer a { color: #c7d2dc; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.footer-grid h4 { color: #fff; font-size: .85rem; letter-spacing: .05em; margin-bottom: 1rem; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .55rem; }
.footer-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.footer-brand img { width: 48px; height: 48px; border-radius: 50%; background: #fff; object-fit: cover; flex: 0 0 auto; }
.footer-bottom {
  border-top: 1px solid var(--profond-line); margin-top: 2.5rem; padding-top: 1.4rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  font-size: .82rem; color: #8ea3b6;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__right { min-height: 220px; }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .services { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cols2 { columns: 1; }
}
@media (max-width: 720px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: 74px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bleu-profond); border-top: 1px solid var(--profond-line);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav__links.open { max-height: 420px; }
  .nav__links li { width: 100%; }
  .nav__links a { display: block; padding: .9rem var(--pad); width: 100%; }
  .nav__links a.is-active::after { display: none; }
  .grid--3, .grid--4, .grid--2 { grid-template-columns: 1fr; }
  .services { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .form .row { grid-template-columns: 1fr; }
  .cta .container { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
