/* ============================================================
   SADIS — Contact · Coda-synthèse des 4 DA
   OYLA (blanc pur, hairlines 1px, serif géant) ·
   Cortex (header pilule sombre backdrop-blur) ·
   SynapseX (micro-détails Space Mono) ·
   prmpt (capsule géante minuscules + mix-blend-mode:exclusion)
   ============================================================ */

:root {
  --ink: #000000;
  --paper: #ffffff;
  --hairline: 1px solid #000000;
  --pill-bg: rgba(2, 6, 23, 0.55);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --pad-x: clamp(16px, 4vw, 48px);
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Inter Tight', 'Inter', Arial, sans-serif;
  --monof: 'Space Mono', 'Courier New', monospace;
  --garamond: 'Cormorant Garamond', Georgia, serif;
  /* Couleurs SADIS — les 3 barres du logo (bleu Auto, teal Digital, vert Immo) */
  --sds-blue: #3A5AC9;
  --sds-teal: #47A1AC;
  --sds-green: #52A76C;
  --sds-gradient: linear-gradient(90deg, #3A5AC9 0%, #47A1AC 50%, #52A76C 100%);
}

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

html { scroll-behavior: auto; }

body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.4 var(--sans);
  letter-spacing: -0.2px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: #000; color: #fff; }

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible { outline: 2px solid #000; outline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---- micro-détail monospace (SynapseX) ---- */
.mono {
  font-family: var(--monof);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.5;
}

.eyebrow { opacity: 0.55; }

/* ============================================================
   HEADER — pilule sombre flottante backdrop-blur (Cortex)
   ============================================================ */
.hd {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: calc(100% - 32px);
  background: var(--pill-bg);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border-radius: 12px;
  padding: 4px 20px 4px 4px;
}

.hd-logo { display: flex; align-items: center; gap: 10px; }

.hd-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.10);
  display: grid;
  place-items: center;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.hd-logo:hover .hd-mark { background: rgba(255, 255, 255, 0.15); transform: scale(1.06); }
.hd-logo:active .hd-mark { transform: scale(0.95); }

.hd-mark rect { transition: transform 0.3s var(--ease-soft); }
.hd-logo:hover .hd-mark rect:nth-child(1) { transform: translateY(-1.5px); }
.hd-logo:hover .hd-mark rect:nth-child(2) { transform: translateY(-2.5px); transition-delay: 0.05s; }
.hd-logo:hover .hd-mark rect:nth-child(3) { transform: translateY(-3.5px); transition-delay: 0.1s; }

.hd-word {
  font-family: var(--garamond);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.02em;
  color: #fff;
  line-height: 1;
}

.hd-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}

.hd-nav a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.025em;
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.15s ease;
}

.hd-nav a:hover { color: #fff; }

.hd-nav a[aria-current="page"] {
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hd-nav a[aria-current="page"]::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
}

@media (min-width: 768px) {
  .hd { width: auto; gap: 32px; }
  .hd-nav { gap: 20px; }
  .hd-nav a { font-size: 13.5px; }
}

@media (min-width: 1024px) {
  .hd { top: 20px; }
}

@media (max-width: 480px) {
  .hd-word { display: none; }
  .hd-nav { gap: 11px; }
  .hd-nav a { font-size: 11.5px; }
  .hd-mark { width: 36px; height: 36px; }
}

/* ============================================================
   HERO — serif géant vs colonne méta étroite (OYLA × Cortex)
   ============================================================ */
.hero {
  padding: clamp(140px, 22vh, 220px) var(--pad-x) clamp(72px, 12vh, 140px);
  background: var(--paper);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: end;
  max-width: 1500px;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr 328px; }
}

.hero-left .eyebrow { margin-bottom: clamp(20px, 3vh, 36px); }

.hero-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(46px, 8.5vw, 118px);
  line-height: 0.95;
  letter-spacing: -0.02em;
}

.hero-title em { font-style: italic; font-weight: 400; }

.ht-line { display: block; overflow: hidden; }

.ht-inner {
  display: block;
  transform: translateY(110%);
  transition: transform 1s var(--ease-soft);
  will-change: transform;
}

body.hero-in .ht-line:nth-child(1) .ht-inner { transform: none; transition-delay: 0.05s; }
body.hero-in .ht-line:nth-child(2) .ht-inner { transform: none; transition-delay: 0.15s; }
body.hero-in .ht-line:nth-child(3) .ht-inner { transform: none; transition-delay: 0.25s; }

.hero-right {
  max-width: 328px;
  justify-self: start;
}

@media (min-width: 1024px) {
  .hero-right { justify-self: end; }
}

.meta-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: var(--hairline);
  min-width: min(328px, 100%);
}

