:root {
  --bg: #07080b;
  --fg: #c9ccd6;
  --dim: #666b7c;
  --acc: #b3122d;
  --line: #1c1f29;
  --pan: #0d0f15;
  color-scheme: dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
}
* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font:
    300 14px/1.65 "IBM Plex Mono",
    ui-monospace,
    Menlo,
    monospace;
  min-height: 100vh;
}
#grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.07;
  z-index: 5;
}
body:after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.18) 0 1px,
    transparent 1px 3px
  );
}
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 22px 18px calc(84px + env(safe-area-inset-bottom, 0px));
}
h1,
h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 300;
  letter-spacing: 0.04em;
  margin: 0;
}
h1 {
  font-size: 44px;
  line-height: 1.05;
}
h2 {
  font-size: 28px;
}
.dim {
  color: var(--dim);
}
.acc {
  color: var(--acc);
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.row b {
  font-weight: 400;
}
button {
  font: inherit;
  color: var(--fg);
  background: none;
  border: 1px solid var(--dim);
  padding: 14px 18px;
  cursor: pointer;
  letter-spacing: 0.12em;
  width: 100%;
  text-align: center;
  min-height: 48px;
}
button:hover,
button:focus-visible {
  border-color: var(--acc);
  color: #fff;
  outline: none;
}
button.q {
  width: auto;
  padding: 8px 12px;
  min-height: 40px;
  font-size: 12px;
  letter-spacing: 0.05em;
}
.item {
  display: flex;
  gap: 16px;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  letter-spacing: 0;
}
.item .n {
  color: var(--dim);
  width: 38px;
}
.item .s {
  font-size: 12px;
  margin-top: 2px;
}
.clock {
  font-size: 34px;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}
nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  background: rgba(7, 8, 11, 0.94);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
nav button {
  border: 0;
  flex: 1;
  font-size: 12px;
  color: var(--dim);
}
nav button.on {
  color: var(--fg);
  box-shadow: inset 0 2px var(--acc);
}
canvas.img {
  width: 100%;
  aspect-ratio: 1;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  background: #000;
}
.bar {
  height: 6px;
  background: var(--line);
  margin: 8px 0;
}
.bar i {
  display: block;
  height: 100%;
  background: var(--acc);
}
#term {
  background: var(--pan);
  border: 1px solid var(--line);
  padding: 12px;
  min-height: 260px;
  max-height: 52vh;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
#cmd {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}
#cmd input {
  flex: 1;
  min-width: 0;
  background: var(--pan);
  border: 1px solid var(--line);
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  padding: 10px;
}
.qs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.glitch {
  animation: g 0.35s steps(2) 1;
}
@keyframes g {
  0% {
    transform: translateX(-3px);
    color: var(--acc);
  }
  50% {
    transform: translateX(3px);
  }
  100% {
    transform: none;
  }
}
#ov {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: #000;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 18px;
  letter-spacing: 0.3em;
}
.hid {
  display: block;
  color: var(--bg);
  user-select: all;
  font-size: 11px;
}
@media (prefers-reduced-motion: reduce) {
  .glitch {
    animation: none;
  }
}
