:root {
  --bg: #020403;
  --green: #6cff9c;
  --green-strong: #93ffb8;
  --green-soft: rgba(108, 255, 156, 0.64);
  --green-line: rgba(108, 255, 156, 0.22);
  --glow: rgba(108, 255, 156, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(108, 255, 156, 0.06), transparent 28%),
    linear-gradient(180deg, #010201 0%, var(--bg) 55%, #000000 100%);
  color: var(--green);
  font-family: "IBM Plex Mono", monospace;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at center, transparent 36%, rgba(0, 0, 0, 0.72) 100%);
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(108, 255, 156, 0.06) 0,
      rgba(108, 255, 156, 0.06) 1px,
      transparent 1px,
      transparent 4px
    );
  opacity: 0.16;
  mix-blend-mode: screen;
}

.system {
  position: relative;
  min-height: 100vh;
  width: 100%;
  padding: 1rem 0.75rem 2rem;
  display: grid;
  gap: 2rem;
  align-content: center;
  justify-items: center;
}

.terminal-stage {
  position: relative;
  width: min(1320px, calc(100% - 1rem));
  min-height: 48rem;
  margin: 0 auto;
}

.terminal {
  position: absolute;
  max-width: min(32rem, calc(100vw - 1.5rem));
  border: 1px solid var(--green-line);
  background: linear-gradient(180deg, rgba(7, 17, 10, 0.86), rgba(2, 4, 3, 0.96));
  box-shadow:
    0 0 0 1px rgba(108, 255, 156, 0.05),
    0 0 40px var(--glow);
  opacity: 0;
  transform: scale(0.94) translateY(18px);
  font-family: "IBM Plex Mono", monospace;
}

.terminal.is-open {
  animation: terminal-open 700ms ease forwards;
}

.terminal-alert {
  border-color: rgba(108, 255, 156, 0.38);
  box-shadow:
    0 0 0 1px rgba(108, 255, 156, 0.08),
    0 0 55px rgba(108, 255, 156, 0.22);
}

.terminal-alert .terminal-bar {
  background: rgba(108, 255, 156, 0.09);
}

.terminal-final {
  transform: translateX(-50%) scale(0.94) translateY(18px);
  max-width: none;
  box-shadow:
    0 0 0 1px rgba(108, 255, 156, 0.12),
    0 0 70px rgba(108, 255, 156, 0.24);
  overflow: hidden;
}

.terminal-final.is-open {
  animation: terminal-open-final 700ms ease forwards;
}

.terminal-final.is-fullscreen {
  top: 10px !important;
  left: 50% !important;
  width: 100vw !important;
  height: calc(100vh - 10px) !important;
  transform: translateX(-50%) !important;
  transition:
    top 700ms ease,
    left 700ms ease,
    width 700ms ease,
    height 700ms ease,
    transform 700ms ease;
}

.terminal-final .terminal-body {
  padding: 0.75rem 0.85rem;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.terminal-final .terminal-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.terminal-final .line {
  min-height: 1.18em;
  font-size: 0.78rem;
  line-height: 1.18;
}

.terminal-final.is-fullscreen .terminal-body {
  height: calc(100vh - 10px - 3.25rem) !important;
  min-height: calc(100vh - 10px - 3.25rem) !important;
  max-height: calc(100vh - 10px - 3.25rem) !important;
}

.terminal-final .ascii-line {
  margin: 0;
  min-height: 1.02em;
  font-size: 0.44rem;
  line-height: 1.02;
  white-space: pre;
  color: var(--green-strong);
  text-shadow: 0 0 8px rgba(108, 255, 156, 0.18);
}

.terminal-final .ascii-line::before {
  content: none;
}

.login-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.55em;
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--green);
}

.login-label {
  color: var(--green-strong);
  white-space: pre;
}

.login-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--green);
  font: inherit;
  caret-color: var(--green-strong);
}

.login-input::placeholder {
  color: rgba(108, 255, 156, 0.35);
}

.login-input:focus {
  text-shadow: 0 0 10px rgba(108, 255, 156, 0.22);
}

.choice-menu {
  margin: 0 0 0.25rem;
}

.choice-line {
  cursor: default;
}

.choice-line::before {
  content: "";
}

