html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  background: black;
  overflow: hidden;
  font-family: monospace;
  color: white;
  position: relative;
}

img {
  height: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  display: block;
}

.logo-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  z-index: 1;
  text-align: center;
  user-select: none;
  pointer-events: none;
  width: 90%;
  max-width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
}

.logo-main {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: #00FF00;
  text-shadow:
    0 0 10px #00FF00,
    0 0 20px #00FF00,
    0 0 30px #00FF00;
  letter-spacing: 0.2em;
  margin: 0;
  line-height: 1;
  /* Responsive sizing using clamp */
  font-size: clamp(3rem, 15vw, 8rem);
}

.logo-version {
  font-family: 'Courier New', monospace;
  color: #00FF00;
  text-shadow:
    0 0 5px #00FF00,
    0 0 10px #00FF00;
  letter-spacing: 0.1em;
  margin-top: 0.5em;
  opacity: 0.8;
  /* Responsive sizing using clamp */
  font-size: clamp(1.2rem, 5vw, 2.5rem);
}

/* Mobile adjustments */
@media (max-width: 480px) {
  .logo-main {
    letter-spacing: 0.1em;
  }
  .logo-version {
    letter-spacing: 0.2em;
  }
}

/* Large screen adjustments */
@media (min-width: 1920px) {
  .logo-main {
    font-size: 10rem;
  }
  .logo-version {
    font-size: 3rem;
  }
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: 10px;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2;
  box-sizing: border-box;
}

.footer-link {
  color: white;
  text-decoration: underline;
}

@media (max-width: 768px) {
  footer {
    font-size: 12px;
    padding: 8px;
  }
}

@keyframes glitch {
  0% {
    text-shadow: 2px 0 red, -2px 0 cyan;
    transform: translate(0, 0);
  }
  15% {
    text-shadow: -2px 2px lime, 2px -2px magenta;
    transform: translate(-2px, 2px);
  }
  30% {
    text-shadow: 3px -1px red, -3px 1px cyan;
    transform: translate(3px, -1px);
  }
  45% {
    text-shadow: -1px 2px lime, 1px -2px magenta;
    transform: translate(-1px, 1px);
  }
  60% {
    text-shadow: 2px -1px red, -2px 1px cyan;
    transform: translate(2px, 1px);
  }
  75% {
    text-shadow: -2px 1px lime, 2px -1px magenta;
    transform: translate(-2px, -1px);
  }
  100% {
    text-shadow: none;
    transform: translate(0, 0);
  }
}

@keyframes logoGlitch {
  0%, 100% {
    text-shadow:
      0 0 10px #00FF00,
      0 0 20px #00FF00,
      0 0 30px #00FF00,
      0 0 40px #00FF00;
  }
  25% {
    text-shadow:
      2px 0 10px #FF0000,
      -2px 0 20px #00FFFF,
      0 0 30px #00FF00,
      0 0 40px #00FF00;
  }
  50% {
    text-shadow:
      -2px 2px 10px #FF00FF,
      2px -2px 20px #FFFF00,
      0 0 30px #00FF00,
      0 0 40px #00FF00;
  }
  75% {
    text-shadow:
      0 0 10px #00FF00,
      3px -1px 20px #FF0000,
      -3px 1px 30px #00FFFF,
      0 0 40px #00FF00;
  }
}

.glitch-active {
  animation: glitch 1s linear 1;
}

.logo-glitch {
  animation: logoGlitch 0.3s linear 1;
}

.footer-binary {
  color: #00FF00;
  font-family: monospace;
  white-space: pre;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  margin-left: 1em;
}

/* Boot Sequence Styles */
.boot-sequence {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  font-family: 'Courier New', monospace;
  overflow: hidden;
}

.boot-sequence::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    transparent 0%,
    rgba(0, 255, 0, 0.03) 50%,
    transparent 100%
  );
  animation: scanline 8s linear infinite;
  pointer-events: none;
}

@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

.boot-sequence.hidden {
  display: none;
}

.boot-line {
  color: #00FF00;
  font-size: clamp(12px, 2vw, 16px);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Glitch effect for boot text */
.glitch-boot-text {
  animation: bootGlitch 0.4s linear;
}

@keyframes bootGlitch {
  0% { transform: skewX(0deg); text-shadow: none; }
  15% { transform: skewX(5deg); text-shadow: -1px 0px 5px red, 1px 0px 5px cyan; }
  30% { transform: skewX(0deg); text-shadow: 1px 0px 5px red, -1px 0px 5px cyan; }
  45% { transform: skewX(-5deg); text-shadow: -1px 0px 5px red, 1px 0px 5px cyan; }
  60% { transform: skewX(0deg); text-shadow: 1px 0px 5px red, -1px 0px 5px cyan; }
  75% { transform: skewX(5deg); text-shadow: -1px 0px 5px red, 1px 0px 5px cyan; }
  90% { transform: skewX(-5deg); text-shadow: 1px 0px 5px red, -1px 0px 5px cyan; }
  100% { transform: skewX(0deg); text-shadow: none; }
}

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

.cursor::after {
  content: '_';
  animation: blink 1s infinite;
}

/* Performance Monitor Styles */
.perf-monitor {
  position: fixed;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #00FF00;
  padding: 10px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #00FF00;
  z-index: 100;
  min-width: 180px;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
  cursor: pointer;
  user-select: none;
}

.perf-monitor:hover {
  border-color: #00FFFF;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.perf-monitor.visible {
  opacity: 1;
}

.perf-line {
  margin: 3px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.perf-line span {
  float: right;
  color: #00FFFF;
  text-shadow: 0 0 5px #00FFFF;
}

@media (max-width: 480px) {
  .perf-monitor {
    font-size: 9px;
    min-width: 150px;
    padding: 8px;
  }
}

.perf-monitor.glitch {
  animation: perfGlitch 0.2s linear;
}

@keyframes perfGlitch {
  0%, 100% {
    transform: translateX(0);
    filter: hue-rotate(0deg);
  }
  20% {
    transform: translateX(-2px);
    filter: hue-rotate(90deg);
  }
  40% {
    transform: translateX(2px);
    filter: hue-rotate(180deg);
  }
  60% {
    transform: translateX(-1px);
    filter: hue-rotate(270deg);
  }
  80% {
    transform: translateX(1px);
    filter: hue-rotate(360deg);
  }
}

/* Hide logo initially during boot */
.logo-container.booting {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

/* Hide footer during boot */
footer.booting {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

/* 404 page */
.error-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  text-align: center;
  width: 90%;
  max-width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
}

.error-code {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: #00FF00;
  text-shadow:
    0 0 10px #00FF00,
    0 0 20px #00FF00,
    0 0 30px #00FF00;
  letter-spacing: 0.2em;
  margin: 0;
  line-height: 1;
  font-size: clamp(3rem, 15vw, 8rem);
}

.error-message {
  font-family: 'Courier New', monospace;
  color: #00FF00;
  text-shadow:
    0 0 5px #00FF00,
    0 0 10px #00FF00;
  letter-spacing: 0.1em;
  margin-top: 0.5em;
  opacity: 0.8;
  font-size: clamp(1rem, 4vw, 1.8rem);
}

.error-link {
  display: inline-block;
  margin-top: 1.5em;
  color: #00FFFF;
  text-decoration: none;
  border: 1px solid #00FFFF;
  padding: 0.5em 1.5em;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.1em;
  text-shadow: 0 0 5px #00FFFF;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
  transition: background 0.2s ease-in-out;
}

.error-link:hover {
  background: rgba(0, 255, 255, 0.15);
}
