/* Shared appearance controls for A / Direction and C / Pilotage.
   Load after style.css. The editorial B direction is deliberately untouched. */
html[data-theme="light"] body:is(.direction, .pilotage) {
  color-scheme: light;
  --paper: #ffffff;
  --panel: #f5f6f2;
  --ink: #20251f;
  --muted: #626b5f;
  --line: #dfe4da;
  --lime: #d4ef4a;
  --accent: #415b2e;
  --contact-surface: #edf1e6;
  --form-surface: #ffffff;
  --form-border: #d3dccb;
  --field-surface: #ffffff;
  --field-border: #bcc8b3;
  --form-error: #a12d23;
  --focus: #708d18;
}
html[data-theme="dark"] body:is(.direction, .pilotage) {
  color-scheme: dark;
  --paper: #11150f;
  --panel: #1a2117;
  --ink: #f0f3e9;
  --muted: #b1baa8;
  --line: #35402e;
  --lime: #d4ef4a;
  --accent: #c7df89;
  --contact-surface: #1b2517;
  --form-surface: #151d11;
  --form-border: #42503a;
  --field-surface: #1c2717;
  --field-border: #56634d;
  --form-error: #ffad9f;
  --focus: #d4ef4a;
}
html[data-theme] body:is(.direction, .pilotage) {
  background: var(--paper);
  color: var(--ink);
}
html[data-theme] :is(.direction, .pilotage) .brand img {
  filter: none;
  height: auto;
  object-fit: contain;
}
html[data-theme] :is(.direction, .pilotage) :is(a, button, summary, input, select, textarea):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}
html[data-theme] :is(.direction, .pilotage) .skip {
  color: #1d2913;
}

