:root {
  --bg: #020403;
  --fg: #b7e8b7;
  --dim: #4f7a4f;
  --mid: #7cbf7c;
  --bright: #e8ffe8;
  --accent: #3dff2b;
  --amber: #e2b15a;
  --err: #ff6b6b;
  --link: #9dff9d;
  --bar: #061008;
  --scan: rgba(0, 0, 0, 0.18);
  --glow: rgba(61, 255, 43, 0.28);
  --font: "JetBrains Mono", "IBM Plex Mono", "Fira Code", "Cascadia Code",
    "Source Code Pro", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --pad: clamp(10px, 2.4vw, 20px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100%;
}

html {
  height: 100%;
}

body {
  min-height: 100dvh;
}

html.js body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vh, 36px) clamp(12px, 3vw, 36px);
}

::selection {
  background: #1a5c1a;
  color: var(--bright);
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--bright);
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
}

.skip:focus {
  left: 8px;
  z-index: 20;
  background: var(--bg);
  color: var(--bright);
  padding: 6px 10px;
}

/* no-js document */
.static {
  max-width: 72ch;
  margin: 0 auto;
  padding: 28px var(--pad) 64px;
}

.static h1,
.static h2,
.static h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bright);
  letter-spacing: 0.02em;
}

.static h1 {
  font-size: 1.25rem;
  color: var(--accent);
  text-shadow: 0 0 8px var(--glow);
}

.static .tag {
  color: var(--amber);
  margin-top: -0.4rem;
}

.static ul {
  padding-left: 1.2rem;
}

.static-langs {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

html.js .static {
  display: none;
}

html:not(.js) #static-pl {
  display: none;
}

html:not(.js) #static-pl:target {
  display: block;
}

html:not(.js) body:has(#static-pl:target) #static-en {
  display: none;
}

html:not(.js) #app {
  display: none !important;
}

/* terminal chrome */
#app {
  display: flex;
  flex-direction: column;
  width: min(92ch, 100%);
  height: min(44rem, calc(100dvh - 48px));
  background: var(--bg);
  border: 1px solid #1c3a1c;
  box-shadow: 0 0 0 1px #050805, 0 18px 50px rgba(0, 0, 0, 0.45);
}

.bar {
  display: flex;
  align-items: center;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 8px var(--pad);
  background: var(--bar);
  border-bottom: 1px solid #163016;
  color: var(--mid);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mark {
  color: var(--accent);
  font-weight: 700;
  text-shadow: 0 0 8px var(--glow);
}

.cmds {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 2px;
  flex: 1;
}

.cmds button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mid);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  cursor: pointer;
}

.cmds button:hover,
.cmds button:focus-visible {
  color: var(--bright);
  outline: none;
  box-shadow: 0 1px 0 var(--accent);
}

.bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.langs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.langs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 6px 8px;
  cursor: pointer;
}

.langs button:hover,
.langs button:focus-visible {
  color: var(--bright);
  outline: none;
}

.langs button[aria-pressed="true"] {
  color: var(--accent);
  text-shadow: 0 0 6px var(--glow);
}

#clock {
  font-variant-numeric: tabular-nums;
}

#term {
  flex: 1;
  overflow: auto;
  padding: 14px var(--pad) 8px;
  text-shadow: 0 0 1px var(--glow);
  scrollbar-color: #1e4a1e var(--bg);
}

#prompt-form {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px var(--pad) calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid #163016;
  background: var(--bar);
  flex-shrink: 0;
}

.ps1 {
  color: var(--accent);
  white-space: nowrap;
  text-shadow: 0 0 6px var(--glow);
}

.ps1-short {
  display: none;
}

#cmd {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--bright);
  font: inherit;
  font-size: 16px;
  caret-color: var(--accent);
  outline: none;
  padding: 0;
}

.line {
  margin: 0 0 2px;
  white-space: pre-wrap;
  word-break: break-word;
}

.out {
  margin: 0 0 12px;
  font: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

.echo .ps {
  color: var(--accent);
}

.echo .typed {
  color: var(--bright);
}

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

.mid {
  color: var(--mid);
}

.hi {
  color: var(--bright);
}

.ok {
  color: var(--accent);
}

.amber {
  color: var(--amber);
}

.err {
  color: var(--err);
}

.k {
  color: var(--amber);
}

.cmd {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cmd:hover {
  color: var(--bright);
}

.ascii {
  color: var(--mid);
  line-height: 1.15;
  margin: 8px 0 12px;
  overflow-x: auto;
}

.launch {
  margin-bottom: 4px;
}

.ascii-wide {
  display: none;
}

.row,
.kv {
  display: grid;
  grid-template-columns: 11ch 1fr;
  gap: 0 12px;
}

.kv {
  margin: 0 0 2px;
}

.kv.block {
  margin-bottom: 0.85em;
}

.pad {
  height: 0.75em;
}

@media (max-width: 640px) {
  html.js body {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  #app {
    width: 100%;
    height: 100dvh;
    height: 100svh;
    max-height: none;
    border: 0;
    box-shadow: none;
  }

  .hide-sm {
    display: none !important;
  }

  .ps1-full {
    display: none;
  }

  .ps1-short {
    display: inline;
  }

  .bar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .bar-left {
    grid-column: 1;
    grid-row: 1;
  }

  .bar-right {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
  }

  .cmds {
    grid-column: 1 / -1;
    grid-row: 2;
    flex: unset;
    display: grid;
    grid-template-columns: repeat(3, max-content);
    gap: 0 4px;
  }

  .cmds button {
    padding: 6px 8px;
  }

  .row,
  .kv {
    grid-template-columns: 9ch 1fr;
  }
}

@media (min-width: 700px) {
  .ascii-wide {
    display: block;
  }

  .ascii-narrow {
    display: none;
  }

  html,
  body {
    font-size: 15.5px;
  }
}

/* CRT overlay */
html.js body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 8;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 2px,
    var(--scan) 2px,
    var(--scan) 3px
  );
  opacity: 0.45;
}

html.js body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.45) 100%);
}

@media (prefers-reduced-motion: reduce) {
  html.js body::before,
  html.js body::after {
    display: none;
  }
}

@media print {
  html.js body::before,
  html.js body::after,
  #app {
    display: none !important;
  }

  html.js[lang="en"] #static-en,
  html.js[lang="pl"] #static-pl {
    display: block !important;
    color: #111;
  }

  .static a {
    color: #111;
  }
}
