/* Dark mode for the whole site: a terminal after hours. Light stays the default; the switch in the header sets html[data-theme="dark"] and remembers it.
   Every page takes its colours from the same tokens, so most of this file is the tokens. The rest fixes the few places that name a colour outright. */
html[data-theme="dark"] { color-scheme: dark; --bg: #0b0e0c; --card: #131715; --ink: #e4f0e2; --text: #a7b4a6; --muted: #7b877d; --line: #232a25; --accent: #56f28a; --accent-ink: #7dffa6; }
html[data-theme="dark"] ::selection { background: #56f28a; color: #0b0e0c; }
html[data-theme="dark"] header.site { background: rgba(11, 14, 12, .8); }
html[data-theme="dark"] h2, html[data-theme="dark"] .top .num { font-family: var(--mono); letter-spacing: -.05em; }
/* Solid buttons were dark with white text; now they are light with dark text. */
html[data-theme="dark"] .btn, html[data-theme="dark"] .prose .social a.kit, html[data-theme="dark"] .filter button[aria-pressed="true"], html[data-theme="dark"] .arch .head .go,
html[data-theme="dark"] .signup button, html[data-theme="dark"] .years a[aria-current], html[data-theme="dark"] .tl.two .mo, html[data-theme="dark"].js .tl.two > li.on .mo { color: var(--bg); }
html[data-theme="dark"] .prose .social a.kit::after { color: rgba(11, 14, 12, .6); }
html[data-theme="dark"] .signup button:hover, html[data-theme="dark"] .arch .head .go:hover { background: var(--accent); }
html[data-theme="dark"] .marks button.m { background: #55605a; } html[data-theme="dark"] .marks button.w { color: #55605a; }
html[data-theme="dark"] .marks button.m:hover, html[data-theme="dark"] .marks button.m.on, html[data-theme="dark"] .marks button.m[aria-pressed="true"] { background: var(--accent); }
html[data-theme="dark"] .marks button.w:hover, html[data-theme="dark"] .marks button.w.on, html[data-theme="dark"] .marks button.w[aria-pressed="true"] { color: var(--accent); }
html[data-theme="dark"] .list a:hover, html[data-theme="dark"] .vid:hover, html[data-theme="dark"] .soc:hover { background: #1a201c; }
html[data-theme="dark"] .posts a, html[data-theme="dark"] .col, html[data-theme="dark"] .arch .strip a { outline-color: var(--line); }
html[data-theme="dark"] .portrait { box-shadow: 0 0 0 1px var(--line), 0 18px 40px -12px rgba(0, 0, 0, .7); }
html[data-theme="dark"] .col .mail a, html[data-theme="dark"] .mail a { text-decoration-color: var(--accent); }
html[data-theme="dark"] .tl .snapimg { background: #e9ece8; }
html[data-theme="dark"] .lost .card404 { box-shadow: 0 0 0 1px var(--line), 0 30px 60px -22px rgba(0, 0, 0, .8); }

/* The switch: a pixel sun or moon in the header */
.theme { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); cursor: pointer; }
.theme:hover { border-color: var(--ink); }
.theme svg { width: 16px; height: 16px; display: block; shape-rendering: crispEdges; }
.theme .moon { display: none; } html[data-theme="dark"] .theme .sun { display: none; } html[data-theme="dark"] .theme .moon { display: block; }
html[data-theme="dark"] .theme { color: var(--accent); }

/* Changing between day and night: the old look lifts away and the new one settles in. Only opacity and scale move, so it stays smooth on the long archive pages. */
::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; animation-duration: .42s; animation-timing-function: cubic-bezier(.3, .7, .2, 1); animation-fill-mode: both; }
::view-transition-old(root) { animation-name: theme-out; } ::view-transition-new(root) { animation-name: theme-in; }
@keyframes theme-out { to { opacity: 0; transform: scale(1.015); } } @keyframes theme-in { from { opacity: 0; transform: scale(.985); } }
.theme svg { transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); } .theme.turn svg { transform: rotate(180deg) scale(.6); }
.brand .f.flip { animation: folder-flip .09s steps(1) infinite; } @keyframes folder-flip { 50% { transform: translateY(-2px) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }
