:root {
  --crt-bg: #05060d;
  --crt-phosphor: #9fb8e8;
  --crt-accent: #3d54a6;
  --crt-bright: #dbe6ff;
  --crt-dim: #4c5a86;
  --crt-amber: 255, 184, 108;
  --crt-window-bg: rgba(5, 6, 13, 0.85);
  --crt-window-border: rgba(159, 184, 232, 0.3);
  --crt-titlebar-bg: rgba(159, 184, 232, 0.08);
  --crt-titlebar-border: rgba(159, 184, 232, 0.2);
  --crt-glow-text: 0 0 5px rgba(159, 184, 232, 0.4), 0 0 10px rgba(159, 184, 232, 0.2);
  --crt-glow-border: 0 0 8px rgba(159, 184, 232, 0.15), inset 0 0 8px rgba(159, 184, 232, 0.05);
  --crt-glow-accent: 0 0 5px rgba(255, 184, 108, 0.4), 0 0 10px rgba(255, 184, 108, 0.2);
  --crt-scanline-dark: rgba(0,0,0,0.15);
  --crt-rain-opacity: 0.55;
  --crt-selection-bg: rgba(132, 160, 216, 0.3);
  --crt-selection-text: #fff;
  --crt-row-hover: rgba(159, 184, 232, 0.07);
  --ph-100: 219, 230, 255;
  --ph-200: 193, 209, 242;
  --ph-300: 159, 184, 232;
  --ph-400: 132, 160, 216;
  --ph-500: 100, 128, 192;
  --ph-600: 73, 94, 147;
  --ph-900: 20, 27, 61;
}
:root[data-theme="light"] {
  --crt-bg: #e8e4d8;
  --crt-phosphor: #3a3a4a;
  --crt-accent: #5566aa;
  --crt-bright: #151522;
  --crt-dim: #707088;
  --crt-amber: 148, 82, 0;
  --crt-window-bg: rgba(232, 228, 216, 0.9);
  --crt-window-border: rgba(58, 58, 74, 0.25);
  --crt-titlebar-bg: rgba(58, 58, 74, 0.05);
  --crt-titlebar-border: rgba(58, 58, 74, 0.15);
  --crt-glow-text: none;
  --crt-glow-border: 0 0 4px rgba(58, 58, 74, 0.08);
  --crt-glow-accent: none;
  --crt-scanline-dark: rgba(0,0,0,0.06);
  --crt-rain-opacity: 0.28;
  --crt-selection-bg: rgba(58, 58, 74, 0.15);
  --crt-selection-text: #151522;
  --crt-row-hover: rgba(58, 58, 74, 0.04);
  --ph-100: 42, 42, 58;
  --ph-200: 58, 58, 74;
  --ph-300: 74, 74, 90;
  --ph-400: 90, 90, 106;
  --ph-500: 122, 122, 138;
  --ph-600: 154, 154, 170;
  --ph-900: 216, 212, 200;
}
html {
  scroll-behavior: smooth;
}
body {
  background-color: var(--crt-bg);
  color: var(--crt-phosphor);
  font-family: 'Share Tech Mono', 'Courier New', monospace;
}
::selection {
  background: var(--crt-selection-bg);
  color: var(--crt-selection-text);
}
h1, h2, h3, .retro-title {
  font-family: 'VT323', 'Courier New', monospace;
}
.scanlines {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(255,255,255,0) 50%,
    var(--crt-scanline-dark) 50%,
    var(--crt-scanline-dark)
  );
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 9999;
}
.crt-flicker {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(18, 16, 16, 0.05);
  opacity: 0;
  animation: flicker 0.15s infinite;
  pointer-events: none;
  z-index: 9998;
  will-change: opacity;
  transform: translateZ(0);
}
@keyframes flicker {
  0% { opacity: 0.015; }
  50% { opacity: 0.035; }
  100% { opacity: 0.015; }
}
@media (prefers-reduced-motion: reduce) {
  .crt-flicker {
    animation: none;
    opacity: 0.015;
  }
}
.glow-text {
  text-shadow: var(--crt-glow-text);
}
.glow-border {
  box-shadow: var(--crt-glow-border);
}
.glow-accent {
  text-shadow: var(--crt-glow-accent);
}
.typing-cursor::after {
  content: '█';
  animation: blink 1s step-end infinite;
  color: var(--crt-phosphor);
  margin-left: 2px;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.window-chrome {
  border: 1.5px solid var(--crt-window-border);
  background: var(--crt-window-bg);
  backdrop-filter: blur(4px);
}
.window-title-bar {
  background: var(--crt-titlebar-bg);
  border-bottom: 1.5px solid var(--crt-titlebar-border);
}
.retro-btn {
  border: 1px solid rgba(159, 184, 232, 0.4);
  background: rgba(159, 184, 232, 0.05);
  transition: all 0.2s;
}
.retro-btn:hover {
  background: rgba(159, 184, 232, 0.2);
  box-shadow: 0 0 12px rgba(159, 184, 232, 0.3);
  transform: translateY(-1px);
}
.retro-link {
  color: rgb(var(--crt-amber));
  text-decoration: underline;
  text-decoration-color: rgb(var(--crt-amber));
  text-underline-offset: 2px;
}
.retro-link:hover {
  color: var(--crt-bright);
}
.scroll-retro::-webkit-scrollbar {
  width: 10px;
  background: #0a0e1a;
}
.scroll-retro::-webkit-scrollbar-thumb {
  background: rgba(159, 184, 232, 0.25);
  border: 1px solid rgba(159, 184, 232, 0.4);
}
.scroll-retro::-webkit-scrollbar-thumb:hover {
  background: rgba(159, 184, 232, 0.45);
}
@keyframes bootReveal {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.boot-line {
  opacity: 0;
  animation: bootReveal 0.3s forwards;
}
.section-fade {
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.7s ease-out;
}
.section-fade.visible {
  opacity: 1;
  transform: translateY(0);
}
.repo-row:hover {
  background: var(--crt-row-hover);
  box-shadow: inset 2px 0 0 0 var(--crt-phosphor);
}
.repo-row:hover td:first-child {
  box-shadow: inset 2px 0 0 0 var(--crt-phosphor);
}
.hud-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--crt-phosphor);
  opacity: 0.35;
  pointer-events: none;
}
.hud-corner.tl { top: -9px; left: -9px; border-top: 2px solid; border-left: 2px solid; }
.hud-corner.tr { top: -9px; right: -9px; border-top: 2px solid; border-right: 2px solid; }
.hud-corner.bl { bottom: -9px; left: -9px; border-bottom: 2px solid; border-left: 2px solid; }
.hud-corner.br { bottom: -9px; right: -9px; border-bottom: 2px solid; border-right: 2px solid; }
#data-rain {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  opacity: var(--crt-rain-opacity);
}
.hero-name {
  font-family: 'VT323', 'Courier New', monospace;
  line-height: 0.92;
  letter-spacing: 0.02em;
}
.hero-name .glitch-pass {
  display: inline-block;
  animation: nameFlicker 6s ease-in-out infinite;
  will-change: transform, opacity;
}
@keyframes nameFlicker {
  0%, 92%, 100% { opacity: 1; filter: none; }
  93% { opacity: 0.85; filter: blur(0.4px); transform: translateX(1px); }
  94% { opacity: 1; filter: none; transform: none; }
  97% { opacity: 0.9; filter: blur(0.3px); transform: translateX(-1px); }
  98% { opacity: 1; filter: none; transform: none; }
}
.navbar-scroll {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: calc(64rem - 2rem);
  z-index: 90;
  display: none;
  view-transition-name: none !important;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.navbar-scroll.navbar-hidden {
  transform: translateX(-50%) translateY(-120%);
  opacity: 0;
  pointer-events: none;
}
.ascii-rule {
  color: var(--crt-dim);
  font-size: 10px;
  letter-spacing: 2px;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
}
.crt-power-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid var(--crt-window-border);
  background: var(--crt-titlebar-bg);
  cursor: pointer;
  font-size: 9px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--crt-dim);
  transition: all 0.2s;
  user-select: none;
  line-height: 1;
  flex-shrink: 0;
}
.crt-power-switch:hover {
  color: var(--crt-amber);
  border-color: var(--crt-amber);
}
.crt-power-switch.on .ps-led {
  background: rgb(var(--crt-amber));
  box-shadow: 0 0 4px rgb(var(--crt-amber));
}
.crt-power-switch .ps-led {
  width: 6px;
  height: 6px;
  border: 1px solid var(--crt-dim);
  background: transparent;
  flex-shrink: 0;
}
::view-transition-old(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-new(root) {
  animation: 0.42s cubic-bezier(0.68, -0.15, 0.265, 1.35) lhci-sweep forwards;
  mix-blend-mode: normal;
}
@keyframes lhci-sweep {
  0% {
    clip-path: inset(0 0 100% 0);
  }
  100% {
    clip-path: inset(0 0 0 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-new(root) {
    animation: none;
  }
}
