/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: #050814;
  color: #f1f5f9;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  height: 100vh;
}
#root, .page {
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.page > .hero { flex: 1 1 auto; min-height: 0; }
.page > .footer { flex: 0 0 auto; }

:root {
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --warm: #fb923c;
  --text-1: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --green: #4ade80;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

::selection { background: rgba(34,211,238,.3); color: #fff; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ===== Hero ===== */
.hero {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute; inset: 0;
  background-image: url('assets/hero.jpg');
  background-size: cover;
  background-position: center;
  filter: saturate(1.05) contrast(1.02);
  z-index: 0;
  transform: scale(1.03);
}
.hero__overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(5,8,20,0) 0%, rgba(5,8,20,0.55) 70%, rgba(5,8,20,0.92) 100%),
    linear-gradient(to top, rgba(5,8,20,0.92) 0%, rgba(5,8,20,0.6) 45%, rgba(5,8,20,0.3) 100%);
  z-index: 1;
}
.hero__grain {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 2;
}
.hero__particles {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 2;
}
.hero__pulses { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.hero__sparks { position: absolute; inset: 0; z-index: 4; pointer-events: none; }

.hero__inner {
  position: relative;
  z-index: 5;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 28px 40px 32px;
}

/* Top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 12.5px; letter-spacing: 0.04em;
  color: var(--text-2);
}
.brand__mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid rgba(34,211,238,0.45);
  background: rgba(34,211,238,0.08);
  border-radius: 6px;
  color: var(--cyan);
  box-shadow: 0 0 18px rgba(34,211,238,0.18) inset;
}
.brand__name { color: var(--text-1); font-weight: 500; }
.brand__sep { opacity: 0.45; }

.statuspill {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  color: #bef0f7;
  background: rgba(5,8,20,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(34,211,238,0.3);
  box-shadow: 0 0 30px rgba(34,211,238,0.06);
}
.statuspill__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(34,211,238,0.6);
  animation: pulse-dot 1.8s ease-out infinite;
}
@keyframes pulse-dot {
  0%   { box-shadow: 0 0 0 0 rgba(34,211,238,0.55); transform: scale(1); }
  70%  { box-shadow: 0 0 0 10px rgba(34,211,238,0); transform: scale(1.06); }
  100% { box-shadow: 0 0 0 0 rgba(34,211,238,0); transform: scale(1); }
}

/* Center content */
.hero__center {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 22px;
  padding: 12px 0 12px;
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
}
.tag {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(5, 8, 20, 0.78);
  border: 1px solid rgba(34,211,238,0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 0 1px rgba(34,211,238,0.08), 0 0 24px -4px rgba(34,211,238,0.45);
  text-shadow: 0 0 14px rgba(34,211,238,0.5);
}
.tag__beam {
  width: 18px; height: 1px;
  background: linear-gradient(to right, transparent, var(--cyan));
}
.headline {
  margin: 0;
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 0.98;
  color: #fff;
  text-wrap: balance;
}
.headline__caret {
  display: inline-block;
  width: 0.55ch;
  margin-left: 0.08em;
  border-bottom: 0.08em solid var(--cyan);
  animation: caret 1.05s steps(2, end) infinite;
  vertical-align: baseline;
}
@keyframes caret { 50% { opacity: 0; } }

.subhead {
  margin: 0;
  font-size: clamp(15px, 1.4vw, 18px);
  color: var(--text-2);
  max-width: 620px;
  line-height: 1.55;
  text-wrap: pretty;
}
.subhead em {
  font-style: normal;
  color: var(--text-1);
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(167,139,250,0.1);
  padding: 1px 7px;
  border-radius: 4px;
  border: 1px solid rgba(167,139,250,0.2);
}

/* Terminal */
.terminal {
  margin-top: 12px;
  width: 100%;
  max-width: 560px;
  background: rgba(5,8,20,0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(148,163,184,0.12);
  border-left: 2px solid var(--cyan);
  border-radius: 10px;
  text-align: left;
  font-family: var(--mono);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,0.6), 0 0 0 1px rgba(34,211,238,0.04);
  overflow: hidden;
}
.terminal__head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148,163,184,0.08);
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.terminal__sessionlamp {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  flex-shrink: 0;
}
.terminal__sessiontag {
  color: var(--text-2);
  font-weight: 500;
  letter-spacing: 0.12em;
}
.terminal__path { color: var(--text-2); text-transform: none; letter-spacing: 0.02em; font-size: 11.5px; }
.terminal__pid { margin-left: auto; color: var(--cyan); text-transform: none; letter-spacing: 0.04em; }
.terminal__body {
  padding: 16px 18px 18px;
  font-size: 13.5px;
  line-height: 1.7;
  min-height: 120px;
}
.terminal__hist { color: var(--text-3); }
.terminal__hist-text { color: var(--text-3); }
.terminal__hist .ok { color: var(--green); margin-left: 8px; }
.terminal__line { display: flex; align-items: center; gap: 8px; }
.terminal__prompt { color: var(--cyan); user-select: none; }
.terminal__text { color: var(--text-1); white-space: pre; }
.terminal__cursor {
  display: inline-block;
  width: 8px; height: 1.05em;
  background: var(--cyan);
  vertical-align: -2px;
  margin-left: 2px;
  animation: caret 1s steps(2, end) infinite;
  box-shadow: 0 0 8px rgba(34,211,238,0.7);
}

/* Metrics widget bottom-left */
.metrics {
  position: absolute;
  left: 28px; bottom: 76px;
  z-index: 6;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
  background: rgba(5,8,20,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(148,163,184,0.1);
  border-radius: 8px;
  padding: 12px 14px;
  min-width: 200px;
  letter-spacing: 0.02em;
}
.metrics__head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(148,163,184,0.12);
}
.metrics__head em {
  font-style: normal;
  color: var(--cyan);
  display: inline-flex; align-items: center; gap: 6px;
}
.metrics__head em::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.metrics__row { display: flex; justify-content: space-between; gap: 14px; }
.metrics__row + .metrics__row { margin-top: 4px; }
.metrics__label { color: var(--text-3); }
.metrics__val { color: var(--text-1); font-variant-numeric: tabular-nums; }
.metrics__val .up   { color: var(--green); margin-left: 4px; }
.metrics__bar {
  margin-top: 10px;
  height: 4px; border-radius: 4px;
  background: rgba(148,163,184,0.12);
  overflow: hidden;
}
.metrics__bar > span {
  display: block; height: 100%;
  background: linear-gradient(to right, var(--cyan), var(--violet));
  box-shadow: 0 0 10px rgba(34,211,238,0.5);
  transition: width 600ms cubic-bezier(.2,.7,.2,1);
}


/* Pulsing nodes overlay */
.pulse-node {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px 2px rgba(34,211,238,0.6), 0 0 30px 6px rgba(34,211,238,0.25);
  animation: nodepulse 3.2s ease-in-out infinite;
  opacity: 0.8;
}
.pulse-node.violet {
  background: var(--violet);
  box-shadow: 0 0 12px 2px rgba(167,139,250,0.55), 0 0 30px 6px rgba(167,139,250,0.2);
}
.pulse-node.small { width: 6px; height: 6px; }
@keyframes nodepulse {
  0%, 100% { transform: scale(0.85); opacity: 0.45; }
  50%      { transform: scale(1.25); opacity: 1; }
}

/* Sparks */
.spark {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--warm);
  box-shadow: 0 0 8px 2px rgba(251,146,60,0.9), 0 0 18px 5px rgba(251,146,60,0.4);
  opacity: 0;
  animation: sparkflash 4s ease-out infinite;
}
@keyframes sparkflash {
  0%, 80%, 100% { opacity: 0; transform: scale(0.6) translate(0,0); }
  82% { opacity: 1; transform: scale(1.4) translate(2px,-2px); }
  88% { opacity: 0.7; transform: scale(1) translate(6px,-8px); }
  95% { opacity: 0; transform: scale(0.6) translate(10px,-14px); }
}


/* ===== Footer ===== */
.footer {
  border-top: 1px solid rgba(148,163,184,0.08);
  padding: 22px 40px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.04em;
}
.footer__right { display: inline-flex; align-items: center; gap: 8px; }
.footer__caret {
  display: inline-block;
  width: 7px; height: 0.95em;
  background: var(--cyan);
  vertical-align: -2px;
  animation: caret 1s steps(2, end) infinite;
  box-shadow: 0 0 6px rgba(34,211,238,0.7);
}

/* ===== Responsive ===== */

@media (max-width: 1180px) {
  .metrics { display: none; }
}
@media (max-width: 880px) {
  .hero__inner, .footer { padding-left: 22px; padding-right: 22px; }
}
@media (max-width: 560px) {
  .footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding-top: 18px;
    padding-bottom: 18px;
  }
  .footer__copy { display: flex; flex-direction: column; gap: 4px; }
  .footer__sep { display: none; }
}
@media (max-width: 480px) {
  .statuspill { display: none; }
  .hero__center { padding: 8px 0; gap: 16px; }
  .terminal__body { font-size: 12.5px; }
}
