:root {
  --bg: #07090d;
  --panel: rgba(16, 20, 28, 0.72);
  --border: rgba(120, 160, 255, 0.16);
  --text: #e6ebf5;
  --muted: #8b95a9;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --green: #4ade80;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.55;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(120, 160, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

.glow {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.28;
  z-index: 0;
  animation: float 14s ease-in-out infinite alternate;
}
.glow-1 { background: var(--cyan); top: -160px; left: -140px; }
.glow-2 { background: var(--violet); bottom: -180px; right: -140px; animation-delay: -7s; }

@keyframes float {
  to { transform: translate(80px, 60px) scale(1.15); }
}

.wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 72px 16px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 28px;
}

.title {
  font-size: clamp(3rem, 13vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.title .line { display: block; }
.title .accent {
  position: relative;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--cyan));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

/* glitch layers */
.title .accent::before,
.title .accent::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: inherit;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0;
}
.title .accent::before { animation: glitch-a 4s infinite steps(1); }
.title .accent::after  { animation: glitch-b 4s infinite steps(1); }
@keyframes glitch-a {
  0%, 92%, 100% { opacity: 0; transform: none; }
  93% { opacity: 0.8; transform: translate(-4px, -2px); clip-path: inset(10% 0 55% 0); }
  95% { opacity: 0.8; transform: translate(3px, 1px); clip-path: inset(60% 0 10% 0); }
}
@keyframes glitch-b {
  0%, 93%, 100% { opacity: 0; transform: none; }
  94% { opacity: 0.7; transform: translate(4px, 2px); clip-path: inset(40% 0 30% 0); }
  96% { opacity: 0.7; transform: translate(-3px, -1px); clip-path: inset(5% 0 75% 0); }
}

.terminal {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.b { width: 11px; height: 11px; border-radius: 50%; }
.b.r { background: #ff5f57; }
.b.y { background: #febc2e; }
.b.g { background: #28c840; }
.term-title {
  margin-left: auto;
  margin-right: auto;
  padding-right: 45px;
  font-size: 0.75rem;
  color: var(--muted);
}
.term-body {
  padding: 16px 18px 20px;
  min-height: 210px;
  font-size: 0.85rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.term-body .prompt { color: var(--green); }
.term-body .path { color: var(--cyan); }
.term-body .ok { color: var(--green); }
.term-body .info { color: var(--violet); }
.term-body .dim { color: var(--muted); }
.cursor {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--cyan);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.progress { width: 100%; }
.progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.6);
  transition: width 0.6s ease;
}

.stack {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.stack li {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  font-size: 0.78rem;
  color: var(--muted);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.stack li:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  transform: translateY(-2px);
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.links a:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.25);
}

.foot {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px 16px;
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 520px) {
  .wrap { padding-top: 48px; gap: 22px; }
  .term-body { font-size: 0.76rem; min-height: 230px; }
  .term-title { padding-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
