/* Shared surfaces for the portal and appearance switch. The default palette
   is the site's original cream, navy and gold. */
:root {
  color-scheme: light;
  --ui-panel: #fcfaf5;
  --ui-section: #eae7df;
  --ui-border: #c9c4bb;
  --ui-selection: #f1ece2;
  --ui-tag: #eae4d7;
  --ui-accent-text: #86642b;
  --ui-error: #9b3028;
  --ui-placeholder: #676d73;
  --ui-disabled-bg: #dcd8d0;
  --ui-disabled-text: #5e6368;
  --ui-action-hover: #26364d;
}

/* A single discreet outline icon suggests the alternate appearance.
   Keep a larger invisible hit area and a visible keyboard focus indicator. */
.theme-switch {
  display:grid;place-items:center;flex:none;width:36px;height:36px;
  min-width:36px;padding:0;border:0;border-radius:4px;
  background:transparent;color:var(--muted);
  cursor:pointer;direction:ltr;transition:color .18s ease;
}
.theme-switch[hidden]{display:none!important}
.theme-switch>span{display:grid;place-items:center;line-height:1}
.theme-switch svg{display:block;width:16px;height:16px}
.theme-switch[aria-checked="false"] .theme-sun,
.theme-switch[aria-checked="true"] .theme-moon{display:none}
.theme-switch:hover{color:var(--navy)}
.theme-switch:focus-visible{outline:2px solid var(--gold);outline-offset:1px}
.nav-assets[aria-current="page"]{color:var(--ui-accent-text);text-decoration:underline;text-underline-offset:7px}
header>nav .nav-contact{border-left:0;padding-left:0;border-inline-start:1px solid var(--line);padding-inline-start:24px}
header .header-actions{gap:14px}
.legal-header-actions{display:flex;align-items:center;gap:14px;min-width:0}

/* Re-map the original foreground/background variables, and explicitly
   retain the dark photographic and editorial panels. */
