/* ==========================================================================
   Portfolio — Walid Bensaoula
   Design system : fond profond, panneaux encastrés, dégradé bleu → violet.
   Aucune dépendance externe, aucun build.
   ========================================================================== */

:root {
  /* Fonds : du plus profond (page) au plus clair (carte) */
  --bg: #F7F9FF;
  --bg-panel: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F1F4FC;

  --border: rgba(16, 24, 48, 0.10);
  --border-strong: rgba(16, 24, 48, 0.18);

  --ink: #101830;
  --ink-dim: #454E68;
  --muted: #6B748C;

  --primary: #4C6FFF;
  --primary-2: #8B5CF6;
  --accent: #4257D8;
  --gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  --gradient-soft: linear-gradient(135deg, rgba(76, 111, 255, 0.16), rgba(139, 92, 246, 0.16));

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  /* Échelle typographique modulaire (ratio 1.25) */
  --fs-2xs: 0.6875rem;   /* 11px — tags, mentions secondaires */
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-panel: 28px;

  --shell: 1180px;
  --gutter: 24px;

  --shadow-card: 0 16px 40px rgba(16, 24, 48, 0.10);
  --shadow-glow: 0 18px 50px rgba(76, 111, 255, 0.35);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Layout ---------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: 88px; }
.section--tight { padding-block: 56px; }

/* Panneau encastré : la signature visuelle de la maquette */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  padding: 56px 44px;
}

/* ---------- Typographie ---------- */

.kicker {
  margin: 0 0 12px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.h1 {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
}

.h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 2.9vw, 2.3rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-xl);
  line-height: 1.3;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-lg);
  line-height: 1.7;
}
/* Sous-titre du hero : plus discret que le chapô des autres sections. */
.lead--sm { font-size: var(--fs-base); line-height: 1.6; }

/* Le bloc de texte du hero ne dépasse pas 70 % de la largeur disponible :
   les lignes restent courtes et le regard revient vite au début. */
.hero .h1,
.hero .lead { max-width: 70%; }

.muted { color: var(--muted); }

/* Le dégradé appliqué au texte — utilisé sur les mots accentués des titres */
.grad {
  /* Bleu uni : la charte du titre se limite au noir et au bleu. */
  color: var(--primary);
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease,
              border-color 0.2s ease, background-color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn--ghost {
  background: rgba(16, 24, 48, 0.03);
  border-color: var(--border-strong);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--accent); }

.btn--light {
  background: #fff;
  color: #2A3BD4;
}

.btn--sm { padding: 10px 18px; font-size: var(--fs-xs); }

.btn--pill { border-radius: 999px; }

/* ---------- Badges & tags ---------- */

.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.badge--glass {
  background: rgba(143, 166, 255, 0.14);
  border: 1px solid rgba(143, 166, 255, 0.28);
  color: var(--accent);
}

/* Tag purement indicatif : discret, jamais concurrent du titre ni du descriptif */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 24, 48, 0.05);
  color: var(--ink-dim);
  font-size: var(--fs-2xs);
  line-height: 1.5;
  white-space: nowrap;
}

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
}
.nav__brand { display: flex; align-items: center; gap: 12px; }
.nav__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gradient);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}
.nav__name { font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; }
.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__link {
  color: var(--ink-dim);
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: color 0.2s ease;
}
.nav__link:hover, .nav__link[aria-current="true"] { color: var(--ink); }
.nav__burger {
  display: none;
  padding: 6px;
  background: none;
  border: none;
  color: var(--ink);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: 72px 64px;
  background:
    radial-gradient(60% 55% at 74% 22%, rgba(90, 90, 255, 0.20), transparent 62%),
    var(--bg);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 48px;
  align-items: center;
}
/* Une piste `fr` a `min-width: auto` : elle s'élargit jusqu'à la largeur
   minimale de son contenu. La bande de logos étant en `max-content`, elle
   étirait la colonne et écrasait le visuel. */
.hero__grid > * { min-width: 0; }
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 30px 0 40px;
}

