/* ==========================================================================
   Night mode — "8-bit midnight". Only tokens + a few dark-specific tweaks.
   ========================================================================== */
html.dark {
  --bg: #17141f;
  --surface: #211d2e;
  --surface-2: #2c2640;
  --line: #e9e1cf;
  --ink: #ece6d6;
  --muted: #9a93b3;
  --shadow: #0a0810;
  --grid: rgba(233, 225, 207, 0.035);
  --accent: #ff7a59;
  --accent-ink: #17141f;
  --accent-2: #6be38c;
  --gold: #ffd166;
  --sky: #7fb2ff;
  --select: #4a3f73;

  --grass: #4f9a3a;
  --grass-dk: #2f6b27;
  --dirt: #4a3828;
  --dirt-dk: #33261b;
}

html.dark img { filter: brightness(0.85) contrast(1.1); }
html.dark .header .logo,
html.dark .hero-avatar img { filter: none; }

/* buttons: dark outline frames read better with dark text on hover */
html.dark .px-btn:hover,
html.dark .chip:hover { color: #17141f; }
html.dark .px-btn[aria-current='page'] { color: #17141f; }

/* code highlight (rouge one-dark) sits on our surface instead of github grey */
html.dark .page-post .highlight,
html.dark .page-post pre.highlight,
html.dark .page-post .highlight pre { background: transparent; }
html.dark .page-post .code-frame { background: #120f19; }
html.dark .code-bar { background: #2c2640; color: var(--ink); }
html.dark .code-copy { background: var(--surface); color: var(--ink); }
html.dark .code-copy:hover { color: #17141f; }

html.dark .page-post iframe { opacity: 0.85; }
html.dark .page-search #search-input::placeholder { color: var(--muted); }

/* year badge is cream in dark mode: use a deeper prefix colour */
html.dark .year-badge::before { color: #c2410c; }
