:root {
  --bg: #0b0d14;
  --bg-deep: #080a10;
  --panel: #1b2030;
  --panel-2: #141a28;
  --cyan: #22d3ee;
  --cyan-bright: #67e8f9;
  --ice: #a5f3fc;
  --deep-cyan: #0e7490;
  --text: #e8f4f8;
  --muted: #93a8b3;
  --line: rgba(34, 211, 238, 0.14);
  --line-soft: rgba(34, 211, 238, 0.08);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --wrap: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(52rem 34rem at 85% -5%, rgba(34, 211, 238, 0.07), transparent 60%),
    radial-gradient(46rem 30rem at 0% 105%, rgba(34, 211, 238, 0.06), transparent 65%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

code {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.92em;
  color: var(--ice);
  background: rgba(34, 211, 238, 0.08);
  padding: 0.05em 0.35em;
  border-radius: 4px;
}

/* header */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 1.4rem 1.5rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; }
.brand-name { font-weight: 600; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 1.3rem; font-size: 0.9rem; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.nav-cta { color: var(--cyan-bright) !important; }

/* hero */
.hero {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  gap: 2.5rem 3rem;
  align-items: center;
}
.headline {
  font-size: clamp(2.3rem, 4.6vw, 3.7rem);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.dots { color: var(--cyan); }
.accent { color: var(--cyan-bright); text-shadow: 0 0 34px rgba(34, 211, 238, 0.35); }
.sub {
  margin-top: 1.2rem;
  max-width: 34em;
  color: var(--muted);
  font-size: 1.05rem;
  min-height: 3.2em;
}
.cta-row { display: flex; gap: 0.8rem; margin-top: 1.7rem; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.15rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 550;
  transition: transform 0.25s var(--ease), background 0.2s, border-color 0.2s;
}
.btn.primary {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(34, 211, 238, 0.55);
  color: var(--ice);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.16);
}
.btn.primary:hover { transform: translateY(-2px); background: linear-gradient(135deg, rgba(34, 211, 238, 0.24), rgba(6, 182, 212, 0.16)); }
.btn.ghost { border: 1px solid var(--line); color: var(--muted); }
.btn.ghost:hover { color: var(--text); border-color: rgba(34, 211, 238, 0.4); }
/* hallucinations button — unstable, double-vision */
.btn.halluc {
  border-color: rgba(34, 211, 238, 0.28);
  color: var(--ice);
  animation: halluc-idle 6s ease-in-out infinite;
}
.btn.halluc:hover {
  animation: halluc-glitch 0.38s steps(2, jump-none) infinite;
  border-color: rgba(34, 211, 238, 0.55);
}
@keyframes halluc-idle {
  0%, 100% { text-shadow: none; opacity: 1; }
  46% { text-shadow: 1.5px 0 rgba(34, 211, 238, 0.4), -1.5px 0 rgba(255, 0, 170, 0.32); opacity: 0.94; }
  54% { text-shadow: -1px 0.5px rgba(255, 0, 170, 0.4), 1px -0.5px rgba(34, 211, 238, 0.4); }
}
@keyframes halluc-glitch {
  0% { transform: translate(0, 0) skewX(0deg); text-shadow: 2px 0 rgba(255, 0, 170, 0.65), -2px 0 rgba(34, 211, 238, 0.65); opacity: 1; }
  25% { transform: translate(-1.5px, 1px) skewX(-2deg); text-shadow: -3px 0 rgba(255, 0, 170, 0.65), 3px 0 rgba(34, 211, 238, 0.65); opacity: 0.85; }
  50% { transform: translate(1.5px, -1px) skewX(1.5deg); text-shadow: 1px 1px rgba(255, 0, 170, 0.55), -1px -1px rgba(34, 211, 238, 0.55); opacity: 1; }
  75% { transform: translate(-1px, -1px) skewX(0.5deg); text-shadow: 2px -1px rgba(255, 0, 170, 0.65), -2px 1px rgba(34, 211, 238, 0.65); opacity: 0.9; }
  100% { transform: translate(0, 0) skewX(0deg); text-shadow: 2px 0 rgba(255, 0, 170, 0.65), -2px 0 rgba(34, 211, 238, 0.65); }
}
.meta-line { color: var(--muted); opacity: 0.75; margin-top: 2.2rem; }

/* 3D bay */
.bay-stage { perspective: 1300px; min-height: 500px; display: flex; justify-content: center; }
.bay {
  position: relative;
  width: 100%;
  max-width: 540px;
  height: 500px;
  transform-style: preserve-3d;
  animation: sway 16s ease-in-out infinite alternate;
}
@keyframes sway {
  from { transform: rotateX(7deg) rotateY(-9deg); }
  to { transform: rotateX(3deg) rotateY(9deg); }
}
.plate {
  position: absolute;
  inset: 8% 0 0;
  transform-style: preserve-3d;
  transform: translateZ(0);
  background: linear-gradient(160deg, #182033, #0d1220 70%);
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 14px;
  box-shadow:
    inset 0 0 60px rgba(34, 211, 238, 0.06),
    0 30px 60px rgba(0, 0, 0, 0.5);
}
.plate::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  pointer-events: none;
}
.plate-head {
  position: absolute;
  top: 10px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}
.state { color: var(--cyan-bright); }
.state.swapping { color: #fbbf24; }
.slot-pad {
  position: absolute;
  top: 47%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 62%;
  height: 34%;
  border: 1px dashed rgba(34, 211, 238, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slot-pad span { color: rgba(34, 211, 238, 0.4); font-size: 0.62rem; letter-spacing: 0.14em; }
.chip {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  background: linear-gradient(145deg, #101a2a, #0c1422);
  border: 1px solid rgba(103, 232, 249, 0.32);
  border-radius: 7px;
  padding: 0.42rem 0.55rem;
  text-align: center;
  min-width: 74px;
  cursor: pointer;
  transition:
    transform 0.9s var(--ease),
    left 0.9s var(--ease),
    top 0.9s var(--ease),
    border-color 0.4s,
    box-shadow 0.4s;
  will-change: transform;
}
.chip:hover { border-color: rgba(103, 232, 249, 0.6); }
.chip-name { display: block; font-family: ui-monospace, Menlo, monospace; font-size: 0.72rem; color: var(--ice); }
.chip-size { display: block; font-family: ui-monospace, Menlo, monospace; font-size: 0.58rem; color: var(--muted); margin-top: 2px; }
.chip.slot {
  left: var(--sx);
  top: var(--sy);
  transform: translate(-50%, -50%) translateZ(90px) scale(1.24);
  border-color: var(--cyan);
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.3), 0 0 70px rgba(34, 211, 238, 0.12);
  cursor: default;
}
.chip.slot .chip-size { color: var(--cyan-bright); }
.vram {
  position: absolute;
  bottom: 70px;
  left: 22px;
  right: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.vram-label { color: rgba(34, 211, 238, 0.55); }
.bar {
  flex: 1;
  height: 10px;
  background: rgba(34, 211, 238, 0.07);
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}
.fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--deep-cyan), var(--cyan));
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}
.fill.loading { transition: width 2s cubic-bezier(0.3, 0.1, 0.2, 1); }
.log {
  position: absolute;
  bottom: 12px;
  left: 22px;
  right: 22px;
  min-height: 66px;
  color: var(--muted);
  font-size: 0.66rem;
}
.logline {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: logIn 0.5s var(--ease);
}
.logline.ok { color: var(--cyan-bright); }
.logline.warn { color: #fbbf24; }
@keyframes logIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.req {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translate(-50%, 0);
  background: rgba(11, 13, 20, 0.9);
  border: 1px solid rgba(34, 211, 238, 0.45);
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  color: var(--ice);
  font-size: 0.68rem;
  white-space: nowrap;
}
.req b { color: var(--cyan-bright); font-weight: 600; }

/* bands */
.band { max-width: var(--wrap); margin: 0 auto; padding: 3.5rem 1.5rem; }
.band-title {
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  font-weight: 620;
  letter-spacing: -0.015em;
  margin-bottom: 1.8rem;
}
.band::before {
  content: "";
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin: 0 0 3rem;
}
.steps { list-style: none; display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: step; }
.steps h3 { font-size: 1.02rem; font-weight: 600; margin-bottom: 0.4rem; }
.steps p { color: var(--muted); font-size: 0.94rem; }
.step-num { color: var(--cyan); opacity: 0.7; display: block; margin-bottom: 0.55rem; }
.steps li {
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: rgba(27, 32, 48, 0.35);
}
.footnote {
  margin-top: 1.6rem;
  color: var(--muted);
  font-size: 0.88rem;
  max-width: 52em;
  border-left: 2px solid rgba(34, 211, 238, 0.3);
  padding-left: 1rem;
}
.cap-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 2rem;
}
.cap-list li { color: var(--muted); font-size: 0.94rem; }
.cap-list b { color: var(--text); font-weight: 600; }

/* video embed */
section.video-embed {
  max-width: var(--wrap);
  margin: 0 auto 3rem;
  padding: 0 1.5rem;
}
.video-embed iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  display: block;
}

/* swarm band */
.swarm-band {
  position: relative;
  margin-top: 3rem;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.05), rgba(11, 13, 20, 0.2));
  overflow: hidden;
}
.swarmfield { position: absolute; inset: 0; opacity: 0.65; }
.swarmfield svg { width: 100%; height: 100%; }
.swarm-copy {
  position: relative;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
  max-width: 640px;
}
.swarm-copy p { color: var(--muted); font-size: 0.98rem; max-width: 40em; }
.swarm-copy em { color: var(--cyan-bright); font-style: normal; }
.linkline { stroke: var(--cyan); stroke-width: 1.2; stroke-opacity: 0.8; fill: none; }
.node { fill: var(--cyan); }
.pulse { fill: var(--cyan-bright); }
.linkline.calm { stroke-opacity: 0.18; animation: none; }
.node.calm { opacity: 0.55; animation: none; }