.trust__label {
  margin: 0 0 16px;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.trust__logos {
  overflow: hidden;
  width: 100%;
  min-width: 0;
  /* Estompe les deux bords : la bande semble sortir et entrer du cadre
     plutôt que d'être coupée net. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.trust__track {
  display: flex;
  align-items: center;
  gap: 44px;
  width: max-content;
  /* La liste est triplée côté JS : décaler d'un tiers reboucle sans saut. */
  animation: defile 46s linear infinite;
}
.trust__logos:hover .trust__track { animation-play-state: paused; }
@keyframes defile {
  from { transform: translateX(0); }
  to   { transform: translateX(-33.3333%); }
}
.trust__track img {
  height: 28px;
  max-width: 112px;
  object-fit: contain;
  flex-shrink: 0;
  /* Désaturation seule : `brightness(0)` transformait tout logo au fond opaque
     en rectangle noir uni — d'où les pavés gris. */
  filter: grayscale(1);
  opacity: 0.55;
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.trust__track img:hover { opacity: 1; filter: none; }

/* Portrait + halo + pastilles flottantes */
.hero__visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 380px;
}
.hero__halo {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 120, 255, 0.42), transparent 68%);
  filter: blur(14px);
}
.hero__portrait {
  position: relative;
  width: min(300px, 100%);
  filter: drop-shadow(0 26px 50px rgba(0, 0, 0, 0.55));
}
/* Réservation d'espace tant que la photo détourée n'est pas fournie */
.hero__portrait--placeholder {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  background: linear-gradient(160deg, var(--surface), var(--bg-panel));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.chip {
  position: absolute;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 200px;
  padding: 12px 15px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
}
.chip__icon { color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.chip__title { font-size: var(--fs-xs); font-weight: 700; }
.chip__sub { font-size: 0.68rem; line-height: 1.4; color: var(--muted); }
.chip--a { top: 6%;   right: -4%; }
.chip--b { top: 44%;  left: -8%; }
.chip--c { bottom: 4%; right: -2%; }

/* Flottement léger et désynchronisé : chaque pastille a sa propre durée et son
   propre décalage, sinon les trois montent et descendent ensemble et l'effet
   devient mécanique. Amplitude faible pour ne pas distraire du titre. */
@keyframes flotte {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-9px) rotate(-0.4deg); }
}
.chip {
  animation: flotte 6s ease-in-out infinite;
  will-change: transform;
}
.chip--b { animation-duration: 7.5s; animation-delay: -2.4s; }
.chip--c { animation-duration: 6.8s; animation-delay: -4.1s; }

/* ---------- En-tête de section ---------- */

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 34px;
}

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

/* Carrousel paginé ET défilable : la piste glisse horizontalement au trackpad,
   au doigt ou avec Maj+molette, mais s'aligne toujours sur une page entière —
   donc jamais de carte coupée au bord, et aucune barre de défilement visible. */
.projects__viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.projects__viewport::-webkit-scrollbar { display: none; }

.projects__track { display: flex; }

.projects__page {
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

/* Flèches discrètes, alignées avec les puces plutôt que posées sur les cartes */
.dots__nav {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--ink-dim);
  transition: color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.dots__nav:hover:not(:disabled) { color: var(--ink); border-color: var(--accent); }
.dots__nav:disabled { opacity: 0.25; cursor: default; }

/* ---------- Pagination du carrousel ---------- */

.dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 28px;
}
.dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(16, 24, 48, 0.18);
  transition: background 0.2s ease, transform 0.2s ease, width 0.2s ease;
}
.dot:hover { background: rgba(16, 24, 48, 0.35); }
.dot[aria-selected="true"] {
  width: 26px;
  border-radius: 999px;
  background: var(--gradient);
}

.grid-projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(143, 166, 255, 0.45);
  box-shadow: var(--shadow-card);
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(150deg, var(--surface-2), var(--bg-panel));
  overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* Vignette de substitution tant que le visuel du projet n'est pas fourni */
.card__placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
  color: rgba(16, 24, 48, 0.18);
  background-image: var(--gradient-soft);
}

/* Le badge catégorie est superposé à l'image, comme dans la maquette.
   Le fond opaque le garde lisible même sur une illustration chargée. */
.card__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(66, 87, 216, 0.28);
  backdrop-filter: blur(6px);
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 22px;
}

