/* ===== Tokens ===== */
:root {
  --bg: #05060f;
  --bg-2: #0b0e22;
  --text: #e9ecff;
  --muted: #8d93b8;
  --cyan: #5ef2ff;
  --violet: #a77bff;
  --blue: #2a6cff;
  --line: rgba(120, 140, 255, 0.12);
  --font: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

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

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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 70% 20%, var(--bg-2), var(--bg) 60%);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
}

/* ===== Background ===== */
.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 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%);
  animation: gridDrift 20s linear infinite;
  pointer-events: none;
}
@keyframes gridDrift { to { background-position: 48px 48px, 48px 48px; } }

.glow {
  position: fixed;
  width: 60vmax; height: 60vmax;
  left: 50%; top: 50%;
  translate: -50% -50%;
  background: radial-gradient(circle, rgba(94, 242, 255, .10), rgba(167, 123, 255, .06) 40%, transparent 70%);
  filter: blur(40px);
  animation: breathe 8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes breathe { 50% { scale: 1.15; opacity: .7; } }

/* Floating data particles */
.particles span {
  position: fixed;
  bottom: -10px;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  opacity: 0;
  animation: rise 12s linear infinite;
}
.particles span:nth-child(1)  { left: 5%;  animation-delay: 0s; }
.particles span:nth-child(2)  { left: 14%; animation-delay: 3s;  background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.particles span:nth-child(3)  { left: 23%; animation-delay: 7s; }
.particles span:nth-child(4)  { left: 31%; animation-delay: 1.5s; animation-duration: 15s; }
.particles span:nth-child(5)  { left: 42%; animation-delay: 9s;  background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.particles span:nth-child(6)  { left: 51%; animation-delay: 5s; }
.particles span:nth-child(7)  { left: 60%; animation-delay: 2s;  animation-duration: 10s; }
.particles span:nth-child(8)  { left: 68%; animation-delay: 6s;  background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.particles span:nth-child(9)  { left: 76%; animation-delay: 4s; }
.particles span:nth-child(10) { left: 84%; animation-delay: 8s;  animation-duration: 14s; }
.particles span:nth-child(11) { left: 91%; animation-delay: 1s; }
.particles span:nth-child(12) { left: 97%; animation-delay: 10s; background: var(--violet); box-shadow: 0 0 8px var(--violet); }
@keyframes rise {
  0%   { transform: translateY(0); opacity: 0; }
  10%  { opacity: .9; }
  90%  { opacity: .6; }
  100% { transform: translateY(-105vh); opacity: 0; }
}

/* ===== Header / logo ===== */
.site-header {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 0;
}
.logo {
  display: block;
  width: clamp(180px, 22vw, 260px);
  height: auto;
  animation: logoIn .9s ease-out both;
}
@keyframes logoIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* ===== Layout ===== */
.wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 56px;
}

/* ===== AI visual ===== */
.visual {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  max-width: 520px;
  justify-self: center;
  display: grid;
  place-items: center;
}

.net {
  position: relative;
  z-index: 2;
  width: 88%;
  overflow: visible;
}

.edges line { animation: edgeFade 6s ease-in-out infinite; }
.edges line:nth-child(3n)   { animation-delay: 1s; }
.edges line:nth-child(3n+1) { animation-delay: 2.5s; }
@keyframes edgeFade { 50% { stroke-opacity: .45; } }

/* "rewiring" connections that disconnect and reconnect */
.edges .flicker { animation: rewire 4s steps(1) infinite; }
.edges .f2      { animation-delay: 2s; }
@keyframes rewire {
  0%, 100% { stroke-opacity: 1; }
  40%      { stroke-opacity: 0; }
  48%      { stroke-opacity: 1; }
  52%      { stroke-opacity: 0; }
  60%      { stroke-opacity: 1; }
}

.signals line {
  stroke: var(--cyan);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 14 186;
  stroke-dashoffset: 14;
  filter: drop-shadow(0 0 4px var(--cyan));
  animation: signal 3.6s cubic-bezier(.4, 0, .2, 1) infinite;
  animation-delay: var(--d);
}
@keyframes signal {
  0%        { stroke-dashoffset: 14; }
  17%, 100% { stroke-dashoffset: -100; }
}

.nodes circle {
  fill: url(#nodeGrad);
  stroke: rgba(94, 242, 255, .5);
  stroke-width: 1;
  transform-box: fill-box;
  transform-origin: center;
  animation: fire 3.6s ease-out infinite;
  animation-delay: calc(var(--d) + .55s);
}
.nodes .out { stroke: rgba(167, 123, 255, .8); }
@keyframes fire {
  0%   { transform: scale(1);   filter: drop-shadow(0 0 0 transparent); }
  6%   { transform: scale(1.45); filter: drop-shadow(0 0 10px var(--cyan)); }
  25%  { transform: scale(1);   filter: drop-shadow(0 0 2px var(--cyan)); }
  100% { transform: scale(1); }
}

.net-label {
  font-family: var(--mono);
  font-size: 9px;
  fill: var(--muted);
  letter-spacing: .08em;
  animation: blinkLabel 2s steps(2) infinite;
}
@keyframes blinkLabel { 50% { fill-opacity: .4; } }

/* Orbit rings */
.orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}
.orbit-1 {
  border: 1px dashed rgba(94, 242, 255, .25);
  animation: spin 40s linear infinite;
}
.orbit-2 {
  inset: 9%;
  border: 1px solid transparent;
  border-top-color: rgba(167, 123, 255, .6);
  border-left-color: rgba(167, 123, 255, .15);
  animation: spin 9s linear infinite reverse;
}
.orbit-3 {
  inset: 3%;
  animation: spin 14s linear infinite;
}
.orbit-3 i {
  position: absolute;
  top: -4px; left: 50%;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 14px 3px var(--cyan);
}
@keyframes spin { to { rotate: 360deg; } }

/* Scanner sweep */
.scan {
  position: absolute;
  z-index: 3;
  left: 12%; right: 12%;
  height: 2px;
  top: 15%;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 18px 2px rgba(94, 242, 255, .5);
  opacity: .7;
  animation: scan 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes scan {
  0%, 100% { top: 18%; opacity: 0; }
  10%      { opacity: .8; }
  50%      { top: 80%; opacity: .8; }
  60%      { opacity: 0; }
}

/* ===== Copy ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border: 1px solid rgba(94, 242, 255, .3);
  border-radius: 999px;
  background: rgba(94, 242, 255, .06);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cyan);
}
.badge i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  animation: ping 1.6s ease-out infinite;
}
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(94, 242, 255, .7); }
  100% { box-shadow: 0 0 0 10px rgba(94, 242, 255, 0); }
}

h1 {
  margin: 22px 0 18px;
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.02em;
}
h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--cyan));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 4s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }

.lead {
  max-width: 46ch;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

/* Cycling terminal log */
.log {
  position: relative;
  margin: 28px 0;
  height: 48px;
  max-width: 420px;
  padding: 0 16px;
  border: 1px solid rgba(120, 140, 255, .18);
  border-radius: 10px;
  background: rgba(10, 14, 34, .7);
  font-family: var(--mono);
  font-size: 14px;
  overflow: hidden;
}
.log-line {
  position: absolute;
  left: 16px; right: 16px;
  top: 50%;
  translate: 0 -50%;
  white-space: nowrap;
  opacity: 0;
  animation: logCycle 12s infinite;
  animation-delay: var(--d);
}
.log-line b { color: var(--violet); font-weight: 500; margin-right: 6px; }
@keyframes logCycle {
  0%        { opacity: 0; transform: translateY(8px); }
  4%, 21%   { opacity: 1; transform: translateY(0); }
  25%, 100% { opacity: 0; transform: translateY(-8px); }
}
.caret {
  position: absolute;
  right: 16px; top: 50%;
  translate: 0 -50%;
  width: 8px; height: 16px;
  background: var(--cyan);
  animation: caret 1s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.contact { color: var(--muted); font-size: .95rem; }
.contact a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--violet);
  transition: color .2s, border-color .2s;
}
.contact a:hover { color: var(--cyan); border-color: var(--cyan); }

footer {
  position: relative;
  z-index: 1;
  padding: 20px 24px 28px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .wrap {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 16px;
    text-align: center;
  }
  .visual { max-width: 360px; }
  .site-header { padding: 24px 16px 0; }
  .logo { margin: 0 auto; }
  .lead, .log { margin-left: auto; margin-right: auto; }
  .log { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .log-line:first-of-type { opacity: 1; }
}
