/* Shared theme layer. The original dark presentation remains available. */
:root {
  --site-ink: #f8fafb;
  --site-copy: #c2d5df;
  --site-accent: #6ae8ec;
  --site-line: #8dc6d53d;
  --site-surface: #0b2330;
  --site-soft: #102a37b8;
  --site-panel: linear-gradient(125deg, #0b202cf5, #0c2531e8);
  --site-section: linear-gradient(100deg, #06111ae8, #081d28c4);
  --site-shadow: 0 24px 64px #0002;
  --site-hero-size: clamp(4.8rem, 7.7vw, 7.4rem);
  --site-heading-size: clamp(2.4rem, 4.25vw, 3.8rem);
  --theme-text: #edf7f9;
  --theme-muted: #bdd1dc;
  --theme-control: #0b2330;
  --theme-control-hover: #173b49;
  --theme-border: #587e8d;
  --theme-focus: #8af2f5;
}

html[data-theme="light"] {
  --site-ink: #162f3d;
  --site-copy: #4c6573;
  --site-accent: #006c78;
  --site-line: #789baa55;
  --site-surface: #ffffff;
  --site-soft: #eaf2f4b8;
  --site-panel: linear-gradient(125deg, #fffffff7, #f4f9faf2);
  --site-section: linear-gradient(100deg, #f5f9fbed, #edf5f8c9);
  --site-shadow: 0 18px 50px #193f5110;
  color-scheme: light;
  --theme-text: #162f3d;
  --theme-muted: #4c6573;
  --theme-control: #ffffff;
  --theme-control-hover: #e2eef1;
  --theme-border: #6e8b9b;
  --theme-focus: #006b77;
  --theme-accent: #006c78;
  --theme-surface: #ffffff;
  --theme-soft: #eaf2f4;
  --theme-line: #c4d4db;
  --theme-shadow: 0 18px 50px #193f5110;
  --paper: #ffffff;
  --muted: #4c6573;
  --muted-dark: #4c6573;
  --teal: #006c78;
  --line: #c4d4db;
  --line-dark: #c4d4db;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--theme-border);
  border-radius: 24px;
  background: var(--theme-control);
  color: var(--theme-text);
  font: 500 .8125rem/1.3 var(--font-body, sans-serif);
  white-space: nowrap;
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--theme-control-hover); }
.theme-toggle:focus-visible { outline: 3px solid var(--theme-focus); outline-offset: 4px; }
.theme-toggle svg { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-moon { display: none; }
html[data-theme="dark"] .theme-icon-sun { display: none; }
html[data-theme="dark"] .theme-icon-moon { display: block; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 20px; }
.site-header .header-inner { gap: 18px; }
.site-header .theme-toggle { margin-left: auto; font: 500 .8125rem/1.3 var(--font-body, sans-serif); }
.site-header .scene-control { margin-left: 0; }

/* Light shell and continuous landscape fallback. Canvas has its own palette. */
html[data-theme="light"] body {
  background: #f3f7f8;
  color: var(--theme-text);
}
html[data-theme="light"] .spatial-site {
  --space-line: #b9cfd7;
  --space-copy: var(--theme-muted);
}
html[data-theme="light"] #ambient-scene {
  background: radial-gradient(ellipse at 82% 36%, #c1dce3 0, transparent 53%), linear-gradient(145deg, #f6fafb 15%, #dcebef 63%, #f1f7f8);
}
html[data-theme="light"] #ambient-scene::before {
  background-image: linear-gradient(#477f9326 1px, transparent 1px), linear-gradient(90deg, #477f9326 1px, transparent 1px);
}
html[data-theme="light"] #ambient-scene::after {
  background: linear-gradient(90deg, #f5f9fbe8, #f5f9fb91 36%, #f5f9fb0a 74%);
}
html[data-theme="light"] .spatial-site .section-light { color: var(--theme-text); color-scheme: light; }
html[data-theme="light"] :focus-visible,
html[data-theme="light"] .spatial-site .section-light :focus-visible { outline-color: var(--theme-focus); }
html[data-theme="light"] .spatial-site .section + .section { border-color: #789baa30; }
html[data-theme="light"] .spatial-site .section h2 { text-shadow: none; }
html[data-theme="light"] .spatial-site .muted-heading,
html[data-theme="light"] .spatial-site .suite-section .muted-heading { color: #426b7b; }
html[data-theme="light"] .cyan,
html[data-theme="light"] .spatial-site .section .eyebrow,
html[data-theme="light"] .spatial-site .hero h1 > span,
html[data-theme="light"] .method-intro h2 > span,
html[data-theme="light"] .contact-copy h2 > span { color: var(--theme-accent); }
html[data-theme="light"] .brand { color: #243946; }
html[data-theme="light"] .spatial-site .site-header { background: linear-gradient(#f5f9fbf5, #f5f9fbd9 70%, #f5f9fb80); border-color: #b7cdd780; }
html[data-theme="light"] .spatial-site .site-header.is-scrolled { background: #f6fafbf5; border-color: var(--theme-line); }
html[data-theme="light"] .main-nav > a:hover,
html[data-theme="light"] .main-nav > a[aria-current="location"] { color: var(--theme-accent); }
html[data-theme="light"] .nav-contact { border-color: var(--theme-border); }
html[data-theme="light"] .menu-toggle { border-color: var(--theme-border); background: #fff; }
html[data-theme="light"] .menu-toggle span { background: var(--theme-text); }
html[data-theme="light"] .scene-control { color: var(--theme-text); background: var(--theme-control); border-color: var(--theme-border); box-shadow: 0 5px 20px #193f5110; }
html[data-theme="light"] .scene-control:hover { background: var(--theme-control-hover); border-color: var(--theme-accent); }
html[data-theme="light"] .scene-control .motion-label { background: var(--theme-control); border-color: var(--theme-border); }
html[data-theme="light"] .spatial-site .hero .eyebrow,
html[data-theme="light"] .spatial-site .hero-description,
html[data-theme="light"] .spatial-site .hero-footnote,
html[data-theme="light"] .spatial-site .hero-bottom > p { color: var(--theme-muted); }
html[data-theme="light"] .hero-explore { color: var(--theme-accent); border-color: #87acb8; }
html[data-theme="light"] .text-link.light-link,
html[data-theme="light"] .spatial-site .journey-actions .text-link,
html[data-theme="light"] .spatial-site .journey-catalog .text-link,
html[data-theme="light"] .spatial-site .faq-layout .text-link { color: var(--theme-accent); border-color: #709ba8; }
html[data-theme="light"] .text-link:hover { color: #004c59; border-color: #004c59; }
html[data-theme="light"] .button-outline-light { color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="light"] .button-outline-light:hover { background: var(--theme-soft); }
html[data-theme="light"] .spatial-site .expertise-strip { background: #eaf3f5d9; }
html[data-theme="light"] .spatial-site .expertise-inner > span { color: #385a69; }
html[data-theme="light"] .expertise-inner i { color: var(--theme-accent); }

/* Goal explorer, including all four panels and their example diagrams. */
html[data-theme="light"] .spatial-site .journey-section { --journey-border: #c4d4db; --journey-soft: #e6f1f3; }
html[data-theme="light"] .spatial-site .journey-tabs { background: #f9fcfce8; box-shadow: var(--theme-shadow); }
html[data-theme="light"] .spatial-site .journey-tab { color: #365462; }
html[data-theme="light"] .spatial-site .journey-tab:hover { background: #e4eff2; }
html[data-theme="light"] .spatial-site .journey-tab[aria-selected="true"] { background: #d8ebef; color: #124d5d; }
html[data-theme="light"] .journey-selected { stroke: var(--theme-accent); }
html[data-theme="light"] .journey-tab[aria-selected="true"]::before { background: var(--theme-accent); }
html[data-theme="light"] .spatial-site .journey-tab-icon,
html[data-theme="light"] .spatial-site .journey-kicker { color: var(--theme-accent); }
html[data-theme="light"] .spatial-site .journey-panel {
  background: linear-gradient(125deg, #fffffff7, #f4f9faf2);
  border-color: var(--theme-line);
  box-shadow: var(--theme-shadow);
}
html[data-theme="light"] .spatial-site .journey-build-label,
html[data-theme="light"] .spatial-site .journey-build-list li,
html[data-theme="light"] .spatial-site .journey-first-step strong,
html[data-theme="light"] .spatial-site .journey-example,
html[data-theme="light"] .journey-flow strong { color: var(--theme-text); }
html[data-theme="light"] .spatial-site .journey-build-list li::before { border-color: #1c7b87; }
html[data-theme="light"] .spatial-site .journey-example { border-color: var(--theme-line); }
html[data-theme="light"] .spatial-site .journey-example-label,
html[data-theme="light"] .spatial-site .journey-example-footnote,
html[data-theme="light"] .journey-flow small { color: var(--theme-muted); }
html[data-theme="light"] .spatial-site .journey-flow-icon { background: #e5f0f3; color: #006c78; border-color: #83aeb8; }
html[data-theme="light"] .spatial-site .journey-flow li:last-child .journey-flow-icon { background: #cbe7eb; color: #095b67; }
html[data-theme="light"] .journey-flow::before { background: #89b3bd; }
html[data-theme="light"] .spatial-site .journey-nojs a { color: var(--theme-accent); }

/* Product demonstrations keep their original illustrative colors. */
html[data-theme="light"] .spatial-site .suite-showcase { border-color: #a8c2cc; box-shadow: 0 24px 65px #193f5120; }
html[data-theme="light"] .spatial-site .carousel-controls .button-outline { color: var(--theme-text); background: #ffffffdb; border-color: var(--theme-border); }
html[data-theme="light"] .spatial-site .carousel-controls .button-outline:hover { background: var(--theme-soft); }
html[data-theme="light"] .spatial-site .project-track { scrollbar-color: #779eae #dfebef; }
html[data-theme="light"] .spatial-site .project-card { background: #fff; border-color: #bccfd7; box-shadow: 0 8px 28px #193f510a; }
html[data-theme="light"] .spatial-site .method-grid > article,
html[data-theme="light"] .spatial-site .faq-list { background: #ffffffed; border-color: var(--theme-line); box-shadow: var(--theme-shadow); }
html[data-theme="light"] .spatial-site .method-grid p,
html[data-theme="light"] .spatial-site .method-grid article > span,
html[data-theme="light"] .spatial-site .faq-list details > p { color: var(--theme-muted); }
html[data-theme="light"] .spatial-site .method-grid article > span,
html[data-theme="light"] .spatial-site .faq-list details { border-color: var(--theme-line); }
html[data-theme="light"] .spatial-site .method-icon,
html[data-theme="light"] .spatial-site .faq-list summary > span { color: var(--theme-accent); }
html[data-theme="light"] .spatial-site .faq-list summary { color: var(--theme-text); }

/* Contact, validation, optional details and the generated brief. */
html[data-theme="light"] .spatial-site .contact-steps,
html[data-theme="light"] .contact-channel strong,
html[data-theme="light"] .project-form label { color: var(--theme-text); }
html[data-theme="light"] .spatial-site .channel-icon { background: #f7fbfc; border-color: #8caebc; color: var(--theme-accent); }
html[data-theme="light"] .contact-channel:hover .channel-icon { background: #dceef1; }
html[data-theme="light"] .contact-channel:hover strong { color: var(--theme-accent); }
html[data-theme="light"] .spatial-site .contact-channel small,
html[data-theme="light"] .contact-signature > p,
html[data-theme="light"] .contact-signature > p > span,
html[data-theme="light"] .form-intro,
html[data-theme="light"] .field-help,
html[data-theme="light"] .need-inspiration > p,
html[data-theme="light"] .form-notice,
html[data-theme="light"] .project-form label > span:not(.select-wrap),
html[data-theme="light"] .contact-optional > summary > span { color: var(--theme-muted); }
html[data-theme="light"] .spatial-site .project-form { background: #fffffff2; border-color: #b6cdd7; box-shadow: var(--theme-shadow); }
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] option { color: var(--theme-text); background: #fff; border-color: var(--theme-border); }
html[data-theme="light"] .project-form input,
html[data-theme="light"] .project-form select,
html[data-theme="light"] .project-form textarea { background: #f7fafb; border-color: #6e8b9b; color: var(--theme-text); }
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder,
html[data-theme="light"] .project-form input::placeholder,
html[data-theme="light"] .project-form textarea::placeholder { color: #5a7180; }
html[data-theme="light"] .project-form :is(input, select, textarea):focus { border-color: #007582; box-shadow: 0 0 0 3px #0075821a; }
html[data-theme="light"] :is(input, select, textarea)[aria-invalid="true"] { border-color: #a53324; }
html[data-theme="light"] .select-wrap::after { border-color: #456573; }
html[data-theme="light"] .need-examples button { color: #365767; background: #edf5f7; border-color: #a5bfc9; }
html[data-theme="light"] .need-examples button:hover { background: #d9ecf0; border-color: #5c919e; }
html[data-theme="light"] .form-status { color: #075c68; }
html[data-theme="light"] .spatial-site .brief-preview { background: #edf6f8; border-color: #86adb9; }
html[data-theme="light"] .brief-preview > p,
html[data-theme="light"] .brief-preview pre { color: #365767; }
html[data-theme="light"] .brief-preview pre,
html[data-theme="light"] .brief-actions { border-color: #adc7d1; }
html[data-theme="light"] .brief-edit { color: var(--theme-accent); }
html[data-theme="light"] .mobile-project-bar { background: #f8fcfdf5; border-color: #8eafb9; box-shadow: 0 8px 30px #193f5120; }
html[data-theme="light"] .mobile-project-bar > span { color: var(--theme-text); }
html[data-theme="light"] .spatial-site .site-footer { background: linear-gradient(0deg, #e1eef2ed, #edf5f8c7); }
html[data-theme="light"] .spatial-site .footer-top > p,
html[data-theme="light"] .spatial-site .footer-top nav,
html[data-theme="light"] .spatial-site .footer-bottom { color: var(--theme-muted); }
html[data-theme="light"] .footer-bottom { border-color: #b4ccd6; }
html[data-theme="light"] .footer-top nav a:hover { color: var(--theme-accent); }
html[data-theme="light"] .spatial-site .footer-word { color: #bdd3dc30; -webkit-text-stroke-color: #789dab4a; }
html[data-theme="light"] .catalog-dialog::backdrop { background: #294c6380; backdrop-filter: blur(8px); }
html[data-theme="light"] .catalog-search input::placeholder { color: #5a7180; }

/* Tools have their own tokens; include result, warning and error states. */
html[data-theme="light"] .tools-page {
  color-scheme: light;
  --tools-bg: #f3f7f8;
  --tools-panel: #ffffff;
  --tools-text: #162f3d;
  --tools-muted: #4c6573;
  --tools-line: #c4d4db;
  --tools-cyan: #006c78;
  --tools-alert: #a33324;
}
html[data-theme="light"] .tools-panel { background: linear-gradient(155deg, #e9f4f64d, transparent 44%), #fff; box-shadow: var(--theme-shadow); }
html[data-theme="light"] .tools-local-note,
html[data-theme="light"] .tools-demo-label,
html[data-theme="light"] .tools-price-list dt,
html[data-theme="light"] .tools-rules summary,
html[data-theme="light"] .tools-progress-meta p,
html[data-theme="light"] .tools-privacy-result > p,
html[data-theme="light"] .tools-result-counts li { color: var(--theme-muted); }
html[data-theme="light"] .tools-page .tools-form input:not([type="checkbox"]),
html[data-theme="light"] .tools-page .tools-form select,
html[data-theme="light"] .tools-page .tools-form option { background-color: #f7fafb; color: var(--theme-text); border-color: #6e8b9b; }
html[data-theme="light"] .tools-page .tools-form select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' viewBox='0 0 20 20'%3E%3Cpath d='m6 8 4 4 4-4' stroke='%23456573' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
html[data-theme="light"] .tools-page .tools-form [aria-invalid="true"] { border-color: var(--tools-alert); }
html[data-theme="light"] .tools-page .tools-button-primary { background: #00c7d4; color: #061015; }
html[data-theme="light"] .tools-page .tools-button-primary:hover { background: #49dae2; }
html[data-theme="light"] .tools-page .tools-button-secondary { border-color: #6e8b9b; }
html[data-theme="light"] .tools-page .tools-button-secondary:hover { background: #e2eff2; border-color: #597e8b; }
html[data-theme="light"] .tools-page progress,
html[data-theme="light"] .tools-page progress::-webkit-progress-bar { background: #d4e4e9; }
html[data-theme="light"] .tools-priority-tag[data-status="no-sabe"] { color: #775214; }
html[data-theme="light"] .tools-noscript { color: #714a19; background: #fff7e7; border-color: #bda477; }
html[data-theme="light"] .tools-skip { background: #00c7d4; }

/* Privacy page and shared secondary-page header. */
html[data-theme="light"] .privacy-header,
html[data-theme="light"] .privacy-main section,
html[data-theme="light"] .privacy-footer { border-color: var(--theme-line); }
html[data-theme="light"] .privacy-date,
html[data-theme="light"] .privacy-main section > p,
html[data-theme="light"] .privacy-footer { color: var(--theme-muted); }

@media (max-width: 1120px) {
  .site-header .theme-toggle { width: 44px; padding: 10px; }
  .site-header .theme-toggle [data-theme-label] { display: none; }
}
@media (max-width: 1040px) {
  html[data-theme="light"] .main-nav { background: #f7fbfcfc; border-color: var(--theme-line); box-shadow: 0 24px 40px #193f5120; }
  html[data-theme="light"] .main-nav > a[aria-current="location"] { background: #dfedf1; }
  html[data-theme="light"] .main-nav .nav-contact { background: #00c7d4; color: #06131a; border-color: #00b2be; }
}
@media (max-width: 720px) {
  .site-header .header-inner { gap: 10px; }
  .header-actions { gap: 13px; }
  .header-actions .theme-toggle { width: 44px; padding: 10px; }
  .header-actions .theme-toggle [data-theme-label] { display: none; }
  .privacy-header .header-actions > a { font-size: .8125rem; }
  html[data-theme="light"] #ambient-scene::after { background: linear-gradient(90deg, #f5f9fbd9, #f5f9fb7a 78%, #f5f9fb52); }
}
@media (max-width: 380px) {
  .site-header .header-inner { gap: 8px; }
  .site-header .brand { gap: 8px; }
  .site-header .brand-symbol { width: 30px; height: 36px; }
  .site-header .brand-type { font-size: 1.25rem; }
  .site-header .brand-type small { font-size: .4rem; }
  .tools-header-inner { gap: 10px; }
  .tools-brand { gap: 8px; }
  .tools-brand img { width: 32px; height: 32px; }
  .tools-home-link { font-size: .8125rem; }
  .header-actions { gap: 10px; }
}
@media print {
  .theme-toggle { display: none; }
}
