:root {
  color-scheme: light;
  --bg-dark: #f7f9fc;
  --bg-card: #ffffff;
  --terminal-green: #087437;
  --terminal-blue: #006f8b;
  --terminal-yellow: #805700;
  --terminal-red: #ba2938;
  --terminal-purple: #7040a0;
  --text-primary: #152137;
  --text-secondary: #516078;
  --accent-glow: rgb(8 116 55 / 0.14);
  --glass-border: #cbd5e1;
  --header-bg: rgb(255 255 255 / 0.96);
  --sidebar-top: #f4f7fb;
  --sidebar-bottom: #eaf0f7;
  --terminal-title-bg: #edf2f7;
  --surface-alt: #edf2f7;
  --green-rgb: 8 116 55;
  --blue-rgb: 0 111 139;
  --yellow-rgb: 128 87 0;
  --red-rgb: 186 41 56;
  --on-accent: #ffffff;
  --shadow: 0 4px 16px rgb(0 0 0 / 0.08);
  --shadow-hover: 0 10px 25px rgb(0 0 0 / 0.12);
  --bg: var(--bg-dark);
  --surface: var(--bg-card);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --border: var(--glass-border);
  --accent: var(--terminal-green);
  --link: var(--terminal-blue);
  --warning: var(--terminal-yellow);
  --danger: var(--terminal-red);
  --success: var(--terminal-green);
  --panel: var(--bg-card);
  --panel-2: var(--surface-alt);
  --primary: var(--terminal-blue);
  --warn: var(--terminal-yellow);
  --bad: var(--terminal-red);
  --good: var(--terminal-green);
  --terminal-bg: var(--bg-dark);
  --terminal-bg-light: var(--surface-alt);
  --terminal-text: var(--text-primary);
  --terminal-gray: var(--text-secondary);
  --terminal-border: var(--glass-border);
  --error: var(--terminal-red);
  --card: var(--bg-card);
  --card-text: var(--text-primary);
  --soft: var(--glass-border);
  --code-bg: var(--surface-alt);
  --accent-soft: rgb(var(--green-rgb) / 0.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-dark: #0a0e17;
    --bg-card: rgba(20, 25, 40, 0.7);
    --terminal-green: #00ff41;
    --terminal-blue: #00d4ff;
    --terminal-yellow: #ffb800;
    --terminal-red: #ff4757;
    --terminal-purple: #a371f7;
    --text-primary: #e0e6ed;
    --text-secondary: #8b92a8;
    --accent-glow: rgba(0, 255, 65, 0.3);
    --glass-border: rgba(255, 255, 255, 0.1);
    --header-bg: rgba(10, 14, 23, 0.9);
    --sidebar-top: rgba(10, 14, 23, 0.95);
    --sidebar-bottom: rgba(20, 25, 40, 0.98);
    --terminal-title-bg: rgba(0, 0, 0, 0.3);
    --surface-alt: #141928;
    --green-rgb: 0 255 65;
    --blue-rgb: 0 212 255;
    --yellow-rgb: 255 184 0;
    --red-rgb: 255 71 87;
    --on-accent: #0a0e17;
    --shadow: 0 4px 6px rgb(0 0 0 / 0.3);
    --shadow-hover: 0 10px 25px rgb(0 0 0 / 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-dark: #0a0e17;
  --bg-card: rgba(20, 25, 40, 0.7);
  --terminal-green: #00ff41;
  --terminal-blue: #00d4ff;
  --terminal-yellow: #ffb800;
  --terminal-red: #ff4757;
  --terminal-purple: #a371f7;
  --text-primary: #e0e6ed;
  --text-secondary: #8b92a8;
  --accent-glow: rgba(0, 255, 65, 0.3);
  --glass-border: rgba(255, 255, 255, 0.1);
  --header-bg: rgba(10, 14, 23, 0.9);
  --sidebar-top: rgba(10, 14, 23, 0.95);
  --sidebar-bottom: rgba(20, 25, 40, 0.98);
  --terminal-title-bg: rgba(0, 0, 0, 0.3);
  --surface-alt: #141928;
  --green-rgb: 0 255 65;
  --blue-rgb: 0 212 255;
  --yellow-rgb: 255 184 0;
  --red-rgb: 255 71 87;
  --on-accent: #0a0e17;
  --shadow: 0 4px 6px rgb(0 0 0 / 0.3);
  --shadow-hover: 0 10px 25px rgb(0 0 0 / 0.5);
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--terminal-green);
  outline-offset: 4px;
}
.theme-controls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.theme-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 34px;
  height: 34px;
  padding: 5px 8px;
  border: 1px solid var(--glass-border);
  border-radius: 5px;
  background: var(--bg-card);
  color: var(--text-primary);
  font:
    12px "Courier New",
    monospace;
  line-height: 1;
  cursor: pointer;
}
.theme-controls button:hover,
.theme-controls button[aria-pressed="true"] {
  border-color: var(--terminal-green);
  color: var(--terminal-green);
}
.theme-controls svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.theme-sun {
  display: none;
}
[data-theme="dark"] .theme-sun {
  display: block;
}
[data-theme="dark"] .theme-moon {
  display: none;
}
.page-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  font-size: 12px;
}
.page-tools a {
  color: var(--link);
}
.floating-tools {
  position: fixed;
  top: 8px;
  right: 10px;
  z-index: 1000;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .js-motion .reveal {
    opacity: 1;
    transform: none;
  }
}
@media print {
  .theme-controls,
  .page-tools,
  .skip-link,
  .activity-toggle,
  .binary-bg,
  .security-icon,
  .fab {
    display: none !important;
  }
  :root,
  :root[data-theme],
  :root:not([data-theme="light"]) {
    color-scheme: light;
    --bg-dark: #f7f9fc;
    --bg-card: #ffffff;
    --terminal-green: #087437;
    --terminal-blue: #006f8b;
    --terminal-yellow: #805700;
    --terminal-red: #ba2938;
    --terminal-purple: #7040a0;
    --text-primary: #152137;
    --text-secondary: #516078;
    --accent-glow: rgb(8 116 55 / 0.14);
    --glass-border: #cbd5e1;
    --header-bg: rgb(255 255 255 / 0.96);
    --sidebar-top: #f4f7fb;
    --sidebar-bottom: #eaf0f7;
    --terminal-title-bg: #edf2f7;
    --surface-alt: #edf2f7;
    --green-rgb: 8 116 55;
    --blue-rgb: 0 111 139;
    --yellow-rgb: 128 87 0;
    --red-rgb: 186 41 56;
    --on-accent: #ffffff;
    --shadow: 0 4px 16px rgb(0 0 0 / 0.08);
    --shadow-hover: 0 10px 25px rgb(0 0 0 / 0.12);
    --bg-dark: white;
    --bg-card: white;
    --text-primary: #111;
    --text-secondary: #444;
  }
}
