/* ==========================================================================
   2M Digital — système visuel « SwiftUI » (mode sombre) + page d'accueil
   Couleurs : palette sombre d'iOS (fond noir, cartes #1c1c1e / #2c2c2e) et jaune de marque.
   Police : SF Pro sur les appareils Apple (police système), Inter ailleurs.
   ========================================================================== */

:root {
  /* Couleurs */
  --bg: #000;
  --surface: #1c1c1e;          /* cartes */
  --surface-2: #2c2c2e;        /* cartes surélevées, pastilles, champs */
  --surface-3: #3a3a3c;        /* survol */
  --label: #fff;               /* texte principal */
  --label-2: #98989f;          /* texte secondaire, 2e ligne des titres */
  --label-3: #636366;          /* numéros, mentions discrètes */
  --separator: #38383a;
  --yellow: #ffe500;           /* jaune de marque : actions principales */
  --on-yellow: #000;
  --orange: #ff9f0a;           /* pictos — écran & code */
  --blue: #0a84ff;             /* pictos — web & Google */
  --green: #30d158;            /* pictos — email, validations */
  --purple: #bf5af2;           /* pictos — papier & textile */
  --teal: #40c8e0;
  --red: #ff453a;              /* erreurs */
  --glass: rgba(28, 28, 30, .72);

  /* Typographie */
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;

  /* Formes */
  --r-sm: 12px;
  --r-md: 18px;
  --r-card: 24px;
  --r-lg: 32px;

  /* Mise en page : contenu de 1280 px max, marges de 80 px à 1440 px */
  --max: 1280px;
  --gutter: 40px;
  --wrap: max(var(--gutter), (100% - var(--max)) / 2);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, h4, p, dl, dd, ol, ul, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }

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

/* Pictogrammes : <svg class="icon"><use href="/assets/img/icons.svg#…"/></svg> */
.icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wrap { padding-inline: var(--wrap); }
.muted { color: var(--label-2); }
.accent { color: var(--yellow); }

/* Halo jaune flou, décor des en-têtes de page et des encarts d'appel */
.glow {
  position: absolute;
  z-index: -1;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 229, 0, .42) 0%, rgba(255, 229, 0, .14) 42%, transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}

/* ---------- Titres ---------- */

.title {
  font-weight: 700;
  font-size: clamp(36px, 4.2vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.title--xl { font-size: clamp(44px, 6vw, 84px); line-height: 1.04; letter-spacing: -0.035em; }
.title--lg { font-size: clamp(40px, 5vw, 72px); line-height: 1.06; letter-spacing: -0.03em; }
.title--sm { font-size: clamp(30px, 3.3vw, 44px); }
.title .muted, .title--muted { color: var(--label-2); }

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--label-2);
}

.lead { max-width: 640px; font-size: 21px; line-height: 1.55; color: var(--label-2); }
.lead strong { font-weight: 400; color: var(--label); }

.section-head { display: flex; flex-direction: column; gap: 16px; }
.section-head--row { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-head--center { align-items: center; text-align: center; }
.section-head--center .lead { max-width: 560px; font-size: 18px; }

/* Fil d'Ariane */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 17px; color: var(--label-2); }
.crumbs a:hover { color: var(--label); }
.crumbs .icon { width: 16px; height: 16px; color: var(--label-3); }
.crumbs [aria-current] { color: var(--label); font-weight: 500; }

