/* One appearance preference; each work retains its own visual language. */
:root {
  --site-theme-ink:#25313a; --site-theme-muted:#65717c; --site-theme-panel:#fffdf8;
  --site-theme-line:#d6d9dc; --site-theme-accent:#315ee7; --site-theme-hover:#eaf0f5;
}
html[data-site-theme="dark"] {
  --site-theme-ink:#e7ecef; --site-theme-muted:#a9b4bc; --site-theme-panel:#242b32;
  --site-theme-line:#47515c; --site-theme-accent:#a1bcff; --site-theme-hover:#323f50;
  --paper:#171b20; --surface:#22282e; --surface-muted:#272e34; --surface-hover:#303a40;
  --paper-overlay:#171b20f5; --ink:#e6ebe8; --muted:#a8b5bc; --line:#3b454c;
  --line-strong:#57636c; --rule:#56636a; --accent:#efa184; --accent-soft:#3c2e29;
  --teal:#93cbcf; --forest:#3c594d; --selected:#3c594d; --soft:#272e34;
  --interactive-soft:#293c35; --positive:#f3a28c; --negative:#83d1b1;
  --red:#f3a28c; --loss:#83d1b1; --blue:#9ab8ff;
  --theme-panel:#22282e; --theme-soft:#272e34; --theme-line:#47545d;
  --theme-text:#e6ebe8; --theme-muted:#a8b5bc;
  --theme-blue:#9cbaff; --theme-green:#a0d7bd; --theme-teal:#93cbcf;
  --theme-amber:#e4c47d; --theme-rose:#f1b0a5; --theme-purple:#cbb0e4;
  --theme-soft-blue:#27354d; --theme-soft-green:#263d33; --theme-soft-teal:#243c3f;
  --theme-soft-amber:#3a3426; --theme-soft-rose:#3e2d2e; --theme-soft-purple:#352c42;
  background:var(--paper); color:var(--ink);
}
html[data-site-theme="dark"] body { background:var(--paper); color:var(--ink); }
html[data-site-theme="dark"] select option { background:var(--surface); color:var(--ink); }
xfevra-theme { display:inline-flex; flex:0 0 132px; width:132px; height:44px; align-self:center; }
html[data-site-theme] .site-utility-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; }
html[data-site-theme="dark"] .site-privacy a { color:var(--blue); }
html[data-site-theme] .work-bar { gap:12px; border-color:var(--line); }
html[data-site-theme] .work-bar>span { margin-left:auto; }
html[data-site-theme] .work-view.town-work-view { grid-template-rows:52px minmax(0,1fr); }
html[data-site-theme] .portfolio-header { gap:16px; }
@media (min-width:1281px) and (max-width:1500px) {
  html[data-site-theme] .portfolio-nav-link { min-width:96px; padding-inline:12px; }
  html[data-site-theme] .portfolio-brand-zone { gap:28px; }
  html[data-site-theme] .brand-motion { flex-basis:310px; }
}
@media (max-width:1280px) {
  html[data-site-theme] .portfolio-header { grid-template-columns:minmax(0,1fr) 132px; gap:0 14px; }
  html[data-site-theme] .portfolio-brand-zone { grid-column:1; grid-row:1; }
  html[data-site-theme] .portfolio-theme { grid-column:2; grid-row:1; }
  html[data-site-theme] .portfolio-nav { grid-column:1/-1; grid-row:2; }
}
@media (max-width:600px) {
  html[data-site-theme] .portfolio-header { column-gap:8px; }
  html[data-site-theme] .portfolio-brand-zone { display:contents; }
  html[data-site-theme] .portfolio-brand-cluster { grid-column:1; grid-row:1; }
  html[data-site-theme] .portfolio-header:has(.brand-motion) { grid-template-rows:68px auto 48px; }
  html[data-site-theme] .portfolio-header:has(.brand-motion) .portfolio-nav { grid-row:3; }
  html[data-site-theme] .brand-motion { grid-column:1/-1; grid-row:2; width:100%; min-width:0; max-width:none; margin:0; }
  html[data-site-theme] .brand-motion-title { font-size:clamp(13px,3.5vw,20px); }
  html[data-site-theme] .work-bar { padding-inline:12px; letter-spacing:0; font-size:12px; }
}
html[data-site-theme="dark"] :is(.work-view,.work-frame) { background:var(--paper); }
html[data-site-theme="dark"] :is(.brand-motion,.featured-button,.skip-link,.music-player .music-play-button) { background:#174be0; color:white; }
html[data-site-theme="dark"] :is(.project-image,.featured-image,.article-cover,.article-source-note) { background:var(--surface); }
html[data-site-theme="dark"] .brand-motion { --blue:#124cff; }
html[data-site-theme="dark"] .project-tags li { color:var(--muted); }
html[data-site-theme="dark"] .project-row-link:hover { background:var(--surface-hover); }
html[data-site-theme="dark"] .video-card-play { color:#25313a; }
html[data-site-theme="dark"] .video-library-footer { color:var(--ink); }
html[data-site-theme="dark"] .video-library-footer :is(p,nav) { color:var(--muted); }
html[data-site-theme="dark"] .video-playback-status { color:#f1b0a5; }
html[data-site-theme="dark"] .video-dialog-top>button:hover { background:var(--surface-hover); }

/* The listening room has a complete light palette, including lyrics and transport. */
html[data-site-theme="light"] .music-page { background:#faf9f5; }
html[data-site-theme="light"] :is(.music-room,.music-track,.record-lyrics) { color:#212b31; }
html[data-site-theme="light"] :is(.music-thought,.music-track-number,.music-track-duration,.music-track-artist,.record-view-toggle,.record-lyrics-source,.music-footer,.music-progress,.music-now-playing p) { color:#65717a; }
html[data-site-theme="light"] :is(.music-track,.music-footer) { border-color:#d6d9dc; }
html[data-site-theme="light"] .music-track:hover { background:#edf0f1; }
html[data-site-theme="light"] .music-track.is-selected :is(.music-track-title,.music-track-number,.music-track-duration) { color:#3158b8; }
html[data-site-theme="light"] .music-player { background:#f4f3eff5; border-color:#cdd3d7; }
html[data-site-theme="light"] .music-player button { color:#3e4b55; }
html[data-site-theme="light"] .music-player .music-play-button { color:white; }
html[data-site-theme="light"] :is(.music-provider-link,.record-lyrics-heading>:last-child,.music-eyebrow) { color:#3158b8; }
html[data-site-theme="light"] .record-lyric { color:#5a6673; opacity:.6; }
html[data-site-theme="light"] .record-lyric.is-before { opacity:.4; }
html[data-site-theme="light"] .record-lyric.is-upcoming { color:#526b9b; opacity:.85; }
html[data-site-theme="light"] .record-lyric.is-current { color:#172f5f; opacity:1; text-shadow:none; }
html[data-site-theme="light"] .music-playback-status.has-error { color:#805326; }

/* MBTI: warm charcoal paper with the same four families and colorful letter keys. */
html[data-site-theme="dark"] .mbti-page { --mbti-paper:#1c2025; --mbti-ink:#e7ece9; --mbti-muted:#aeb8bf; --mbti-line:#414b53; --mbti-blue:#a4baff; }
html[data-site-theme="dark"] .mbti-guide-page { --mg-paper:#1c2025; --mg-ink:#e7ece9; --mg-muted:#aeb8bf; --mg-line:#414b53; --mg-accent:#a4baff; }
html[data-site-theme="dark"] .mg-purple { --mg-color:#cdb1e9; --mg-tint:#3b2f48; --mg-soft:#2c2536; --mg-rule:#69517d; }
html[data-site-theme="dark"] .mg-green { --mg-color:#94d7b6; --mg-tint:#293e34; --mg-soft:#242f2b; --mg-rule:#466e59; }
html[data-site-theme="dark"] .mg-blue { --mg-color:#8fcee8; --mg-tint:#283e4a; --mg-soft:#222f39; --mg-rule:#456a7c; }
html[data-site-theme="dark"] .mg-amber { --mg-color:#e5c775; --mg-tint:#443a23; --mg-soft:#302c23; --mg-rule:#74633c; }
html[data-site-theme="dark"] #mg-pair-EI { --mg-color:#8fcee8; --mg-tint:#283e4a; --mg-rule:#456a7c; }
html[data-site-theme="dark"] #mg-pair-SN { --mg-color:#e5c775; --mg-tint:#443a23; --mg-rule:#74633c; }
html[data-site-theme="dark"] #mg-pair-TF { --mg-color:#f1b0a5; --mg-tint:#46302f; --mg-rule:#7a514d; }
html[data-site-theme="dark"] #mg-pair-JP { --mg-color:#94d7c8; --mg-tint:#263d38; --mg-rule:#456e61; }
html[data-site-theme="dark"] .mbti-tile { color:#243644; }
html[data-site-theme="dark"] .mbti-random-tile { color:#243644; }
html[data-site-theme="dark"] .mbti-random-letters { --mbti-ink:#243644; }
html[data-site-theme="dark"] .mbti-decor-tile { --mbti-ink:#243644; }
html[data-site-theme="dark"] .mbti-primary { --mbti-blue:#315dc8; }
html[data-site-theme="dark"] .mg-character { mix-blend-mode:normal; border-radius:50%; background-color:#fffcf5; }
html[data-site-theme="dark"] .mg-hero-pair { --pair-color:#91cee7; --pair-rule:#456a7c; }
html[data-site-theme="dark"] .mg-hero-pair-1 { --pair-color:#e5c775; --pair-rule:#74633c; }
html[data-site-theme="dark"] .mg-hero-pair-2 { --pair-color:#f1b0a5; --pair-rule:#7a514d; }
html[data-site-theme="dark"] .mg-hero-pair-3 { --pair-color:#94d7c8; --pair-rule:#456e61; }
html[data-site-theme="dark"] .mbti-tile-empty { color:#b5bdc5!important; background:#353c44!important; box-shadow:0 4px 0 #1a1e23; }
html[data-site-theme="dark"] :is(.mbti-yellow,.mbti-coral,.mbti-teal) .mbti-pair-switch [aria-pressed="true"] { color:#202b31; }
html[data-site-theme="dark"] :is(.mbti-modes [aria-selected="true"],.mbti-primary,.mg-primary-link,.mg-read-preview) { background:#315dc8; color:white; }
html[data-site-theme="dark"] .mbti-share-fallback { background:var(--surface); color:var(--ink); }
html[data-site-theme="dark"] .mbti-reading-nav { background:#1c2025f5; }
html[data-site-theme="dark"] .mbti-quiz .mbti-quiz-card { background:#22282e; border-color:#47545d; box-shadow:0 5px 0 #151a1e; }
html[data-site-theme="dark"] :is(.mbti-quiz-counter,.mbti-quiz-auto,.mbti-quiz-prompt,.mbti-quiz-feedback,.mbti-quiz-answer-label,.mbti-quiz-navigation>span,.mbti-quiz-jump>summary>span:last-child) { color:#aeb8bf; }
html[data-site-theme="dark"] :is(.mbti-quiz-original>p,.mbti-quiz-navigation,.mbti-quiz-navigation .mbti-quiz-next,.mbti-quiz-or) { background:#2b343c; border-color:#47545d; color:#e7ece9; box-shadow:none; }
html[data-site-theme="dark"] .mbti-quiz-navigation .mbti-quiz-next:hover:not(:disabled) { background:#354657; border-color:#91add5; }
html[data-site-theme="dark"] .mbti-result-scale-grid>button[aria-pressed="true"] { background:#2b3d4e; box-shadow:0 4px 0 #1a232c; }
html[data-site-theme="dark"] .mbti-result-spectrum text { fill:#aeb8bf; }
html[data-site-theme="dark"] .mbti-result-spectrum text.mbti-spectrum-letter { fill:#e7ece9; }
html[data-site-theme="dark"] .mbti-summary-sheet { --theme-text:initial; --theme-muted:initial; --theme-panel:initial; --theme-soft:initial; color:#273947; background:#faf8f1; }
html[data-site-theme] .mbti-header nav xfevra-theme { margin-left:2px; }
@media (max-width:700px) {
  html[data-site-theme] .mbti-header:not(.mbti-header-with-rotation) { height:auto; flex-wrap:wrap; padding-top:14px; gap:6px; }
  html[data-site-theme] .mbti-header:not(.mbti-header-with-rotation) nav { width:100%; min-height:48px; justify-content:space-between; }
}
@media (max-width:600px) {
  html[data-site-theme] .mbti-header nav { gap:8px; }
  html[data-site-theme] .mbti-header nav a { white-space:nowrap; }
  .mbti-header { gap:12px; }
}
@media (max-width:359px) { html[data-site-theme] .mbti-guide-page .mbti-header nav { font-size:12px; gap:4px; } }

/* The Galton canvas reads these live values without resetting the experiment. */
html[data-site-theme="dark"] .gb-page { --gb-paper:#1b2024; --gb-ink:#e4e9e6; --gb-muted:#adb9ba; --gb-border:#455056; --gb-accent:#efa36e; --gb-accent-strong:#f5b589; --gb-theory:#95c5de; --gb-soft:#293238; --gb-highlight:#49382d; --gb-selection:#33434c; --gb-collector:#acb9ae; --gb-peg-light:#d0d8d1; --gb-peg:#94a399; --gb-peg-edge:#69786f; }
html[data-site-theme="dark"] .gb-playback { background:#1b2024f7; }
html[data-site-theme="dark"] .gb-primary { background:#3c5b50; color:white; }
@media (max-width:760px) {
  html[data-site-theme] .gb-header { height:auto; flex-wrap:wrap; padding-block:12px; gap:8px; }
  html[data-site-theme] .gb-brand { flex-shrink:0; white-space:nowrap; }
  html[data-site-theme] .gb-header nav { width:100%; justify-content:space-between; gap:12px; }
  html[data-site-theme] .gb-header nav button { white-space:nowrap; }
}
@media (max-width:740px) {
  html[data-site-theme] .cube-lab .cube-header-right { flex-wrap:wrap; gap:8px 12px; }
  html[data-site-theme] .cube-lab .method-switch { flex-shrink:0; }
  html[data-site-theme] .cube-lab .method-switch button,
  html[data-site-theme] .cube-lab .lab-learn-link { white-space:nowrap; }
}

/* Investment apps: shared paper/ink, independent gain and loss colors. */
html[data-site-theme="dark"] :is(.strategy-card.selected,.segmented button.active,.segmented button[aria-pressed="true"],.range-options button.active,.research-header .chart-controls button.active) { color:#f1f5f2; }
html[data-site-theme="dark"] :is(.chart-point-label,.chart-readout strong) { fill:var(--ink); color:var(--ink); }
html[data-site-theme="dark"] .chart-dot { stroke:var(--surface); }
html[data-site-theme="dark"] .account-chart-benchmark { stroke:var(--accent); }
html[data-site-theme="dark"] .research-atlas .main-nav button.active { color:var(--teal); border-color:var(--teal); }
html[data-site-theme="dark"] .research-header .reference-thumbnail { background:#fff; }
html[data-site-theme="dark"] .research-index-row { border-bottom-color:var(--line); }
@media (max-width:640px) {
  html[data-site-theme] body:has(.masthead) { min-width:0; }
  .masthead { flex-wrap:wrap; height:auto; min-height:76px; gap:8px; }
  .masthead xfevra-theme { margin-left:auto; }
  html[data-site-theme] .masthead .strategy-tabs { gap:8px; justify-content:space-between; }
  html[data-site-theme] .masthead .strategy-tabs button { font-size:14px; padding-inline:4px; white-space:nowrap; }
  .research-atlas .site-header { gap:10px; }
}
@media (min-width:521px) and (max-width:800px) {
  html[data-site-theme] .research-atlas .site-header { grid-template-columns:minmax(0,1fr) auto auto 132px; }
  html[data-site-theme] .research-atlas .site-header xfevra-theme { grid-column:4; grid-row:1; }
  html[data-site-theme] .research-atlas .header-date { grid-column:2/5; }
}
@media (max-width:520px) {
  html[data-site-theme] .research-atlas .site-header { display:flex; flex-wrap:wrap; gap:6px 8px; padding-block:14px 10px; }
  html[data-site-theme] .research-atlas .site-header .brand { order:0; }
  html[data-site-theme] .research-atlas .site-header xfevra-theme { order:1; margin-left:auto; }
  html[data-site-theme] .research-atlas .main-nav { order:2; width:100%; margin:0; justify-content:space-between; }
  html[data-site-theme] .research-atlas .header-date { order:3; display:flex; margin:0; padding:0; }
  html[data-site-theme] .research-atlas .refresh-button { order:4; margin-left:auto; }
  html[data-site-theme] .research-atlas .home-link { order:5; margin-left:0; }
  html[data-site-theme] .four-strategies .site-header { grid-template-columns:minmax(0,1fr) auto 132px; }
  html[data-site-theme] .four-strategies .site-identity { grid-column:1/3; grid-row:1; }
  html[data-site-theme] .four-strategies .header-actions { display:contents; }
  html[data-site-theme] .four-strategies .header-actions xfevra-theme { grid-column:3; grid-row:1; }
  html[data-site-theme] .four-strategies .header-actions .home-link { grid-column:1; grid-row:2; justify-self:start; }
  html[data-site-theme] .four-strategies .header-actions .icon-button { grid-column:2; grid-row:2; }
  html[data-site-theme] .four-strategies .header-actions .data-status { grid-column:3; grid-row:2; }
  html[data-site-theme] .four-strategies .site-header .strategy-nav { grid-row:3; }
  html[data-site-theme] .four-strategies .header-actions .home-link { font-size:12px; padding-inline:6px; }
  html[data-site-theme] .four-strategies .header-actions .home-link svg { display:none; }
}

/* Embedded works: the art, scene, tiles and report images retain their source colors. */
html[data-site-theme="dark"]:has(.map-shell) body { background:#171b20; }
html[data-site-theme="dark"] :is(.map-shell .controls,.map-shell button,.leaflet-popup-content-wrapper,.leaflet-popup-tip,.map-shell .leaflet-control-layers,.leaflet-control-zoom a) { background:var(--surface); color:var(--ink); border-color:var(--line); }
html[data-site-theme="dark"] .map-shell button[aria-pressed="true"] { background:#3f5d6e; color:white; }
html[data-site-theme="dark"]:has(.page-shell) { --paper:#30242e; --ink:#f2dfe9; --muted:#c2a9b8; --line:#634655; --accent:#d8fb6a; }
html[data-site-theme="dark"] .date-poster { background:#211a1f; color:#eda6c4; }
html[data-site-theme="dark"] :is(.poster-seal,.pick-me-badge) { color:#211a1f; }
html[data-site-theme="dark"] .alternate-time-field input { background:#45313e; color:var(--ink); border-color:#896579; }
html[data-site-theme="dark"] .page-shell .primary-button { color:#211a1f; }
html[data-site-theme="dark"] .page-shell :is(.speech-bubble,.text-button,.tiny-signoff,.step-mark>span) { color:#c2a9b8; }
html[data-site-theme="dark"] .page-shell :is(.character-art,.character-art img) { mix-blend-mode:normal; border-radius:12px; }
html[data-site-theme="dark"] .page-shell .primary-button:hover { background:#d8fb6a; color:#211a1f; }
html[data-site-theme="dark"] .page-shell .secondary-button:hover { background:#634655; }
html[data-site-theme="dark"] .space-experience { background:#202823; color:#e3e9e4; --space-line:#49584d; }
html[data-site-theme="dark"] :is(.space-header,.space-sidebar,.space-toolbar,.space-help,.scene-photo-button,.scene-photo-notice) { background:#252f29; color:#e3e9e4; border-color:#49584d; }
/* Appearance controls the town interface; scene time and weather stay independent. */
html[data-site-theme="dark"] :is(.town-app,.space-experience>.environment-panel) { --ink:#e3e9e4; --muted:#afbeb5; --paper:#223129f2; --line:#55665b; }
html[data-site-theme="light"] :is(.town-app,.space-experience>.environment-panel) { --ink:#314843; --muted:#72827b; --paper:#f9faf3f0; --line:#586b5b2b; }
html[data-site-theme="dark"] :is(.space-loading,.loading,.error-shade,.space-footer,.space-switcher,.space-camera-tools,.space-scene-caption,.reference-panel,.table-view) { background:#252f29f5; color:#e3e9e4; border-color:#49584d; }
html[data-site-theme="dark"] :is(.space-back,.space-breadcrumb,.space-eyebrow,.reference-limits,.space-gesture,.space-live-clock) { color:#afbeb5; }
html[data-site-theme="dark"] .town-app .walk-trigger { background:#3c594d; color:#e3e9e4; }
html[data-site-theme="light"] .town-app .walk-trigger { background:#e4edde; color:#314843; }

@media print { xfevra-theme { display:none!important; } }
