:root {
  --bg: #000300;
  --green: #00ff6a;
  --green-dim: #14b85a;
  --green-deep: #06331d;
  --text: #c9ffe2;
  --muted: #5f8f75;
  --glow: 0 0 2px rgba(0, 255, 106, .5), 0 0 18px rgba(0, 255, 106, .28);
}

* { box-sizing: border-box; }

html, body { height: 100%; max-width: 100%; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 400;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
}

/* ---------- background layers ---------- */

#rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: .62;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, .22) 3px,
    rgba(0, 0, 0, .22) 4px
  );
  mix-blend-mode: multiply;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(0, 255, 106, .07), transparent 60%),
    radial-gradient(100% 80% at 50% 50%, transparent 35%, rgba(0, 0, 0, .74) 100%);
}

/* ---------- layout ---------- */

main {
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 16px 32px;
}

.terminal {
  width: 100%;
  min-width: 0;
  max-width: 980px;
  padding: 0 0 26px;
  border: 1px solid rgba(0, 255, 106, .28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0, 24, 13, .9), rgba(0, 8, 4, .94));
  box-shadow:
    0 0 0 1px rgba(0, 255, 106, .06),
    0 24px 80px rgba(0, 0, 0, .8),
    0 0 90px rgba(0, 255, 106, .12) inset;
  animation: boot .9s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes boot {
  from { opacity: 0; transform: translateY(14px) scale(.99); }
  to   { opacity: 1; transform: none; }
}

.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(0, 255, 106, .2);
  background: rgba(0, 255, 106, .05);
  border-radius: 11px 11px 0 0;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-deep);
  border: 1px solid rgba(0, 255, 106, .45);
}

.dot:first-child { background: rgba(0, 255, 106, .55); }

.path {
  margin-left: 10px;
  font-size: .72rem;
  letter-spacing: .06em;
  color: var(--muted);
}

.prompt {
  margin: 20px 0 0;
  padding: 0 clamp(18px, 4vw, 40px);
  font-size: clamp(.72rem, 1.9vw, .85rem);
  color: var(--muted);
  letter-spacing: .02em;
}

.prompt.tail { margin: 24px 0 0; }
.user { color: var(--green); }
.host { color: var(--green-dim); }
.dir  { color: #7fd8ff; }
.cmd  { color: var(--text); }

.caret {
  display: inline-block;
  width: .62em;
  height: 1.05em;
  vertical-align: -.18em;
  background: var(--green);
  box-shadow: var(--glow);
  animation: blink 1.05s steps(1, end) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---------- headline ---------- */

h1 {
  margin: 18px 0 0;
  padding: 0 clamp(18px, 4vw, 40px);
  font-size: clamp(1.15rem, 4.1vw, 2.5rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -.02em;
  overflow-wrap: break-word;
}

.line {
  display: block;
  color: #eafff3;
  text-shadow: var(--glow);
}

.line + .line { margin-top: .5em; }

.line.accent {
  color: var(--green);
  font-weight: 600;
  text-shadow: 0 0 2px rgba(0, 255, 106, .45), 0 0 22px rgba(0, 255, 106, .3);
}

.line.accent em {
  font-style: normal;
  position: relative;
  color: #fff;
  text-shadow: 0 0 2px rgba(0, 255, 106, .6), 0 0 20px rgba(0, 255, 106, .75);
}

.line.accent em.nb { white-space: nowrap; }

.line.accent em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -.12em;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
  box-shadow: 0 0 12px var(--green);
}

/* chromatic-aberration glitch */
.glitch { position: relative; }

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .75;
}

.glitch::before {
  color: #ff2e6a;
  animation: shift-a 4.4s infinite steps(2, end);
  clip-path: inset(0 0 58% 0);
}

.glitch::after {
  color: #29e7ff;
  animation: shift-b 3.7s infinite steps(2, end);
  clip-path: inset(56% 0 0 0);
}

@keyframes shift-a {
  0%, 92%, 100% { transform: none; opacity: 0; }
  93% { transform: translate(-3px, -1px); opacity: .8; }
  96% { transform: translate(2px, 1px); opacity: .5; }
}

@keyframes shift-b {
  0%, 90%, 100% { transform: none; opacity: 0; }
  91% { transform: translate(3px, 1px); opacity: .8; }
  95% { transform: translate(-2px, -1px); opacity: .5; }
}

/* ---------- footer ---------- */

footer {
  position: relative;
  z-index: 2;
  padding: 26px 16px 42px;
  text-align: center;
  border-top: 1px solid rgba(0, 255, 106, .14);
  background: linear-gradient(180deg, transparent, rgba(0, 255, 106, .04));
}

.from {
  margin: 0 0 14px;
  font-size: .72rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: center;
}

.links a {
  position: relative;
  padding: 9px 16px;
  border: 1px solid rgba(0, 255, 106, .3);
  border-radius: 999px;
  color: var(--green);
  font-size: clamp(.78rem, 2.4vw, .92rem);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: .01em;
  background: rgba(0, 255, 106, .035);
  transition: color .18s, background .18s, border-color .18s, transform .18s, box-shadow .18s;
}

.links a::before {
  content: "\203A ";
  color: var(--green-dim);
}

.links a:hover,
.links a:focus-visible {
  color: #001a0c;
  background: var(--green);
  border-color: var(--green);
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(0, 255, 106, .55), 0 8px 24px rgba(0, 0, 0, .6);
  outline: none;
}

.links a:hover::before,
.links a:focus-visible::before { color: #001a0c; }

/* ---------- responsive / a11y ---------- */

@media (max-width: 720px) {
  main { padding: 48px 14px 24px; }

  h1, .prompt { padding: 0 18px; }
  .terminal { border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  #rain { display: none; }
  .terminal { animation: none; }
  .caret { animation: none; }
  .glitch::before, .glitch::after { display: none; }
  .links a:hover { transform: none; }
}
