* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'Libre Franklin', system-ui, sans-serif; color: #171E38; background: #ffffff; -webkit-font-smoothing: antialiased; }
a { color: #BF1726; text-decoration: none; }
a:hover { color: #8f111c; }
::selection { background: #1B2A6B; color: #fff; }

@keyframes dgFadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* Accessibility: visible keyboard focus, without adding an outline on mouse clicks */
a:focus-visible, button:focus-visible {
  outline: 2px solid #BF1726;
  outline-offset: 3px;
  border-radius: 1px;
}

/* Skip link: hidden until keyboard-focused, lets keyboard users jump past the nav */
.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 100;
  background: #1B2A6B;
  color: #fff !important;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 2px;
  transition: top .2s ease;
}
.skip-link:focus {
  top: 12px;
}

/* Header gains depth once the page scrolls, so it reads above content */
.site-header {
  transition: box-shadow .25s ease;
}
.site-header.is-scrolled {
  box-shadow: 0 8px 24px -16px rgba(14,22,56,0.35);
}

[data-menu-toggle] { display: none; }
[data-mobile-nav] { display: none; }
[data-mobile-nav].open { display: flex; }

[data-mobile-nav-backdrop] {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(10,16,42,0.35);
}
[data-mobile-nav-backdrop].open { display: block; }

@media (max-width: 780px) {
  [data-navlink], [data-nav-cta] { display: none !important; }
  [data-menu-toggle] { display: flex !important; }
}

/* Scroll-reveal: sections fade up into place as they enter the viewport */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Card lift: reinforces that expertise/value tiles are hoverable, beyond the background tint */
.ui-card {
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.ui-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px -18px rgba(14,22,56,0.28);
  z-index: 1;
  position: relative;
}

/* Back-to-top button, only surfaced once the visitor has scrolled a screen down */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: #1B2A6B;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px -10px rgba(14,22,56,0.5);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: #131F4E;
}

/* Progressive disclosure: discreet "en savoir plus" panels on expertise cards, method sheets, FAQ */
details.dg-detail summary { list-style: none; cursor: pointer; }
details.dg-detail summary::-webkit-details-marker { display: none; }
details.dg-detail summary::marker { content: ""; }
details.dg-detail .dg-chevron { transition: transform .25s ease; }
details.dg-detail[open] .dg-chevron { transform: rotate(180deg); }
details.dg-detail summary:focus-visible { outline: 2px solid #BF1726; outline-offset: 3px; border-radius: 1px; }

/* Expertise — galerie éditoriale des projets */
.expertise-showcase { background: #0e1638; color: #fff; }
.expertise-showcase__inner { max-width: 1364px; margin: 0 auto; padding: clamp(80px, 10vw, 132px) clamp(20px, 5vw, 72px); }
.expertise-showcase__intro { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, .65fr); gap: 24px clamp(32px, 7vw, 104px); align-items: end; margin-bottom: clamp(44px, 6vw, 72px); }
.expertise-showcase__intro .section-kicker { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.68); font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.expertise-showcase__intro .section-kicker span { width: 28px; height: 2px; background: #bf1726; }
.expertise-showcase__intro h2 { margin: 0; max-width: 760px; font-family: 'Newsreader', Georgia, serif; font-size: clamp(34px, 4.6vw, 58px); font-weight: 400; line-height: 1.08; letter-spacing: -.015em; }
.expertise-showcase__intro p { margin: 0 0 5px; max-width: 50ch; color: rgba(255,255,255,.68); font-size: 15px; line-height: 1.75; }
.expertise-gallery { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 230px; gap: clamp(12px, 1.4vw, 20px); }
.expertise-photo { position: relative; grid-column: span 4; margin: 0; overflow: hidden; border-radius: 3px; background: #171f43; isolation: isolate; }
.expertise-photo--wide { grid-column: span 8; }
.expertise-photo--tall { grid-row: span 2; }
.expertise-photo img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.2,1), filter .4s ease; }
.expertise-photo::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, transparent 32%, rgba(5,10,30,.88) 100%); }
.expertise-photo figcaption { position: absolute; z-index: 2; left: clamp(18px, 2.2vw, 30px); right: clamp(18px, 2.2vw, 30px); bottom: clamp(18px, 2vw, 26px); display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: baseline; }
.expertise-photo figcaption span { grid-row: 1 / 3; color: #e34a57; font-family: ui-monospace, monospace; font-size: 12px; font-weight: 700; }
.expertise-photo figcaption strong { font-size: clamp(15px, 1.4vw, 19px); line-height: 1.25; }
.expertise-photo figcaption small { margin-top: 4px; color: rgba(255,255,255,.68); font-size: 12px; line-height: 1.4; }
.expertise-photo:hover img { transform: scale(1.035); filter: saturate(1.06); }

@media (max-width: 900px) {
  .expertise-showcase__intro { grid-template-columns: 1fr; }
  .expertise-gallery { grid-auto-rows: 220px; }
  .expertise-photo, .expertise-photo--wide { grid-column: span 6; }
  .expertise-photo--tall { grid-row: span 1; }
}
@media (max-width: 600px) {
  .expertise-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -20px; padding: 0 20px 14px; scrollbar-width: thin; }
  .expertise-photo, .expertise-photo--wide, .expertise-photo--tall { flex: 0 0 min(84vw, 360px); height: 410px; scroll-snap-align: center; }
  .expertise-showcase__intro { margin-bottom: 34px; }
}

