:root {
  --bg-color: #050505;
  --text-color: #f4efe7;
  --nav-bg: rgba(5, 5, 5, 0.7);
  --glow-color: rgba(255, 255, 255, 0.08);
  --surface-border: rgba(128, 128, 128, 0.18);
  --shadow-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] {
  --bg-color: #f4efe7;
  --text-color: #111111;
  --nav-bg: rgba(244, 239, 231, 0.8);
  --glow-color: rgba(0, 0, 0, 0.08);
  --surface-border: rgba(128, 128, 128, 0.12);
  --shadow-color: rgba(0, 0, 0, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
  color-scheme: dark;
}

::selection {
  background: var(--text-color);
  color: var(--bg-color);
}

body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: "Roboto Mono", monospace;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

a,
button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

img,
svg {
  display: block;
}

#bgCanvas,
#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#bgCanvas {
  z-index: 0;
}

#canvas {
  z-index: 1;
}

.navbar {
  position: absolute;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  z-index: 20;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--surface-border);
  backdrop-filter: blur(12px);
  -webkit-user-select: none;
  user-select: none;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.logo-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
}

.site-name {
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.site-name-meta {
  opacity: 0.5;
  font-weight: 300;
}

.cursor {
  font-weight: 700;
  animation: blink 2s infinite;
}

.theme-toggle {
  position: relative;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  overflow: hidden;
}

.theme-toggle:active {
  transform: scale(0.92);
}

.theme-toggle svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition:
    transform 0.35s ease,
    opacity 0.25s ease;
}

.moon-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

[data-theme="light"] .sun-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

[data-theme="light"] .moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 15px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
