/* ── RADAR — MAQUETTES ─────────────────────────────────────────
   Radar est passé à la charte « Le Déclic » le 31/10/2026 (JobAi/frontend/src/index.css) : les maquettes
   reprennent les jetons du site et suivent son thème, comme l'appli. Seuls les sémantiques hi / md
   manquent à style.css. */
:root {
  --ja-hi: #E3769B;
  --ja-md: #DD9C3D;
  --ja-sel: color-mix(in oklab, var(--pri) 16%, transparent); /* sélection (--selBg) */
}
[data-theme="light"] {
  --ja-hi: #BE3D70;
  --ja-md: #B96404;
}

/* Coupe 60° des maquettes : même construction que les COINS COUPÉS de style.css (fond en ::before,
   trait de 1 px en ::after), locale à cette page. */
.ja-cut {
  --c: 9px;
  --v: calc(var(--c) * 1.732);
  --cut: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% var(--v), 100% calc(100% - var(--v)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--v)), 0 var(--v));
  --ring: polygon(evenodd, var(--c) 0, calc(100% - var(--c)) 0, 100% var(--v), 100% calc(100% - var(--v)), calc(100% - var(--c)) 100%, var(--c) 100%, 0 calc(100% - var(--v)), 0 var(--v), var(--c) 0,
    calc(var(--c) + .58px) 1px, calc(100% - var(--c) - .58px) 1px, calc(100% - 1px) calc(var(--v) + .27px), calc(100% - 1px) calc(100% - var(--v) - .27px), calc(100% - var(--c) - .58px) calc(100% - 1px), calc(var(--c) + .58px) calc(100% - 1px), 1px calc(100% - var(--v) - .27px), 1px calc(var(--v) + .27px), calc(var(--c) + .58px) 1px);
  --fill: transparent;
  --edge: transparent;
  --rappel: transparent;
  position: relative;
  isolation: isolate;
}
.ja-cut::before, .ja-cut::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: var(--z-fond);
  pointer-events: none;
  transition: background-color var(--d-base);
}
.ja-cut::before { clip-path: var(--cut); background-color: var(--fill); }
.ja-cut::after { clip-path: var(--ring); background-color: var(--edge);
  background-image: linear-gradient(var(--rappel), var(--rappel)), linear-gradient(var(--rappel), var(--rappel));
  background-position: top left, bottom right; background-size: calc(var(--c) + 1px) calc(var(--v) + 1px); background-repeat: no-repeat; }

/* badge de la charte (Retenue, Écartée, Inchangé) : fond à 20 %, texte mêlé à 30 % de --fg */
.ja-badge { --c: 2.7px; display: inline-block; flex-shrink: 0; font-size: var(--t-xs); font-weight: 500; line-height: 1.5; padding: 2px 9px; white-space: nowrap; }
.ja-badge.neu { --fill: var(--bg-elevated); color: var(--fg-muted); }
.ja-badge.lo { --fill: color-mix(in oklab, var(--lo) 20%, transparent); color: color-mix(in oklab, var(--lo), var(--fg) 30%); }
.ja-badge.hi { --fill: color-mix(in oklab, var(--ja-hi) 20%, transparent); color: color-mix(in oklab, var(--ja-hi), var(--fg) 30%); }

/* icônes de la charte (sprite #ja-i-*) ; les tracés sont fins : un trait les épaissit aux petites tailles */
.ja-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ja-ic { display: block; width: 1em; height: 1em; fill: currentColor; }
.pipe-connector .ja-ic { width: 20px; height: 20px; }
.n8n-node-check .ja-ic { width: 12px; height: 12px; margin: 1px auto 0; stroke: currentColor; stroke-width: 1.5; }
.n8n-status .t-ok .ja-ic { display: inline-block; vertical-align: -2px; width: 14px; height: 14px; stroke: currentColor; stroke-width: .8; }

/* ── KEYFRAMES ───────────────────────────────────────────────── */
/* entrée d'une ligne de liste (.stagger de la charte : 300 ms, Nette, 10 px) */
@keyframes ja-rise { from { opacity: 0; transform: translateY(10px); } }

