:root {
  --bg: #0a0b12;
  --cyan: #08d9d6;
  --magenta: #ff2e63;
  --text: #c9f7f4;
  --muted: #5b6480;
  --panel: #11131f;
  --panel-border: #23273f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  overflow-x: hidden;
}

/* ---------- Ambient background effects ---------- */

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.035),
    rgba(255, 255, 255, 0.035) 1px,
    transparent 2px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  animation: flicker 6s infinite;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.75) 100%);
}

.grid-floor {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60vh;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(8, 217, 214, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 217, 214, 0.35) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(300px) rotateX(65deg);
  transform-origin: bottom;
  mask-image: linear-gradient(to top, black, transparent);
  -webkit-mask-image: linear-gradient(to top, black, transparent);
  animation: drift 3s linear infinite;
  opacity: 0.5;
}

@keyframes drift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 0 60px, 0 0;
  }
}

@keyframes flicker {
  0%,
  100% {
    opacity: 1;
  }
  92% {
    opacity: 1;
  }
  93% {
    opacity: 0.6;
  }
  94% {
    opacity: 1;
  }
}

/* ---------- Layout ---------- */

.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.boot-log {
  width: 100%;
  max-width: 640px;
  color: var(--cyan);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
  white-space: pre-wrap;
  text-shadow: 0 0 6px rgba(8, 217, 214, 0.6);
}

.boot-log .cursor {
  display: inline-block;
  width: 0.6em;
  background: var(--cyan);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.content {
  width: 100%;
  max-width: 640px;
  transition: opacity 0.6s ease;
}

.content.hidden {
  display: none;
  opacity: 0;
}

.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 8vw, 3.5rem);
  margin: 0;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(8, 217, 214, 0.7), 0 0 24px rgba(8, 217, 214, 0.35);
  letter-spacing: 2px;
  position: relative;
}

.tagline {
  color: var(--muted);
  margin-top: 0.75rem;
  font-size: 0.95rem;
  letter-spacing: 1px;
}

/* Glitch effect: duplicate the title with color-split layers */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  opacity: 0;
}

.glitch::before {
  color: var(--magenta);
}

.glitch::after {
  color: var(--cyan);
}

.glitch.glitching::before {
  opacity: 0.8;
  animation: glitch-shift 0.25s steps(2, end) 2;
}

.glitch.glitching::after {
  opacity: 0.8;
  animation: glitch-shift 0.25s steps(2, end) 2 reverse;
}

@keyframes glitch-shift {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-3px, 2px);
  }
  100% {
    transform: translate(2px, -2px);
  }
}

/* ---------- Directory ---------- */

.directory-title {
  font-size: 1rem;
  color: var(--muted);
  font-weight: normal;
  margin: 0 0 1rem;
  letter-spacing: 1px;
}

.node {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  margin-bottom: 0.9rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.node:hover {
  border-color: var(--cyan);
  transform: translateX(4px);
  box-shadow: 0 0 16px rgba(8, 217, 214, 0.25);
}

.node-status {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

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

.node-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.node-name {
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.node-desc {
  font-size: 0.8rem;
  color: var(--muted);
}

.node-arrow {
  color: var(--muted);
  font-size: 1.1rem;
}

.node:hover .node-arrow {
  color: var(--cyan);
}

.site-footer {
  text-align: center;
  margin-top: 2.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}
