:root {
  --bg: #050505;
  --fg: #f1f1e6;
  --dim: #88887c;
  --line: #d8d8ca;
  --accent: #ffffff;
  --warn: #cfcfbd;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Courier New", "Berkeley Mono", "JetBrains Mono", monospace;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.045),
    rgba(255, 255, 255, 0.045) 1px,
    transparent 1px,
    transparent 4px
  );
  opacity: 0.34;
  z-index: 5;
}

a,
button {
  color: var(--fg);
  font: inherit;
}

button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

a:hover,
button:hover {
  background: var(--fg);
  color: var(--bg);
}

pre {
  margin: 0;
  white-space: pre-wrap;
}

.ascii-bg {
  position: fixed;
  right: -3rem;
  bottom: -2rem;
  z-index: 0;
  color: rgba(255, 255, 255, 0.07);
  font-size: clamp(0.72rem, 1.5vw, 1.15rem);
  line-height: 1.05;
  pointer-events: none;
  user-select: none;
}

.screen {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem) 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(230px, 0.6fr) minmax(160px, 0.3fr);
  gap: 2rem;
  align-items: end;
  margin-bottom: 1.3rem;
}

.logo {
  font-size: clamp(0.52rem, 1.45vw, 1rem);
  line-height: 1.05;
  color: var(--accent);
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.28);
}

.subtitle {
  color: var(--dim);
  font-size: clamp(0.78rem, 1.3vw, 0.98rem);
  line-height: 1.4;
}

.logo-art {
  margin: 0;
  justify-self: end;
  width: min(210px, 24vw);
  color: var(--dim);
  text-align: center;
}

.logo-art img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  filter: contrast(1.18) brightness(1.12);
}

.logo-art figcaption {
  margin-top: 0.45rem;
  font-size: 0.72rem;
}

.window {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.16);
}

.window-title {
  color: var(--line);
  font-size: clamp(0.68rem, 1.2vw, 0.95rem);
}

.grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 0.58fr);
  gap: 1.2rem;
  min-height: 590px;
  padding: 0.6rem 0;
}

.side {
  color: var(--dim);
  font-size: clamp(0.68rem, 1.05vw, 0.92rem);
  line-height: 1.22;
}

.log-panel {
  display: block;
  max-height: 360px;
  margin: 0.6rem 0 0.9rem;
  overflow: auto;
  color: var(--fg);
  padding-right: 0.35rem;
  white-space: pre-wrap;
}

.log-panel[hidden] {
  display: none;
}

.terminal-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 590px;
}

.terminal {
  min-height: 0;
  overflow: auto;
  padding-right: 0.4rem;
  color: var(--fg);
  line-height: 1.32;
  font-size: clamp(0.8rem, 1.2vw, 1rem);
}

.line {
  display: block;
  margin-bottom: 0.8rem;
}

.cmd {
  color: var(--warn);
}

.system {
  color: var(--dim);
}

.error {
  color: #fff;
  background: #333;
}

.prompt {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding-top: 0.8rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.28);
}

.prompt input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
}

.prompt input::placeholder {
  color: rgba(255, 255, 255, 0.42);
}

footer {
  margin-top: 1.1rem;
  color: var(--dim);
  font-size: 0.82rem;
}

@media (max-width: 860px) {
  .topbar,
  .grid {
    grid-template-columns: 1fr;
  }

  .logo-art {
    justify-self: start;
    width: min(220px, 60vw);
  }

  .side {
    order: 2;
  }

  .terminal-panel {
    min-height: 520px;
  }
}