/* ---------- Boutons & liens ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease, filter .15s ease;
}
.btn .icon { width: 20px; height: 20px; stroke-width: 2.25; transition: transform .15s ease; }
.btn:hover .icon--go { transform: translateX(3px); }
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--yellow); color: var(--on-yellow); }
.btn--primary:hover { filter: brightness(1.06); }
.btn--secondary { background: var(--surface-2); color: var(--label); }
.btn--secondary:hover { background: var(--surface-3); }
.btn--sm { min-height: 46px; padding: 0 22px; font-size: 17px; }
.btn--block { width: 100%; }

.link-accent {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
  font-weight: 600;
  color: var(--yellow);
  white-space: nowrap;
}
.link-accent .icon { width: 20px; height: 20px; stroke-width: 2.25; transition: transform .15s ease; }
.link-accent:hover .icon { transform: translate(2px, -2px); }
.link-accent:hover .icon--go { transform: translateX(3px); }

/* ---------- Pastilles ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--label-2);
  font-size: 15px;
  line-height: 1.3;
  white-space: nowrap;
}
.pill--yellow { background: var(--yellow); color: var(--on-yellow); font-weight: 600; }
.pill--dark { background: rgba(0, 0, 0, .6); color: var(--label); }
.pill--lg { padding: 10px 18px; font-size: 17px; font-weight: 600; color: var(--label); }

/* Puce de couleur devant un libellé (rangée de savoir-faire de l'accueil) */
.dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--c, var(--yellow)); }

/* ---------- Pictogrammes en tuile colorée ---------- */

.tile {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: var(--c, var(--surface-2));
  color: #fff;
}
.tile .icon { width: 24px; height: 24px; }
.tile--sm { width: 36px; height: 36px; border-radius: 9px; }
.tile--sm .icon { width: 20px; height: 20px; }
.tile--lg { width: 72px; height: 72px; border-radius: 18px; }
.tile--lg .icon { width: 34px; height: 34px; }
.c-orange { --c: var(--orange); }
.c-blue { --c: var(--blue); }
.c-green { --c: var(--green); }
.c-purple { --c: var(--purple); }
.c-teal { --c: var(--teal); }

/* ---------- Cartes ---------- */

.card { background: var(--surface); border-radius: var(--r-card); }

/* Chiffres clés */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { display: flex; flex-direction: column; gap: 10px; padding: 28px; background: var(--surface); border-radius: var(--r-card); }
.stat__value { font-size: clamp(44px, 4.5vw, 64px); font-weight: 700; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat__value--accent { color: var(--yellow); }
.stat__label { font-size: 16px; line-height: 1.45; color: var(--label-2); }

/* Liste groupée façon Réglages iOS : lignes séparées par un filet qui démarre après le picto */
.list { overflow: hidden; background: var(--surface); border-radius: var(--r-card); }
.list__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  transition: background-color .15s ease;
}
a.list__row:hover { background: #242426; }
.list__row + .list__row::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--sep-left, 84px);
  right: 0;
  height: 1px;
  background: var(--separator);
}
.list__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.list__title { display: flex; align-items: baseline; gap: 10px; font-size: 20px; font-weight: 600; line-height: 1.3; }
.list__num { font-size: 13px; font-weight: 500; color: var(--label-3); white-space: nowrap; }
.list__desc { font-size: 16px; line-height: 1.45; color: var(--label-2); }
.list__chevron { width: 20px; height: 20px; color: var(--label-3); }