.choice-line.is-selected {
  color: #020403;
  background: var(--green-strong);
  text-shadow:
    none;
}

.choice-line.is-locked {
  color: var(--green-strong);
}

.loading-block {
  margin: 0.35rem 0 0.65rem;
}

.loading-label {
  margin: 0 0 0.4rem;
  min-height: 1.18em;
  color: var(--green);
  font-size: 0.78rem;
  line-height: 1.18;
  text-shadow: 0 0 10px rgba(108, 255, 156, 0.22);
}

.loading-label::before {
  content: "> ";
  color: var(--green-strong);
}

.loading-terminal-line {
  margin: 0;
  min-height: 1.18em;
  color: var(--green-strong);
  font-size: 0.76rem;
  line-height: 1.18;
  letter-spacing: 0.04rem;
  text-shadow: 0 0 10px rgba(108, 255, 156, 0.2);
  white-space: pre;
}

.loading-terminal-line::before {
  content: "> ";
  color: var(--green-strong);
}


.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--green-line);
  background: rgba(108, 255, 156, 0.05);
}

.terminal-bar p {
  margin: 0 0 0 0.35rem;
  color: var(--green-soft);
  font-size: 0.72rem;
  letter-spacing: 0.12rem;
}

.terminal-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: 1px solid rgba(108, 255, 156, 0.45);
  background: rgba(108, 255, 156, 0.08);
}

.terminal-body {
  padding: 1rem 1rem 1.2rem;
}

.line {
  margin: 0;
  min-height: 1.55em;
  color: var(--green);
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
  line-height: 1.55;
  white-space: pre;
  text-shadow: 0 0 10px rgba(108, 255, 156, 0.22);
}

.line::before {
  content: "> ";
  color: var(--green-strong);
}

.line strong,
.thinking-line strong,
.loading-terminal-line strong {
  color: #d8ffb3;
  font-weight: 700;
}

.line em,
.thinking-line em,
.loading-terminal-line em {
  color: #c8ffcf;
  font-style: italic;
  display: inline-block;
  width: calc(100% - 0.4rem);
  margin-left: 0.1rem;
  padding: 0.08rem 0 0.08rem 0.7rem;
  border-left: 2px solid rgba(154, 245, 176, 0.45);
  background: linear-gradient(90deg, rgba(108, 255, 156, 0.08), rgba(108, 255, 156, 0.02) 70%, transparent);
  box-shadow: inset 0 0 18px rgba(108, 255, 156, 0.05);
  letter-spacing: 0.01rem;
  text-shadow: 0 0 12px rgba(154, 245, 176, 0.22);
}

.line-spacer {
  min-height: 0.8rem;
}

.line-spacer::before {
  content: "";
}

.thinking-line {
  margin: 0;
  min-height: 1.18em;
  color: var(--green);
  font-size: 0.78rem;
  line-height: 1.18;
  text-shadow: 0 0 10px rgba(108, 255, 156, 0.22);
}

.thinking-line::before {
  content: "> ";
  color: var(--green-strong);
}

.thinking-dots {
  display: inline-block;
  min-width: 1.6em;
}

.thinking-dots span {
  opacity: 0.2;
  animation: thinking-blink 1.2s infinite;
}

.thinking-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

.hero {
  position: relative;
  width: min(1320px, calc(100% - 1rem));
  opacity: 0;
  transform: translateY(20px);
}

.hero.is-visible {
  animation: fade-up 1200ms ease forwards;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--green-soft);
  font-size: 0.82rem;
  letter-spacing: 0.36rem;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--green-strong);
  font-size: clamp(2.6rem, 6vw, 5.8rem);
  font-weight: 700;
  letter-spacing: 0.22rem;
  text-transform: uppercase;
  text-shadow:
    0 0 18px rgba(108, 255, 156, 0.18),
    0 0 40px rgba(108, 255, 156, 0.08);
}

@keyframes terminal-open {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(18px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes terminal-open-final {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.94) translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1) translateY(0);
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes thinking-blink {
  0%,
  20% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.2;
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .system {
    padding: 1.25rem;
  }

  .terminal-stage {
    min-height: auto;
    display: grid;
    gap: 1rem;
  }

  .terminal {
    position: relative;
    inset: auto !important;
    width: 100% !important;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .terminal,
  .hero {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}