html[data-theme="dark"] {
  color-scheme:dark;
  --navy:#f5f1e8;
  --cream:#111722;
  --gold:#c9a56a;
  --line:#364151;
  --muted:#c0c6d0;
  --ui-panel:#1c2532;
  --ui-section:#18212d;
  --ui-border:#596576;
  --ui-selection:#293348;
  --ui-tag:#2b3544;
  --ui-accent-text:#dfbd82;
  --ui-error:#ffb5ad;
  --ui-placeholder:#abb4c1;
  --ui-disabled-bg:#273140;
  --ui-disabled-text:#b3bdca;
  --ui-action-hover:#ddd3bf;
}
html[data-theme="dark"] body{background:var(--cream);color:var(--navy)}
html[data-theme="dark"] header{background:#111722;border-color:var(--line)}
html[data-theme="dark"] .brand .brand-monogram img{filter:invert(1);mix-blend-mode:screen}
html[data-theme="dark"] .brand-advisory{color:var(--navy)}
html[data-theme="dark"] nav,
html[data-theme="dark"] .nav-contact,
html[data-theme="dark"] .language-switch{color:var(--muted)}
html[data-theme="dark"] nav a:hover,
html[data-theme="dark"] nav a[aria-current]{color:var(--ui-accent-text)}
html[data-theme="dark"] .language-options{background:var(--ui-panel);border-color:var(--line);box-shadow:0 12px 30px #0005}
html[data-theme="dark"] .language-options a:hover,
html[data-theme="dark"] .language-options a.selected{background:var(--ui-selection);color:var(--navy)}
html[data-theme="dark"] .menu-toggle{color:var(--navy)}
html[data-theme="dark"] .highlights,
html[data-theme="dark"] .work-hero,
html[data-theme="dark"] .records-section,
html[data-theme="dark"] .deliverables{background:var(--ui-section)}
html[data-theme="dark"] .highlight-grid article{background:var(--ui-panel);border-color:var(--line)}
html[data-theme="dark"] .highlight-grid .more-references{background:transparent}
html[data-theme="dark"] .visual-card{background:#0a1526}
html[data-theme="dark"] .card-overlay,
html[data-theme="dark"] .hero-photo figcaption{color:#fff}
html[data-theme="dark"] .approach,
html[data-theme="dark"] .contact{background:#0b111a;color:#f5f1e8}
html[data-theme="dark"] .approach .eyebrow,
html[data-theme="dark"] .contact .eyebrow{color:var(--ui-accent-text)}
html[data-theme="dark"] .steps article,
html[data-theme="dark"] .record,
html[data-theme="dark"] .filters,
html[data-theme="dark"] .email{border-color:var(--line)}
html[data-theme="dark"] #experience-search{background:var(--ui-panel);color:var(--navy);border-color:var(--ui-border)}
html[data-theme="dark"] #experience-search::placeholder{color:var(--ui-placeholder)}
html[data-theme="dark"] .status{color:var(--muted);border-color:var(--ui-border)}
html[data-theme="dark"] .status.completed{color:#a7d7b4;border-color:#587c65}
html[data-theme="dark"] .skip{color:var(--cream);background:var(--navy)}
html[data-theme="dark"] .button:not(.secondary):not(:disabled):hover{background:var(--ui-action-hover);border-color:var(--ui-action-hover);color:var(--cream)}
html[data-theme="dark"] .button.secondary:hover{background:#c9a56a20}
html[data-theme="dark"] .back-to-top{border-color:var(--ui-border);color:var(--navy);box-shadow:0 3px 12px #0003}
html[data-theme="dark"] .back-to-top:hover,
html[data-theme="dark"] .back-to-top:focus-visible{background:var(--navy);border-color:var(--navy);color:var(--cream)}
html[data-theme="dark"] .legal-home{border-color:var(--navy)}
html[data-theme="dark"] .legal-body a{color:var(--navy)}
html[data-theme="dark"] .legal-body th{background:var(--ui-panel)}
html[data-theme="dark"] .cookie-panel{background:var(--ui-panel);color:var(--navy);border-color:var(--ui-border);box-shadow:0 12px 45px #0007}
html[data-theme="dark"] .cookie-panel .cookie-owner,
html[data-theme="dark"] .cookie-policy-language{color:var(--muted)}
html[data-theme="dark"] .cookie-actions button{background:var(--navy);border-color:var(--navy);color:var(--cream)}
html[data-theme="dark"] .cookie-actions button:hover{background:var(--ui-action-hover);border-color:var(--ui-action-hover)}
html[data-theme="dark"] .cookie-close{color:var(--navy);border-color:var(--ui-border)}
html[data-theme="dark"] .cookie-close:hover{background:var(--ui-selection)}

/* Extra room for the localized menu, language picker and theme switch. */
@media(max-width:1100px){
  header>nav .nav-contact{padding-inline-start:17px}
}
@media(max-width:980px){
  header{height:84px;padding:0 5%;gap:16px}
  header>nav#navigation{display:none;position:absolute;top:84px;inset-inline:0;width:100%;background:var(--cream);padding:24px 6%;border-bottom:1px solid var(--line);white-space:normal}
  header>nav#navigation.open{display:flex;flex-direction:column;align-items:flex-start;gap:20px;font-size:17px}
  header>nav .nav-contact{border:0;padding:0}
  .menu-toggle{display:flex;gap:12px;align-items:center;justify-content:center;padding:10px 0;font-size:14px;min-width:36px}
  header .header-actions{gap:14px}
}
@media(max-width:600px){
  header{gap:10px;padding-inline:4%}
  header .header-actions{gap:8px}
  .menu-toggle{font-size:0;gap:0}
  .theme-switch svg{width:15px;height:15px}
  .legal-header-actions{gap:10px}
  .language-switch summary{padding-inline:3px}
  .language-switch summary>span[dir]{max-width:72px}
}
@media(max-width:440px){
  header .brand{width:116px}
  header .brand-monogram{width:108px}
  header .brand-advisory{font-size:8.2px;letter-spacing:.3px}
  header .header-actions{gap:5px}
  .menu-toggle{min-width:32px}
  .language-switch summary{gap:4px}
  .language-switch summary>span[dir]{max-width:56px;font-size:11px}
}
@media(max-width:355px){
  header .brand{width:106px}
  header .brand-monogram{width:99px}
  header .brand-advisory{font-size:7.7px;letter-spacing:.2px}
  .language-switch summary>span[dir]{display:none}
  .legal-header-actions{gap:8px}
  .legal-home{white-space:normal}
}
@media(prefers-reduced-motion:reduce){
  .theme-switch{transition:none}
}
@media print{
  .theme-switch{display:none!important}
  html[data-theme="dark"]{color-scheme:light;--navy:#0a1526;--cream:#fff;--line:#ccc;--muted:#444;--gold:#a5803e}
  html[data-theme="dark"] body{background:white;color:#0a1526}
  html[data-theme="dark"] .legal-body th{background:#eee9df}
  html[data-theme="dark"] .legal-body a{color:#000}
}