/* Étapes de méthode */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: start; }
.step { display: flex; flex-direction: column; gap: 14px; padding: 28px; background: var(--surface); border-radius: var(--r-card); }
.step__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.step__num { font-size: 32px; font-weight: 700; line-height: 1; color: #48484a; font-variant-numeric: tabular-nums; }
.step__name { font-size: 22px; font-weight: 600; line-height: 1.25; }
.step__desc { font-size: 16px; line-height: 1.45; color: var(--label-2); white-space: pre-line; }

/* FAQ en accordéon (<details>) dans une carte */
.faq { overflow: hidden; background: var(--surface); border-radius: var(--r-card); }
.qa { position: relative; }
.qa + .qa::before { content: ""; position: absolute; top: 0; left: 24px; right: 0; height: 1px; background: var(--separator); }
.qa summary {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 24px;
  align-items: start;
  gap: 0;
  padding: 24px;
  cursor: pointer;
  list-style: none;
}
.qa summary::-webkit-details-marker { display: none; }
.qa__num { padding-top: 4px; font-size: 13px; font-weight: 500; color: var(--label-3); white-space: nowrap; }
.qa__q { font-size: 18px; font-weight: 600; line-height: 1.4; }
.qa__toggle { width: 22px; height: 22px; margin-top: 2px; color: var(--label-3); transition: transform .3s cubic-bezier(.22, .8, .24, 1), color .15s ease; }
.qa[open]:not(.is-closing) .qa__toggle { transform: rotate(90deg); color: var(--label); }
.qa summary:hover .qa__q { color: var(--yellow); }
.qa__a { margin-top: -12px; padding: 0 64px 24px 96px; font-size: 16px; line-height: 1.6; color: var(--label-2); white-space: pre-line; }

/* Encart d'appel final */
.cta-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  padding: clamp(48px, 7vw, 96px) clamp(24px, 5.5vw, 80px);
  background: var(--surface);
  border-radius: var(--r-lg);
}
.cta-card .glow { top: -300px; right: -180px; width: 620px; height: 620px; }
.cta-card .lead { font-size: 21px; }
.cta-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.cta-card__mail { font-size: 17px; color: var(--label-2); }
.cta-card__mail a { color: var(--label); }
.cta-card__mail a:hover { color: var(--yellow); }
.cta-card--center { align-items: center; text-align: center; }
.cta-card--center .cta-card__actions { flex-direction: column; gap: 14px; }

/* Rayures de chantier (visuel par défaut d'une carte sans photo) */
.stripes { background: var(--surface-2); }

