/* Hekza V3 : planche de style, direction « dense-tiles » (taste-skill) sur la charte officielle */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-grotesk-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Cascadia Code";
  src: url("/assets/fonts/cascadia-code-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  /* charte Hekza, répartie dans les rôles */
  --bg: #050315;          /* noir de la charte : le sol */
  --surface: #13102b;     /* une marche au-dessus du sol : tuiles */
  --surface-2: #0c0a20;   /* seconde marche, pour alterner les rangées sombres */
  --ink: #fbfbfe;         /* blanc de la charte */
  --muted: #b9b0cc;
  --accent: #ffe900;      /* jaune : l'action */
  --accent-ink: #050315;
  --violet: #c45df0;      --violet-ink: #050315;
  --lavande: #f4e3ff;     --lavande-ink: #050315;
  --anthra: #1d1d1b;      --anthra-ink: #fbfbfe;

  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-code: "Cascadia Code", ui-monospace, monospace; /* taste-skill-ignore : police de marque, réservée aux vrais extraits de code (<code>) */

  /* cinq tailles visibles */
  --step-small: clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-statement: clamp(1.625rem, 1.1rem + 1.2vw, 2.25rem);
  --step-head: clamp(2rem, 1.3rem + 3.2vw, 4rem);
  --step-hero: clamp(3.25rem, 5.2vw, 5rem);

  --edge: 8px;            /* marges et joints du plateau */
  --pad: 24px;            /* marge intérieure des tuiles */
  --margin: calc(var(--edge) + var(--pad)); /* le texte hors tuile s'aligne sur le texte des tuiles */
  --section: clamp(6rem, 12vw, 12rem);
  --radius: 0px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-reveal: 800ms;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--step-body); line-height: 1.5;
  letter-spacing: -0.01em; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { font-weight: 800; text-wrap: balance; letter-spacing: -0.04em; line-height: 0.95; }
p { text-wrap: pretty; }
a { color: inherit; }
svg { display: block; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--edge); top: var(--edge); z-index: 10; padding: 12px 16px; background: var(--accent); color: var(--accent-ink); clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.skip:focus { clip-path: none; width: auto; height: auto; }
.wrap { padding-inline: var(--margin); }
.link-plain { text-decoration: underline; text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3.25rem; padding: 0 1.5rem;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; border-radius: var(--radius);
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease;
}
.button:hover { background: var(--ink); color: var(--bg); }
.button:active { transform: scale(0.97); }
.button-small { min-height: 2.75rem; padding: 0 1.1rem; font-size: var(--step-small); }

/* ---------- haut de page : un fragment sur une scène taillée à l'angle de l'hexagone ---------- */
.hero {
  position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px;
  height: 100svh; min-height: 720px; padding-inline: var(--margin); overflow: hidden;
}
.nav { position: absolute; z-index: 2; top: 28px; left: var(--margin); right: var(--margin); display: flex; justify-content: space-between; align-items: center; }
.nav ul { display: flex; gap: 36px; font-size: var(--step-small); font-weight: 500; }
.nav ul a, .home { text-decoration: none; }
.nav ul a { text-underline-offset: 0.3em; text-decoration-thickness: 2px; }
.nav ul a:hover { text-decoration: underline; text-decoration-color: var(--violet); }
.logo { height: 44px; width: auto; fill: currentColor; }
.h-text { grid-column: 1 / 7; padding-top: 150px; align-self: start; }
.h-text h1 { font-size: var(--step-hero); font-weight: 600; letter-spacing: -0.045em; line-height: 1; }
.h-sub { margin: 28px 0 32px; max-width: 38ch; font-size: max(18px, var(--step-body)); line-height: 1.5; }
.h-facts { position: absolute; left: var(--margin); bottom: 40px; display: grid; gap: 4px; font-size: var(--step-small); color: var(--muted); }
.stage {
  position: absolute; top: 42%; right: 0; bottom: 0; left: calc(var(--margin) + (100% - 2 * var(--margin) + 24px) * 4 / 12);
  background: var(--violet); padding: 56px 0 0 56px; overflow: hidden;
  clip-path: polygon(72px 0, 100% 0, 100% 100%, 0 100%, 0 125px); /* coin taillé à 60°, l'angle des chevrons */
}