.meta-line + .meta-line { border-top: 1px solid rgba(0, 0, 0, 0.25); }

.meta-line span:first-child { opacity: 0.5; }

.hero-sub {
  border-top: var(--hairline);
  padding-top: 14px;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.2px;
}

.resume-badge {
  margin-top: 14px;
  border: var(--hairline);
  padding: 9px 12px;
  line-height: 1.6;
}

/* ============================================================
   LA FICHE — étapes à filets hairline (OYLA)
   ============================================================ */
.fiche { border-top: var(--hairline); }

.step {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: clamp(32px, 5vh, 56px) var(--pad-x);
}

.step + .step, .recap-row { border-top: var(--hairline); }

@media (min-width: 900px) {
  .step { grid-template-columns: 220px 1fr; gap: 48px; }
}

/* Questions dynamiques du configurateur : elles apparaissent quand un
   besoin est choisi, avec une entrée douce en cascade. */
#branchSteps .step { border-top: var(--hairline); }
.step-branch {
  animation: branch-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.step-branch .step-name {
  font-size: clamp(20px, 2.4vw, 28px);
}
.step-branch .step-name::after {
  content: " ↳";
  font-size: 0.6em;
  opacity: 0.35;
}
@keyframes branch-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .step-branch { animation: none; }
}

.step-label { display: flex; flex-direction: column; gap: 8px; }

.step-num { opacity: 0.55; }

.step-name {
  font-family: var(--serif);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.5px;
}

.step-name em { font-style: italic; font-size: 0.62em; letter-spacing: 0; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
}

.chip {
  border: var(--hairline);
  border-radius: 100px;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.2px;
  background: var(--paper);
  color: var(--ink);
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.chip:hover { background: #000; color: #fff; }
.chip:active { transform: scale(0.97); }

.chip.on { background: #000; color: #fff; }

.msg-wrap { display: flex; flex-direction: column; gap: 8px; }

#msgBox {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: var(--hairline);
  border-radius: 0;
  background: transparent;
  padding: 18px;
  font: 400 17px/1.5 var(--sans);
  letter-spacing: -0.2px;
  color: var(--ink);
  transition: box-shadow 0.25s ease;
}

#msgBox::placeholder { color: rgba(0, 0, 0, 0.4); }

#msgBox:focus { outline: none; box-shadow: 0 0 0 1px #000; }

.msg-count { align-self: flex-end; opacity: 0.5; }

/* ---- récap : phrase serif + carte mono (SynapseX) ---- */
.recap-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding: clamp(32px, 5vh, 56px) var(--pad-x);
}

@media (min-width: 900px) {
  .recap-row { grid-template-columns: 1fr 380px; gap: 48px; }
}

.recap-sentence {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(24px, 3.4vw, 40px);
  line-height: 1.2;
  letter-spacing: -0.5px;
  max-width: 20em;
}

.note {
  margin-top: 20px;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.55;
  max-width: 420px;
}

.recap-card {
  border: var(--hairline);
  padding: 24px;
  background: var(--paper);
  align-self: start;
}

.rc-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.rc-circle {
  position: relative;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  color: var(--ink);
}

.rc-circle svg { width: 100%; height: 100%; }

.rc-circle > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--monof);
  font-size: 10px;
  letter-spacing: -0.04em;
}

.rc-title { font-weight: 700; }

.rc-rows { border-bottom: var(--hairline); }

.rc-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: var(--hairline);
}

.rc-row span:first-child { opacity: 0.5; flex-shrink: 0; }

