
:root {
  --font-size: 16px;
}

html {
  font-size: var(--font-size);
}

body {
    background-color: #012456;
    background-image: url("/images/hacker_background.png");
    background-size: auto;
    background-repeat: no-repeat;
    background-position: top;
    color: #fff;
    font-family: "Fira Code", monospace;
    font-size: var(--base-font-size);
    margin: 2rem;
}

a {
    color: #00bcf2;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.cursor {
    display: inline-block;
    width: 10px;
    background-color: #00bcf2;
    animation: blink 1s infinite;
}

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

h1, h2, h3 {
    color: #f6f6f6;
}

em {
    color: #cccccc;
}

.monitor {
  background-color: #001516;
  border: 14px solid #003035;
  border-radius: 8px;
  padding: 5px;
  max-width: 800px;
  min-height: 500px;
  margin: 2rem auto;
  box-shadow: 0 0 200px #000;
  transform: perspective(1000px) rotateX(0deg) rotateY(-7deg) translateX(25px);
  transform-style: preserve-3d;
  transition: transform 0.3s ease-in-out;
}

.monitor.no-skew {
  transform: none;
}

.screen {
  background-color: #012456;
  padding: 1rem;
  min-height: 490px;
  max-height: 490px;
  overflow-y: auto;
  position: relative;
  box-shadow: inset 0 0 30px rgba(0, 255, 0, 0.1);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.screen::-webkit-scrollbar {
  width: 10px;
}

.screen::-webkit-scrollbar-thumb {
  background-color: #0d339b;
  border-radius: 5px;
}

.screen::-webkit-scrollbar-track {
  background-color: #001516;
}

.sidebar {
    width: 180px;
    margin-left: 1rem;
    flex-shrink: 0;
    order: 2;
}

.content {
    flex: 1;
    order: 1;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar li {
    margin-bottom: 0.5rem;
}

#cursor {
  border-right: 0.15em solid;
  width: fit-content;
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
  max-width: 100%;
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: #fff; }
}

/* Power-off animation */
@keyframes crt-poweroff {
  0% {
    transform: scaleY(1);
    opacity: 1;
  }
  40% {
    transform: scaleY(0.1);
    opacity: 1;
  }
  100% {
    transform: scaleY(0);
    opacity: 0;
  }
}

.screen.poweroff {
  animation: crt-poweroff 2s ease-out forwards;
  transform-origin: center;
}

@keyframes crt-blink {
  0%   { background: #819cc2;}
  100% { background: transparent; }
}

.monitor.blink::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #000;
  animation: crt-blink 1s ease-in-out;
  z-index: 100;
  pointer-events: none;
}

#restart-btn {
  display: none;
  color: #fff;
  font-family: monospace;
  text-align: center;
  margin-top: 92px;
  margin-right: 274px;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.75;
  transition: opacity 0.3s;
}

.exit {
  color: #fff;
  cursor: pointer;
  transition: opacity 0.3s;
}

#restart-btn:hover, .exit:hover {
  opacity: 1;
  text-decoration: underline;
}

@media (max-width: 600px) {
  body {
    background-image: none;
    margin: 0;
  }

  .monitor {
    border: none;
    box-shadow: none;
    transform: none;
    max-width: 100%;
    margin: 0;
    min-height: auto;
  }

  .screen {
    min-height: auto;
    max-height: none;
    flex-direction: column;
  }

  .sidebar {
    width: auto;
    margin-left: 0;
    margin-top: 1rem;
  }

  .content {
    margin-right: 0;
  }
}

.font-controls {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 200;
}

.font-controls button {
  background: #003035;
  border: 1px solid #0d339b;
  color: #fff;
  font-family: monospace;
  cursor: pointer;
  padding: 2px 6px;
  margin-left: 2px;
}

#skew-toggle {
  margin-left: 0;
}

@media (max-width: 600px) {
  #skew-toggle {
    display: none;
  }
}
