:root {
  --bg: #080a0e;
  --panel: #0d1016;
  --panel-2: #111620;
  --line: #1e2634;
  --text: #c9d1d9;
  --dim: #7d8590;
  --green: #7ee787;
  --amber: #ffa657;
  --blue: #79c0ff;
  --red: #ff7b72;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

html { background: var(--bg); scrollbar-color: #2b3342 var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  padding: clamp(0.75rem, 3vw, 3rem) clamp(0.5rem, 3vw, 2rem) 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  font-family: var(--mono);
  font-size: clamp(0.82rem, 0.55vw + 0.68rem, 0.95rem);
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(120% 80% at 50% -10%, #16202c 0%, rgba(8, 10, 14, 0) 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-shadow: 0 0 12px rgba(126, 231, 135, 0.06);
}

/* matrix easter egg canvas, only filled when invoked */
#rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
#rain.on { opacity: 0.38; }

.term { z-index: 1; }
.foot, .noscript { position: relative; z-index: 1; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--panel);
  color: var(--green);
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
}
.skip:focus { left: 0.5rem; top: 0.5rem; z-index: 10; }

/* window */
.term {
  position: relative;
  width: min(74ch, 100%);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow:
    0 30px 80px -34px #000,
    0 0 0 1px #0009 inset,
    0 0 60px -24px rgba(126, 231, 135, 0.14);
  overflow: hidden;
}
.term::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(126, 231, 135, 0.5), transparent);
}

.titlebar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: #0a0d13;
  border-bottom: 1px solid var(--line);
  font-size: 0.78em;
  color: var(--dim);
}
.dots { display: inline-flex; gap: 0.4rem; }
.dots i { width: 0.7em; height: 0.7em; border-radius: 50%; background: #2b3342; display: block; }
.dots i:first-child { background: #ff5f57aa; }
.dots i:nth-child(2) { background: #febc2eaa; }
.dots i:nth-child(3) { background: #28c840aa; }
.title .sep { color: var(--blue); }
.clock { margin-left: auto; color: var(--green); opacity: 0.8; font-variant-numeric: tabular-nums; }

/* screen */
.screen {
  padding: 1.1rem 1.15rem 0.4rem;
  max-height: min(72vh, 44rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2b3342 transparent;
  position: relative;
}
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.016) 0 1px, transparent 1px 3px);
}
.screen::-webkit-scrollbar { width: 8px; }
.screen::-webkit-scrollbar-thumb { background: #2b3342; border-radius: 4px; }

.banner {
  margin: 0 0 0.2rem;
  font-size: clamp(0.5rem, 1.5vw, 0.75rem);
  line-height: 1.15;
  color: var(--green);
  text-shadow: 0 0 18px rgba(126, 231, 135, 0.35);
  white-space: pre;
  overflow-x: auto;
}
.tagline { margin: 0 0 1rem; font-size: 0.82em; letter-spacing: 0.14em; text-transform: uppercase; }

.prompt { margin: 0.9rem 0 0.35rem; white-space: pre-wrap; word-break: break-word; }
.prompt:first-of-type { margin-top: 0; }
.ps1 { color: var(--green); }
.path { color: var(--blue); }
.cmd { color: var(--text); }

.out { padding-left: 0; }
.out p, .out ul { margin: 0 0 0.6rem; }
h1 { font-size: 1.12em; margin: 0 0 0.5rem; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 1em; margin: 0 0 0.25rem; font-weight: 600; }
.accent { color: var(--green); text-shadow: 0 0 16px rgba(126, 231, 135, 0.25); }
.dim { color: var(--dim); }
.lead { color: var(--text); }

.item {
  border-left: 2px solid #23303f;
  padding: 0.15rem 0 0.55rem 0.85rem;
  margin-bottom: 0.5rem;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}
.item:hover {
  border-left-color: var(--green);
  transform: translateX(3px);
  background: linear-gradient(90deg, rgba(126, 231, 135, 0.05), transparent 70%);
}
.tag { color: var(--amber); font-size: 0.85em; }

.plain { list-style: none; padding: 0; }
.plain li::before { content: "- "; color: var(--dim); }

.contact .mail { font-size: 1.05em; }
a { color: var(--blue); text-decoration: none; border-bottom: 1px solid #79c0ff33; }
a:hover { color: var(--green); border-bottom-color: #7ee78755; }

#extra { margin-top: 0.5rem; }
.err { color: var(--red); }
.ok { color: var(--green); }
.warn { color: var(--amber); }

/* prompt input */
.promptline {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 1.15rem 0.85rem;
  border-top: 1px solid var(--line);
  background: #0a0d13;
}
.promptline label { white-space: nowrap; }
#cmd {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font: inherit;
  caret-color: transparent;
}
#cmd::placeholder { color: #4b5566; }
.caret {
  width: 0.6em;
  height: 1.05em;
  background: var(--green);
  opacity: 0.85;
  flex: 0 0 auto;
}

/* tmux-ish status line */
.statusbar {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-top: 1px solid var(--line);
  background: #0a0d13;
  font-size: 0.72em;
  color: var(--dim);
  letter-spacing: 0.04em;
}
.statusbar .mode {
  background: rgba(126, 231, 135, 0.16);
  color: var(--green);
  padding: 0 0.45rem;
  border-radius: 3px;
}
.statusbar .right { margin-left: auto; }

.foot {
  width: min(74ch, 100%);
  color: var(--dim);
  font-size: 0.8em;
  text-align: center;
}
.foot p { margin: 0.2rem 0; }
.noscript { width: min(74ch, 100%); color: var(--dim); font-size: 0.85em; text-align: center; }

@media (max-width: 34rem) {
  .clock { display: none; }
  .screen { max-height: none; }
  .statusbar { font-size: 0.68em; }
}

@media (prefers-reduced-motion: no-preference) {
  .caret { animation: blink 1.05s steps(1) infinite; }
  @keyframes blink { 0%, 50% { opacity: 0.9; } 51%, 100% { opacity: 0; } }

  .reveal { opacity: 0; transform: translateY(3px); transition: opacity 0.45s ease, transform 0.45s ease; }
  .reveal.shown { opacity: 1; transform: none; }

  .term::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(126, 231, 135, 0.035), transparent 22%);
    animation: sweep 7s linear infinite;
  }
  @keyframes sweep {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .term::after { display: none; }
}