/* ---------- extraits d'interface (data-ui : leurs propres conventions) ---------- */
[data-ui] { font-size: 15px; line-height: 1.4; letter-spacing: 0; }
[data-ui] .ui-title { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 16px; }
.demo { width: min(660px, 100%); min-height: calc(100% + 2px); background: var(--bg); color: var(--ink); border-radius: 10px 10px 0 0; padding: 24px 24px 32px; } /* rogné par le bas de l'écran */
[data-ui] .demo-q { border: 0; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
[data-ui] .demo-q input { position: absolute; opacity: 0; pointer-events: none; }
[data-ui] .demo-q label {
  padding: 9px 14px; border-radius: 6px; background: var(--surface); cursor: pointer; font-size: 15px;
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease;
}
[data-ui] .demo-q label:hover { background: #221d44; }
[data-ui] .demo-q input:checked + label { background: var(--lavande); color: var(--lavande-ink); font-weight: 600; }
[data-ui] .demo-q input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
[data-ui] .demo-a { background: var(--surface); border-radius: 8px; padding: 22px 24px; }
[data-ui] .demo-a .a { display: none; }
[data-ui] .demo-a .a p:first-child { font-size: 19px; line-height: 1.5; }
[data-ui] .demo-a .src { margin-top: 16px; font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
[data-ui] .demo-a .src a { color: var(--lavande); background: rgba(196, 93, 240, 0.22); padding: 3px 9px; border-radius: 4px; text-decoration: none; }
[data-ui] .demo-a .src a:hover { background: var(--violet); color: var(--violet-ink); }
.demo-body:has(#q1:checked) .a1, .demo-body:has(#q2:checked) .a2, .demo-body:has(#q3:checked) .a3 { display: block; animation: answer 420ms var(--ease-out); }
@supports not selector(:has(*)) { [data-ui] .demo-a .a { display: block; margin-bottom: 16px; } }
@keyframes answer { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- intro ---------- */
.intro { padding-block: 96px; }
.lead-wide { font-size: var(--step-statement); line-height: 1.2; letter-spacing: -0.02em; max-width: 64ch; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 64px; margin-top: 72px; max-width: 1120px; }
.cols b { font-weight: 700; }

/* ---------- gabarit commun : le titre à gauche, sur un seul bord ---------- */
.sec-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end; margin-bottom: 56px; }
.sec-head h2, .split-head h2 { font-size: var(--step-head); }
.sec-head h2 { grid-column: 1 / 7; }
.sec-side { grid-column: 8 / 13; display: grid; gap: 20px; justify-items: start; }
.split { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.split-head { grid-column: 1 / 6; display: grid; gap: 20px; position: sticky; top: 48px; }
.split-head p { max-width: 36ch; }
.split-body { grid-column: 7 / 13; }

/* ---------- offres : une bande par offre, aux couleurs du motif ---------- */
.offers { padding-top: var(--section); }
.ob {
  position: relative; overflow: hidden; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center;
  min-height: 46svh; padding: 64px var(--margin);
}
.ob h3 { grid-column: 1 / 6; font-size: var(--step-head); line-height: 0.95; letter-spacing: -0.045em; position: relative; z-index: 1; }
.ob-body { grid-column: 6 / 10; display: grid; gap: 16px; justify-items: start; position: relative; z-index: 1; }
.ob-body p:first-child { font-size: var(--step-lead); line-height: 1.35; letter-spacing: -0.015em; }
.ob-ex { font-weight: 600; }
.ob-mk { position: absolute; top: 50%; right: -9vw; height: 94%; width: auto; aspect-ratio: 152.74 / 131.4; transform: translateY(-50%); }
.ob-rag { background: var(--violet); color: var(--violet-ink); fill: var(--accent); }
.ob-agents { background: var(--accent); color: var(--accent-ink); fill: var(--bg); }
.ob-workflows { background: var(--anthra); color: var(--anthra-ink); fill: var(--ink); }
.ob-resolution { background: var(--lavande); color: var(--lavande-ink); fill: var(--violet); }
.button-ink { background: var(--bg); color: var(--ink); margin-top: 8px; }
.button-ink:hover { background: var(--violet); color: var(--violet-ink); }

/* ---------- vitrine ---------- */
.showcase { padding-top: var(--section); }
.panels { display: flex; height: 54svh; min-height: 460px; }
.p { flex: var(--g) 1 0; min-width: 0; overflow: hidden; padding: 28px; transition: flex-grow 500ms var(--ease-out); }
.p:hover { flex-grow: 6; }
.p1 { --g: 4; background: var(--anthra); color: var(--anthra-ink); }
.p2 { --g: 2.6; background: var(--accent); color: var(--accent-ink); }
.p3 { --g: 3; background: var(--surface); color: var(--ink); }
.p4 { --g: 2.6; background: var(--violet); color: var(--violet-ink); }
[data-ui] .p-title { font-family: var(--font); font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -0.03em; max-width: 18ch; margin-bottom: 32px; }
[data-ui] .run li { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: baseline; padding: 14px 0; border-top: 1px solid rgba(244, 227, 255, 0.12); }
[data-ui] .run time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
[data-ui] .run i { font-style: normal; font-size: 13px; padding: 2px 8px; border-radius: 4px; background: rgba(244, 227, 255, 0.1); color: var(--lavande); white-space: nowrap; }
[data-ui] .run .now i { background: var(--accent); color: var(--accent-ink); }
[data-ui] .ask { background: var(--bg); color: var(--ink); border-radius: 8px; padding: 18px; }
[data-ui] .who { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
[data-ui] .ask .btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
[data-ui] .ask .btns span { font-size: 14px; padding: 8px 12px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
[data-ui] .ask .btns span + span { background: rgba(244, 227, 255, 0.12); color: var(--ink); }
[data-ui] pre { margin: 0; font-size: 14px; line-height: 1.6; color: var(--lavande); white-space: pre; }
[data-ui] code { font-family: var(--font-code); }
[data-ui] .cite { display: grid; gap: 10px; }
[data-ui] .cite .doc { font-weight: 700; font-size: 16px; }
[data-ui] .cite .quote { font-size: 16px; line-height: 1.5; }
[data-ui] mark { background: var(--accent); color: var(--accent-ink); padding: 0 2px; }

/* ---------- méthode : un chapitre clair ---------- */
.method { margin-top: calc(var(--section) * 0.6); padding-block: 72px 96px; background: var(--lavande); color: var(--lavande-ink); }
.flow { width: 100%; height: auto; }
.flow-tall { display: none; }
.u-pale { fill: #9f86c2; }
.u-dim { fill: #cdb7e6; }
.u-mid { fill: var(--violet); }
.u-acc { fill: var(--bg); }
.m-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 40px; }
.m-steps li { display: grid; gap: 6px; max-width: 34ch; }
.m-steps b { font-size: var(--step-lead); letter-spacing: -0.02em; }

/* ---------- socle ---------- */
.socle { padding-top: var(--section); }
.bar { background: var(--surface); margin-bottom: 6px; border-radius: var(--radius); }
.bar summary {
  min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px;
  font-weight: 500; cursor: pointer; list-style: none; transition: background-color var(--t-hover) ease;
}
.bar summary::-webkit-details-marker, .tile summary::-webkit-details-marker { display: none; }
.bar summary:hover { background: #1c1838; }
/* le plus : deux barres pleines ; la verticale tourne pour devenir le moins */
.bar summary, .tile summary { position: relative; padding-right: 64px !important; }
.bar summary::before, .bar summary::after, .tile summary::before, .tile summary::after {
  content: ""; position: absolute; right: 24px; top: 50%; width: 16px; height: 3px; margin-top: -1.5px; background: currentColor;
}
.bar summary::after, .tile summary::after { transform: rotate(90deg); transition: transform 240ms var(--ease-out); }
.bar[open] summary::after, .tile[open] summary::after { transform: rotate(0deg); }
.bar ul { padding: 4px 18px 20px; display: grid; gap: 14px; }
.bar:not([open]) ul, .tile:not([open]) p { display: none; }
.bar li { display: flex; justify-content: space-between; gap: 16px; }
.bar li span + span { color: var(--muted); text-align: right; }

/* ---------- à propos ---------- */
.about { padding-top: var(--section); }
.a-facts { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 8px 40px; font-size: var(--step-small); margin-top: 8px; }
.a-facts dt { color: var(--muted); }
.a-text { font-size: var(--step-lead); line-height: 1.4; }
.a-word { font-size: var(--step-body); font-weight: 700; letter-spacing: -0.01em; margin: 48px 0 16px; }
.a-list { columns: 2; column-gap: 48px; font-size: var(--step-body); }
.a-list li { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; break-inside: avoid; }
.a-list li span + span { color: var(--muted); }

/* ---------- questions ---------- */
.faq { padding-top: var(--section); }
.faq-list { display: grid; gap: 8px; }
.tile { background: var(--surface); border-radius: var(--radius); scroll-margin-top: 24px; transition: background-color 240ms ease, color 240ms ease; }
.tile summary {
  min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px var(--pad);
  font-size: var(--step-lead); font-weight: 500; letter-spacing: -0.02em; cursor: pointer; list-style: none;
}
.tile:not([open]) summary:hover { background: #1c1838; }
.tile[open] { background: var(--accent); color: var(--accent-ink); }
.tile p { padding: 0 var(--pad) 24px; max-width: 52ch; font-size: var(--step-body); }

/* ---------- contact ---------- */
.contact {
  margin-top: var(--section); min-height: 82svh; background: var(--ink); color: var(--bg);
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr auto auto; padding: 40px var(--margin) 32px;
}
.c-sentence { grid-column: 1; font-size: var(--step-lead); font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; max-width: 24ch; }
.c-promise { grid-column: 2; justify-self: end; max-width: 30ch; font-size: var(--step-body); }
.c-mail {
  grid-column: 1 / -1; grid-row: 3; align-self: end; margin-bottom: 12vh;
  font-size: clamp(48px, 10.6vw, 190px); font-weight: 500; letter-spacing: -0.05em; line-height: 0.9; text-decoration: none; white-space: nowrap;
  transition: color var(--t-hover) ease;
}
.c-mail:hover { color: #9a2fc9; }
.br-phone { display: none; }
.c-left, .c-right { grid-row: 4; font-size: var(--step-small); }
.c-right { text-align: right; }

/* ---------- pied de page : le motif construit en grand ---------- */
.footer { padding: var(--edge); }
.motif { display: flex; align-items: flex-end; gap: 4px; height: 34svh; min-height: 220px; margin-top: var(--edge); }
.motif .b { flex: 1; height: var(--h); display: grid; place-items: center; }
.motif svg { width: 46%; height: auto; aspect-ratio: 152.74 / 131.4; }
.b-vj { background: var(--violet); fill: var(--accent); }
.b-jn { background: var(--accent); fill: var(--bg); }
.b-ab { background: var(--anthra); fill: var(--ink); }
.b-lv { background: var(--lavande); fill: var(--violet); }
.f-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 32px; padding: 56px var(--pad) 0; font-size: var(--step-small); }
.f-grid ul { grid-column: span 2; display: grid; gap: 8px; align-content: start; }
.f-grid address { grid-column: 9 / 13; font-style: normal; line-height: 1.6; }
.f-grid a { text-decoration: none; text-underline-offset: 0.2em; }
.f-grid a:hover { text-decoration: underline; }
.f-last { display: flex; justify-content: space-between; align-items: center; padding: 48px var(--pad) var(--pad); font-size: var(--step-small); }
.f-last .button { background: var(--surface); color: var(--ink); }
.f-last .button:hover { background: var(--ink); color: var(--bg); }

/* ---------- mouvement (le contenu reste visible sans JS) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* le titre et la démo restent visibles dès le premier rendu (LCP) : ils glissent sans fondu */
  .js .h-text > *, .js .nav { animation: slide 700ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms); }
  .js .h-facts { animation: rise 700ms var(--ease-out) both 400ms; }
  .js .stage { animation: stage 1100ms var(--ease-out) both 300ms; }
  .js .demo, .js .frag { animation: slide 900ms var(--ease-out) both 300ms; }
  .js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .ob .ob-mk { transform: translate(14%, -50%); transition: transform 1100ms var(--ease-out); }
  .js .ob.is-in .ob-mk { transform: translate(0, -50%); }
  .js .flow .u { opacity: 0; transition: opacity 500ms var(--ease-out); transition-delay: calc(var(--i, 0) * 5ms); }
  .js .m-fig.is-in .flow .u { opacity: 1; }
  .js .motif .b { transform: scaleY(0.2); transform-origin: bottom; transition: transform 900ms var(--ease-out); }
  .js .motif.is-in .b { transform: none; }
  .js .motif .b:nth-child(2) { transition-delay: 60ms; } .js .motif .b:nth-child(3) { transition-delay: 120ms; }
  .js .motif .b:nth-child(4) { transition-delay: 180ms; } .js .motif .b:nth-child(5) { transition-delay: 240ms; }
  .js .motif .b:nth-child(6) { transition-delay: 300ms; } .js .motif .b:nth-child(7) { transition-delay: 360ms; }
  .js .motif .b:nth-child(8) { transition-delay: 420ms; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes slide { from { transform: translateY(18px); } to { transform: none; } }
@keyframes stage { from { transform: translateY(18%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .p, .button { transition: none; }
  [data-ui] .demo-a .a { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- téléphone et tablette : une composition à part ---------- */
@media (max-width: 900px) {
  :root { --edge: 6px; --pad: 18px; }
  .hero { display: block; height: auto; min-height: 0; padding: 0; overflow: visible; }
  .nav { position: static; flex-wrap: wrap; gap: 14px 24px; padding: 20px var(--margin) 0; }
  .nav ul { gap: 18px; flex-wrap: wrap; }
  .logo { height: 36px; }
  .h-text { padding: 40px var(--margin) 0; }
  .h-text h1 { font-size: clamp(2.5rem, 10.5vw, 3.5rem); }
  .h-sub { margin: 20px 0 24px; }
  .h-facts { display: none; }
  .stage { position: relative; inset: auto; margin-top: 40px; padding: 56px 16px 0; clip-path: polygon(48px 0, 100% 0, 100% 100%, 0 100%, 0 83px); }
  .demo { width: 100%; min-height: 0; padding: 18px 18px 24px; }
  [data-ui] .demo-a .a p:first-child { font-size: 17px; }

  .intro { padding-block: 64px; }
  .cols { grid-template-columns: 1fr; gap: 28px; margin-top: 40px; }

  .features { grid-template-columns: 1fr; }
  .sec-head { grid-template-columns: 1fr; row-gap: 20px; margin-bottom: 32px; }
  .sec-head h2, .sec-side { grid-column: 1 / -1; }
  .split { grid-template-columns: 1fr; row-gap: 28px; }
  .split-head, .split-body { grid-column: 1 / -1; position: static; }
  .ob { grid-template-columns: 1fr; row-gap: 16px; min-height: 0; padding: 40px var(--margin) 128px; }
  .ob h3, .ob-body { grid-column: 1 / -1; }
  .ob-mk { top: auto; bottom: -14px; right: -22px; height: 112px; transform: none; }
  .js .ob .ob-mk, .js .ob.is-in .ob-mk { transform: none; }
  .panels { display: grid; grid-template-columns: 1fr 1fr; height: auto; min-height: 0; }
  .p { padding: 18px; }
  .p:hover { flex-grow: 0; }
  .p1, .p3 { grid-column: 1 / -1; } .p2, .p4 { min-height: 300px; } .p3 { order: 3; }
  [data-ui] .p-title { font-size: 20px; margin-bottom: 16px; }
  [data-ui] .run li { grid-template-columns: 1fr; gap: 2px; padding: 8px 0; }
  [data-ui] .run time { display: none; }
  [data-ui] pre { font-size: 13px; }

  .m-fig { display: grid; grid-template-columns: minmax(0, 1fr) 38vw; gap: 16px; align-items: stretch; }
  .flow-wide { display: none; }
  .flow-tall { display: block; }
  .m-steps { grid-template-columns: 1fr; grid-template-rows: repeat(3, 1fr); margin-top: 0; gap: 12px; }
  .m-steps b { font-size: var(--step-body); }
  .m-steps span { font-size: 15px; line-height: 1.4; }

  .a-list { columns: 1; }

  .tile summary { font-size: 18px; min-height: 64px; }
  .tile p { font-size: 16px; padding: 0 20px 20px; }

  .contact { min-height: 86svh; grid-template-columns: 1fr; grid-template-rows: auto auto 1fr auto auto auto; }
  .c-sentence { grid-row: 1; } .c-promise { grid-column: 1; grid-row: 2; justify-self: start; margin-top: 16px; }
  .c-mail { grid-row: 4; font-size: 15vw; white-space: normal; margin-bottom: 6vh; }
  .br-phone { display: inline; }
  .c-left { grid-row: 5; } .c-right { grid-row: 6; text-align: left; margin-top: 8px; }

  .motif { height: 22svh; min-height: 140px; }
  .f-grid { grid-template-columns: 1fr 1fr; padding-inline: var(--pad); }
  .f-grid ul { grid-column: span 1; }
  .f-grid address { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .cols { grid-template-columns: 1fr; }
}

/* =====================================================================
   Pages intérieures
   ===================================================================== */

/* ---------- thèmes : chaque offre garde la couleur de sa bande d'accueil ---------- */
body { --th: var(--violet); --th-ink: var(--violet-ink); --th-mk: var(--accent); }
.th-rag { --th: var(--violet); --th-ink: var(--violet-ink); --th-mk: var(--accent); }
.th-agents { --th: var(--accent); --th-ink: var(--accent-ink); --th-mk: var(--bg); }
.th-workflows { --th: var(--anthra); --th-ink: var(--anthra-ink); --th-mk: var(--ink); }
.th-resolution { --th: var(--lavande); --th-ink: var(--lavande-ink); --th-mk: var(--violet); }
.th-socle { --th: var(--ink); --th-ink: var(--bg); --th-mk: var(--violet); }
.th-local { --th: var(--lavande); --th-ink: var(--lavande-ink); --th-mk: var(--violet); }
.stage { background: var(--th); }
.th-workflows .stage { background: #2a2a27; }

/* liens sortants de l'accueil */
.ob-link { font-weight: 700; text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 2px; }
.ob-link:hover { text-decoration-thickness: 4px; }
.bar-link { display: inline-block; margin: 0 18px 20px; color: var(--lavande); font-weight: 600; text-underline-offset: 0.2em; }
.bar-link:hover { color: var(--ink); }
.bar:not([open]) .bar-link { display: none; }

/* ---------- haut de page intérieur ---------- */
.hero-inner { height: 88svh; min-height: 680px; }
.hero-inner .stage { top: 40%; }
.crumbs { position: absolute; left: var(--margin); bottom: 40px; font-size: var(--step-small); color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li:not(:last-child)::after { content: "›"; margin-left: 8px; }
.crumbs a { text-underline-offset: 0.2em; }
.crumbs a:hover { color: var(--ink); }
.crumbs [aria-current] { color: var(--ink); }
.hero-plain { position: relative; padding: 140px var(--margin) 72px; }
.hero-plain .nav { position: absolute; }
.hero-plain h1 { font-size: var(--step-hero); font-weight: 600; letter-spacing: -0.045em; line-height: 1; max-width: 16ch; }
.hero-plain .h-sub { margin-bottom: 0; }
.hero-plain .h-btn { margin-top: 28px; }

/* ---------- sections communes ---------- */
.sec { padding-top: var(--section); }
.sec .sec-side p { font-size: var(--step-lead); line-height: 1.4; letter-spacing: -0.01em; }
.uses { display: grid; }
.uses li { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 8px 28px; padding: 26px 28px; background: var(--surface); }
.uses li:nth-child(even) { background: var(--surface-2); }
.uses h3 { font-size: var(--step-lead); line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.field { margin-top: var(--section); padding-block: 88px 96px; background: var(--th); color: var(--th-ink); }
.th-socle .field, .th-workflows .field { background: var(--surface); color: var(--ink); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px 32px; }
.steps li { display: grid; gap: 10px; align-content: start; }
.steps h3 { font-size: var(--step-lead); line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.field .field-note { margin-top: 48px; max-width: 62ch; font-size: var(--step-body); font-weight: 600; }
.trust { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 48px; }
.trust li { display: grid; gap: 10px; align-content: start; }
.trust h3 { font-size: var(--step-lead); line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.panels-3 .p:nth-child(1) { --g: 4; } .panels-3 .p:nth-child(2) { --g: 3; } .panels-3 .p:nth-child(3) { --g: 3; }
.pa { background: var(--anthra); color: var(--anthra-ink); }
.pj { background: var(--accent); color: var(--accent-ink); }
.ps { background: var(--surface); color: var(--ink); }
.pv { background: var(--violet); color: var(--violet-ink); }
.pl { background: var(--lavande); color: var(--lavande-ink); }
.scenario { margin-top: 32px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.scenario p { grid-column: 1 / 8; font-size: var(--step-body); }
.related { padding-top: var(--section); }
.rel { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.rel a {
  position: relative; overflow: hidden; display: flex; align-items: flex-start; min-height: 200px; padding: 28px 28px 96px;
  font-size: var(--step-lead); font-weight: 700; letter-spacing: -0.02em; text-decoration: none; transition: padding-left 300ms var(--ease-out);
}
.rel a:hover { padding-left: 40px; }
.rel svg { position: absolute; right: -18px; bottom: -14px; height: 104px; width: auto; aspect-ratio: 152.74 / 131.4; transition: transform 400ms var(--ease-out); }
.rel a:hover svg { transform: translateX(-10px); }
.rel-rag { background: var(--violet); color: var(--violet-ink); fill: var(--accent); }
.rel-agents { background: var(--accent); color: var(--accent-ink); fill: var(--bg); }
.rel-workflows { background: var(--anthra); color: var(--anthra-ink); fill: var(--ink); }
.rel-resolution { background: var(--lavande); color: var(--lavande-ink); fill: var(--violet); }
.rel-socle { background: var(--surface); color: var(--ink); fill: var(--violet); }

/* texte long : pages légales */
.prose { max-width: 70ch; }
.prose h2 { font-size: var(--step-lead); letter-spacing: -0.02em; line-height: 1.2; margin: 48px 0 12px; }
.prose p, .prose ul { margin-bottom: 14px; }
.prose ul { list-style: disc; padding-left: 1.2em; }
.prose a { text-underline-offset: 0.2em; }

/* formulaire de contact */
.form { display: grid; gap: 18px; max-width: 640px; color: var(--th-ink); }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: var(--step-small); }
.form input, .form select, .form textarea {
  width: 100%; min-height: 3.25rem; padding: 0.8rem 0.9rem; border: 0; border-radius: var(--radius); font: inherit; font-weight: 400;
  background: var(--bg); color: var(--ink);
}
.form textarea { min-height: 9rem; resize: vertical; }
.form input:focus-visible, .form select:focus-visible, .form textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.form .hint { font-weight: 400; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form .button { justify-self: start; background: var(--bg); color: var(--ink); }
.form .button:hover { background: var(--accent); color: var(--accent-ink); }
.stage-form { padding: 56px 56px 0; overflow: auto; }

/* ---------- boîte à outils des extraits d'interface (data-ui) ---------- */
.frag { width: min(640px, 100%); min-height: calc(100% + 2px); background: var(--bg); color: var(--ink); border-radius: 10px 10px 0 0; padding: 24px 24px 32px; }
[data-ui] .inbox li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid rgba(244, 227, 255, 0.14); }
[data-ui] .inbox b { font-size: 15px; }
[data-ui] .inbox span { font-size: 14px; color: var(--lavande); }
[data-ui] .chat { display: grid; gap: 12px; }
[data-ui] .chat .q { justify-self: end; max-width: 80%; background: var(--lavande); color: var(--lavande-ink); padding: 10px 14px; border-radius: 10px 10px 2px 10px; font-size: 15px; }
[data-ui] .chat .r { max-width: 92%; background: var(--surface); padding: 14px 16px; border-radius: 10px 10px 10px 2px; font-size: 15px; line-height: 1.5; }
[data-ui] .chat .src { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; }
[data-ui] .chat .src span { background: rgba(196, 93, 240, 0.25); color: var(--lavande); padding: 2px 8px; border-radius: 4px; }
[data-ui] .ui-table { width: 100%; border-collapse: collapse; font-size: 14px; }
[data-ui] .ui-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 8px 10px 8px 0; border-bottom: 1px solid rgba(244, 227, 255, 0.16); }
[data-ui] .ui-table td { padding: 10px 10px 10px 0; border-bottom: 1px solid rgba(244, 227, 255, 0.08); vertical-align: top; }
[data-ui] .tag { display: inline-block; font-size: 13px; padding: 2px 8px; border-radius: 4px; background: rgba(244, 227, 255, 0.12); white-space: nowrap; }
[data-ui] .tag-hi { background: #ff6b6b; color: #1a0505; }
[data-ui] .tag-mid { background: var(--accent); color: var(--accent-ink); }
[data-ui] .tag-ok { background: #5ee0a0; color: #03140b; }
[data-ui] .gauge { display: grid; gap: 6px; }
[data-ui] .gauge div { display: grid; grid-template-columns: 1fr auto; font-size: 14px; }
[data-ui] .gauge i { display: block; grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--surface); position: relative; overflow: hidden; }
[data-ui] .gauge i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--v); background: var(--violet); border-radius: 4px; }

@media (max-width: 900px) {
  .hero-inner { height: auto; min-height: 0; }
  .crumbs { position: static; padding: 24px var(--margin) 0; }
  .hero-plain { padding: 0 0 48px; }
  .hero-plain .nav { position: static; }
  .hero-plain > :not(.nav) { margin-inline: var(--margin); }
  .hero-plain h1 { margin-top: 40px; font-size: clamp(2.5rem, 10.5vw, 3.5rem); }
  .uses li { grid-template-columns: 1fr; padding: 22px var(--margin); }
  .trust { grid-template-columns: 1fr; gap: 28px; }
  .scenario p { grid-column: 1 / -1; }
  .frag { min-height: 0; padding: 18px; }
  .panels-3 { grid-template-columns: 1fr; }
  .panels-3 .p { grid-column: 1 / -1 !important; min-height: 0; }
  .rel a { min-height: 120px; padding: 22px 96px 22px 22px; }
  .rel svg { height: 80px; }
  .form-row { grid-template-columns: 1fr; }
  .stage-form { padding: 40px 16px 32px; }
}
.def h2 { font-size: var(--step-head); margin-bottom: 32px; }
.def-text { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 48px; }
.def-text p { font-size: var(--step-lead); line-height: 1.4; letter-spacing: -0.01em; }
@media (max-width: 900px) { .def-text { grid-template-columns: 1fr; } }
/* le motif officiel 2 × 2 en grand, à droite du titre de la page à propos */
.hero-motif { position: absolute; right: var(--margin); top: 120px; width: min(36vw, 520px); aspect-ratio: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.hero-motif .b { display: grid; place-items: center; }
.hero-motif svg { width: 50%; height: auto; aspect-ratio: 152.74 / 131.4; }
.hero-plain:has(.hero-motif) { min-height: calc(min(36vw, 520px) + 200px); }
@media (max-width: 900px) { .hero-motif { position: static; width: auto; margin-top: 40px; } }
/* scène sans extrait : le chevron de l'offre, en grand */
.stage-plain { display: grid; place-items: center start; padding: 0 0 0 12%; }
.stage-mk { height: 78%; width: auto; aspect-ratio: 152.74 / 131.4; fill: var(--th-mk); }
@media (max-width: 900px) { .stage-plain { min-height: 260px; padding-left: 20%; } .stage-mk { height: 200px; } }
.form-status { font-weight: 600; padding: 14px 16px; background: var(--bg); color: var(--ink); }
.form-status[data-kind="ok"] { background: var(--accent); color: var(--accent-ink); }
.form-status a { color: inherit; }
.form button:disabled { opacity: 0.6; cursor: wait; }
