/* ============================================================================
   Expériatis — mise en page et composants
   ----------------------------------------------------------------------------
   Aucune couleur brute ici : tout vient de tokens.css.

   Le responsive repose sur flex-wrap + flex-basis pour les blocs à deux
   colonnes et sur repeat(auto-fit, minmax(...)) pour les grilles de cartes ;
   la typographie s'échelonne en clamp(). La seule media query de mise en page
   est le repli de la navigation sous 700px.
   ========================================================================== */

/* --- Base ---------------------------------------------------------------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
blockquote,
figure {
  margin: 0;
}

h1,
h2,
h3,
p,
blockquote {
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--text);
}

/* Le prototype ne définissait que le survol : le focus clavier est ajouté ici. */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--accent);
  color: var(--selection-ink);
}

a,
.card {
  transition: color 0.15s ease, border-color 0.15s ease,
    background-color 0.15s ease, filter 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  a,
  .card {
    transition: none;
  }
}

/* --- Coquille de section ------------------------------------------------- */

.section {
  padding: var(--pad-y) var(--pad-x);
}

.section[id] {
  /* L'en-tête collant ne doit jamais recouvrir un titre après un saut d'ancre. */
  scroll-margin-top: var(--header-h);
}

.section--band {
  background: var(--band);
  border-top: 1px solid var(--border-fade);
  border-bottom: 1px solid var(--border-fade);
}

.wrap {
  max-width: var(--content);
  margin: 0 auto;
}

.wrap--stack {
  display: flex;
  flex-direction: column;
  gap: clamp(30px, 4vw, 48px);
}

/* Surtitre commun à toutes les sections : carré d'accent + libellé mono. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-label);
}

.eyebrow::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
}

.section-title {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 800;
}

/* En-tête de section : titre à gauche, texte ou lien d'appui à droite. */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-head__main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 640px;
}

.section-head__support {
  max-width: 38ch;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-muted-2);
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px var(--pad-x);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-fade);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

/* Le signe : quatre colonnes montantes sur une grille de 19 (module 4,
   gouttière 1). Il remplace le carré d'accent, et il exige 16px : sous 14, les
   gouttières tombent sous le pixel et l'escalier s'empâte en tache. */
.logo__mark {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.logo__name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo__tld {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
  font-size: 14px;
  font-weight: 500;
}

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

.nav__link:hover {
  color: var(--text);
}

.nav__cta {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.nav__cta-host {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}

.nav__cta:hover,
.nav__cta:hover .nav__cta-host {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sous 700px les sauts de section encombrent : on ne garde que la pastille CV.
   Sous 460px, la pastille elle-même passerait sur deux lignes à côté du
   logo : le nom d'hôte s'efface, le libellé suffit. */
@media (max-width: 700px) {
  .nav__link {
    display: none;
  }
}

@media (max-width: 460px) {
  .nav__cta-host {
    display: none;
  }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  font-size: 15.5px;
}

.btn--primary {
  padding: 15px 26px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.btn--primary:hover {
  color: var(--on-accent);
  filter: brightness(1.1);
}

.btn--ghost {
  padding: 15px 24px;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-weight: 600;
}

.btn--ghost:hover {
  color: var(--text);
  border-color: var(--border-hover-alt);
  background: var(--hairline);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* --- 1. Hero ------------------------------------------------------------- */

.hero {
  position: relative;
  padding: clamp(56px, 9vw, 116px) var(--pad-x) clamp(44px, 6vw, 76px);
  background-image: repeating-linear-gradient(
      90deg,
      var(--hairline) 0 1px,
      transparent 1px 88px
    ),
    radial-gradient(120% 90% at 78% 0%, var(--accent-glow), transparent 60%);
  border-bottom: 1px solid var(--border-fade);
}

.hero__inner {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(36px, 5vw, 64px);
  align-items: flex-end;
}

.hero__main {
  display: flex;
  flex-direction: column;
  gap: 26px;
  min-width: 0;
  flex: 1 1 440px;
}

.hero__title {
  font-size: clamp(38px, 5.6vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.hero__title .accent {
  color: var(--accent);
}

.hero__lede {
  max-width: 62ch;
  font-size: clamp(16.5px, 1.35vw, 20px);
  line-height: 1.62;
  color: var(--text-body);
}

.hero__lede strong {
  color: var(--text);
  font-weight: 600;
}

.hero .btn-row {
  margin-top: 4px;
}

/* Rail de chiffres : quatre lignes, filet sous chacune sauf la dernière. */
.stats {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  flex: 0 1 250px;
  font-family: var(--mono);
}

.stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.stat:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.stat__value {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat__label {
  font-size: 11.5px;
  text-align: right;
  line-height: 1.4;
  letter-spacing: 0.04em;
  color: var(--text-label);
}

/* --- 2. Expertise -------------------------------------------------------- */

.expertise .wrap--stack {
  gap: clamp(32px, 4vw, 52px);
}

.card-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 30px 26px 32px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-card);
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--surface-card-hover);
}

.card__index {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
}

.card__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.card__body {
  font-size: 14.8px;
  line-height: 1.62;
  color: var(--text-muted);
}

/* --- 3. Référence -------------------------------------------------------- */

.reference__inner {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(32px, 4vw, 60px);
}

.reference__intro {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  flex: 1 1 330px;
}

.reference__lede {
  font-size: 16px;
  line-height: 1.62;
  color: var(--text-body-dim);
}

.quote {
  margin-top: 8px;
  padding: 22px 24px;
  border-left: 2px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: var(--quote-fill);
  font-size: 15.5px;
  line-height: 1.66;
  font-style: italic;
  color: var(--text-strong-body);
}

/* Coquille de carte à en-tête, partagée avec « Modalités d'intervention ». */
.panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.panel--deliverables {
  flex: 1.25 1 420px;
  background: var(--surface-sunken);
}

.panel--terms {
  flex: 1 1 320px;
  background: var(--surface-card);
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--text-label-dim);
}

.panel__head--dotted::before {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.panel__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px 24px 30px;
}

.bullet {
  display: flex;
  gap: 14px;
}

.bullet::before {
  content: '';
  flex: none;
  margin-top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
}

.bullet p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-strong-body);
}

.bullet strong {
  font-weight: 700;
  color: var(--text-bright);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.tag {
  padding: 5px 11px;
  border: 1px solid var(--border-chip);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-muted);
}

/* --- 4. Stack ------------------------------------------------------------ */

.stack__head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 660px;
}

/* Grille en filets : le fond de la grille transparaît dans le gap de 1px.
   Corollaire : une dernière rangée incomplète laisse un pavé de filet en
   aplat. Le nombre de colonnes doit donc diviser les 8 cellules — d'où des
   paliers explicites plutôt qu'un auto-fit, qui donnait 3 colonnes et un trou
   au-delà de 1100px. Le palier de 700px garde des cellules >= 320px, la
   largeur minimale prévue par le handoff. */
.matrix {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .matrix {
    grid-template-columns: repeat(2, 1fr);
  }
}

.matrix__cell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 24px;
  background: var(--surface-cell);
}

