/* Dark mode for the pages that are not built on devengine.css (About, Contact).
   Same tokens as the home page (devengine.css), so moving between pages never flashes white
   (Sebastian, 19/11/2026: dark mode everywhere, no abrupt change). Light mode is unchanged. */

/* Theme toggle button (same look as on the home page) */
body:not(.de-home) {
  --de-accent: #ff9f01;
  --de-text: #17171a;
}
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; margin-left: 1rem;
  border: 1px solid var(--de-accent); border-radius: 6px;
  background: transparent; color: var(--de-text); cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.theme-toggle:hover { background: var(--de-accent); color: #0b0b0d; }
.theme-toggle:focus-visible { outline: 2px solid var(--de-accent); outline-offset: 3px; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
@media (max-width: 992px) { .theme-toggle { margin: 0; } }

/* Dark tokens: same values as html[data-theme="dark"] body.de-home */
/* styles.css paints html white and gives html/body a fixed 100% height: when the page scrolls past the first
   screen, that white showed below the dark body (Contact, About, legal pages). Dark html background fixes it. */
html[data-theme="dark"] { color-scheme: dark; background-color: #0b0b0d; }
html[data-theme="dark"] body:not(.de-home) {
  --de-bg: #0b0b0d;
  --de-panel: #131316;
  --de-panel-2: #1a1a1e;
  --de-line: #2a2a30;
  --de-text: #f2f2f3;
  --de-soft: #c9c9d0;
  --de-muted: #a1a1aa;
  background-color: var(--de-bg);
  color: var(--de-text);
}
html[data-theme="dark"] body:not(.de-home) header,
html[data-theme="dark"] body:not(.de-home) header.scrolled {
  background-color: rgba(11, 11, 13, 0.88);
  box-shadow: none;
  border-bottom-color: var(--de-line);
}
html[data-theme="dark"] body:not(.de-home) header.scrolled { border-bottom-color: #ff9f01; }
html[data-theme="dark"] body:not(.de-home) .menu-lang nav ul li a { color: var(--de-text); }
html[data-theme="dark"] body:not(.de-home) .menu-lang nav ul li a:hover,
html[data-theme="dark"] body:not(.de-home) .menu-lang nav ul li a.active { color: #ff9f01; }
html[data-theme="dark"] body:not(.de-home) select { background-color: var(--de-panel); color: var(--de-text); }
html[data-theme="dark"] body:not(.de-home) canvas.three-background { opacity: 0.3; }
html[data-theme="dark"] body:not(.de-home) footer { border-top: 1px solid var(--de-line); }

/* Page blocks */
html[data-theme="dark"] body:not(.de-home) main section {
  background-color: var(--de-panel);
  border-color: var(--de-line);
  box-shadow: none;
}
html[data-theme="dark"] body:not(.de-home) main h1,
html[data-theme="dark"] body:not(.de-home) main h2,
html[data-theme="dark"] body:not(.de-home) main h3 { color: var(--de-text); }
html[data-theme="dark"] body:not(.de-home) main p { color: var(--de-soft); }
html[data-theme="dark"] body:not(.de-home) main strong { color: var(--de-text); }
html[data-theme="dark"] body:not(.de-home) .badge-soon { color: var(--de-muted); border-color: #3a3a42; }

/* About */
html[data-theme="dark"] body:not(.de-home) .values { background-color: var(--de-panel-2); box-shadow: none; }
html[data-theme="dark"] body:not(.de-home) .value-card,
html[data-theme="dark"] body:not(.de-home) .member {
  background-color: #222227;
  box-shadow: none;
  border: 1px solid var(--de-line);
}
html[data-theme="dark"] body:not(.de-home) .value-card p,
html[data-theme="dark"] body:not(.de-home) .member p { color: var(--de-soft); }

/* Contact */
.contact-paths, .about-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .55rem; margin: 1rem 0 1.5rem; }
.about-actions a { color: inherit; text-decoration: underline; text-underline-offset: .2em; }
.contact-paths a {
  border: 1px solid #ff9f01;
  border-radius: 8px;
  padding: .4rem .75rem;
  color: var(--site-link);
  font-weight: 600;
  text-decoration: none;
}
.contact-paths a:hover { background: #ff9f01; color: #18181b; }
.contact-paths a:focus-visible, .about-actions a:focus-visible { outline: 2px solid #ff9f01; outline-offset: 3px; }
#about-team { scroll-margin-top: 3rem; }
.about-history { max-width: 68ch; margin: 1.5rem auto 2rem; text-align: left; }
.about-history summary { color: var(--site-link); cursor: pointer; font-weight: 700; }
.about-history[open] summary { margin-bottom: 1rem; }
#about .about-history p { text-align: left; }
#contact-form h2 { margin: 0 0 .35rem; text-align: left; font-size: clamp(1.25rem, 3.8vw, 1.55rem); }
#contact-form h2::after { content: none; }
#contact-form .subject-group summary { width: fit-content; cursor: pointer; font-size: .9rem; font-weight: 600; }
#contact-form .subject-group[open] summary { margin-bottom: .7rem; }
#contact-form .subject-group { margin-bottom: 1.45rem; }
#contact-form .required-mark { color: var(--site-link); }
#contact-form .message-help { margin: 0 0 .5rem; }
#contact-form .form-required { margin: -.2rem 0 .85rem; }
@media (max-width: 600px) {
  #contact-form.demo-request :is(input[type="text"], input[type="email"], textarea) { margin-bottom: .7rem; }
  #contact-form.demo-request .subject-group { margin-bottom: .9rem; }
  #contact-form.demo-request [data-demo-context] { margin-bottom: .7rem; }
}
html[data-theme="dark"] body:not(.de-home) #contact-form { background-color: var(--de-panel-2); box-shadow: none; border: 1px solid var(--de-line); }
html[data-theme="dark"] body:not(.de-home) #contact-form label { color: var(--de-text); }
html[data-theme="dark"] body:not(.de-home) #contact-form input,
html[data-theme="dark"] body:not(.de-home) #contact-form textarea {
  background-color: var(--de-bg);
  color: var(--de-text);
  border-color: #3a3a42;
}
html[data-theme="dark"] body:not(.de-home) #contact-form input::placeholder,
html[data-theme="dark"] body:not(.de-home) #contact-form textarea::placeholder { color: #8b8b95; } /* 5.8:1 (audit I12) */
html[data-theme="dark"] body:not(.de-home) #contact-form input:focus,
html[data-theme="dark"] body:not(.de-home) #contact-form textarea:focus { border-color: #ff9f01; }
html[data-theme="dark"] body:not(.de-home) .contact-note { color: var(--de-muted) !important; } /* has an inline grey */
html[data-theme="dark"] body:not(.de-home) .form-status { color: var(--de-soft); }

/* styles.css targets some blocks by id: same strength here */
html[data-theme="dark"] body:not(.de-home) #about .values { background-color: var(--de-panel-2); box-shadow: none; }
html[data-theme="dark"] body:not(.de-home) #about .value-card h3::before { background-color: #2a2216; }
html[data-theme="dark"] body:not(.de-home) #contact { background-color: var(--de-panel); box-shadow: none; }
html[data-theme="dark"] body:not(.de-home) #contact-form .form-hint,
html[data-theme="dark"] body:not(.de-home) #contact-form .form-privacy { color: var(--de-muted); }
html[data-theme="dark"] body:not(.de-home) #contact-form .form-privacy a { color: #ffb84d; }
html[data-theme="dark"] body:not(.de-home) #contact-form [aria-invalid="true"] { border-color: #ff8a80; }

/* Contrast in dark mode (audit I12 and M10, 21/11/2026): orange text is readable on the dark panels; the LinkedIn
   logos use their white variant (the blue one was 2.78:1 on the cards). */
html[data-theme="dark"] body:not(.de-home) .member .member-title { color: #ff9f01; }
html[data-theme="dark"] body:not(.de-home) .member .linkedin-link { color: #ffffff; }