/* ── PAGE HERO ───────────────────────────────────────────────── */
.project-hero {
  padding: var(--section-pad) var(--col-gap);
  max-width: var(--max-w);
  margin-inline: auto;
}
.project-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: var(--t-sm);
  color: var(--fg-muted);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color var(--d-fast);
  font-weight: 500;
}
@media (hover: hover) { .project-hero__back:hover { color: var(--accent-text); } }

.project-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.project-hero__eyebrow .mono-label + .mono-label { color: var(--fg-muted); }
.project-hero__title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}
.project-hero__title em {
  font-style: normal; /* Déclic n'a pas d'italique : la lettre reste droite, seule la couleur la distingue */
  color: var(--pri); /* charte-ok : très grand titre */
}
.project-hero__desc {
  max-width: 58ch;
  color: var(--fg-muted);
  line-height: 1.75;
  margin-bottom: 2rem;
  font-size: 1.05rem;
}
.project-hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.ja-tag {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--fg-muted);
  padding: 2px 8px;
  font-weight: 500;
}

/* ── PROBLEM QUOTE ───────────────────────────────────────────── */
.project-quote {
  padding: 0 var(--col-gap) var(--section-pad);
  max-width: var(--max-w);
  margin-inline: auto;
}
/* Deux équerres coupées aux coins opposés d'un cadre fictif : bras vertical, biais à 60°, bras horizontal,
   bouts coupés parallèlement au biais. --c / --v : biais ; --av : bras vertical ; bras horizontal allongé
   pour que l'équerre tienne dans un carré. Bas droite = même forme tournée à 180°. */
.project-quote__inner {
  --c: 14px;
  --v: calc(var(--c) * 1.732);
  --av: 14px;
  --ah: calc(var(--av) + var(--v) - var(--c));
  --t: 6px;
  position: relative;
  padding: calc(var(--v) + var(--av) * .5 + .75rem) 1.75rem;
  max-width: 62ch;
}
.project-quote__inner::before,
.project-quote__inner::after {
  content: '';
  position: absolute;
  width: calc(var(--c) + var(--ah));
  height: calc(var(--v) + var(--av));
  background: var(--pri);
  clip-path: polygon(0 100%, 0 var(--v), var(--c) 0, 100% 0, calc(100% - var(--t) * .577) var(--t),
    calc(var(--c) + var(--t) * .577) var(--t), var(--t) calc(var(--v) + var(--t) * .268), var(--t) calc(100% - var(--t) * 1.732));
}
.project-quote__inner::before { left: 0; top: 0; }
.project-quote__inner::after { right: 0; bottom: 0; transform: rotate(180deg); }
.project-quote__inner p {
  color: var(--fg-muted);
  line-height: 1.8;
  font-size: 1.05rem;
}

/* ── MAQUETTES D'APPAREILS (conteneur) ──────────────────────── */
.ja-devices-wrap {
  padding: 0 var(--col-gap) var(--section-pad);
  max-width: var(--max-w);
  margin-inline: auto;
}

/* ── FEATURE SECTIONS ────────────────────────────────────────── */
.project-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding: clamp(3rem, 7vw, 6rem) var(--col-gap);
  max-width: var(--max-w);
  margin-inline: auto;
  border-top: var(--border);
}
.project-feature.reverse { direction: rtl; }
.project-feature.reverse > * { direction: ltr; }

