/* ==========================================================================
   REDESIGN - PROPOSITION
   Direction : éditorial-technique. Base encre/papier, un seul accent orange brûlé.
   Contraintes conservées : vanilla CSS, polices auto-hébergées, budget perf 100/100.
   ========================================================================== */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/plus-jakarta-sans-variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Tokens : palette claire par défaut --------------------------------- */
:root {
  --paper: #fbfaf8;
  --surface: #ffffff;
  --surface-sunk: #f4f2ef;
  --ink: #191817;
  --ink-soft: #57534e;
  --ink-faint: #6b645e;
  --rule: #e3dfda;
  --rule-strong: #cfc9c1;

  /* Accent unique, verrouillé sur toute la page */
  --accent: #c2410c;
  --accent-deep: #9a3412;
  --accent-wash: rgba(194, 65, 12, 0.08);
  --on-accent: #ffffff;

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --shell: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  /* Verrou de forme : tout est à angle droit. Aucun rayon nulle part. */
  --radius: 0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141312;
    --surface: #1c1b19;
    --surface-sunk: #232120;
    --ink: #f5f3f0;
    --ink-soft: #b5aea6;
    --ink-faint: #9c948c;
    --rule: #302d2a;
    --rule-strong: #423e3a;

    --accent: #fb7c3f;
    --accent-deep: #f97316;
    --accent-wash: rgba(251, 124, 63, 0.12);
    --on-accent: #17120e;
  }
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* --- Typographie -------------------------------------------------------- */
h1, h2, h3 { font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }

