/* Palette 2.1 : surfaces calmes et accents réservés aux actions. */
:root {
  --ivory: #f5f2eb;
  --paper: #fcfbf7;
  --graphite: #242b33;
  --bg: var(--ivory);
  --surface: var(--paper);
  --ink: var(--graphite);
  --muted: #53606d;
  --line: #cbd0d2;
  --cobalt: #405da2;
  --blue: #405da2;
  --coral: #d49b87;
  --lime: #bbc797;
  --warm: #963b2d;
  --blue-surface: #e6eaf0;
  --clay-surface: #eedfd6;
  --sage-surface: #e4e9da;
  --success: #396044;
  --control-line: #85909a;
}

body { background: var(--ivory); color: var(--graphite); }
::selection { background: var(--cobalt); color: #fff; }
.skip { background: var(--cobalt); color: #fff; }
:focus-visible { outline-color: var(--graphite); }

.site-header, .sector-menu, .nav.open { background: var(--ivory); color: var(--graphite); }
.site-header, .sector-menu, .sector-menu a + a { border-color: var(--line); }
.brand svg { color: var(--cobalt); }
.tag { color: var(--muted); border-color: #a7afb5; }
.tag.blue { color: var(--cobalt); border-color: #8596be; }
.light .tag.blue { color: var(--cobalt); border-color: #8596be; }
.tag.warm { color: var(--warm); border-color: #be8e83; }
.btn:not(.primary):not(.text), .menu-toggle { color: var(--graphite); border-color: var(--control-line); }
.btn.primary,
.hero-v2 .btn.primary,
.page-hero .btn.primary,
.skills-chapter .btn.primary,
.light .btn.primary,
.supplier .btn.primary {
  background: var(--cobalt);
  color: #fff;
  border-color: var(--cobalt);
}
.btn.primary:hover,
.supplier .btn.primary:hover { background: #334c89; border-color: #334c89; color: #fff; }
.btn:not(.primary):hover { border-color: var(--cobalt); }
.btn.text, .muted, .eyebrow { color: var(--muted); }
.link, .blue, .prose a, .prose .link { color: var(--cobalt); }

/* Les grandes surfaces colorées deviennent des fonds légèrement teintés. */
.hero-v2, .light, .page-hero, .intro-chapter, .sectors-chapter, .courses-chapter {
  background: var(--ivory);
  color: var(--graphite);
}
.hero-v2:before { background: var(--clay-surface); }
.hero-sculpture:before { background: var(--clay-surface); }
.hero-editorial .eyebrow,
.hero-intro,
.hero-availability,
.hero-metiers > .mono,
.hero-sculpture figcaption,
.stage-hero :is(.stage-index, .stage-coordinate) { color: var(--muted); }
.hero-metiers { border-color: var(--line); }
.hero-editorial h1 em { color: var(--cobalt); }
.light :is(.eyebrow, .muted, .section-head > p, .need p),
.sector-row p,
.sector-num,
.page-hero :is(.lead, .eyebrow),
.sector-hero:is([data-sector=formation], [data-sector=textile]) :is(.lead, .eyebrow) {
  color: var(--muted);
}
.light .link, .page-hero .link,
.sector-hero:is([data-sector=formation], [data-sector=textile]) .link { color: var(--cobalt); }
.needs, .need + .need, .sector-list, .sector-row { border-color: var(--line); }
.sector-row:nth-child(2) { border-left-color: #b8806c; }
.sector-row:nth-child(4) { border-left-color: var(--cobalt); }
.sector-row:hover h3 { color: var(--cobalt); }
.sector-hero[data-sector=formation],
.sector-hero[data-sector=textile] { background: var(--clay-surface); }
.sector-hero[data-sector=comptabilite] { background: var(--sage-surface); }
.sector-hero[data-sector=immobilier] { background: var(--blue-surface); }
.skills-chapter { background: var(--sage-surface); color: var(--graphite); }
.skills-layout :is(p, .eyebrow, .demo-note) { color: var(--muted); }
.skills-layout .eyebrow:before { background: var(--success); }
.skills-layout h2 em, .skills-layout .link { color: var(--cobalt); }
.skills-list li { border-color: #bac3ae; }
.stage-skills :is(.stage-index, .stage-coordinate) { color: var(--muted); }
.cta-section { background: var(--clay-surface); color: var(--graphite); }
.cta-section .link { color: var(--cobalt); }

/* L’anatomie reste sombre pour rendre les pièces et le filaire lisibles. */
.agent-chapter, .site-footer {
  --bg: #242b33;
  --surface: #303a45;
  --ink: #f5f2eb;
  --muted: #bdc6cf;
  --line: #56616d;
  --blue: #aec0ed;
  --warm: #e0b7a7;
  background: var(--graphite);
  color: var(--ivory);
}
.agent-copy h2 em { color: var(--coral); }
.agent-steps, .agent-steps li, .agent-caption { border-color: #57616a; }
.agent-steps li, .agent-steps small { color: #bdc6cf; }
.agent-steps li.active, .agent-caption { color: #cbd6af; }
.stage-agent { background: #2a333e; }
.stage-agent :is(.stage-index, .stage-coordinate) { color: #bdc6cf; }
.agent-chapter .link, .site-footer .link { color: #aec0ed; }
.agent-chapter :focus-visible, .site-footer :focus-visible { outline-color: var(--ivory); }
.site-footer .brand svg { color: var(--coral); }
.footer-grid li a:hover { color: #cbd6af; }
.footer-bottom { border-color: #56616d; }

/* Le Lab ne remplit plus l’écran d’un bleu saturé. */
.lab-chapter { background: var(--blue-surface); color: var(--graphite); }
.lab-heading h2 em { color: var(--cobalt); }
.lab-heading .eyebrow, .lab-heading > p, .lab-disclaimer { color: var(--muted); }
.lab-heading .eyebrow:before { background: var(--cobalt); }
.lab-visual { background: #dce2eb; border-color: #a1afc2; }
.stage-lab :is(.stage-index, .stage-coordinate) { color: var(--muted); }
.lab-current .mono { color: var(--cobalt); }
.lab-current .btn { color: var(--graphite); border-color: var(--control-line); }
.lab-current .btn.primary { color: #fff; border-color: var(--cobalt); }
.lab-choice, .lab-choice:last-child, .lab-disclaimer { border-color: #a6b1bf; }
.lab-choice button, .lab-choice button[aria-pressed=true] { color: var(--graphite); }
.lab-choice button small { color: var(--muted); }
.lab-choice button[aria-pressed=true] strong { color: var(--cobalt); }
.lab-choice button[aria-pressed=true] > span:nth-child(3) {
  background: var(--cobalt);
  color: #fff;
}
.lab-choice > a { color: var(--cobalt); }
.lab-choice > a:hover { color: #334c89; text-decoration-color: #334c89; }
.lab-chapter :focus-visible { outline-color: var(--graphite); }

/* Cartes, textes et formulaires des pages intérieures. */
.course-card { background: var(--paper); color: var(--graphite); border: 1px solid var(--line); }
.course-card:nth-child(3n+2) { background: var(--clay-surface); }
.course-card:nth-child(3n+3) { background: var(--sage-surface); }
.course-card :is(p, .mono.muted),
.course-card:nth-child(3n+2) :is(p, .mono.muted) { color: var(--muted); }
.course-card .tag { color: var(--muted); border-color: #89939a; }
.course-card .card-foot { border-color: #b8c1c5; }
.course-card .link { color: var(--cobalt); }
.course-card:hover { border: 1px solid #93a0ad; }
.course-card:focus-within { outline-color: var(--cobalt); }
.prose p, .prose li, .light .prose p, .light .prose li { color: var(--muted); }
.light .formula :is(ul, p) { color: var(--muted); }
.info-panel, .filter-bar, .sector-example, .training-example {
  background: #ecefed;
  color: var(--graphite);
  border-color: #bcc5c8;
}
.result-count { color: var(--muted); }
.field input, .field select, .field textarea,
.info-panel .field input, .info-panel .field select, .info-panel .field textarea {
  background: var(--paper);
  color: var(--graphite);
  border-color: var(--control-line);
  color-scheme: light;
}
.field input::placeholder, .field textarea::placeholder { color: #69737d; opacity: 1; }
.field input:invalid:not(:placeholder-shown) { border-color: var(--warm); }
.notice { color: var(--muted); background: var(--clay-surface); border-left-color: #a16957; }
.notice strong { color: var(--graphite); }
.form-message { color: var(--warm); }
.inline-error { color: var(--warm); background: #f1e2dd; border-color: #a16957; }
.download-file-link { color: var(--cobalt); }
.competence-scene { background: #e9e8e0; color: var(--graphite); border-color: #bac1bd; }
.competence-line span { background: var(--paper); border-color: #bdc6c8; }
.competence-line span:last-child { background: var(--blue-surface); }
.competence-scene .muted, .competence-line small { color: var(--muted); }

/* Chaque surface du cockpit est claire, y compris les états et les sources. */
.demo-shell { background: var(--paper); color: var(--graphite); border-color: #9daab4; }
.demo-heading { background: #dce2eb; border-color: #a1afc2; }
.demo-heading h2 { color: var(--graphite); }
.demo-heading .tag { color: var(--muted); border-color: #8996a4; }
.demo-toolbar, .demo-controls, .textile-links, .trace {
  background: #edf0ed;
  color: var(--graphite);
  border-color: #b8c3ca;
}
.demo-output { background: var(--paper); color: var(--graphite); }
.demo-tabs { border-color: #a6b1bb; }
.demo-tabs button { color: var(--muted); }
.demo-tabs button[aria-selected=true] { color: var(--cobalt); border-bottom-color: var(--cobalt); }
.decision { background: var(--blue-surface); color: var(--graphite); border-left-color: var(--cobalt); }
.decision.warning { background: var(--clay-surface); border-left-color: #a16957; }
.supplier { background: #eef0eb; color: var(--graphite); border-color: #a6b3b2; }
.supplier.recommended { background: var(--sage-surface); border-color: #58714d; }
.supplier .tag.blue { color: var(--success); border-color: #71866b; }
.metric { background: #ecefed; color: var(--graphite); border-color: #b4bfc4; }
.metric small { color: var(--muted); }
.metric .value { color: var(--cobalt); }
.breakdown-bar { background: #d5dcd8; }
.breakdown-bar > span { background: #7288b3; }
.draft-box { background: #faf8f3; color: var(--graphite); border-color: #a6b1bb; }
.doc-check { background: #eef0eb; color: var(--graphite); border-color: #a6b3b2; }
.doc-check.problem { background: #f1e2dd; border-color: #b98270; }
.timeline > div { background: #ecefed; color: var(--graphite); border-color: #b4bfc4; }
.timeline > div .blue { color: var(--cobalt); }
.textile-link > div { background: var(--paper); color: var(--graphite); border-color: #a6b1bb; }
.relation-path { color: var(--cobalt); }
.trace { color: var(--muted); }
.trace .complete { color: var(--success); }
.source-citation { color: var(--graphite); border-color: #a6b1bb; }
.source-citation[open] { background: #edf0ed; }
.source-citation strong { color: var(--cobalt); }
.source-citation blockquote { color: var(--muted); }
.property, .comparison th, .comparison td { border-color: #aab5bd; }
.comparison th { background: #e6eae7; color: var(--graphite); }
.comparison td { color: var(--muted); }

/* Les représentations HTML gardées dans les démonstrations suivent la même palette. */
.scene, .lab-item, .lab-item.featured {
  background: #edf0ed;
  color: var(--graphite);
  border-color: #b4bfc4;
  box-shadow: none;
}
.scene-caption { color: var(--muted); }
.input-doc, .mini-result { background: var(--paper); border-color: #b4bfc4; }
.workflow-step { background: var(--paper); border-color: #b4bfc4; }
.workflow-step.active { background: var(--blue-surface); border-color: #8194b9; }
.workflow-step:last-child { border-color: #a16957; }
.result-doc { background: var(--paper); color: var(--graphite); box-shadow: 0 12px 30px #242b3312; }
.result-doc .mono { color: var(--cobalt); }
.result-doc .result-mark { color: var(--muted); border-color: var(--line); }
.orbit-node { background: var(--paper); color: var(--graphite); border-color: #b4bfc4; box-shadow: none; }
.orbit-lines path { stroke: #7288b3; }
.orbit-symbol { border-color: #8194b9; box-shadow: none; }
.status i { background: #a16957; box-shadow: none; }
.preview-banner { background: #dce2eb; color: var(--graphite); }

@media (max-width: 1100px) {
  .nav, .nav.open { background: var(--ivory); color: var(--graphite); border-bottom-color: var(--line); }
}
@media print {
  body, .light, .page-hero, .skills-chapter, .course-card, .info-panel { background: #fff; color: #000; }
  .prose p, .prose li, .muted, .page-hero .lead { color: #333; }
}

/* Lisibilité, repli des colonnes et commandes tactiles. */
.hero-composition,.agent-layout,.lab-showcase,.skills-layout,.sector-hero-layout,.two-col,.demo-layout{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.hero-composition{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)}
.demo-layout{grid-template-columns:260px minmax(0,1fr)}
.hero-editorial{container-type:inline-size}.hero-editorial h1{font-size:clamp(42px,15.4cqw,116px);margin-left:0}
.hero-composition>* , .agent-layout>* , .lab-showcase>* , .skills-layout>* , .two-col>* , .demo-layout>* , .course-grid>*{min-width:0}
.hero-paths{flex-wrap:wrap;gap:8px 24px}.hero-availability{font-size:12px;line-height:1.6}.hero-metiers>.mono{font-size:10px}.hero-metiers>div{font-size:12px}
.link,.card-foot a,.chapter-shortcut{min-height:44px}.chapter-shortcut{display:flex;align-items:center;margin-top:8px}
.light .demo-note{color:var(--muted)}.demo-note{font-size:12px;line-height:1.65}
.agent-layout{padding:32px 0;gap:48px}.agent-copy h2{font-size:clamp(42px,4.3vw,66px);margin-bottom:18px}.agent-steps{margin:18px 0}.agent-steps li{margin-top:0;padding:10px 0}.agent-steps strong{font-size:13px}.agent-steps small{font-size:12px;line-height:1.5}.stage-agent{height:min(520px,calc(100svh - 230px))}
.agent-chapter.is-unpinned{height:auto}.agent-chapter.is-unpinned .agent-sticky{position:static;min-height:0;overflow:visible}
.demo-controls>.full{grid-column:1/-1}.demo-controls output{display:block;font-size:12px;margin-top:4px}
.demo-controls details summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:8px;font-size:13px}.demo-controls details summary:before{content:'+';font-size:18px}.demo-controls details[open] summary:before{content:'−'}
.demo-controls details summary::-webkit-details-marker{display:none}.demo-controls details .field{margin-top:18px}
.demo-tabs{display:flex;flex-wrap:wrap;overflow:visible;gap:8px;padding-bottom:12px}
.demo-tabs button{min-height:44px;font-size:13px;line-height:1.35;padding:12px 14px;border:1px solid #a7b2c0;border-radius:5px;color:var(--graphite);white-space:normal;text-align:left}
.demo-tabs button[aria-selected=true]{background:var(--blue-surface);color:var(--cobalt);border:1px solid var(--cobalt);font-weight:700}
.demo-output{container-type:inline-size}#demo-results{scroll-margin-top:104px}.results-shortcut{display:none}
.supplier-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.supplier dl{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 10px}.supplier dd{margin-left:0;white-space:nowrap}.supplier .btn{width:100%;min-width:0;gap:8px}.supplier h3{overflow-wrap:anywhere}
.metric .value{overflow-wrap:anywhere;font-size:clamp(23px,3cqw,34px)}.breakdown-row{grid-template-columns:minmax(0,1fr) auto;gap:8px 16px}.breakdown-row .amount{white-space:nowrap}
[data-download-ready]{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center}[data-download-ready]:empty,[data-download-ready][hidden]{display:none}[data-download-ready]>*,.download-file-link{max-width:100%;overflow-wrap:anywhere}
.prose a,.notice,.inline-error,.form-message,.draft-box,.source-citation{overflow-wrap:anywhere}.table-wrap{max-width:100%;overflow-x:auto}.lab-choice button>span:nth-child(2){min-width:0}.lab-choice>a{font-size:12px}
.footer-grid a{display:inline-flex;align-items:center;min-height:44px}.footer-grid li+li{margin-top:0}.footer-bottom{flex-wrap:wrap;gap:12px}.motion-toggle{font-size:11px}
.reveal-ready{opacity:0;transform:translateY(14px);transition:opacity .42s ease,transform .42s ease;transition-delay:var(--reveal-delay,0ms)}.reveal-ready.is-visible{opacity:1;transform:none}
@container(max-width:720px){.supplier-grid{grid-template-columns:1fr}.supplier{padding:22px}.supplier dl{font-size:13px}.supplier h3{font-size:25px}.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.metric .value{font-size:27px}}
@container(max-width:440px){.metrics{grid-template-columns:1fr}.timeline{grid-template-columns:1fr}}
@media(max-width:1100px){.nav.open{max-height:calc(100svh - 84px);overflow-y:auto}.demo-layout{grid-template-columns:230px minmax(0,1fr)}.agent-layout{gap:30px}.lab-showcase,.skills-layout,.sector-hero-layout{gap:30px}}
@media(max-width:900px){.hero-composition{grid-template-columns:1fr;min-height:0}.hero-editorial{padding-bottom:32px}.hero-editorial h1{font-size:clamp(48px,10vw,80px);max-width:740px}.hero-editorial .actions{display:flex}.hero-editorial .actions .btn+.btn{margin-top:0}.hero-paths{display:flex}.hero-paths a{display:inline-flex}.hero-availability{max-width:none}.hero-sculpture{max-width:650px;width:100%;margin:auto}.hero-sculpture figcaption{display:flex;padding:0 14px 24px}.hero-v2:before{display:none}.hero-sculpture:before{content:'';position:absolute;inset:0 calc(-1 * var(--space));background:var(--clay-surface);border-radius:100px 0 0 0}.hero-sculpture>*{position:relative;z-index:1}.stage-hero.sculpture-stage{height:400px}.hero-metiers{grid-template-columns:1fr;padding-top:24px;gap:8px}.hero-metiers>.mono{max-width:none}.hero-metiers>div{gap:4px 22px}.agent-layout,.lab-showcase,.skills-layout,.demo-layout,.two-col{grid-template-columns:1fr}.agent-layout{padding:60px 0}.stage-agent{height:420px}.skills-layout{gap:32px}.skills-layout .skills-visual{max-width:620px;width:100%;margin:auto}.demo-controls{grid-template-columns:repeat(3,minmax(0,1fr))}.results-shortcut{display:inline-flex}.course-card .card-foot{flex-wrap:wrap}.sector-hero-layout{grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr)}}
@media(max-width:600px){.nav.open{max-height:calc(100svh - 70px)}.hero-editorial h1{font-size:clamp(42px,11.6vw,66px)}.hero-editorial .actions{display:grid;grid-template-columns:1fr}.hero-editorial .btn{width:100%}.hero-paths{display:grid;gap:0}.hero-sculpture figcaption{display:flex;flex-wrap:wrap;gap:0}.stage-hero.sculpture-stage{height:310px}.hero-metiers>div{display:grid;grid-template-columns:1fr 1fr;gap:4px 16px}.hero-metiers a{line-height:1.4}.agent-copy h2{font-size:clamp(42px,11vw,58px)}.agent-steps{grid-template-columns:1fr}.stage-agent{height:340px}.skills-layout h2{font-size:clamp(38px,10vw,56px)}.sector-hero-layout{grid-template-columns:1fr}.demo-controls{grid-template-columns:repeat(2,minmax(0,1fr))}.demo-tabs button{font-size:12px;padding:11px 12px}.demo-heading .tag{font-size:10px}.trace{font-size:11px}.info-panel{padding:24px}.course-card h3{font-size:27px}.sector-row h3{overflow-wrap:anywhere}}
@media(prefers-reduced-motion:reduce){.reveal-ready{opacity:1;transform:none;transition:none}}
html.motion-reduced .reveal-ready{opacity:1;transform:none;transition:none}
@media print{.reveal-ready{opacity:1;transform:none}.results-shortcut{display:none}.demo-tabs{display:none}.demo-output{container-type:normal}}

.demo-controls .field{display:flex;flex-direction:column;gap:7px}.demo-controls .field :is(input,select,textarea){min-height:44px}.demo-controls .field input[type=range]{padding:0}.demo-controls .field label{line-height:1.45}
@media(max-width:900px){.demo-controls>.field label{min-height:2.9em}}

h1,h2,h3{overflow-wrap:break-word;hyphens:auto}
@media(max-width:600px){.section-head h2,.cta-layout h2{font-size:clamp(30px,9vw,40px)}}

.demo-tabs{margin:0 0 20px}.demo-output [data-demo-error]:not(:empty){margin-bottom:20px}

.sector-nav summary[aria-current]{color:var(--cobalt)}