.feature-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  margin-top: 0.5rem;
}
.feature-desc {
  color: var(--fg-muted);
  line-height: 1.75;
  font-size: 0.95rem;
}
.feature-desc code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-elevated);
  border: var(--border);
  padding: 0.05em 0.35em;
  color: var(--fg);
}
.feature-demo {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ── CADRE DES MAQUETTES (carte de la charte) ──────────────────── */
.ja-frame {
  --fill: var(--bg-surface);
  --edge: var(--stroke);
  --rappel: var(--logo-acc);
  width: 100%;
  max-width: 420px;
  padding: 20px;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  line-height: 1.5;
}

/* ── FEATURE 01 — PIPELINE DE SOURCING ────────────────────────── */
.pipe-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.pipe-node {
  --c: 4.5px;
  --fill: var(--bg-elevated);
  --edge: var(--stroke);
  flex: 1;
  min-width: 96px;
  text-align: center;
  padding: 12px 8px;
  font-weight: 500;
  color: var(--fg-muted);
  transition: color var(--d-base);
}
.pipe-node.live.on {
  --fill: var(--ja-sel);
  --edge: var(--pri);
  color: var(--fg);
}
.pipe-node.dead {
  --fill: transparent;
  text-decoration: line-through;
}
.pipe-node.dead.flash {
  --edge: var(--ja-hi);
  color: var(--fg);
}
/* bloc en ligne : le barré du nom de la source ne se propage pas à l'étiquette */
.pipe-dead-tag {
  display: inline-block;
  width: 100%;
  margin-top: 4px;
  text-decoration: none;
  color: color-mix(in oklab, var(--ja-hi), var(--fg) 30%);
}
.pipe-connector {
  display: flex;
  justify-content: center;
  padding: 12px 0;
  color: var(--fg-muted);
  font-size: var(--t-sm);
}
/* compteur : tuile de la charte, comme StatTile de l'appli (libellé puis gros chiffre) */
.pipe-hub {
  --fill: var(--bg-elevated);
  --edge: var(--stroke);
  width: fit-content;
  min-width: 160px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 16px;
}
.pipe-hub.active { --edge: var(--pri); }
.pipe-hub-label { color: var(--fg-muted); }
.pipe-hub-count {
  font-family: var(--font-display);
  font-size: var(--t-2xl);
  font-weight: 600;
  line-height: 1.15;
  color: var(--accent-text);
}
.pipe-dead-row {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-c);
  display: flex;
  gap: 8px;
}

/* ── FEATURE 02 — FILTRE GRATUIT ───────────────────────────────── */
.filter-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 246px;
}
.filter-row {
  --c: 4.5px;
  --fill: var(--bg-elevated);
  --edge: var(--stroke);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  visibility: hidden;
}
.filter-row.show { visibility: visible; animation: ja-rise 300ms cubic-bezier(.6, 0, .1, 1) backwards; }
.filter-row-title { flex: 1; color: var(--fg-muted); line-height: 1.3; transition: color var(--d-base); }
.filter-row.evaluated .filter-row-title { color: var(--fg); }
.filter-row.reject .filter-row-title { color: var(--fg-muted); text-decoration: line-through; }
.filter-row-badge:empty { display: none; }
.filter-tally {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-c);
  color: var(--fg-muted);
  display: flex;
  justify-content: space-between;
}
.filter-tally b { color: var(--fg); font-weight: 600; }

/* ── FEATURE 03 — ORCHESTRATEUR (GRAPHE DE NODES) ─────────────── */
.n8n-canvas {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
}
.n8n-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  width: 58px;
}
.n8n-node-box {
  --c: 5.4px;
  --fill: var(--bg-elevated);
  --edge: var(--stroke);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  transition: color var(--d-base);
}
.n8n-node-box svg { width: 18px; height: 18px; }
.n8n-node.active .n8n-node-box {
  --fill: var(--ja-sel);
  --edge: var(--pri);
  color: var(--fg);
}
.n8n-node.done .n8n-node-box {
  --edge: var(--lo);
  color: var(--lo-text);
}
/* pastille « fait » : hexagone plein */
.n8n-node-check {
  position: absolute;
  top: -6px;
  right: -7px;
  width: 16px;
  height: 14px;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: var(--lo);
  color: var(--bg);
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity var(--d-base), transform var(--d-base);
}
.n8n-node.done .n8n-node-check { opacity: 1; transform: scale(1); }
.n8n-node-label {
  text-align: center;
  line-height: 1.25;
  color: var(--fg-muted);
  transition: color var(--d-base);
}
.n8n-node.active .n8n-node-label,
.n8n-node.done .n8n-node-label { color: var(--fg); }

.n8n-connector {
  position: relative;
  flex: 1 1 auto;
  min-width: 6px;
  max-width: 60px;
  height: 40px;
  display: flex;
  align-items: center;
}
.n8n-connector::before {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  background: var(--border-hi-c);
  transition: background-color var(--d-fast);
}
.n8n-connector.flow::before { background: var(--pri); }
/* point qui circule : losange coupé à 60° */
.n8n-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 7px;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
  background: var(--logo-acc);
  transform: translate(-50%, -50%);
  opacity: 0;
}
.n8n-connector.flow .n8n-dot {
  animation: n8n-flow 550ms cubic-bezier(.6, 0, .1, 1) forwards;
}
@keyframes n8n-flow {
  0%   { left: 0%; opacity: 1; }
  100% { left: 100%; opacity: 1; }
}

