/* ============ Theme toggle button ============ */
.theme-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--blue);
  color: var(--blue-light);
  transform: translateY(-1px);
}

.theme-toggle svg { display: block; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

html[data-theme="light"] .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle:hover { color: var(--blue-2); }

@media (max-width: 1060px) {
  .theme-toggle { width: 40px; height: 40px; }
}

/* ============ Hero arrow light theme ============ */
html[data-theme="light"] .hero-arrow {
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  border-color: var(--border);
}

html[data-theme="light"] .hero-arrow:hover {
  background: #ffffff;
  color: var(--blue-2);
  border-color: var(--blue-2);
}

html[data-theme="light"] .hero-dot { background: var(--border); }
html[data-theme="light"] .hero-dot.is-active { background: var(--blue-2); }

/* ============ Back-to-top button ============ */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  z-index: 50;
  box-shadow: var(--shadow);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  color: var(--blue-light);
  border-color: var(--blue);
  transform: translateY(-2px);
}

html[data-theme="light"] .back-to-top:hover { color: var(--blue-2); }

@media (max-width: 600px) {
  .back-to-top { right: 16px; bottom: 16px; width: 40px; height: 40px; }
}

/* ============ Code window (hero decoration) light theme ============ */
html[data-theme="light"] .code-window {
  background: linear-gradient(180deg, #ffffff, #f6f8fa);
  border-color: #d1d9e0;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .code-window-top {
  background: #f6f8fa;
  border-bottom-color: #d1d9e0;
}

html[data-theme="light"] .code-window pre { color: #24292f; }
html[data-theme="light"] .cw-kw { color: #cf222e; }
html[data-theme="light"] .cw-str { color: #0a3069; }
html[data-theme="light"] .cw-fn { color: #8250df; }
html[data-theme="light"] .cw-cm { color: #6e7781; }

/* ============ Side terminal stats card light theme ============ */
html[data-theme="light"] .side-terminal {
  background: linear-gradient(180deg, #ffffff, #f6f8fa);
  border-color: #d1d9e0;
}

html[data-theme="light"] .side-terminal .terminal-bar {
  border-bottom-color: #d1d9e0;
  background: #f6f8fa;
}

html[data-theme="light"] .side-terminal .terminal-title { color: #6e7781; }
html[data-theme="light"] .side-terminal .terminal-body { color: #24292f; }
html[data-theme="light"] .side-terminal .t-prompt { color: #116329; }
html[data-theme="light"] .side-terminal .t-cmd { color: #24292f; }
html[data-theme="light"] .side-terminal .t-tree { color: #6e7781; }
html[data-theme="light"] .side-terminal .t-key { color: #57606a; }
html[data-theme="light"] .side-terminal .t-val { color: #0550ae; }