/* A keeps its fine lines, split composition and quiet surfaces in either mode. */
html[data-theme="dark"] .direction .hero-stage {
  background-color: #1a2218;
  box-shadow: inset 0 0 80px #d4ef4a03;
}
html[data-theme="dark"] .direction h1 em { color: #bacba7; }
html[data-theme="dark"] .direction .ownership {
  background: #23351f;
  color: #f0f3e9;
}
html[data-theme="dark"] .direction .ownership :is(p, .eyebrow) { color: #bacbb0; }
html[data-theme="dark"] .direction .ownership em { color: #d5e6bf; }
html[data-theme="dark"] .direction .weekly {
  background: #162111;
  color: #edf3e7;
  border: 1px solid #45523b;
  box-shadow: 0 14px 45px #00000025;
}
html[data-theme="dark"] .direction .weekly p { color: #b6c5a9; }
html[data-theme="dark"] .direction .weekly b { color: #edf3e7; }
html[data-theme="dark"] .direction .weekly-head,
html[data-theme="dark"] .direction .weekly > div:not(.weekly-head) { border-color: #3a4931; }
html[data-theme="dark"] .direction .button:not(.sf-cta) {
  background: #f0f3e9;
  color: #1b2515;
  border-color: #f0f3e9;
}
html[data-theme="dark"] .direction .button:not(.sf-cta):hover {
  background: #dce9ce;
  border-color: #dce9ce;
}
html[data-theme] .direction .button:not(.sf-cta) > span {
  color: #1e2914;
  background: var(--lime);
}

/* C keeps the mono headline, technical grid and rectilinear objects in light mode. */
html[data-theme="light"] .pilotage {
  --paper: #f9faf6;
  --panel: #eef2e7;
  --line: #d6dfcb;
  --accent: #4d682b;
}
html[data-theme="light"] .pilotage h1 em { color: #526b25; }
html[data-theme="light"] .pilotage .hero-stage {
  border-color: #bbcaaa;
  background-color: #edf2e5;
  background-image: linear-gradient(#91a77326 1px, transparent 1px), linear-gradient(90deg, #91a77326 1px, transparent 1px);
}
html[data-theme="light"] .pilotage :is(.stage-top, .stage-caption) { color: #536448; }
html[data-theme="light"] .pilotage .action-float {
  background: #f8fcee;
  color: #26371c;
  border-color: #a8bc91;
}
html[data-theme="light"] .pilotage .action-float p { color: #526345; }
html[data-theme] .pilotage .work-section { background: var(--panel); }
html[data-theme="light"] .pilotage .sector-summary > span { color: #657e2e; }
html[data-theme="light"] .pilotage .weekly {
  background: #fbfff3;
  color: #26351a;
  border: 1px solid #c2d3a5;
  box-shadow: 0 14px 45px #4c651017;
}
html[data-theme="light"] .pilotage .weekly :is(p, b) { color: #41532e; }
html[data-theme="light"] .pilotage .weekly-head,
html[data-theme="light"] .pilotage .weekly > div:not(.weekly-head) { border-color: #d4dfc4; }

/* Deliverable previews keep their own art direction: a dark site must not turn
   the text of a cream-coloured example landing white. */
html[data-theme] :is(.direction, .pilotage) .industry-page .eyebrow { color: #30452f; }
html[data-theme] :is(.direction, .pilotage) .industry-page p { color: #5d6a56; }
html[data-theme] :is(.direction, .pilotage) .mini-browser,
html[data-theme] :is(.direction, .pilotage) .ad-float,
html[data-theme] :is(.direction, .pilotage) .industry-page { color-scheme: light; }

/* The qualifying form is a coherent part of each mode, with native controls
   and validation messages readable at all steps. */
html[data-theme] :is(.direction, .pilotage) .contact-section {
  background: var(--contact-surface);
  border-color: var(--line);
  color: var(--ink);
}
html[data-theme] :is(.direction, .pilotage) .contact-section :is(p, em, .eyebrow) { color: var(--muted); }
html[data-theme] :is(.direction, .pilotage) .form-card {
  background: var(--form-surface);
  border-color: var(--form-border);
  color: var(--ink);
}
html[data-theme] :is(.direction, .pilotage) .contact-section .form-card :is(p, .eyebrow) { color: var(--muted); }
html[data-theme] :is(.direction, .pilotage) .form-card :is(legend, h3),
html[data-theme] :is(.direction, .pilotage) .form-card .form-done h3 { color: var(--ink); }
html[data-theme] :is(.direction, .pilotage) .form-progress {
  color: var(--muted);
  border-color: var(--line);
}
html[data-theme] :is(.direction, .pilotage) .form-progress .current {
  color: var(--ink);
  text-decoration-color: var(--accent);
}
html[data-theme] :is(.direction, .pilotage) .form-card :is(input, select, textarea) {
  background: var(--field-surface);
  border-color: var(--field-border);
  color: var(--ink);
}
html[data-theme] :is(.direction, .pilotage) .form-card :is(input, textarea)::placeholder {
  color: var(--muted);
  opacity: 1;
}
html[data-theme] :is(.direction, .pilotage) .form-card :is(.text-button, .channels small) { color: var(--muted); }
html[data-theme] :is(.direction, .pilotage) .form-card .channels input { accent-color: #789536; }
html[data-theme] :is(.direction, .pilotage) .form-card .demo-note { color: var(--muted) !important; }
html[data-theme] :is(.direction, .pilotage) .contact-section .form-card #form-error { color: var(--form-error); }
html[data-theme] :is(.direction, .pilotage) .form-card .button:not(.sf-cta) {
  background: #263125;
  color: #fff;
  border-color: #263125;
}
html[data-theme="dark"] :is(.direction, .pilotage) .form-card .button:not(.sf-cta) {
  background: var(--lime);
  color: #1d2913;
  border-color: var(--lime);
}
html[data-theme="dark"] :is(.direction, .pilotage) .form-card .button:not(.sf-cta):hover {
  background: #e2f78f;
  border-color: #e2f78f;
}

/* One small, labelled control. Minimum 44 px target; icon-only on narrow screens. */
:is(.direction, .pilotage) .theme-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  min-width: 44px;
  padding: 9px 11px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 5px;
  font: 11px/1.2 var(--font);
  cursor: pointer;
}
.pilotage .theme-toggle { border-radius: 2px; }
:is(.direction, .pilotage) .theme-toggle:hover {
  border-color: var(--accent);
  background: var(--panel);
}
:is(.direction, .pilotage) .theme-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
:is(.direction, .pilotage) .header { gap: 25px; }
:is(.direction, .pilotage) .header .brand { flex-shrink: 0; }
:is(.direction, .pilotage) .header nav { gap: 22px; }
@media (max-width: 1100px) {
  :is(.direction, .pilotage) .header { gap: 16px; }
  :is(.direction, .pilotage) .header nav { gap: 16px; font-size: 12px; }
  :is(.direction, .pilotage) .theme-toggle { padding-inline: 9px; }
}
@media (max-width: 980px) {
  :is(.direction, .pilotage) .header nav { display: none; }
  :is(.direction, .pilotage) .header .nav-cta { margin-left: auto; }
}
@media (max-width: 600px) {
  :is(.direction, .pilotage) .theme-toggle .theme-label { display: none; }
  :is(.direction, .pilotage) .theme-toggle { padding: 10px; }
  :is(.direction, .pilotage) .header { gap: 10px; }
  :is(.direction, .pilotage) .header .brand img { width: 112px; }
}
@media (max-width: 390px) {
  :is(.direction, .pilotage) .header { gap: 8px; }
  :is(.direction, .pilotage) .header .brand img { width: 104px; }
}

html[data-theme="light"] .pilotage .trust .client-logos img { filter: grayscale(1); mix-blend-mode: normal; }
html[data-theme="light"] .pilotage .trust .client-logos > span { color: #535b51; }
html[data-theme="dark"] .direction .trust .client-logos img { filter: grayscale(1) invert(1); mix-blend-mode: screen; }
html[data-theme="dark"] .direction .trust .client-logos > span { color: #c8cfbd; }