/* ---------- En-tête : barre flottante en verre ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 16px var(--wrap) 0;
  pointer-events: none;
}
.nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 68px;
  padding: 0 10px 0 28px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 34px;
  pointer-events: auto;
}
.logo { display: inline-flex; flex-shrink: 0; }
.logo img { width: auto; height: 32px; }

.nav > nav { flex: 1; display: flex; justify-content: center; min-width: 0; }
.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__link {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: #a1a1a6;
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s ease, background-color .15s ease;
}
.nav__link:hover { color: var(--label); }
.nav__link[aria-current="page"], .nav__item.is-current > .nav__link { background: var(--surface-2); color: var(--label); }
.nav__cta { flex-shrink: 0; }
.nav__menu-btn { display: none; }

/* Sous-menus horizontaux : un panneau en verre sous la barre, ouvert au survol et au clavier */
.nav__item { position: static; }
.nav__item > .nav__link { position: relative; }
/* Pont invisible : le survol continue entre le lien et le panneau */
.nav__item > .nav__link::after { content: ""; position: absolute; left: -12px; right: -12px; top: 100%; height: 34px; pointer-events: none; }
.nav__item:hover > .nav__link::after { pointer-events: auto; }
.nav__panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  background: rgba(28, 28, 30, .92);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--r-card);
  box-shadow: 0 24px 48px rgba(0, 0, 0, .5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  /* Fermeture retardée : laisse le temps de descendre vers une entrée */
  transition: opacity .15s ease .4s, transform .15s ease .4s, visibility 0s linear .55s;
}
.nav__item:hover > .nav__panel,
.nav__item:focus-within > .nav__panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .15s ease, transform .15s ease, visibility 0s;
}
/* Ressources : derniers articles et ebooks (remplis par js/nav.js) */
.nav__panel--res { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 10px; }
.res-col { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: var(--r-md); }
.res-col + .res-col { background: rgba(255, 255, 255, .03); }
.res-col__title { padding: 6px 12px 8px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--label-2); }
.res-col__list { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.res-col__all { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 6px; padding: 8px 12px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--yellow); }
.res-col__all .icon { width: 16px; height: 16px; stroke-width: 2.25; transition: transform .15s ease; }
.res-col__all:hover { background: var(--surface-2); }
.res-col__all:hover .icon { transform: translateX(3px); }
.res-entry { padding: 10px 12px; }
.res-entry__thumb { flex-shrink: 0; width: 72px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.res-entry__cover { flex-shrink: 0; width: 40px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--surface-2); box-shadow: 0 4px 12px rgba(0, 0, 0, .4); }
.res-entry__title { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.res-entry small { margin-top: 4px; }
.res-skel { display: block; height: 68px; margin: 2px 0; border-radius: var(--r-md); background: linear-gradient(90deg, var(--surface-2), #333336, var(--surface-2)); background-size: 200% 100%; animation: res-skel 1.4s ease infinite; opacity: .5; }
.res-col__empty { padding: 10px 12px; font-size: 15px; color: var(--label-2); }
@keyframes res-skel { to { background-position: -200% 0; } }
/* Passage d'un menu à l'autre : le panneau quitté se ferme tout de suite */
.nav__links:has(.nav__item:hover) .nav__item:not(:hover) > .nav__panel { transition: none; opacity: 0; visibility: hidden; }
.nav__entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  color: var(--label);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  text-align: left;
  transition: background-color .15s ease;
}
a.nav__entry:hover, .nav__entry[aria-current="page"] { background: var(--surface-2); }
.nav__entry small { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--label-2); }

/* Formulaires de demande (ebooks, diagnostic) : case de consentement, message de réussite */
/* Case de consentement (obligatoire pour recevoir le guide) */
.eb-consent { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.eb-consent input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  border: 1.5px solid var(--label-3);
  border-radius: 6px;
  background: var(--surface-2);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.eb-consent input:checked {
  border-color: var(--yellow);
  background: var(--yellow) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.eb-consent input:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.eb-consent input[aria-invalid="true"] { border-color: var(--red); }
.eb-consent span { font-size: 13px; line-height: 1.45; color: var(--label-2); }
.eb-consent a { color: var(--label); text-decoration: underline; text-underline-offset: 2px; }

.eb-done { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.eb-done__badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 12px; border-radius: 999px; background: rgba(48, 209, 88, .16); color: var(--green); font-size: 15px; font-weight: 600; }
.eb-done__badge .icon { width: 18px; height: 18px; stroke-width: 2.5; }
.eb-done__title { font-size: 22px; font-weight: 600; line-height: 1.3; }
.eb-done p { font-size: 16px; line-height: 1.5; color: var(--label-2); }
.eb-done a { color: var(--yellow); text-decoration: underline; text-underline-offset: 3px; }
.eb-done--ko .eb-done__badge { background: rgba(255, 69, 58, .16); color: var(--red); }

/* Bandeau de consentement à la mesure d'audience (js/consent.js) */
.consent {
  position: fixed;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 16px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 16px 24px;
  max-width: 620px;
  margin-inline: auto;
  padding: 18px 20px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--r-card);
  background: rgba(28, 28, 30, .94);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, .5);
}
.consent[hidden] { display: none; }
.consent__text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.45; color: var(--label-2); }
.consent__title { margin-bottom: 2px; font-size: 15px; font-weight: 600; color: var(--label); }
.consent__text a { color: var(--label); text-decoration: underline; text-underline-offset: 2px; }
.consent__actions { display: flex; flex-shrink: 0; gap: 8px; }
.consent__actions .btn { min-height: 42px; padding: 0 18px; font-size: 15px; }
@media (max-width: 640px) {
  .consent { flex-direction: column; align-items: stretch; }
  .consent__actions .btn { flex: 1; }
}