.n8n-status-wrap {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-c);
  min-height: 38px;
}
.n8n-status { color: var(--fg); }
.n8n-status .t-ok { color: var(--lo-text); margin-left: 4px; font-weight: 700; }

/* ── FEATURE 04 — DASHBOARD (StatTile + BarList de l'appli) ───── */
.dash-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
.dash-tile {
  --fill: var(--bg-elevated);
  --edge: var(--stroke);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 12px;
}
.dash-tile-label { color: var(--fg-muted); line-height: 1.3; }
.dash-tile-value {
  font-family: var(--font-display);
  font-size: var(--t-2xl);
  font-weight: 600;
  line-height: 1.15;
  color: var(--fg);
}
.dash-tile:first-child .dash-tile-value { color: var(--accent-text); }
.dash-bars-title { margin-bottom: 12px; font-weight: 600; }
.dash-bars { display: flex; flex-direction: column; gap: 12px; }
.dash-bar-row { display: flex; align-items: center; gap: 12px; }
.dash-bar-label { width: 52px; flex-shrink: 0; color: var(--fg-muted); }
.dash-bar-track {
  --c: 2.7px;
  --v: calc(var(--c) * 1.732);
  flex: 1;
  height: 8px;
  background: var(--bg-elevated);
  clip-path: polygon(var(--c) 0, calc(100% - var(--c)) 0, 100% 50%, calc(100% - var(--c)) 100%, var(--c) 100%, 0 50%);
}
.dash-bar-fill {
  height: 100%;
  width: 0%;
  transition: width var(--d-slow);
}
.dash-bar-fill.hi { background: var(--ja-hi); }
.dash-bar-fill.md { background: var(--ja-md); }
.dash-bar-fill.lo { background: var(--lo); }
.dash-bar-val { width: 24px; text-align: right; font-weight: 600; flex-shrink: 0; }

/* ── FEATURE 05 — GÉNÉRATION DE DOCUMENTS ─────────────────────── */
.doc-frame { padding: 0; }
.doc-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-c);
}
.doc-target { color: var(--accent-text); font-weight: 500; }
.doc-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.doc-locked {
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
}
/* zone réécrite : ligne de liste de la charte, sélectionnée pendant l'écriture */
.doc-zone {
  --c: 4.5px;
  --edge: var(--border-c);
  padding: 8px 12px;
}
.doc-zone.active {
  --fill: var(--ja-sel);
  --edge: var(--pri);
}
.doc-zone-label {
  display: block;
  color: var(--fg-muted);
  margin-bottom: 2px;
  transition: color var(--d-base);
}
.doc-zone.active .doc-zone-label { color: var(--accent-text); }
.doc-zone-text {
  color: var(--fg);
  line-height: 1.5;
}

/* moins d'animations demandé : les démos s'affichent directement dans leur état final (radar.js) */
@media (prefers-reduced-motion: reduce) {
  .filter-row.show, .n8n-connector.flow .n8n-dot { animation: none; }
  .ja-cut::before, .ja-cut::after, .dash-bar-fill, .n8n-node-check { transition: none; }
}

/* ── STACK TABLE ─────────────────────────────────────────────── */
.ja-stack-section {
  padding: var(--section-pad) var(--col-gap);
  max-width: var(--max-w);
  margin-inline: auto;
  border-top: var(--border);
}
.ja-stack-section .stack-grid { margin-top: 2rem; }
/* deux paragraphes dans un même bloc, et texte du bilan */
.feature-desc + .feature-desc { margin-top: 1rem; }
.ja-bilan__text { max-width: 68ch; margin-top: 2rem; }
/* bloc « Stack & outils » de l'accueil, plus le rôle de chaque couche */
.stack-group__role {
  font-size: var(--t-sm);
  color: var(--fg-muted);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}
.ja-stack-section .stack-group li { color: var(--fg); }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 839.98px) {
  .project-feature {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .project-feature.reverse { direction: ltr; }
  .feature-demo { order: 1; }
  .ja-frame { max-width: 100%; }
}