.display {
  font-size: clamp(2.5rem, 6.4vw, 5rem);
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.h2 {
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.h3 { font-size: clamp(1.15rem, 1.6vw, 1.4rem); letter-spacing: -0.02em; line-height: 1.2; }

.lede { font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--ink-soft); max-width: 46ch; }
.body { color: var(--ink-soft); max-width: 62ch; }
.prose-gap { margin-bottom: 1.25rem; }
.prose-lead { margin-top: 1.125rem; }

.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* --- Boutons ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  white-space: nowrap;
  font: inherit;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1;
  padding: 0.95rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.btn svg { width: 1.05em; height: 1.05em; flex-shrink: 0; }

/* Le texte du bouton suit la luminosité de l'accent, pour rester lisible
   dans les deux thèmes. Blanc sur orange foncé, encre sur orange clair. */
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-primary:active { transform: translateY(1px); }

/* Contraste : encre sur papier, jamais blanc sur blanc */
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-ghost:hover { border-color: var(--ink); background: var(--surface-sunk); }
.btn-ghost:active { transform: translateY(1px); }

.btn-block { width: 100%; }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Navigation : une seule ligne, 68px ---------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.nav-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.wordmark {
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark span { color: var(--accent); }

.nav-links { display: flex; align-items: center; gap: 1.75rem; list-style: none; }

.nav-links a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s ease;
}

.nav-links a:hover { color: var(--ink); }

.nav-cta { display: inline-flex; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  padding: 0.5rem;
  cursor: pointer;
  border-radius: var(--radius);
}

.nav-toggle svg { width: 20px; height: 20px; display: block; }

/* --- Rythme des sections ------------------------------------------------ */
.section { padding-block: clamp(4.5rem, 9vw, 8rem); }
.section-sunk { background: var(--surface-sunk); }
.section-head { max-width: 40ch; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head .body { margin-top: 1.125rem; }

/* --- HERO : manifeste éditorial. Le titre est l'élément visuel. ----------
   Pas d'illustration ni de portrait : la typographie à grande échelle et le
   filet de séparation portent seuls la composition. */
.hero { padding-top: clamp(3.5rem, 7vw, 6rem); padding-bottom: clamp(3rem, 6vw, 5rem); }

.hero .display {
  font-size: clamp(2.5rem, 8vw, 6.5rem);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  max-width: 18ch;
}

/* Accroche à gauche, actions alignées à droite : la ligne occupe toute la
   largeur, ce qui évite l'effet de colonne manquante. */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: end;
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
  border-top: 1px solid var(--rule);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* --- À PROPOS : prose à gauche, expertise à droite ----------------------
   Proportions inversées par rapport aux blocs Offres (5/7) pour que les deux
   sections ne partagent pas la même famille de layout. */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.skills { border-top: 2px solid var(--ink); padding-top: 1.25rem; }

.skills-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

/* Filet entre les lignes seulement, jamais au-dessus et en dessous de chacune. */
.skills-row {
  display: grid;
  grid-template-columns: minmax(6.5rem, auto) 1fr;
  gap: 1rem;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

.skills-row:last-child { border-bottom: 0; }

.skills-row dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  padding-top: 0.15rem;
}

.skills-row dd { font-size: 0.92rem; color: var(--ink-soft); }

/* --- Bande de crédibilité, sous le hero et non dedans ------------------- */
.credentials {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.credentials-grid { display: grid; grid-template-columns: repeat(3, 1fr); }

.credential {
  padding: clamp(1.75rem, 3vw, 2.5rem) clamp(1rem, 2vw, 2rem);
  border-left: 1px solid var(--rule);
}

.credential:first-child { border-left: 0; padding-left: 0; }

.credential dt {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.credential dd { font-size: 0.9rem; color: var(--ink-soft); }

/* --- OFFRES : deux blocs éditoriaux, pas des cartes à badge ------------- */
.offer {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--rule);
}

.offer:last-of-type { border-bottom: 1px solid var(--rule); }

.offer-index { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1rem; }
.offer-index .h3 { margin: 0; }
.offer-title-col .body { margin-bottom: 1.5rem; }

.offer-points { list-style: none; display: grid; gap: 0.9rem; }

.offer-points li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  align-items: start;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.offer-points svg { width: 18px; height: 18px; color: var(--accent); margin-top: 0.2rem; flex-shrink: 0; }
.offer-points strong { color: var(--ink); font-weight: 700; }

/* --- LIVRABLES : bento à 3 cellules, tailles inégales, fonds variés ----- */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.bento-cell { background: var(--surface); padding: clamp(1.5rem, 3vw, 2.25rem); display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.bento-cell.wide { grid-column: span 2; }
.bento-cell.full { grid-column: 1 / -1; }
.bento-cell .body { font-size: 0.95rem; }

/* Variation visuelle réelle : une cellule teintée, une cellule image */
.bento-cell.tinted { background: var(--accent-wash); }

.bento-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: auto; padding-top: 0.75rem; }
.bento-tags span { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-faint); border: 1px solid var(--rule); padding: 0.2rem 0.5rem; }

/* --- MÉTHODE : frise horizontale, famille de layout distincte ----------- */
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(1rem, 2.5vw, 2rem); counter-reset: step; }

.step { counter-increment: step; padding-top: 1.5rem; min-width: 0; position: relative; }

/* Le filet est un pseudo-élément et non un border, pour pouvoir être tracé
   en scaleX (transform seul, donc composité par le GPU). */
.step::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--rule-strong);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .55s cubic-bezier(.16,1,.3,1);
}

.step:first-child::after { background: var(--ink); }
.timeline.in .step::after { transform: scaleX(1); }

/* Les étapes montent une par une : la séquence du texte est rendue par la
   séquence de l'animation. */
.timeline .step::before,
.timeline .step > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.16,1,.3,1);
}

.timeline.in .step::before,
.timeline.in .step > * { opacity: 1; transform: none; }

.timeline .step:nth-child(1)::after,
.timeline .step:nth-child(1)::before,
.timeline .step:nth-child(1) > * { transition-delay: 0ms; }
.timeline .step:nth-child(2)::after,
.timeline .step:nth-child(2)::before,
.timeline .step:nth-child(2) > * { transition-delay: 110ms; }
.timeline .step:nth-child(3)::after,
.timeline .step:nth-child(3)::before,
.timeline .step:nth-child(3) > * { transition-delay: 220ms; }
.timeline .step:nth-child(4)::after,
.timeline .step:nth-child(4)::before,
.timeline .step:nth-child(4) > * { transition-delay: 330ms; }

.step::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.step h3 { margin-bottom: 0.5rem; font-size: 1.05rem; }
.step p { font-size: 0.9rem; color: var(--ink-soft); }

/* --- FAQ ---------------------------------------------------------------- */
.faq { max-width: 780px; border-top: 1px solid var(--rule); }
.faq-item { border-bottom: 1px solid var(--rule); }

.faq-q {
  width: 100%;
  background: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--ink);
  text-align: left;
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  cursor: pointer;
}

