:root {
  /* Catppuccin Mocha palette */
  --ctp-rosewater: #f5e0dc;
  --ctp-mauve: #cba6f7;
  --ctp-red: #f38ba8;
  --ctp-maroon: #eba0ac;
  --ctp-peach: #fab387;
  --ctp-yellow: #f9e2af;
  --ctp-green: #a6e3a1;
  --ctp-teal: #94e2d5;
  --ctp-sky: #89dceb;
  --ctp-sapphire: #74c7ec;
  --ctp-blue: #89b4fa;
  --ctp-lavender: #b4befe;
  --ctp-text: #cdd6f4;
  --ctp-subtext0: #a6adc8;
  --ctp-surface0: #313244;
  --ctp-mantle: #181825;
  --ctp-base: #1e1e2e;

  /* semantic aliases */
  --bg-page: var(--ctp-mantle);
  --bg-terminal: var(--ctp-base);
  --bg-titlebar: var(--ctp-mantle);
  --fg-text: var(--ctp-text);
  --fg-dim: var(--ctp-subtext0);
  --accent-prompt: var(--ctp-green);
  --accent-cursor: var(--ctp-lavender);

  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg-page);
}

body {
  background: radial-gradient(circle at 50% 20%, #232338 0%, var(--bg-page) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}

.terminal-window {
  background: var(--bg-terminal);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  width: min(94vw, 1100px);
  height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
}

.terminal-titlebar {
  background: var(--bg-titlebar);
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 8px;
  position: relative;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.dot-red {
  background: var(--ctp-red);
}

.dot-yellow {
  background: var(--ctp-yellow);
}

.dot-green {
  background: var(--ctp-green);
}

.terminal-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: var(--fg-dim);
  font-size: 13px;
}

.terminal-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg-text);
}

.terminal-body::-webkit-scrollbar {
  width: 10px;
}

.terminal-body::-webkit-scrollbar-track {
  background: var(--bg-titlebar);
}

.terminal-body::-webkit-scrollbar-thumb {
  background: var(--ctp-surface0);
  border-radius: 6px;
}

.terminal-body {
  scrollbar-width: thin;
  scrollbar-color: var(--ctp-surface0) var(--bg-titlebar);
}

.line {
  white-space: pre-wrap;
  word-break: break-word;
}

.line a {
  color: var(--ctp-blue);
}

.line strong {
  color: var(--ctp-mauve);
  font-weight: 700;
}

#prompt-line {
  white-space: pre-wrap;
  word-break: break-word;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

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

#typed-text {
  color: var(--fg-text);
}

.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--accent-cursor);
  animation: blink 1s steps(1) infinite;
  vertical-align: text-bottom;
  margin-left: 1px;
}

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

#hidden-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  border: none;
  outline: none;
  padding: 0;
  font-size: 16px;
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 640px) {
  body {
    display: block;
  }

  .terminal-window {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    border-radius: 0;
  }

  .terminal-body {
    font-size: 13px;
    padding: 14px 16px 28px;
  }
}
