:root {
  --bg: #0a0e14;
  --bg-2: #0d131b;
  --border: #1e2a37;
  --text: #d7e0ea;
  --muted: #8b99a9;
  --green: #3ddc97;
  --cyan: #4cc9f0;
  --amber: #f6c177;
  --mono: ui-monospace, "JetBrains Mono", "Fira Code", "Cascadia Code", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  display: flex; flex-direction: column;
  background:
    radial-gradient(900px 500px at 50% 35%, rgba(61, 220, 151, .07), transparent 65%),
    var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 4px; }

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

.cursor {
  display: inline-block; width: .6em; height: 1.1em; background: var(--green);
  vertical-align: -3px; animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* terminal */
.shell-page { height: 100%; overflow: hidden; }
.shell {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  width: min(920px, 100% - 32px); margin: 24px auto;
  background: rgba(7, 10, 15, .92);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  box-shadow: 0 30px 90px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(61, 220, 151, .05), 0 0 60px -20px rgba(61, 220, 151, .15);
}
.shell-bar {
  display: flex; align-items: center; gap: 7px; padding: 10px 14px; flex: none;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
}
.shell-bar span { width: 11px; height: 11px; border-radius: 50%; }
.shell-bar span:nth-child(1) { background: #ff5f57; }
.shell-bar span:nth-child(2) { background: #febc2e; }
.shell-bar span:nth-child(3) { background: #28c840; }
.shell-bar em { margin: 0 auto; padding-right: 50px; font-size: .8rem; color: var(--muted); font-style: normal; }

.screen {
  flex: 1; min-height: 0; overflow-y: auto; cursor: text;
  padding: 18px 20px 22px; font-size: .95rem; line-height: 1.6;
  text-shadow: 0 0 6px rgba(61, 220, 151, .12);
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.row { white-space: pre-wrap; word-break: break-word; min-height: 1.6em; }
.row.pre { white-space: pre; word-break: normal; overflow-x: auto; }
.ok { color: var(--green); }
.warn { color: var(--amber); }
.bad { color: #ff7b72; }
.accent { color: var(--green); font-weight: 600; }
.cyan { color: var(--cyan); }
.ps1-echo { color: var(--cyan); }

.line { display: flex; align-items: baseline; gap: .6em; }
.line.busy { visibility: hidden; }
.ps1 { color: var(--cyan); white-space: nowrap; }
#cmd {
  flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent;
  color: var(--text); font: inherit; font-size: max(16px, 1em); caret-color: var(--green);
}

.chips {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; flex: none;
  border-top: 1px solid var(--border); background: var(--bg-2);
}
.chips[hidden], .line[hidden] { display: none; }
.chips button {
  font: .8rem var(--mono); color: var(--muted); cursor: pointer;
  padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; background: transparent;
}
.chips button:hover { color: var(--green); border-color: var(--green); }

#matrix { position: fixed; inset: 0; z-index: 10; cursor: pointer; }
#matrix[hidden] { display: none; }

.noscript { padding: 48px 20px; text-align: center; }
.noscript h1 { margin: 12px 0 4px; font-size: clamp(2.4rem, 10vw, 4.5rem); letter-spacing: -.03em; }

@media (max-width: 640px) {
  .shell { width: 100%; margin: 0; border: 0; border-radius: 0; }
  .screen { padding: 14px 14px 18px; font-size: .85rem; }
  .shell-bar em { padding-right: 0; }
}

/* 404 */
.notfound { flex: 1; display: grid; place-items: center; padding: 16px; }
.term {
  width: min(560px, 100%); background: #070a0f;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.term-bar {
  display: flex; align-items: center; gap: 7px; padding: 10px 14px;
  background: var(--bg-2); border-bottom: 1px solid var(--border);
}
.term-bar span { width: 11px; height: 11px; border-radius: 50%; }
.term-bar span:nth-child(1) { background: #ff5f57; }
.term-bar span:nth-child(2) { background: #febc2e; }
.term-bar span:nth-child(3) { background: #28c840; }
.term-bar em { margin-left: 10px; font-size: .8rem; color: var(--muted); font-style: normal; }
.term-body { margin: 0; padding: 20px 22px; font: .92rem/1.7 var(--mono); white-space: pre-wrap; }
.p { color: var(--cyan); }

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}