.faq-q svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; transition: transform .25s ease; }
.faq-item[open] .faq-q svg { transform: rotate(45deg); }
.faq-a { padding-bottom: 1.5rem; }
.faq-a p { color: var(--ink-soft); max-width: 62ch; }
.faq-q::-webkit-details-marker { display: none; }

/* --- CONTACT ------------------------------------------------------------ */
.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }

.contact-lines { display: grid; gap: 1.25rem; margin-top: 2rem; }
.contact-line dt { display: flex; align-items: center; gap: 0.6rem; font-size: 0.8rem; color: var(--ink-faint); margin-bottom: 0.3rem; }
.contact-line dt svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
/* La valeur s'aligne sur le libellé, sous l'icône. */
.contact-line dd { padding-left: calc(18px + 0.6rem); }
.contact-line dd, .contact-line dd a { font-weight: 600; color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.contact-line dd a:hover { color: var(--accent); }

.form { display: grid; gap: 1.25rem; background: var(--surface); border: 1px solid var(--rule); padding: clamp(1.5rem, 3vw, 2.25rem); }
.field { display: grid; gap: 0.45rem; }

.field label { font-size: 0.875rem; font-weight: 600; color: var(--ink); }
.field .req { color: var(--accent); }

.field input, .field select, .field textarea {
  font: inherit;
  font-size: 1rem;
  width: 100%;
  padding: 0.8rem 0.9rem;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s ease;
}

/* Contraste AA : placeholder assez sombre pour rester lisible */
.field ::placeholder { color: var(--ink-faint); opacity: 1; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
.field textarea { resize: vertical; min-height: 120px; }
.field select { background-image: none; }

.form-note { font-size: 0.8rem; color: var(--ink-faint); }
/* Pot de miel anti-spam : invisible pour les humains */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { font-size: 0.9rem; font-weight: 600; min-height: 1.2em; }
.form-status.ok { color: var(--accent-deep); }
.form-status.ko { color: #b91c1c; }

@media (prefers-color-scheme: dark) {
  .form-status.ok { color: var(--accent); }
  .form-status.ko { color: #fca5a5; }
}

/* --- Pied de page ------------------------------------------------------- */
.foot { border-top: 1px solid var(--rule); padding-block: 3rem 2rem; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.foot h2 { font-size: 0.8rem; font-weight: 700; color: var(--ink); margin-bottom: 1rem; letter-spacing: 0; }
.foot ul { list-style: none; display: grid; gap: 0.6rem; }
.foot a { color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; }
.foot a:hover { color: var(--accent); }
.foot-tag { color: var(--ink-soft); font-size: 0.9rem; max-width: 38ch; margin-top: 0.75rem; }
.foot-base { border-top: 1px solid var(--rule); padding-top: 1.5rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* --- Révélation au scroll (MOTION 5) ------------------------------------ */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.16,1,.3,1), transform .6s cubic-bezier(.16,1,.3,1); }
.reveal.in { opacity: 1; transform: none; }

/* --- Repli mobile, déclaré explicitement -------------------------------- */
@media (max-width: 900px) {
  .hero-grid, .contact-grid, .offer, .about-grid { grid-template-columns: 1fr; }
  .hero .display { max-width: none; }
  .skills { margin-top: 0.5rem; }
  .credentials-grid { grid-template-columns: 1fr; }
  .credential { border-left: 0; border-top: 1px solid var(--rule); padding-inline: 0; }
  .credential:first-child { border-top: 0; }
  .bento, .timeline { grid-template-columns: 1fr; }
  .bento-cell.wide, .bento-cell.full { grid-column: auto; }
  .foot-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links, .nav-cta { display: none; }

  .nav.open .nav-links {
    display: flex;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--gutter) 1.25rem;
  }

  .nav.open .nav-links li { width: 100%; }
  .nav.open .nav-links a { display: block; padding: 0.85rem 0; border-top: 1px solid var(--rule); }
  .nav.open .nav-cta { display: flex; position: absolute; top: calc(68px + 1px); left: 0; right: 0; padding: 0 var(--gutter) 1.25rem; background: var(--paper); transform: translateY(100%); }
  .nav.open .nav-cta .btn { width: 100%; }

  .hero-actions .btn { width: 100%; }
  .foot-base { flex-direction: column; }
}

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