:root {
  --bg: #000000;
  --crt-green: #2798f5;
  --crt-green-dim: rgba(9, 152, 245, 0.45);
  --crt-border: rgba(9, 152, 245, 0.18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  background: var(--bg);
  overflow-x: hidden;
  font-family: "Courier New", Courier, monospace;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.05) 0px,
      rgba(255, 255, 255, 0.05) 1px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0) 4px
    );
  opacity: 0.18;
  mix-blend-mode: soft-light;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse at center,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(255, 255, 255, 0.015) 30%,
      rgba(0, 0, 0, 0.16) 68%,
      rgba(0, 0, 0, 0.44) 100%
    );
}

.screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #000;
}

.language-switcher {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 1;
  display: flex;
  gap: 4px;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.language-switcher a {
  padding: 4px 6px;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.language-switcher a:hover,
.language-switcher a:focus-visible {
  outline: none;
  color: white;
}

.language-switcher a.active {
  color: white;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.85),
    0 0 12px rgba(255, 255, 255, 0.3);
}

.site-header {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 32px 24px 0;
}

.site-logo {
  max-width: 200px;
  width: 100%;
  margin-top: 40px;
  height: auto;
  filter:
    drop-shadow(0 0 4px rgba(255, 255, 255, 0.60))
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.24))
    drop-shadow(0 0 28px rgba(255, 255, 255, 0.10));
  animation: logoFlicker 2.8s infinite alternate;
}

.terminal-box {
  flex: 1;
  width: min(760px, 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 40px 24px;
  margin-bottom: 50px;
  transform: perspective(1000px) rotateX(1.5deg);
  filter: drop-shadow(0 0 10px rgba(140, 255, 155, 0.08))
          drop-shadow(0 0 28px rgba(140, 255, 155, 0.05));
}

.headline {
  color: white;
  font-size: clamp(12px, 2vw, 19px);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  text-align: center;
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.85),
    0 0 14px rgba(255, 255, 255, 0.35),
    0 0 28px rgba(255, 255, 255, 0.15);
  animation: textFlicker 2.8s infinite alternate;
}

.fake-caret.hidden {
  display: none;
}

.crt-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: min(820px, 100%);
  min-height: 72px;
  padding: 0 22px;
  border: 1px solid var(--crt-border);
  border-radius: 12px;
  background:
    linear-gradient(
      to bottom,
      rgba(12, 28, 14, 0.94),
      rgba(5, 14, 7, 0.98)
    );
  overflow: hidden;
  box-shadow:
    inset 0 0 24px rgba(140, 255, 155, 0.06),
    inset 0 -10px 24px rgba(0, 0, 0, 0.42),
    0 0 14px rgba(140, 255, 155, 0.09),
    0 0 36px rgba(140, 255, 155, 0.05);
}

.crt-input-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.045) 0px,
      rgba(255, 255, 255, 0.045) 1px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0) 4px
    );
  opacity: 0.32;
}

.crt-input-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse at center,
      rgba(255, 255, 255, 0.03) 0%,
      rgba(255, 255, 255, 0.01) 40%,
      rgba(0, 0, 0, 0.14) 78%,
      rgba(0, 0, 0, 0.22) 100%
    );
}

.prompt {
  position: relative;
  z-index: 2;
  margin-right: 14px;
  color: white;
  font-size: 18px;
  line-height: 1;
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.85),
    0 0 12px rgba(255, 255, 255, 0.32);
}

.crt-input {
  position: relative;
  z-index: 2;
  flex: 1;
  height: 70px;
  border: 0;
  outline: none;
  background: transparent;
  color: white;
  font-size: clamp(22px, 2.2vw, 22px);
  line-height: 1;
  letter-spacing: 0.04em;
  font-family: inherit;
  text-shadow:
    0 0 3px rgba(255, 255, 255, 0.95),
    0 0 10px rgba(255, 255, 255, 0.35);
  caret-color: transparent;
}

.fake-caret {
  position: absolute;
  z-index: 3;
  left: 58px;
  top: 50%;
  width: 11px;
  height: 34px;
  transform: translateY(-50%);
  background: white;
  box-shadow:
    0 0 6px rgba(255, 255, 255, 0.95),
    0 0 16px rgba(255, 255, 255, 0.38);
  animation: blinkCaret 1s steps(1, end) infinite;
  pointer-events: none;
}

.quick-questions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: min(820px, 100%);
}

.quick-question {
  padding: 8px 20px;
  border: 1px solid var(--crt-green-dim);
  border-radius: 999px;
  background: rgba(5, 14, 7, 0.82);
  color: white;
  font-family: inherit;
  font-size: clamp(13px, 1.4vw, 16px);
  letter-spacing: 0.06em;
  text-transform: lowercase;
  text-shadow:
    0 0 3px rgba(255, 255, 255, 0.85),
    0 0 10px rgba(255, 255, 255, 0.3);
  box-shadow:
    inset 0 0 10px rgba(140, 255, 155, 0.06),
    0 0 10px rgba(9, 152, 245, 0.08);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.quick-question:not(:disabled):hover,
.quick-question:focus-visible {
  outline: none;
  border-color: var(--crt-green);
  box-shadow:
    inset 0 0 10px rgba(9, 152, 245, 0.12),
    0 0 14px rgba(9, 152, 245, 0.35);
}

.quick-question:disabled {
  opacity: 0.45;
  cursor: default;
}

.assistant-output {
  width: min(820px, 100%);
  min-height: 80px;
  overflow: hidden;
  color: white;
  font-size: clamp(14px, 1.6vw, 20px);
  line-height: 1.5;
  padding: 14px 18px;
  border: 1px solid var(--crt-border);
  border-radius: 12px;
  background: rgba(5, 14, 7, 0.82);
  box-shadow: inset 0 0 14px rgba(140, 255, 155, 0.06);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  opacity: 0;
}

.assistant-output a {
  color: var(--crt-green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.assistant-output ul,
.assistant-output ol {
  margin: 0.2em 0;
  padding-left: 1.6em;
}

.assistant-output pre {
  margin: 0.4em 0;
  font-family: inherit;
  white-space: pre;
  overflow-x: auto;
}

.reply-question {
  margin-bottom: 0.5em;
  color: var(--crt-green);
  opacity: 0.85;
}

.reply-status {
  opacity: 0.6;
}

.reply-error {
  color: #ff8a8a;
}

.chat-notice {
  width: min(820px, 100%);
  margin: -12px 0 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.chat-notice a,
.site-footer a {
  color: inherit;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  padding: 0 24px 28px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.hidden-form {
  display: none;
}

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

@keyframes logoFlicker {
  0%   { opacity: 0.958; }
  2%   { opacity: 0.916; }
  4%   { opacity: 0.972; }
  19%  { opacity: 0.937; }
  21%  { opacity: 0.986; }
  60%  { opacity: 0.965; }
  100% { opacity: 0.993; }
}

@keyframes textFlicker {
  0% { opacity: 0.94; }
  2% { opacity: 0.88; }
  4% { opacity: 0.96; }
  19% { opacity: 0.91; }
  21% { opacity: 0.98; }
  60% { opacity: 0.95; }
  100% { opacity: 0.99; }
}

@media (max-width: 640px) {
  .language-switcher {
    top: 12px;
    right: 12px;
    font-size: 12px;
  }

  .crt-input-wrap {
    min-height: 62px;
    padding: 0 18px;
  }

  .prompt {
    font-size: 24px;
    margin-right: 10px;
  }

  .fake-caret {
    left: 48px;
    width: 9px;
    height: 28px;
  }
}
