:root {
  color-scheme: dark;
  --bg: #020403;
  --green: #4dff88;
  --green-soft: #a0ffbd;
  --white: #e7f2e9;
  --muted: #71927a;
  --line: rgba(77, 255, 136, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--white);
  background:
    radial-gradient(circle at 18% 10%, rgba(38, 119, 66, 0.11), transparent 36rem),
    var(--bg);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(77, 255, 136, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 255, 136, 0.018) 1px, transparent 1px);
  background-size: 24px 24px;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.1;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(126, 255, 173, 0.14) 4px
  );
}

.terminal {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 3.6vw, 48px);
  text-shadow: 0 0 10px rgba(77, 255, 136, 0.11);
}

.boot-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--muted);
  font-size: clamp(0.72rem, 1.6vw, 0.92rem);
}

.prompt-user,
.prompt-path,
.online {
  color: var(--green);
}

.terminal-content {
  width: min(100%, 1040px);
  flex: 1;
  padding: clamp(34px, 7vh, 76px) 0 48px;
}

.ascii-title {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--green);
  font-size: clamp(0.39rem, 1.48vw, 1rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
  white-space: pre;
  filter: drop-shadow(0 0 8px rgba(77, 255, 136, 0.22));
}

.subtitle {
  margin: 17px 0 0;
  color: var(--white);
  font-size: clamp(0.85rem, 2vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.2em;
}

.session {
  margin: 10px 0 clamp(30px, 5vh, 54px);
  color: var(--muted);
  font-size: clamp(0.66rem, 1.5vw, 0.82rem);
}

.session span {
  color: var(--green-soft);
}

.output {
  min-height: 254px;
  max-width: 940px;
  color: #cddbd0;
  font-size: clamp(0.76rem, 1.75vw, 0.96rem);
  line-height: 1.72;
}

.line {
  margin: 0 0 4px;
}

.line::before {
  content: "[+]";
  margin-right: 12px;
  color: var(--green);
}

.line.is-alert {
  color: #ffe2a8;
}

.line.is-alert::before {
  content: "[!]";
  color: #ffcf70;
}

.line.is-final {
  color: var(--green-soft);
  font-weight: 700;
}

.cursor::after {
  content: "█";
  margin-left: 4px;
  color: var(--green);
  animation: blink 0.8s step-end infinite;
}

.progress-section {
  max-width: 680px;
  margin: 20px 0 2px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #061008;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(
    90deg,
    var(--green) 0,
    var(--green) 8px,
    transparent 8px,
    transparent 11px
  );
  transition: width 0.16s linear;
}

.question {
  max-width: 780px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
  animation: fade 0.45s ease both;
}

.prompt {
  margin: 0 0 22px;
  color: var(--white);
  font-size: clamp(1rem, 2.7vw, 1.45rem);
  font-weight: 700;
}

.prompt span {
  color: var(--green);
}

.actions {
  min-height: 46px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

button {
  min-width: 110px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--green-soft);
  background: transparent;
  font: 700 0.82rem/1 "SFMono-Regular", Consolas, monospace;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

button:hover,
button:focus-visible {
  outline: none;
  color: #011006;
  background: var(--green);
  box-shadow: 0 0 22px rgba(77, 255, 136, 0.18);
}

button.primary {
  color: #011006;
  border-color: var(--green);
  background: var(--green);
}

button.runaway {
  color: var(--muted);
  border-color: rgba(113, 146, 122, 0.34);
  user-select: none;
  touch-action: none;
}

button.runaway.is-running {
  position: fixed;
  z-index: 40;
  margin: 0;
  transition: left 0.18s ease, top 0.18s ease;
}

.success {
  max-width: 780px;
  padding: 28px 0;
  animation: reveal 0.5s ease both;
}

.success p {
  margin: 8px 0;
}

.success__ascii {
  margin: 0 0 22px;
  color: var(--green);
  font-size: clamp(0.85rem, 2.8vw, 1.2rem);
  line-height: 1.4;
}

.success__title {
  color: var(--green-soft);
  font-size: clamp(1.4rem, 4vw, 2.3rem);
  font-weight: 800;
}

.success__plan {
  margin-top: 18px !important;
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 700;
}

.success__activity {
  color: var(--muted);
  font-size: 0.82rem;
}

.terminal-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(77, 255, 136, 0.1);
  color: #496650;
  font-size: 0.66rem;
}

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

[hidden] {
  display: none !important;
}

@keyframes blink {
  50% { opacity: 0; }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 600px) {
  .terminal {
    padding: 16px;
  }

  .terminal-content {
    padding-top: 44px;
  }

  .ascii-title {
    font-size: clamp(0.34rem, 1.6vw, 0.46rem);
  }

  .subtitle {
    letter-spacing: 0.11em;
  }

  .output {
    min-height: 300px;
    line-height: 1.58;
  }

  .line::before {
    margin-right: 7px;
  }

  .actions {
    width: 100%;
  }

  button {
    flex: 0 0 calc(50% - 7px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
