@font-face {
  font-family: 'Perfect DOS VGA 437 Win';
  src: url('./fonts/PerfectDOSVGA437Win.ttf') format('truetype');
  font-display: swap;
}

:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: #050505;
  color: #c0c0c0;
  font-family: 'Perfect DOS VGA 437 Win', 'Lucida Console', 'Courier New', monospace;
  font-size: clamp(16px, 1.55vw, 21px);
  letter-spacing: 0.03em;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}

.terminal {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(1rem, 4vw, 3rem);
  gap: 1.5rem;
  min-height: 0;
}

.monitor {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 1.6vw, 1.2rem);
  padding: clamp(1.4rem, 2.8vw, 2.3rem);
  padding-bottom: clamp(1.2rem, 2.5vw, 2rem);
  border-radius: 24px;
  background: linear-gradient(160deg, #040608, #0b1016 55%, #030507 100%);
  border: 1px solid rgba(70, 110, 160, 0.18);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65), inset 0 0 18px rgba(8, 18, 30, 0.5);
  overflow: hidden;
  z-index: 0;
  min-height: 0;
}

.monitor::before {
  content: '';
  position: absolute;
  inset: -28px -24px -42px;
  border-radius: 32px;
  background: radial-gradient(circle at 50% 15%, rgba(90, 140, 220, 0.12), rgba(6, 12, 20, 0));
  filter: blur(30px);
  opacity: 0.6;
  pointer-events: none;
  z-index: -1;
}

.monitor-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-right: clamp(0.6rem, 2vw, 1.6rem);
  gap: clamp(1.2rem, 3vw, 3rem);
}

.monitor-footer::before {
  content: '';
  flex: 1;
  height: clamp(0.35rem, 0.8vw, 0.6rem);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(35, 50, 65, 0.8), rgba(12, 18, 26, 0.95));
  box-shadow: inset 0 2px 6px rgba(5, 10, 20, 0.65), inset 0 -2px 4px rgba(120, 180, 255, 0.08);
}

.power-button {
  position: relative;
  width: clamp(28px, 4vw, 38px);
  height: clamp(28px, 4vw, 38px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(120, 190, 140, 0.5), rgba(30, 90, 50, 0.85) 55%, rgba(10, 30, 20, 0.95) 90%);
  border: 2px solid rgba(50, 110, 70, 0.6);
  box-shadow: inset 0 0 8px rgba(5, 25, 15, 0.75), 0 0 10px rgba(40, 120, 80, 0.35);
}

.power-button::after {
  content: '';
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 255, 200, 0.45), rgba(40, 100, 60, 0.08));
  opacity: 0.6;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -ms-overflow-style: none;
  scrollbar-width: none;
  white-space: pre-wrap;
  line-height: 1.6;
  border: 2px solid rgba(192, 192, 192, 0.28);
  padding: clamp(1rem, 2.5vw, 2rem);
  box-shadow: inset 0 0 18px rgba(240, 255, 255, 0.05), 0 0 22px rgba(60, 120, 200, 0.18);
  background:
    radial-gradient(ellipse at center, rgba(192, 192, 192, 0.06) 0%, rgba(0, 0, 0, 0.9) 55%, rgba(0, 0, 0, 1) 100%),
    url('./img/zorg-logo.png');
  background-repeat: no-repeat, no-repeat;
  background-position: center, top 0.75rem right 1rem;
  background-size: cover, clamp(200px, 24vw, 360px);
  background-blend-mode: normal, screen;
  position: relative;
  isolation: isolate;
  text-shadow: 0 0 0.05em rgba(160, 200, 255, 0.35), 0 0 0.18em rgba(90, 150, 255, 0.2);
  border-radius: 18px;
}

.screen::-webkit-scrollbar {
  display: none;
}

.screen::before,
.screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.screen::before {
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.39) 0,
    rgba(0, 0, 0, 0.39) 2px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0) 4px
  );
  opacity: 0.3;
  animation: none;
}

.screen::after {
  background: radial-gradient(circle at 80% 10%, rgba(170, 210, 255, 0.25), transparent 55%),
    linear-gradient(to bottom, rgba(40, 130, 255, 0.08), rgba(0, 0, 0, 0.18));
  mix-blend-mode: normal;
  opacity: 0.24;
  z-index: 20;
}

.line {
  min-height: 1.2em;
}

.line a {
  color: inherit;
  text-decoration: none;
}

.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;
}

.log {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

body.booting #command-form {
  visibility: hidden;
}

.prompt {
  font-weight: 600;
}

#command-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: inherit;
  font: inherit;
  caret-color: currentColor;
}

#command-input::selection {
  background: rgba(192, 192, 192, 0.3);
}

@media (max-width: 600px) {
  body {
    font-size: clamp(8px, 1.1vw, 11px);
  }

  .terminal {
    padding: 1.25rem;
    gap: 1rem;
  }

  .screen {
    border-width: 1px;
    background-size: cover, clamp(110px, 28vw, 160px);
  }

  form {
    gap: 0.5rem;
  }
}

@keyframes crt-scan {
  0% {
    transform: translateY(-2%);
  }
  50% {
    transform: translateY(2%);
  }
  100% {
    transform: translateY(-2%);
  }
}

@keyframes crt-flicker {
  0%,
  96% {
    opacity: 0.45;
  }
  100% {
    opacity: 0.7;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen::before,
  .screen::after {
    animation: none;
  }
}
