@import url("https://fonts.googleapis.com/css2?family=VT323&display=swap");

:root {
  --paper: #ff8d00;
  --paper-hot: #ffb043;
  --paper-dim: rgba(255, 141, 0, 0.58);
  --ink: #170c00;
  --glass: #211306;
  --shadow: #080400;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 141, 0, 0.11), transparent 48%),
    radial-gradient(circle at 50% 50%, #241205 0%, #100800 82%);
  color: var(--paper);
  font: 1.4rem VT323, monospace;
  text-shadow: 0 0 2px #a8a8a8;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.16) 0,
      rgba(0, 0, 0, 0.16) 1px,
      rgba(255, 255, 255, 0.03) 2px,
      rgba(255, 255, 255, 0.03) 3px
    );
  mix-blend-mode: soft-light;
}

::selection {
  background: var(--paper);
  color: var(--ink);
  text-shadow: none;
}

.crt-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  box-sizing: border-box;
}

.gh-link {
  margin-top: 18px;
  font: 1rem VT323, monospace;
  color: var(--paper-dim);
  text-decoration: none;
  letter-spacing: 0.02em;
  opacity: 0.55;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.gh-link:hover,
.gh-link:focus-visible {
  opacity: 1;
  color: var(--paper-hot);
  text-decoration: underline;
  outline: none;
}

.terminal-bezel {
  position: relative;
  padding: 14px;
  background: linear-gradient(145deg, #2a1b0c, #080400);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.72),
    inset 0 0 0 1px rgba(255, 176, 67, 0.22),
    inset 0 0 38px rgba(255, 141, 0, 0.08);
}

.terminal-toolbar {
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 4px 8px;
  color: var(--paper-hot);
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0;
  user-select: none;
}

.screen {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  box-shadow:
    inset 0 0 0 1px rgba(255, 176, 67, 0.26),
    inset 0 0 52px rgba(0, 0, 0, 0.68),
    0 0 28px rgba(255, 141, 0, 0.16);
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 141, 0, 0.045), transparent 12%, transparent 88%, rgba(255, 141, 0, 0.035)),
    radial-gradient(ellipse at center, transparent 58%, rgba(0, 0, 0, 0.36) 100%);
}

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: rgba(255, 141, 0, 0.015);
  animation: flicker 5.5s steps(1) infinite;
}

.scanline {
  width: 100%;
  height: 100px;
  z-index: 4;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(255, 255, 255, 0.2) 10%,
    rgba(0, 0, 0, 0.1) 100%
  );
  opacity: 0.1;
  position: absolute;
  bottom: 100%;
  pointer-events: none;
  animation: scanline 7s linear infinite;
}

#terminal {
  position: relative;
  z-index: 1;
  padding: 8px 7px 7px;
  box-sizing: content-box;
}

#terminal .xterm {
  padding: 0;
  font-kerning: none;
  font-variant-ligatures: none;
  font-feature-settings: "kern" 0, "liga" 0, "calt" 0;
}

#terminal .xterm-screen {
  text-shadow: 0 0 2px #a8a8a8, 0 0 9px rgba(255, 141, 0, 0.24);
  font-kerning: none;
  font-variant-ligatures: none;
  font-feature-settings: "kern" 0, "liga" 0, "calt" 0;
}

#terminal .xterm-viewport {
  overflow: hidden !important;
  background-color: var(--ink) !important;
}

#terminal .xterm-cursor-layer {
  filter: drop-shadow(0 0 4px rgba(255, 141, 0, 0.7));
}

.connected {
  color: var(--paper-hot);
}

.disconnected {
  color: var(--paper-dim);
}

@keyframes scanline {
  0% {
    bottom: 100%;
  }
  80% {
    bottom: 100%;
  }
  100% {
    bottom: 0%;
  }
}

@keyframes flicker {
  0%,
  100% {
    opacity: 0.9;
  }
  52% {
    opacity: 0.72;
  }
  53% {
    opacity: 1;
  }
}

@media (max-width: 980px), (max-height: 760px) {
  .crt-shell {
    place-items: start center;
    overflow: auto;
  }

  body {
    overflow: auto;
  }
}

.mobile-block {
  display: none;
}

@media (pointer: coarse) and (hover: none), (max-width: 720px) {
  .crt-shell {
    display: none;
  }

  .mobile-block {
    display: flex;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    text-align: center;
    color: var(--paper-hot);
    font: 1.6rem VT323, monospace;
    line-height: 1.4;
    text-shadow: 0 0 4px rgba(255, 141, 0, 0.5);
  }

  .mobile-block p {
    max-width: 22ch;
    margin: 0;
  }
}
