/* Navy after dark. Journal palette, portfolio typography and component shapes. */
:root { color-scheme: only light; }

:root[data-theme="dark"] {
  color-scheme:dark;
  --beige:#101623;
  --canvas:#20283B;
  --ink:#E4EAF2;
  --ink-soft:#B5C3D5;
  --ink-faint:#A1B3CA;
  --navy:#D1E1EC;
  --navy-ink:#C8D9E6;
  --teal:#A6C5D7;
  --sky:#293D52;
  --highlight-blue:#385671;
  --lavender:#A79BC8;
  --lilac:#302B3E;
  --lav-paper:#191F30;
  --postit:#24394B;
  --postit-edge:#657F99;
  --hairline:#C8D9E62E;
  --blue:#B9D3EF;
  --text:#B5C3D5;
  --pale:#20283B;
  --line:#C8D9E62E;
  --wash:#302B3E;
  --yellow:#DCCBA2;
  --research-highlight:#385671;
}
:root[data-theme="dark"] body { background:#101623; color:var(--ink); }
:root[data-theme="dark"] ::selection { background:#385671; color:#F0EDF5; }
:root[data-theme="dark"] :is(.topbar, header, .band-lilac, .cta-band) { background:#191F30; border-color:var(--hairline); }
:root[data-theme="dark"] :is(.player, .callout, .mini-book, .bk-card, .analysis-window, .compact-book) { background:#20283B; border-color:var(--postit-edge); box-shadow:0 18px 40px -20px #0008, inset 0 1px #ffffff08; }
:root[data-theme="dark"] :is(.player-bar, .player-foot, .win-bar, .card-bar, .analysis-bar) { background:#191F30; border-color:var(--hairline); color:var(--ink-faint); }
:root[data-theme="dark"] :is(.screen, .loom) { background:#101623; }
:root[data-theme="dark"] :is(.finder, .win, .sample, .evidence, .fact, .node, .metric, .map-row) { border-color:var(--hairline); box-shadow:0 18px 40px -24px #0008; }
:root[data-theme="dark"] :is(.wb, .btn, .bk-submit, .hook, .cta-line, .cta-option, .vs .after, .who.me, .out) { background:#293D52; color:var(--navy); border-color:var(--postit-edge); }
:root[data-theme="dark"] :is(.wb, .btn, .bk-submit, .cta-option):is(:hover, :focus-visible) { background:#385671; color:#F0EDF5; border-color:#A6C5D7; }
:root[data-theme="dark"] :is(.wb.secondary, .cta-option, .note-r) { background:#302B3E; border-color:#8F80AD; }
:root[data-theme="dark"] :is(.wb.secondary, .cta-option):is(:hover, :focus-visible),
:root[data-theme="dark"] .cta-option[aria-pressed="true"] { background:#443B58; color:#F0EDF5; border-color:#B6A8CF; }
:root[data-theme="dark"] :is(.btn.primary, .wb.dark, .tip, .who-tag.me) { background:#C8D9E6; color:#142032; border-color:#C8D9E6; }
:root[data-theme="dark"] .wb.dark :is(.go, .n) { color:#142032; }
:root[data-theme="dark"] .btn.primary:hover, :root[data-theme="dark"] .wb.dark:hover { background:#E1EBF3; color:#142032; }
:root[data-theme="dark"] .language-toggle { background:#101623; border-color:var(--postit-edge); }
:root[data-theme="dark"] .language-toggle a { color:var(--ink-soft); }
:root[data-theme="dark"] .language-toggle a[aria-current="page"] { background:#293D52; color:#E4EAF2; }
:root[data-theme="dark"] .wave i { background:#657F9955; }
:root[data-theme="dark"] .flower g { stroke:#A6C5D7; }
:root[data-theme="dark"] .flower { opacity:.5; }
/* No star field or spark cursor in this palette. Existing light mode stays intact. */
:root[data-theme="dark"] :is(.star, .spark, .loader-spark) { display:none; }
:root[data-theme="dark"] .cursor-dot { color:#D1E1EC; }
:root[data-theme="dark"] .cursor-dot::before { content:'•'; }
:root[data-theme="dark"] .cursor-ring { border-color:#A6C5D788; }
:root[data-theme="dark"] .is-hovering .cursor-ring { background:#A6C5D712; border-color:#A6C5D7; }
:root[data-theme="dark"] #site-loader { background:#101623; }
:root[data-theme="dark"] #site-loader .loader-name { color:#E4EAF2; }
:root[data-theme="dark"] #site-loader .loader-sub { color:#A6C5D7; }
:root[data-theme="dark"] #site-loader .loader-line { background:#C8D9E62E; }
:root[data-theme="dark"] #site-loader .loader-line::before { background:#A6C5D7; }
:root[data-theme="dark"] .polaroid { background:#293448; box-shadow:0 20px 44px #0005; }
:root[data-theme="dark"] .polaroid::before { background:#A6C5D755; }
:root[data-theme="dark"] .polaroid .cap { color:var(--navy); }
:root[data-theme="dark"] :is(.post-it .hand, .note-r .hand) { filter:brightness(0) invert(.9); }
:root[data-theme="dark"] .about-work-link .hl-sky { --research-highlight:#385671; }
:root[data-theme="dark"] .about-work-link:hover .hl-sky { --research-highlight:#443B58; }

/* Calendar: legible available, selected, disabled and input states. */
:root[data-theme="dark"] :is(.bk-field input, .bk-field textarea, .cb-email input, .cb-form input) { background:#111B2A; color:var(--ink); border-color:var(--postit-edge); }
:root[data-theme="dark"] :is(.bk-picked, .bk-success, .cb-success) { background:#24394B; color:var(--ink); border-color:var(--postit-edge); }
:root[data-theme="dark"] :is(.bk-label, .bk-req, .bk-error, .cb-error) { color:var(--teal); }
:root[data-theme="dark"] :is(.bk-day.has, .bk-slot, .mini-time, .cb-day, .cb-slot) { background:transparent; color:var(--ink); border-color:var(--postit-edge); }
:root[data-theme="dark"] :is(.bk-day.sel, .bk-slot.sel, .cb-day[aria-pressed="true"], .cb-slot[aria-pressed="true"]) { background:#C8D9E6; color:#142032; border-color:#C8D9E6; }
:root[data-theme="dark"] :is(.bk-day.off, .cb-day:disabled) { color:#8290A4; border-color:transparent; background:transparent; }
:root[data-theme="dark"] .bk-submit { background:#293D52; color:var(--navy); border-color:var(--postit-edge); }

/* Case-study and proposal surfaces; creative imagery retains its original colours. */
:root[data-theme="dark"] :is(.step-list, .analysis-tabs) { background:#191F30; border-color:var(--hairline); }
:root[data-theme="dark"] :is(.step-list button, .analysis-tabs button)[aria-selected="true"] { background:#293D52; color:var(--ink); border-color:var(--teal); }
:root[data-theme="dark"] :is(.who.ai, .why > div) { background:#191F30; color:var(--ink-soft); }
:root[data-theme="dark"] tr.pick td { background:#293D52; }
:root[data-theme="dark"] :is(.section, .tool, .facts, .experience div, footer, .analysis-tabs, .analysis-controls, .copy-flow li) { border-color:var(--hairline); }
:root[data-theme="dark"] :is(.sample p, .caption, .loom-note, .eyebrow, .label, .small-note) { color:var(--ink-soft); }
:root[data-theme="dark"] :is(.analysis-controls button, .hook-buttons button, .scene-controls button) { background:#20283B; color:var(--navy); border-color:var(--postit-edge); }
:root[data-theme="dark"] .hook-buttons button[aria-pressed="true"] { background:#C8D9E6; color:#142032; }
:root[data-theme="dark"] :is(.analysis-bar, .card-bar, .statusbar) { background:#293448; }
:root[data-theme="dark"] .highlight { background-image:linear-gradient(#443B58,#443B58); }
:root[data-theme="dark"] .hero-highlight { background:linear-gradient(transparent 52%,#385671 52%,#385671 91%,transparent 91%); }
:root[data-theme="dark"] .mobile-cta { background:#191F30; border-color:var(--hairline); }

/* Explicit appearance control; follows no system preference. */
.theme-toggle { display:inline-flex; flex:0 0 auto; gap:2px; padding:3px; border:1px solid var(--postit-edge,#7FA3BD); border-radius:999px; background:var(--canvas,#FFFCFA); }
.theme-toggle button { appearance:none; border:0; border-radius:999px; background:transparent; color:var(--navy,#2F4156); padding:6px 10px; font-family:var(--mono,monospace); font-size:11px; line-height:1.4; cursor:pointer; }
.theme-toggle button[aria-pressed="true"] { background:var(--sky,#C8D9E6); }
.theme-toggle button:focus-visible { outline:2px solid var(--navy,#2F4156); outline-offset:2px; }
.has-theme-toggle .crumbs { margin-left:auto; }
.theme-toggle-floating { position:fixed; right:16px; bottom:16px; z-index:50; box-shadow:0 4px 18px #0002; }
@media(max-width:700px) { .has-theme-toggle { flex-wrap:wrap;gap:10px; } .has-theme-toggle .top-meta { display:none; } .has-theme-toggle .theme-toggle { margin-left:auto; } .has-theme-toggle .language-toggle + .theme-toggle { margin-left:0; } .has-theme-toggle .crumbs { display:none; } }

/* Language and appearance are separate controls in the same header group. */
.theme-toggle { padding:0; border:0; background:transparent; }
.theme-toggle button { display:grid;place-items:center;width:38px;height:38px;padding:9px;border:1px solid var(--postit-edge,#7FA3BD);background:var(--canvas,#FFFCFA); }
.theme-toggle button svg { width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round; }
.has-theme-toggle .language-toggle { display:flex;flex-shrink:0;gap:4px;margin-left:auto;border:1px solid var(--postit-edge);border-radius:999px;padding:4px;background:var(--canvas); }
.has-theme-toggle .language-toggle a { font-family:var(--mono);font-size:12px;line-height:normal;text-decoration:none;border-radius:999px;padding:7px 12px;color:var(--navy); }
.has-theme-toggle .language-toggle a[aria-current="page"] { background:var(--sky); }
.has-theme-toggle .language-toggle a:focus-visible { outline:2px solid var(--navy);outline-offset:2px; }
.has-theme-toggle .language-toggle + .theme-toggle { margin-left:0; }
@media(max-width:1000px) { .has-theme-toggle .crumbs {display:none;} }