.matrix__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-bright);
}

.matrix__items {
  font-family: var(--mono);
  font-size: 12.8px;
  line-height: 1.85;
  color: var(--text-muted-2);
}

/* --- 5. Parcours --------------------------------------------------------- */

.parcours .section-head__main {
  max-width: 620px;
}

.timeline {
  display: flex;
  flex-direction: column;
}

.timeline__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  padding: 26px 0;
  border-top: 1px solid var(--border);
}

.timeline__row:last-child {
  border-bottom: 1px solid var(--border);
}

.timeline__meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 0 0 170px;
  font-family: var(--mono);
}

.timeline__period {
  font-size: 12.5px;
  color: var(--text-strong-body);
}

.timeline__row--current .timeline__period {
  color: var(--accent);
}

.timeline__where {
  font-size: 11.5px;
  color: var(--text-faint);
}

.timeline__content {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  flex: 1 1 320px;
}

.timeline__title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.timeline__employer {
  font-weight: 500;
  color: var(--text-body);
}

.timeline__body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

.endnotes {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  padding-top: 6px;
}

.endnote {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.endnote__label {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.endnote__primary {
  font-size: 15px;
  font-weight: 600;
}

.endnote__secondary {
  font-size: 14px;
  color: var(--text-muted-2);
}

/* --- 6. Laboratoire personnel -------------------------------------------- */

.labo {
  padding: clamp(56px, 8vw, 96px) var(--pad-x);
}

.labo__inner {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(28px, 4vw, 56px);
  align-items: flex-start;
}

.labo__intro {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  flex: 1 1 280px;
}

.labo__title {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.labo__lede {
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--text-muted);
}

.labo__grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  min-width: 0;
  flex: 1.6 1 430px;
}

.mini {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px 22px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
}

.mini__title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mini__body {
  font-size: 14.2px;
  line-height: 1.6;
  color: var(--text-muted-2);
}

/* --- 7. Contact ---------------------------------------------------------- */

.contact {
  background-image: radial-gradient(
    90% 120% at 15% 0%,
    var(--accent-glow),
    transparent 62%
  );
  border-top: 1px solid var(--border-fade);
}

.contact__inner {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(32px, 4vw, 64px);
  align-items: flex-start;
}

.contact__main {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  flex: 1.15 1 400px;
}

.contact__title {
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.contact__lede {
  max-width: 54ch;
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--text-body);
}

.contact .btn--primary {
  padding: 16px 28px;
  font-size: 16px;
}

.contact .btn--ghost {
  padding: 16px 26px;
  font-size: 16px;
  font-family: var(--mono);
}

.terms {
  display: flex;
  flex-direction: column;
}

.terms__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 17px 22px;
  border-bottom: 1px solid var(--border-subtle-fade);
}

.terms__row:last-child {
  border-bottom: 0;
}

.terms__label {
  font-size: 13.5px;
  color: var(--text-label);
}

.terms__value {
  font-size: 14.5px;
  font-weight: 600;
  text-align: right;
}

/* --- 8. Pied de page ----------------------------------------------------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px var(--pad-x) 36px;
  border-top: 1px solid var(--border-fade);
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-footer__mark {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.site-footer__name {
  font-size: 14.5px;
  font-weight: 700;
}

.site-footer__role {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}