/* quick start */
.term {
  background: #0d1120;
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
  font-size: 0.85rem;
  overflow-x: auto;
  color: var(--ice);
  box-shadow: inset 0 0 40px rgba(34, 211, 238, 0.05);
}
.term code { background: none; padding: 0; color: inherit; }
.term .comment { color: var(--muted); }
.qs-note { color: var(--muted); font-size: 0.92rem; margin-top: 1rem; max-width: 46em; }

/* footer */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: var(--wrap);
  margin: 4rem auto 0;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line-soft);
}
.foot-links a { color: var(--cyan-bright); }
.foot-links a:hover { text-decoration: underline; }
.dim { opacity: 0.6; }

/* swarm animation ports (login choreography, vanilla) */
.anim .linkline {
  stroke-dasharray: var(--len) 0;
  animation: linkcycle var(--dur) ease-in-out var(--delay) infinite;
}
.anim .node { animation: nodecycle var(--dur) ease-in-out var(--delay) infinite; }
.anim .pulse { animation: pulse var(--dur) linear var(--delay) infinite; }
.anim .pulse.out { animation-name: pulseout; }
.anim .pulse.in { animation-name: pulsein; }
@keyframes linkcycle {
  0% { stroke-dashoffset: var(--len); opacity: 0; }
  12% { stroke-dashoffset: 0; opacity: 0.8; }
  72% { stroke-dashoffset: 0; opacity: 0.8; }
  84% { stroke-dashoffset: var(--len); opacity: 0; }
  100% { stroke-dashoffset: var(--len); opacity: 0; }
}
@keyframes nodecycle {
  0% { opacity: 0.25; }
  12% { opacity: 0.85; }
  72% { opacity: 0.85; }
  84% { opacity: 0.3; }
  100% { opacity: 0.25; }
}
@keyframes pulseout {
  0% { transform: translateX(0); opacity: 0; }
  14% { transform: translateX(0); opacity: 0; }
  46% { transform: translateX(var(--lenp)); opacity: 1; }
  70% { transform: translateX(var(--lenp)); opacity: 0; }
  100% { transform: translateX(0); opacity: 0; }
}
@keyframes pulsein {
  0% { transform: translateX(var(--lenp)); opacity: 0; }
  18% { transform: translateX(var(--lenp)); opacity: 0; }
  52% { transform: translateX(0); opacity: 1; }
  74% { transform: translateX(0); opacity: 0; }
  100% { transform: translateX(var(--lenp)); opacity: 0; }
}

/* responsive */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .bay-stage { min-height: 460px; }
  .bay { height: 460px; }
}
@media (max-width: 640px) {
  .cap-list { grid-template-columns: 1fr; }
  .nav-links { gap: 0.9rem; font-size: 0.8rem; }
  .hero { padding-top: 1.5rem; }
}

/* reduced motion: static calm states */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bay { animation: none; transform: rotateX(4deg) rotateY(-4deg); }
  .chip { transition: none; }
  .anim .linkline, .anim .node, .anim .pulse { animation: none; }
}
