:root {
  --bg: #000000;
  --fg: #ffffff;
  --accent: #ff0000;
  --muted: #888888;
  --dim: #555555;
  --glow: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] {
  --bg: #f0f0f0;
  --fg: #0a0a0a;
  --accent: #cc0000;
  --muted: #666666;
  --dim: #999999;
  --glow: rgba(0, 0, 0, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Space Mono', monospace;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

a { color: var(--fg); text-decoration: none; }
a:hover { text-shadow: 0 0 4px var(--fg); }

.scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--fg);
  opacity: 0.02;
  z-index: 3;
  animation: scanline 10s linear infinite;
  pointer-events: none;
}

.coord {
  position: fixed;
  font-family: 'VT323', monospace;
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 1.8s forwards;
  z-index: 10;
}
.coord-tl { top: 0.8rem; left: 0.8rem; }
.coord-tr { top: 0.8rem; right: 0.8rem; }
.coord-bl { bottom: 0.8rem; left: 0.8rem; }
.coord-br { bottom: 0.8rem; right: 0.8rem; }

.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--muted);
  color: var(--fg);
  font-family: 'VT323', monospace;
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  z-index: 10;
  transition: border-color 0.2s;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 1.5s forwards;
}
.theme-toggle:hover { border-color: var(--fg); }

.signature {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 10;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 2s forwards;
}
.signature a {
  font-family: 'VT323', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}
.signature a:hover {
  color: var(--fg);
  text-shadow: 0 0 4px var(--fg);
}
.signature a.neon-glitch {
  animation: sigNeon 300ms ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes scanline { 0% { top: -2px; } 100% { top: 100%; } }
@keyframes sigNeon {
  0% { color: var(--muted); text-shadow: none; }
  15% { color: #fff; text-shadow: 0 0 6px #fff, 0 0 15px rgba(255,255,255,0.6); }
  30% { color: var(--muted); text-shadow: none; }
  50% { color: #fff; text-shadow: 0 0 4px rgba(255,255,255,0.5); }
  70% { color: var(--muted); text-shadow: none; }
  85% { color: rgba(255,255,255,0.6); text-shadow: 0 0 3px rgba(255,255,255,0.3); }
  100% { color: var(--muted); text-shadow: none; }
}

/* Reveal animation for sections */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

[dir="rtl"] .typing-text { direction: rtl; unicode-bidi: bidi-override; }
[dir="rtl"] .cursor { margin-left: 0; margin-right: 2px; }
