:root {
  color-scheme: dark;
  --bg: #050805;
  --panel: rgba(5, 10, 5, 0.76);
  --line: #142014;
  --accent: #3ddc63;
  --accent-soft: #2a7a3e;
  --text: #d9ffe4;
  --muted: #5a6b5c;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 34%, #0d190c 0, var(--bg) 64%),
    var(--bg);
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

body::before {
  content: "";
  position: fixed;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  opacity: .075;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(217, 255, 228, .25) 4px);
  mix-blend-mode: soft-light;
}

body::after {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 180px rgba(0, 0, 0, .68);
}

#matrix {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .48;
  pointer-events: none;
}

.telemetry {
  position: fixed;
  z-index: 2;
  top: 20px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  color: #344936;
  font-size: 10px;
  letter-spacing: .14em;
  pointer-events: none;
}

.node-state { display: flex; align-items: center; gap: 8px; }
.node-state i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(61, 220, 99, .7);
}

main {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(18px, 3.6vh, 34px);
  padding: clamp(24px, 5vh, 52px) 20px;
}

.identity {
  display: grid;
  justify-items: center;
  gap: 7px;
  text-align: center;
}

.mark {
  position: relative;
  width: clamp(150px, 28vh, 270px);
  aspect-ratio: 1;
  margin-bottom: clamp(2px, 1vh, 10px);
  transform-style: preserve-3d;
  transition: transform 180ms ease-out;
  filter: drop-shadow(0 0 20px rgba(61, 220, 99, .34));
}

.mark::after {
  content: "";
  position: absolute;
  inset: 19%;
  border-radius: 50%;
  background: rgba(61, 220, 99, .08);
  filter: blur(28px);
  transform: translateZ(-10px);
}

.mark img { display: block; width: 100%; height: 100%; }

h1 {
  margin: 0;
  font-size: clamp(30px, 5vh, 43px);
  letter-spacing: -.055em;
  line-height: 1;
  text-shadow: 0 0 18px rgba(61, 220, 99, .48);
}

h1 span {
  color: var(--muted);
  font-weight: 400;
  text-shadow: none;
}

.identity p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(10px, 1.7vw, 13px);
  letter-spacing: .16em;
}

.identity b { color: var(--accent-soft); font-weight: 400; }

.terminal {
  width: min(620px, 90vw);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .24), inset 0 1px rgba(255, 255, 255, .015);
  backdrop-filter: blur(5px);
}

.terminal header {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.terminal header i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1f3a26;
}

.terminal header i.online {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(61, 220, 99, .45);
}

.terminal header span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 11px;
}

.terminal header .terminal-title { flex: 1; }

.terminal header time {
  color: #3a4a3c;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.screen {
  min-height: clamp(88px, 15vh, 142px);
  max-height: 31vh;
  overflow: auto;
  padding: 14px 16px 2px;
  color: #a8c4ad;
  font-size: clamp(12px, 2vw, 14px);
  line-height: 1.7;
  scrollbar-color: #1f3a26 transparent;
}

.screen div { white-space: pre-wrap; overflow-wrap: anywhere; }
.screen em, #prompt label { color: var(--accent-soft); font-style: normal; }

#prompt {
  display: flex;
  align-items: center;
  min-height: 31px;
  padding: 0 16px 10px;
  font-size: clamp(12px, 2vw, 14px);
}

#command {
  width: 1ch;
  min-width: 1ch;
  max-width: calc(100% - 28px);
  flex: 0 1 auto;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  caret-color: transparent;
  font: inherit;
}

.cursor {
  width: 8px;
  height: 17px;
  margin-left: -1px;
  background: var(--accent);
  animation: blink 1.1s step-end infinite;
}

.terminal footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  color: #3a4a3c;
  font-size: 11px;
}

.terminal footer #session {
  flex: none;
  color: #2a7a3e;
}

noscript {
  position: fixed;
  bottom: 12px;
  left: 12px;
  color: var(--muted);
  font-size: 12px;
}

::selection { background: #1f5c31; color: var(--text); }
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

@media (max-height: 700px) {
  main { align-content: start; gap: 14px; padding-block: 20px; }
  .mark { width: 135px; }
  .identity p { font-size: 10px; }
  .screen { min-height: 72px; max-height: 27vh; }
}

@media (max-width: 560px) {
  .telemetry { top: 12px; left: 14px; right: 14px; }
  .telemetry span:last-child, .terminal header time, .terminal footer #session { display: none; }
  .terminal footer { white-space: nowrap; overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  #matrix { display: none; }
  body::before { display: none; }
  .mark { transition: none; }
  .cursor { animation: none; }
}