.rc-row span:last-child {
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rc-dots { display: flex; gap: 8px; padding-top: 16px; }

.dot {
  width: 9px;
  height: 9px;
  border: var(--hairline);
  background: transparent;
  transition: background-color 0.25s ease;
}

.dot.on { background: #000; }

/* ============================================================
   ENVOI — pastille capsule géante minuscules (prmpt)
   ============================================================ */
.send {
  border-top: var(--hairline);
  padding: clamp(64px, 12vh, 130px) var(--pad-x) clamp(72px, 14vh, 150px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(24px, 4vh, 40px);
  text-align: center;
}

.send-capsule {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1335px;
  padding: clamp(18px, 3.5vw, 36px) clamp(52px, 9vw, 110px);
  background: #fff;
  box-shadow: inset 0 0 0 1px #000;
  transform: scale(0);
  transition:
    transform 1.1s var(--ease-soft),
    background-color 0.25s ease,
    color 0.25s ease,
    opacity 0.25s ease;
  will-change: transform;
}

.send-capsule.in { transform: scale(1); }

.send-capsule span {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(52px, 9vw, 110px);
  line-height: 1;
  letter-spacing: -0.04em;
  text-transform: lowercase;
  transition: opacity 0.25s ease;
}

.send-capsule[aria-disabled="true"] { cursor: not-allowed; }
.send-capsule[aria-disabled="true"] span { opacity: 0.22; }

.send-capsule[aria-disabled="false"] {
  background: #000;
  color: #fff;
}

.send-capsule[aria-disabled="false"]:hover { opacity: 0.92; }

.send-capsule.nope { animation: nope 0.4s ease; }

@keyframes nope {
  0%, 100% { transform: scale(1) translateX(0); }
  25% { transform: scale(1) translateX(-7px); }
  55% { transform: scale(1) translateX(6px); }
  80% { transform: scale(1) translateX(-3px); }
}

.send-hint { opacity: 0.5; }

.send-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

/* ---- bouton pill signature OYLA (capsule + cercle «+») ---- */
.pillbtn {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 100px;
  padding: 4px 4px 4px 18px;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
  min-height: 38px;
}

.pillbtn-text {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.1px;
  text-transform: uppercase;
  margin-right: 8px;
}

.pillbtn-circle {
  width: 28px;
  height: 28px;
  background: #2e2e2e;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  transition: background-color 0.25s ease;
}

.pillbtn-circle::before,
.pillbtn-circle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 1px;
  transition: background-color 0.25s ease;
}

.pillbtn-circle::before { width: 10px; height: 1.5px; }
.pillbtn-circle::after { width: 1.5px; height: 10px; }

.pillbtn:hover { background: #000; color: #fff; }
.pillbtn:hover .pillbtn-circle { background: #fff; }
.pillbtn:hover .pillbtn-circle::before,
.pillbtn:hover .pillbtn-circle::after { background: #000; }

.reset-link {
  font-size: 13px;
  letter-spacing: -0.1px;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.reset-link:hover { opacity: 1; }

/* ============================================================
   BANDEAU NOIR — texte auto-inversé mix-blend-mode:exclusion
   (prmpt) — aucun ancêtre de .band-mail ne doit être transformé
   ============================================================ */
.band { position: relative; }

.band-mail {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  z-index: 2;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(30px, 6.8vw, 96px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
  mix-blend-mode: exclusion;
  opacity: 0;
  transition: opacity 0.9s var(--ease-soft);
  padding: 0 var(--pad-x);
  word-break: break-word;
}

.band-mail.in { opacity: 1; }

.band-mail:hover { font-style: italic; }

.band-black {
  background: #000;
  color: #fff;
  padding: clamp(110px, 20vh, 200px) var(--pad-x) clamp(52px, 8vh, 84px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.band-lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(20px, 2.6vw, 30px);
  letter-spacing: -0.3px;
  opacity: 0.85;
}

.band-meta { opacity: 0.55; }

/* ============================================================
   FOOTER — blanc, grille OYLA, hairlines
   ============================================================ */
footer {
  background: var(--paper);
  padding: clamp(56px, 9vh, 80px) var(--pad-x) 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

@media (min-width: 700px) {
  .footer-grid { grid-template-columns: 1.2fr 1fr 1.5fr; gap: 48px; }
}

.fg { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

.fg-head { opacity: 0.5; margin-bottom: 8px; }

.fg a {
  font-size: 17px;
  letter-spacing: -0.2px;
  line-height: 1.35;
  transition: opacity 0.25s ease;
}

.fg a:hover { opacity: 0.6; }

.fg-soft { font-size: 14px; opacity: 0.55; line-height: 1.5; }

.fg-brand p { font-size: 15px; line-height: 1.5; opacity: 0.75; max-width: 380px; }

.fg-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }

.fg-logo em {
  font-family: var(--garamond);
  font-style: normal;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.pillbtn-link { margin-top: 12px; text-decoration: none; }

.legal {
  border-top: var(--hairline);
  margin-top: clamp(40px, 7vh, 64px);
  padding-top: 20px;
  opacity: 0.55;
}

/* ============================================================
   ENTRÉES — douces, cubic-bezier(0.16,1,0.3,1)
   ============================================================ */
.rv {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.9s var(--ease-soft), transform 0.9s var(--ease-soft);
}

.rv.in { opacity: 1; transform: none; }

/* ============================================================
   OPTIMISATION MOBILE — corps de lecture ≥16px, fit ≤640px
   Micro-labels mono plancher 12px · cibles tactiles ≥44px ·
   line-height ≥1.5 · aucun débordement (DA conservée)
   ============================================================ */
@media (max-width: 640px) {
  /* micro-labels techniques mono : plancher lisible 12px */
  .mono { font-size: 12px; }

  /* HERO — sous-titre = vraie phrase de lecture */
  .hero-sub { font-size: 16px; line-height: 1.55; }
  .resume-badge { font-size: 12.5px; line-height: 1.65; }

  /* FICHE — chips = corps lisible + cible tactile ≥44px */
  .chip {
    font-size: 16px;
    padding: 12px 22px;
    letter-spacing: -0.1px;
  }

  /* message : 16px évite le zoom auto iOS, lecture confortable */
  #msgBox { font-size: 16px; line-height: 1.55; }

  /* récap : note = légende lisible (remontée en taille + contraste) */
  .note {
    font-size: 15px;
    line-height: 1.55;
    opacity: 0.7;
  }
  .recap-card { padding: 20px; }

  /* ENVOI — hint + cibles tactiles ≥44px */
  .send-hint { line-height: 1.6; }
  .pillbtn { min-height: 44px; }
  .pillbtn-text { font-size: 13px; }
  .reset-link { font-size: 14px; padding: 12px 4px; }

  /* FOOTER — descriptions & légendes en corps lisible */
  .fg-brand p { font-size: 16px; line-height: 1.55; }
  .fg-soft { font-size: 15px; line-height: 1.55; opacity: 0.7; }
  .fg a { font-size: 16px; }
}

/* ---- très petits écrans : espacements resserrés (respire sans vides géants) ---- */
@media (max-width: 480px) {
  .hero { padding-top: clamp(116px, 20vh, 150px); padding-bottom: clamp(56px, 9vh, 80px); }
  .step { padding-top: 30px; padding-bottom: 30px; }
  .recap-row { padding-top: 30px; padding-bottom: 30px; }
  .send { padding-top: clamp(48px, 9vh, 80px); padding-bottom: clamp(56px, 11vh, 96px); }
  .band-black { padding-top: clamp(84px, 16vh, 140px); }
}

/* ============================================================
   REDUCED MOTION — tout visible, statique
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .rv, .send-capsule, .band-mail, .ht-inner {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ============================================================
   COULEURS SADIS — le contact porte les 3 couleurs du groupe
   (bleu Auto · teal Digital · vert Immo), sur la base prmpt/OYLA.
   ============================================================ */

/* Mot « SADIS » du titre : dégradé des 3 barres du logo */
.ht-sadis {
  background-image: var(--sds-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .ht-sadis { background-image: none; color: var(--sds-blue); -webkit-text-fill-color: currentColor; }
}

/* Filet dégradé tricolore en tête de la fiche */
.fiche {
  border-top: 3px solid;
  border-image: var(--sds-gradient) 1;
}

/* Puces « Vous êtes » : bleu SADIS */
#stepRole .chip:hover,
#stepRole .chip.on { background: var(--sds-blue); border-color: var(--sds-blue); color: #fff; }

/* Puces « Votre besoin » : la couleur du pôle concerné */
#stepNeed .chip[data-v="Pièces auto"]:hover,
#stepNeed .chip[data-v="Pièces auto"].on { background: var(--sds-blue); border-color: var(--sds-blue); color: #fff; }

#stepNeed .chip[data-v="Site web / plateforme"]:hover,
#stepNeed .chip[data-v="Site web / plateforme"].on,
#stepNeed .chip[data-v="Application mobile"]:hover,
#stepNeed .chip[data-v="Application mobile"].on,
#stepNeed .chip[data-v="Logiciel sur mesure"]:hover,
#stepNeed .chip[data-v="Logiciel sur mesure"].on,
#stepNeed .chip[data-v="ERP Sage · Odoo"]:hover,
#stepNeed .chip[data-v="ERP Sage · Odoo"].on { background: var(--sds-teal); border-color: var(--sds-teal); color: #fff; }

#stepNeed .chip[data-v="Immobilier"]:hover,
#stepNeed .chip[data-v="Immobilier"].on { background: var(--sds-green); border-color: var(--sds-green); color: #fff; }

/* Les 3 pastilles d'avancement de la fiche : bleu / teal / vert */
#d1.on { background: var(--sds-blue); }
#d2.on { background: var(--sds-teal); }
#d3.on { background: var(--sds-green); }

/* Zone message : focus teal (Digital écrit, Digital répond) */
#msgBox:focus { box-shadow: 0 0 0 2px var(--sds-teal); }

/* Capsule « envoyer » activée : VERT SADIS — feu vert, on y va */
.send-capsule[aria-disabled="false"] {
  background: var(--sds-green);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--sds-green);
}

/* Bouton pilule footer : liseré dégradé au survol */
.pillbtn:hover { background: var(--sds-blue); color: #fff; border-color: var(--sds-blue); }
.pillbtn:hover .pillbtn-circle::after { background: var(--sds-blue); }
