/*
  HAL_2k v009a
  Programmer: Codex
  Updated: 2026-04-13 GMT-7, Canada
*/

:root {
  --bg: #040806;
  --panel: #07100b;
  --line: #335a46;
  --glow: rgba(125, 201, 152, 0.15);
  --text: #9bc8a6;
  --text-dim: #71937b;
  --cursor: #c3efcc;
  --shadow: rgba(0, 0, 0, 0.45);
  --output-font-size: 1rem;
  --window-width: 960px;
  --window-height: 78vh;
  --outer-bg-top: #020403;
  --outer-bg-bottom: #040806;
  --outer-bg-tint: rgba(74, 118, 92, 0);
  --screen-brightness: 1;
  --text-glow: rgba(170, 255, 200, 0.08);
  --accent-ui: rgba(116, 148, 58, 0.55);
  --accent-ui-solid: #74943a;
  --accent-ui-text: #f4ffe8;
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--accent-ui);
  color: var(--accent-ui-text);
}

::-moz-selection {
  background: var(--accent-ui);
  color: var(--accent-ui-text);
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top, var(--outer-bg-tint), transparent 40%),
    linear-gradient(180deg, var(--outer-bg-top) 0%, var(--outer-bg-bottom) 100%);
  color: var(--text);
  caret-color: var(--accent-ui-text);
  font-family: "Consolas", "Cascadia Mono", "Courier New", monospace;
  filter: brightness(calc(0.92 + (var(--screen-brightness) - 0.72) * 0.38));
  transition: filter 120ms ease;
  scrollbar-color: var(--accent-ui-solid) rgba(8, 16, 11, 0.9);
}

body.is-cursor-hidden,
body.is-cursor-hidden * {
  cursor: none !important;
}

*::-webkit-scrollbar-thumb {
  background: var(--accent-ui-solid);
}

*::-webkit-scrollbar-track {
  background: rgba(8, 16, 11, 0.9);
}

.screen-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.screen-shell:focus {
  outline: none;
}

.terminal-window {
  width: min(var(--window-width), 100%);
  height: min(var(--window-height), calc(100vh - 48px));
  max-height: min(var(--window-height), calc(100vh - 48px));
  border: 3px solid var(--line);
  box-shadow:
    0 0 0 3px rgba(90, 130, 105, 0.15) inset,
    0 0 32px var(--glow),
    0 20px 80px var(--shadow);
  background:
    linear-gradient(180deg, rgba(13, 24, 18, 0.92), rgba(6, 14, 10, 0.98)),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.02) 0 1px,
      transparent 1px 4px
    );
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 3px solid rgba(82, 118, 94, 0.45);
  color: var(--text-dim);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-tag {
  color: var(--text);
}

.terminal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 18px 16px 16px;
}

.output {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  white-space: pre-wrap;
  line-height: 1.58;
  font-size: var(--output-font-size);
  text-shadow: 0 0 10px var(--text-glow);
}

.output::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.output-line {
  margin: 0 0 0.9rem;
}

.output-line.is-system {
  color: var(--text-dim);
}

.output-line.is-partial {
  opacity: 0.86;
}

.prompt-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
  margin: 10px -16px 0;
  padding: 10px 16px 0;
  padding-top: 10px;
  border-top: 3px solid rgba(82, 118, 94, 0.28);
  color: var(--text-dim);
}

.prompt-label {
  color: var(--text);
}

.cursor {
  display: inline-block;
  width: 0.72ch;
  height: 1.1em;
  background: var(--cursor);
  box-shadow: 0 0 10px rgba(185, 233, 195, 0.2);
  animation: blink 1.1s steps(1, end) infinite;
}

.terminal-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 12px;
  border-top: 3px solid rgba(82, 118, 94, 0.28);
  color: var(--text-dim);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.terminal-meta {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#key-readout {
  opacity: 0;
  color: var(--text);
  text-shadow: 0 0 10px rgba(170, 255, 200, 0.18);
  transition: opacity 1s ease;
}

#key-readout.is-active {
  opacity: 1;
}

#key-readout.is-fading {
  opacity: 0;
}

@keyframes blink {
  0%, 48% {
    opacity: 1;
  }

  49%, 100% {
    opacity: 0;
  }
}

@media (max-width: 720px) {
  .screen-shell {
    padding: 12px;
  }

  .terminal-window {
    height: min(var(--window-height), calc(100vh - 24px));
    max-height: min(var(--window-height), calc(100vh - 24px));
  }

  .terminal-header,
  .terminal-body,
  .terminal-footer {
    padding-left: 12px;
    padding-right: 12px;
  }

  .prompt-line {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .output {
    font-size: max(0.96rem, calc(var(--output-font-size) - 0.02rem));
  }

  .terminal-footer {
    flex-direction: column;
    gap: 6px;
  }
}

