/* Shared theme tokens. Forest is explicit in HTML, including without JS. */
:root {
  color-scheme:light;
  --theme-bg:#f8f7f1;
  --theme-surface:#edf0e5;
  --theme-text:#173d2c;
  --theme-muted:#526154;
  --theme-line:#d7ddcf;
  --theme-control:#173d2c;
  --theme-on-control:#f8f7f1;
  --theme-hover:#29553c;
  --theme-focus:#a36919;
}

:root[data-theme="forest"] {
  color-scheme:dark;
  --theme-bg:#123526;
  --theme-surface:#1c4433;
  --theme-text:#f4f3e9;
  --theme-muted:#c0d1c1;
  --theme-line:#456553;
  --theme-control:#d5e6bc;
  --theme-on-control:#123526;
  --theme-hover:#e5efcf;
  --theme-focus:#e8c775;
}

/* The consulting pages use these existing palette names throughout. */
.consulting-site[data-theme="forest"] {
  --forest-deep:var(--theme-text);
  --forest-mid:#d5e6bc;
  --emerald:#b9d7a7;
  --sage:#b4cbb5;
  --cream:var(--theme-bg);
  --cloud:var(--theme-surface);
  --line:var(--theme-line);
  --muted:var(--theme-muted);
}

[data-theme="forest"] .idea-board {
  background:#204733;
  border-color:var(--theme-line);
  box-shadow:10px 14px 0 #0d2b1e;
}
[data-theme="forest"] .idea-board li,
[data-theme="forest"] .process {border-color:var(--theme-line);}
[data-theme="forest"] .board-bottom {background:#2b513b;}
[data-theme="forest"] .invitation,
[data-theme="forest"] .article-visual,
[data-theme="forest"] .contact-form-container {background:var(--theme-surface);}
[data-theme="forest"] .form-group input:not([type=checkbox]),
[data-theme="forest"] .form-group textarea {
  background:var(--theme-bg);
  border-color:#7d9a83;
}
[data-theme="forest"] .form-group input::placeholder,
[data-theme="forest"] .form-group textarea::placeholder {color:#afc2b2;}
[data-theme="forest"] .form-status[data-state=error] {
  color:#ffdcce;
  background:#59362f;
  border-color:#f0aa90;
}

/* High-emphasis figure panels keep light text on an actual dark surface. */
[data-theme="forest"] .article-visual .pipeline-model,
[data-theme="forest"] .article-visual .eval-whole-task,
[data-theme="forest"] .article-visual .eval-loop-number,
[data-theme="forest"] .article-visual .primitive-type,
[data-theme="forest"] .article-visual .choice-selected {
  background:#0b291c;
  color:var(--theme-text);
  border-color:#63866a;
}
[data-theme="forest"] .article-visual .judgment-example dd {color:var(--theme-text);}

.site-nav,.site-nav.scrolled {
  background:var(--theme-bg);
  border-color:var(--theme-line);
}
.site-nav .logo,.site-nav .nav-links a,
.site-nav .nav-links a:hover,.site-nav .nav-links a.active,
.site-nav .nav-toggle {color:var(--theme-text);}
.site-nav .nav-links,.site-nav .nav-toggle {border-color:var(--theme-line);}
.site-nav a[data-contact-cta],.page-outline-return,.skip-link {
  color:var(--theme-on-control);
  background:var(--theme-control);
}
.site-nav a[data-contact-cta]:hover,.site-nav a[data-contact-cta].active,
.page-outline-return:hover {
  color:var(--theme-on-control);
  background:var(--theme-hover);
}
.site-nav .logo {order:1;margin-right:auto;}
.site-nav .nav-links {order:2;}
.site-nav .nav-controls {order:3;display:flex;align-items:center;gap:10px;}
.site-nav .theme-toggle {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  padding:8px 10px;
  border:1px solid var(--theme-line);
  border-radius:6px;
  background:transparent;
  color:var(--theme-text);
  font:500 .8rem 'DM Sans',sans-serif;
  cursor:pointer;
}
.site-nav .theme-toggle:hover {background:var(--theme-surface);}
.theme-switch {width:30px;height:18px;border-radius:12px;background:var(--theme-line);padding:3px;}
.theme-switch::before {content:"";display:block;width:12px;height:12px;border-radius:50%;background:var(--theme-text);}
[aria-pressed="true"] .theme-switch::before {transform:translateX(12px);}

.page-outline {background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-line);}
.page-outline .page-outline-title,.page-outline li>a {color:var(--theme-text);}
.page-outline-title>span,.page-outline li>a::before {color:var(--theme-muted);}
.page-outline ol>li {border-color:var(--theme-line);}
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible,
summary:focus-visible,.page-outline:focus-visible,main h2[tabindex="-1"]:focus-visible {
  outline-color:var(--theme-focus);
}

/* Product pages retain their artwork and dark hero/CTA treatments. */
.project-site .section .btn-primary {color:var(--gulf-deep);}
.project-site[data-theme="forest"] body {background:var(--theme-bg);color:var(--theme-text);}
.project-site[data-theme="forest"] .section:not(.dark):not(.built-by) {
  --forest-deep:var(--theme-text);
  --forest-mid:#d5e6bc;
  --emerald:var(--theme-muted);
  --sage:#b4cbb5;
  --cream:var(--theme-bg);
  --cloud:var(--theme-surface);
  background:var(--theme-bg);
}
.project-site[data-theme="forest"] .section.cloud,
.project-site[data-theme="forest"] .section.features {background:var(--theme-surface);}
.project-site[data-theme="forest"] .not-list strong {color:#efb6a5;}
.project-site[data-theme="forest"] figcaption {color:var(--theme-muted);}

@media(max-width:920px) {
  .site-nav {gap:12px;}
  .site-nav .nav-controls {order:2;gap:8px;}
  .site-nav .nav-links {order:3;}
  .site-nav .theme-toggle {width:44px;padding:6px;}
  .theme-toggle [data-theme-label] {display:none;}
}
@media(max-width:380px) {
  .site-nav,.site-nav.scrolled {padding-left:12px;padding-right:12px;gap:8px;}
  .site-nav .logo {gap:6px;}
  .site-nav .logo-text {font-size:1rem;}
  .site-nav .logo-icon {width:28px;height:28px;}
  .site-nav .nav-toggle {padding:8px;}
  .site-nav .nav-toggle span {margin-left:5px;}
}
@media print {.site-nav .nav-controls {display:none;}}