/* Menu mobile : feuille plein écran façon iOS */
.sheet {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--label);
}
.sheet::backdrop { background: rgba(0, 0, 0, .6); }
.sheet[open] { display: flex; flex-direction: column; }
.sheet__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
  border-bottom: 1px solid var(--separator);
}
.sheet__close {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  cursor: pointer;
}
.sheet__body { flex: 1; overflow-y: auto; padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 22px; }
.sheet__group { display: flex; flex-direction: column; gap: 8px; }
.sheet__group .eyebrow { padding-left: 16px; }
.sheet .list__row { padding: 13px 16px; gap: 14px; --sep-left: 66px; }
.sheet .list__title { font-size: 17px; font-weight: 500; }
.sheet .list__row { align-items: center; flex-wrap: nowrap; }
.sheet .list__row > .list__chevron { position: static; }
.sheet .list__body { padding-right: 0; }

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

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  margin-top: 112px;
  padding-block: 36px;
  border-top: 1px solid var(--separator);
  font-size: 14px;
  color: var(--label-2);
}
.footer .logo img { height: 26px; }
.footer__legal { text-align: center; }
.footer__legal a:hover { color: var(--label); }
.footer__copy { color: var(--label-3); white-space: nowrap; }

/* ==========================================================================
   Accueil
   ========================================================================== */

.page { position: relative; isolation: isolate; overflow-x: clip; } /* les halos ne doivent pas élargir la page */
.section { padding-block: 64px; }
.section--lg { padding-block: 96px; }

