/* Self-hosted IBM Plex Mono. OFL 1.1; mirrored from Google Fonts'
   latin subset. Keeps the font tier inside the same origin so the
   CSP can drop both fonts.googleapis.com and fonts.gstatic.com. */
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/IBMPlexMono-Bold.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

body {
  background: #000;
  color: #00ff00;
  font-family: "IBM Plex Mono", "Courier New", Courier, monospace;
  font-size: clamp(12px, 2.5vw, 16px);
  line-height: 1.4;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

#terminal {
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  position: relative;
}

/* CRT scanline overlay */
#terminal::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(to bottom,
      transparent 0px,
      transparent 2px,
      rgba(0, 0, 0, 0.15) 2px,
      rgba(0, 0, 0, 0.15) 4px);
  pointer-events: none;
  z-index: 10;
}

#output {
  white-space: pre-wrap;
  word-wrap: break-word;
}

#input-line {
  display: flex;
  align-items: center;
}

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

#input-line.hidden {
  display: none;
}

.prompt {
  white-space: pre;
}

#input {
  background: transparent;
  border: none;
  outline: none;
  color: #00ff00;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  width: 0;
  min-width: 0;
  caret-color: transparent;
}

#cursor {
  display: inline-block;
  min-width: 0.6em;
  height: 1.1em;
  background: #00ff00;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  white-space: pre;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@media (max-width: 480px) {
  #terminal {
    padding: 8px;
  }
}

#mobile-hint {
  color: #555;
  font-style: italic;
  position: fixed;
  bottom: 1em;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  transition: opacity 1s;
  z-index: 5;
}