/* Description tronquée à 2 lignes ; le bouton ▾ n'apparaît que si ça déborde. */
.card__desc {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.card__desc.is-open {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

.card__more {
  display: none;              /* activé en JS uniquement si le texte déborde */
  align-self: flex-start;
  align-items: center;
  gap: 5px;
  margin-top: -4px;
  padding: 0;
  background: none;
  border: none;
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.card__more.is-needed { display: inline-flex; }
.card__more svg { transition: transform 0.2s ease; }
.card__more[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Pousse tags + lien en bas pour aligner les cartes entre elles */
.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 6px;
}
.card__link {
  margin-top: 4px;
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.card__link:hover { text-decoration: underline; }

/* ---------- Filtres ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.filter {
  padding: 8px 17px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(16, 24, 48, 0.03);
  color: var(--ink-dim);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: all 0.2s ease;
}
.filter:hover { border-color: var(--accent); color: var(--ink); }
.filter[aria-pressed="true"] {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
}

/* ---------- Barre de stats ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 48px;
  padding: 30px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-inline: 18px;
}
/* Séparateurs verticaux entre les stats */
.stat + .stat { border-left: 1px solid var(--border); }
.stat__icon { color: var(--accent); flex-shrink: 0; }
.stat__value {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.1;
}
.stat__label { font-size: var(--fs-xs); color: var(--muted); line-height: 1.35; }

/* ---------- Expertise (3 colonnes séparées) ---------- */

.expertise {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.expertise__col { padding-inline: 32px; }
.expertise__col:first-child { padding-left: 0; }
.expertise__col:last-child { padding-right: 0; }
.expertise__col + .expertise__col { border-left: 1px solid var(--border); }

.col__title {
  margin: 0 0 22px;
  font-size: var(--fs-sm);
  font-weight: 700;
}

/* Timeline : année en gouttière, puce sur la ligne, texte à droite */
.tl { position: relative; }
.tl__item {
  position: relative;
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 16px;
  padding-bottom: 24px;
}
.tl__item::before {
  content: "";
  position: absolute;
  left: 51px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.tl__item:last-child { padding-bottom: 0; }
.tl__item:last-child::before { display: none; }
.tl__year {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  padding-top: 1px;
}
.tl__body { position: relative; padding-left: 20px; }
.tl__body::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 0 4px var(--bg);
}
.tl__title { font-size: var(--fs-sm); font-weight: 600; margin-bottom: 2px; }
.tl__desc { font-size: var(--fs-xs); color: var(--muted); line-height: 1.5; }

/* Domaines d'expertise */
.domain {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.domain:hover { border-color: rgba(143, 166, 255, 0.4); transform: translateX(3px); }
.domain__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(143, 166, 255, 0.12);
  color: var(--accent);
}
.domain__title { font-size: var(--fs-sm); font-weight: 600; }
.domain__desc { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- À propos ---------- */

.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.sectors { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.sector {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: var(--fs-xs);
  font-weight: 500;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.sector:hover { border-color: rgba(143, 166, 255, 0.45); transform: translateY(-2px); }
.sector__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gradient);
  flex-shrink: 0;
}

/* ---------- CTA contact ---------- */

.cta {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 32px;
  align-items: center;
  padding: 46px 44px;
  border-radius: var(--radius-panel);
  background: var(--gradient);
}
.cta__title { color: #fff; }
.cta__text { color: rgba(255, 255, 255, 0.86); max-width: 440px; }
.cta__actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.cta__link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 310px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}
.cta__link:hover { background: rgba(255, 255, 255, 0.22); transform: translateY(-2px); }
.cta__link--solid {
  justify-content: center;
  background: #fff;
  color: #3B3BD4;
  border-color: transparent;
}
.cta__link--solid:hover { background: #fff; }

/* Orbe décoratif */
.cta__orb {
  position: absolute;
  right: -46px;
  bottom: -56px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #C9D4FF, #6C7CFF 52%, #2A1F80 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  opacity: 0.9;
  pointer-events: none;
}
.cta__ring {
  position: absolute;
  right: -74px;
  bottom: -84px;
  width: 266px;
  height: 266px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  transform: rotate(-18deg) scaleY(0.42);
  pointer-events: none;
}

/* ---------- Footer ---------- */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  padding-block: 30px;
  border-top: 1px solid var(--border);
}
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__name { display: block; font-weight: 600; font-size: var(--fs-sm); }
.footer__role { display: block; font-size: var(--fs-xs); }
.footer__links { display: flex; gap: 22px; }
.footer__links a {
  color: var(--muted);
  font-size: var(--fs-sm);
  transition: color 0.2s ease;
}
.footer__links a:hover { color: var(--ink); }

/* ---------- Apparition au scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

.hidden { display: none !important; }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  /* Hero : le visuel passe DERRIÈRE le texte plutôt que d'être masqué.
     Photo et pastilles flottantes créent une profondeur, le texte reste au-dessus. */
  .hero__grid { grid-template-columns: 1fr; position: relative; }
  .hero__grid > div:first-child { position: relative; z-index: 1; }
  /* Réplique miniature de la composition du bureau, posée en haut à droite
     derrière le texte. On conserve la largeur de référence puis on réduit le tout
     par `transform`, pour que photo ET pastilles gardent leurs proportions
     — les redimensionner séparément casserait la mise en page. */
  .hero__visual {
    display: grid;
    position: absolute;
    top: 2%;
    /* Les pastilles sont posées en retrait négatif (right: -4%) : on rentre la
       miniature d'autant pour qu'elles restent dans le cadre. */
    right: 7%;
    width: 380px;
    min-height: 300px;
    height: auto;
    z-index: 0;
    opacity: 0.3;
    pointer-events: none;
    transform: scale(0.46);
    transform-origin: top right;
  }
  /* Le cadre du hero borne la miniature : sans quoi la mise à l'échelle
     laisserait déborder les pastilles et créerait un défilement horizontal. */
  .hero { overflow: hidden; }
  .hero__halo { display: none; }

  /* Une carte par page : sans cette règle la grille garde 3 colonnes et la
     carte n'occupe qu'un tiers de l'écran. */
  .projects__page { grid-template-columns: 1fr; }

  /* « Domaines d'expertise » et « Pour votre activité » restent côte à côte ;
     le parcours passe en pleine largeur au-dessus. */
  .expertise { grid-template-columns: 1fr 1fr; gap: 28px; }
  .expertise__col:first-child { grid-column: 1 / -1; }
  .expertise__col { padding-inline: 0; }
  .expertise__col:nth-child(2) { border-top: 1px solid var(--border); padding-top: 32px; }
  .expertise__col:nth-child(3) { border-top: 1px solid var(--border); padding-top: 32px; }
  .expertise__col + .expertise__col { border-left: none; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 22px 0; }
  .stat:nth-child(odd) { border-left: none; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--border); padding-top: 22px; }
  .about__grid { display: flex; flex-direction: column; gap: 18px; }
  .about__grid > div:first-child { display: contents; }
  .about__grid .kicker { order: 1; }
  .about__grid .h2 { order: 2; }
  #about-text { order: 3; }
  .sectors { order: 4; margin-top: 6px; }
  .cta { grid-template-columns: 1fr; text-align: center; padding: 38px 26px; }
  .cta__text { margin-inline: auto; }
}

@media (max-width: 720px) {
  :root { --gutter: 18px; }
  .section { padding-block: 60px; }
  .panel { padding: 36px 20px; border-radius: var(--radius-lg); }
  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 14px var(--gutter) 20px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
  }
  .nav__links.is-open { display: flex; }
  .nav__burger { display: block; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
  .trust__logos { gap: 22px; }

  /* Deux colonnes de domaines sur un écran de téléphone : la carte se resserre et
     la typographie suit la largeur disponible via clamp(), pour rester lisible
     sans jamais déborder. */
  .expertise { gap: 14px; }
  /* L'icône passe en médaillon dans le coin bas-droit : le texte occupe toute
     la largeur de la carte, qui devient mécaniquement plus compacte qu'avec
     l'icône empilée au-dessus. */
  .domain {
    position: relative;
    display: block;
    padding: 10px 34px 10px 12px;
    margin-bottom: 8px;
  }
  .domain__icon {
    position: absolute;
    right: 7px;
    bottom: 7px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
  }
  .domain__icon svg { width: 12px; height: 12px; }
  .domain__title { font-size: clamp(0.72rem, 3.1vw, 0.875rem); line-height: 1.25; }
  .domain__desc  { font-size: clamp(0.65rem, 2.7vw, 0.75rem); line-height: 1.3; }
  .col__title    { font-size: clamp(0.78rem, 3.3vw, 1rem); }
  .stats { grid-template-columns: 1fr; padding: 22px; }
  .stat { border-left: none !important; justify-content: flex-start; padding-inline: 0; }
  .stat + .stat { border-top: 1px solid var(--border); padding-top: 20px; }
  .footer { flex-direction: column; text-align: center; }
  .footer__links { order: -1; flex-wrap: wrap; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