/* Hero */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  padding-top: 72px;
  padding-bottom: 104px;
}
.hero .glow { top: -160px; left: -260px; width: 680px; height: 680px; }
.hero__text { display: flex; flex-direction: column; align-items: flex-start; gap: 32px; max-width: 680px; min-width: 0; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Animation « Du code au coton » (vidéo 3:5, en boucle continue) : on rogne les bandes vides du haut et du bas ;
   les côtés restent entiers (des cartes y glissent pendant l'animation). */
.hero-motion {
  --cx: 0; --cy: .0222; --cw: 1; --ch: .9444; --vr: .6;
  position: relative;
  flex: 0 0 432px;
  overflow: hidden;
  line-height: 0;
  border-radius: var(--r-card);
  aspect-ratio: calc(var(--cw) * var(--vr) / var(--ch));
}
.hero-motion video {
  position: absolute;
  display: block;
  width: calc(100% / var(--cw));
  max-width: none;
  height: auto;
  aspect-ratio: var(--vr);
  left: calc(-100% * var(--cx) / var(--cw));
  top: calc(-100% * var(--cy) / var(--ch));
  background: #0d0d0c;
}

/* Rangée de savoir-faire qui défile */
.marquee {
  overflow: hidden;
  padding-block: 4px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: marquee 50s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__group { display: flex; gap: 12px; padding-right: 12px; }
.marquee .pill { padding: 10px 18px 10px 16px; font-size: 16px; font-weight: 600; color: var(--label); }
.marquee .pill:hover { background: var(--surface-3); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Manifeste */
.manifesto { display: flex; flex-direction: column; gap: 64px; }
.manifesto__text { max-width: 1040px; font-size: clamp(28px, 3vw, 40px); font-weight: 700; line-height: 1.3; letter-spacing: -0.02em; text-wrap: pretty; }

/* Carnet de commandes */
.benches { display: flex; flex-direction: column; gap: 40px; margin-top: 48px; }
.bench { display: flex; flex-direction: column; gap: 12px; }
.bench .eyebrow { padding-left: 20px; }
.services .list__row { padding: 22px 24px; }
.services .pill { color: #c7c7cc; }

/* Derrière l'établi */
.about { display: grid; grid-template-columns: 460px minmax(0, 1fr); gap: 80px; align-items: start; }
.portrait { position: relative; overflow: hidden; aspect-ratio: 460 / 580; border-radius: var(--r-card); background: var(--surface); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait__badge {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 20px;
  background: rgba(28, 28, 30, .72);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-radius: var(--r-md);
}
.portrait__name { font-size: 22px; font-weight: 600; }
.portrait__role { font-size: 14px; color: var(--label-2); }
.about__text { display: flex; flex-direction: column; gap: 28px; }
.about__lead { font-size: 21px; line-height: 1.55; }
.about__body { font-size: 17px; line-height: 1.65; color: var(--label-2); }
.spec { overflow: hidden; background: var(--surface); border-radius: var(--r-card); }
.spec__row { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; padding: 18px 24px; }
.spec__row + .spec__row::before { content: ""; position: absolute; top: 0; left: 24px; right: 0; height: 1px; background: var(--separator); }
.spec__row dt { color: var(--label-2); }
.spec__row dd { font-weight: 600; line-height: 1.45; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .pill { font-weight: 400; }
.signature { display: flex; align-items: center; gap: 14px; font-size: 18px; font-weight: 600; }
.signature::before { content: ""; flex-shrink: 0; width: 4px; height: 26px; border-radius: 2px; background: var(--yellow); }

/* Réalisations (cartes partagées accueil / prestations / contact) */
.works { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 40px; }
.works--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.work { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border-radius: var(--r-card); }
.work__visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-2);
}
.work__visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
a.work__visual:hover img { transform: scale(1.03); }
.work__tags { position: absolute; z-index: 1; top: 20px; left: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.work__tags .pill { background: rgba(0, 0, 0, .62); color: var(--label); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
/* Pastilles de prestation sous l'image (aperçus de l'accueil et du contact) */
.work__tagrow { display: flex; flex-wrap: wrap; gap: 8px; padding: 20px 24px 0; }
.work__tagrow .pill { font-size: 14px; }
.work__tagrow + .work__caption { padding-top: 14px; }
.work__icons { display: flex; gap: 16px; }
.work__icons .tile { width: 72px; height: 72px; border-radius: 18px; }
.work__icons .tile .icon { width: 30px; height: 30px; }
.work__count { position: absolute; z-index: 1; right: 16px; bottom: 16px; }
.work__caption { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; }
.work__name { font-size: 22px; font-weight: 600; line-height: 1.3; }
.work__caption--stack { flex-direction: column; align-items: flex-start; gap: 12px; }
.work__caption .pill { white-space: normal; }

/* Cartes d'article (blog, « À lire aussi », cas clients) */
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.section-head + .posts { margin-top: 48px; }
/* Une ou deux cartes seulement (grand écran) : même largeur qu'en trois colonnes, centrées */
@media (min-width: 1025px) {
  .posts:has(> .post:only-child) { grid-template-columns: calc((100% - 48px) / 3); justify-content: center; }
  .posts:has(> .post:nth-child(2):last-child) { grid-template-columns: repeat(2, calc((100% - 48px) / 3)); justify-content: center; }
}
.post { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border-radius: var(--r-card); }
.post[hidden] { display: none; }
.post__visual { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.post__visual img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.post:hover .post__visual img { transform: scale(1.03); }
.post__body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 22px 24px 26px; }
.post__title { font-size: 20px; font-weight: 600; line-height: 1.3; transition: color .15s ease; }
.post:hover .post__title { color: var(--yellow); }
.post__meta { font-size: 14px; color: var(--label-3); }

/* Filtres en segments (Tous / secteurs / catégories) */
.segments { display: flex; flex-wrap: wrap; gap: 8px; }
.segments[hidden] { display: none; }
.segment {
  min-height: 42px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--label);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.segment:hover { background: var(--surface-2); }
.segment[aria-pressed="true"] { background: var(--label); color: var(--bg); }

/* Ce que 2M Digital ne fait pas */
.offlimits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; margin-top: 48px; }
.offlimits__col { display: flex; flex-direction: column; gap: 24px; }
.refusal { display: flex; gap: 16px; align-items: flex-start; --sep-left: 76px; }
.refusal .tile { width: 36px; height: 36px; border-radius: 9px; background: var(--surface-2); color: var(--label-2); }
.refusal .tile .icon { width: 18px; height: 18px; }
.refusal .eyebrow { font-size: 12px; color: var(--label-3); }
.refusal .list__title { font-size: 19px; }
.ask { display: flex; align-items: center; gap: 20px; padding: 48px 28px; }
.ask p { font-size: 19px; font-weight: 600; line-height: 1.4; }
.ask .muted { font-weight: 600; }

/* ---------- Barre « Réserver un appel » fixe (tablette et mobile) ---------- */

.mbar { display: none; }
@media (max-width: 1100px) {
  .mbar {
    display: block;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, .72);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid var(--separator);
    transform: translateY(110%);
    transition: transform .25s ease;
  }
  .mbar.is-on { transform: none; }
  .mbar__btn { width: 100%; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-motion { align-self: center; flex-basis: auto; width: min(100%, 420px); }
  .about { grid-template-columns: 380px minmax(0, 1fr); gap: 48px; }
}

@media (max-width: 1024px) {
  :root { --gutter: 24px; }
  .nav { padding-left: 22px; }
  .nav__links { display: none; }
  .nav__cta { margin-left: auto; }
  .nav__menu-btn {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 50%;
    background: var(--surface-2);
    cursor: pointer;
  }
  .stats, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about { grid-template-columns: minmax(0, 1fr); }
  .portrait { max-width: 460px; }
  .works--3 { grid-template-columns: minmax(0, 1fr); }
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .offlimits { grid-template-columns: minmax(0, 1fr); }
  .footer { flex-direction: column; text-align: center; }
}

@media (max-width: 760px) {
  .works { grid-template-columns: minmax(0, 1fr); }
  .posts { grid-template-columns: minmax(0, 1fr); }
  .section-head--row { flex-direction: column; align-items: flex-start; }
  .list__row { align-items: flex-start; flex-wrap: wrap; padding: 18px 20px; --sep-left: 20px; }
  .list__row > .pill { order: 3; margin-left: 60px; }
  .list__row > .list__chevron { position: absolute; top: 22px; right: 16px; }
  .list__body { flex: 1 1 calc(100% - 60px); padding-right: 24px; }
  .list__title { flex-direction: column; gap: 2px; font-size: 18px; }
  .qa summary { grid-template-columns: minmax(0, 1fr) 24px; padding: 20px; }
  .qa__num { grid-column: 1 / -1; padding: 0 0 4px; }
  .qa__a { padding: 0 20px 20px; margin-top: -8px; }
  .qa + .qa::before { left: 20px; }
  .work__caption { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .site-header { padding-top: 10px; }
  .nav { height: 60px; padding: 0 7px 0 18px; gap: 10px; border-radius: 30px; }
  .logo img { height: 26px; }
  .nav .nav__cta { min-height: 44px; padding: 0 14px; font-size: 15px; }
  .nav .nav__cta .icon { display: none; }
  .nav__menu-btn { width: 44px; height: 44px; }
  .btn { min-height: 52px; padding: 0 22px; font-size: 17px; }
  .lead, .cta-card .lead { font-size: 18px; }
  .section { padding-block: 48px; }
  .hero { padding-top: 40px; padding-bottom: 64px; }
  .stats, .steps { grid-template-columns: minmax(0, 1fr); }
  .stat, .step { padding: 24px; }
  .section-head + .posts { margin-top: 32px; }
  .spec__row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .footer { margin-top: 72px; padding-bottom: calc(36px + 76px); }
}

@media (max-width: 359px) {
  .nav__cta { display: none; }
  .nav__menu-btn { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  /* Sans animation, on garde quand même le délai de fermeture des sous-menus */
  .nav__panel { transition: opacity 0s linear .45s, visibility 0s linear .45s !important; }
  .nav__item:hover > .nav__panel, .nav__item:focus-within > .nav__panel { transition-delay: 0s !important; }
  .marquee { overflow-x: auto; }
}