/* ============================================================ */
/* INFOGRAPHIES — flows, frises, diagrammes (ajout)              */
/* ============================================================ */

/* Flow horizontal qui devient vertical en mobile : étape + icône + connecteur */
.dg-flow { display: flex; align-items: flex-start; justify-content: center; gap: 0; flex-wrap: nowrap; }
.dg-flow-step { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 0 10px; }
.dg-flow-arrow { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; padding-top: 27px; }
.dg-flow-arrow .dg-arrow-v { display: none; }

@media (max-width: 860px) {
  .dg-flow { flex-direction: column; align-items: stretch; }
  .dg-flow-step { padding: 0; }
  .dg-flow-arrow { padding: 4px 0; justify-content: flex-start; padding-left: 27px; }
  .dg-flow-arrow .dg-arrow-h { display: none; }
  .dg-flow-arrow .dg-arrow-v { display: block; }
}

/* Icône ronde utilisée dans les schémas (étapes, acteurs, positionnement) */
.dg-node-icon { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; border: 1.5px solid #1B2A6B; transition: transform .3s ease, box-shadow .3s ease; }
.dg-flow-step:hover .dg-node-icon, .dg-hover-zoom:hover { transform: scale(1.07); box-shadow: 0 14px 26px -14px rgba(14,22,56,0.35); }

/* Tracé progressif des lignes SVG : le path/line porte pathLength="1", révélé quand le parent .reveal devient visible */
.dg-draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s ease; }
.reveal.is-visible .dg-draw { stroke-dashoffset: 0; }

/* Timeline verticale : trait qui se prolonge progressivement à la lecture */
.dg-timeline-line { transform-origin: top; transform: scaleY(0); transition: transform 1.1s ease; }
.reveal.is-visible .dg-timeline-line { transform: scaleY(1); }

/* Matrice de rôles : table classique en desktop, cartes empilées en mobile pour ne perdre aucune lisibilité */
.dg-matrix { width: 100%; border-collapse: collapse; }
.dg-matrix th, .dg-matrix td { border: 1px solid #E4E7EF; padding: 16px 18px; text-align: left; vertical-align: top; }
.dg-matrix thead th { background: #F6F7FA; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #6A7089; }
.dg-matrix tbody th { background: #fff; font-size: 13.5px; font-weight: 700; color: #1B2A6B; white-space: nowrap; }
.dg-matrix td { font-size: 13px; line-height: 1.55; color: #4A5170; }
@media (max-width: 700px) {
  .dg-matrix, .dg-matrix thead, .dg-matrix tbody, .dg-matrix th, .dg-matrix td, .dg-matrix tr { display: block; }
  .dg-matrix thead { display: none; }
  .dg-matrix tr { margin-bottom: 14px; border: 1px solid #E4E7EF; border-radius: 4px; overflow: hidden; }
  .dg-matrix tbody th { border-bottom: 1px solid #E4E7EF; }
  .dg-matrix td { border-top: none; border-left: none; border-right: none; }
  .dg-matrix td::before { content: attr(data-col); display: block; font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #9AA0B4; margin-bottom: 4px; }
}

/* Notre positionnement (qui-sommes-nous) : 3 colonnes desktop, empilées en mobile */
.dg-positioning-grid { grid-template-columns: 1fr auto 1fr; }
.dg-positioning-center { display: flex; align-items: center; justify-content: center; padding: 28px 22px; background: #F6F7FA; }
@media (max-width: 760px) {
  .dg-positioning-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .dg-draw, .dg-timeline-line { transition-duration: .001ms; transform: none; stroke-dashoffset: 0; }
}
