/* Semantic palette shared by home, archive and projects. Day values preserve the approved painting. */
:root{--night-paper:#101e31;--scrollbar:#38678a;--paper:#f6f5ee;--ink:#102d59;--ivory:#fff9ed;--muted:#51647b;--caption:#3c5571;--line:#102d5929;--rule:#102d5933;--rule-strong:#102d5955;--accent:#bb3e2c;--accent-active:#b13c2b;--field:#102d59;--depth:#123b62;--theme-duration:1.4s;--theme-ease:cubic-bezier(.4,0,.2,1)}
:root[data-theme="night"]{--scrollbar:#638399;--paper:var(--night-paper);--ink:#eee9dc;--muted:#b4c3d3;--caption:#b4c3d3;--line:#c5d5e02f;--rule:#c5d5e033;--rule-strong:#c5d5e066;--accent:#ee927a;--accent-active:#ee927a;--field:#081426;--depth:#071e34;color-scheme:dark}
html{color:var(--ink);background:var(--paper);scrollbar-color:var(--scrollbar) var(--paper)}
body{color:var(--ink)}
html,body,.hero-nav,.atlas-services,.atlas-contact,.atlas-footer,.project-footer{transition:color var(--theme-duration) var(--theme-ease),background-color var(--theme-duration) var(--theme-ease)}
.theme-toggle{flex:none;display:grid;place-items:center;width:44px;height:44px;padding:10px;border:0;background:none;color:inherit}
.theme-toggle svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.35;stroke-linecap:round;stroke-linejoin:round;overflow:visible}
.theme-toggle .theme-sun,.theme-toggle .theme-moon{transform-origin:12px 12px;transition:opacity .35s,transform .5s}
.theme-sun{opacity:0;transform:rotate(-40deg) scale(.6)}
[data-theme="night"] .theme-sun{opacity:1;transform:none}
[data-theme="night"] .theme-moon{opacity:0;transform:rotate(35deg) scale(.6)}
.theme-toggle:hover svg{stroke-width:1.8}
[data-theme="night"] .brand .logo-blue{opacity:0}
[data-theme="night"] .brand .logo-ivory{opacity:1}
[data-theme="night"] .atlas-mark .logo-blue{visibility:hidden}
[data-theme="night"] .atlas-mark .logo-ivory{opacity:1!important}
[data-theme="night"] .atlas-sky,[data-theme="night"] .atlas-clouds{filter:brightness(.26) saturate(.5) hue-rotate(10deg)}
[data-theme="night"] .atlas-compass{filter:invert(1);opacity:.65}
[data-theme="night"] .fish{filter:brightness(.6) saturate(.45)}
/* The loader shares the moon material; the sun keeps its approved daytime artwork. */
.atlas-sun::after{content:'';position:absolute;inset:20%;border-radius:50%;opacity:0;background:radial-gradient(ellipse at 65% 35%,#b1b9b4 0,transparent 25%),radial-gradient(ellipse at 35% 70%,#c0c2b5 0,transparent 30%),#e8e6cf;box-shadow:inset 4px -1px 5px #24395466,0 0 24px #e8e6cf18}
[data-theme="night"] .atlas-sun img{visibility:hidden}
[data-theme="night"] .atlas-sun::after{opacity:1}
[data-theme="night"].atlas-booting,[data-theme="night"].atlas-booting .atlas-entry[hidden]{background:var(--field)}
/* Graceful, still-painted fallback for devices without WebGL. */
[data-theme="night"]:not(.canvas-ready) .ocean-fallback,[data-theme="night"]:not(.canvas-ready) .mobile-sky,[data-theme="night"] .atlas-finale:not(.is-painted) img{filter:brightness(.24) saturate(.65)}
[data-theme="night"]:not(.canvas-ready) .boat-fallback{filter:brightness(.5) saturate(.6)}
@media(max-width:700px){.hero-nav{gap:12px}.hero-nav>.brand{margin-right:auto}.hero-nav>.header-links{margin-left:0}.theme-toggle{margin-left:auto}.hero-nav.is-menu-ready>.theme-toggle{margin-left:0}}
@media(prefers-reduced-motion:reduce){.theme-toggle *{transition:none!important}}
