@font-face {
  font-family: "Pixelify Sans";
  src: url("/pixelify-sans-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  background: #060c20;
  color: #eef5ff;
  font-family: system-ui, sans-serif;
  --blue: #5893ff;
  --muted: #a6bbdf;
  --line: #2a4377;
  --pixel: "Pixelify Sans", ui-monospace, monospace;
}

body {
  margin: 0;
}

.hero {
  box-sizing: border-box;
  display: grid;
  position: relative;
  min-block-size: 100vh;
  min-block-size: 100svh;
  place-items: center;
  padding: 4rem 1rem;
  background: radial-gradient(ellipse at center, #101e48 0%, #060c20 70%);
}

h1 {
  max-inline-size: 100%;
  margin: 0;
  color: var(--blue);
  font: 700 clamp(2rem, 7.8vw, 7.5rem) / 1 var(--pixel);
  text-align: center;
  text-wrap: balance;
  text-shadow: 0 0 0.55em #2870ff66;
}

.scroll-link {
  position: absolute;
  inset-block-end: 2rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-underline-offset: 0.3em;
}

.scroll-link:hover {
  color: #fff;
}

.ecosystem {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: center;
  gap: 2.5rem;
  min-block-size: 100svh;
  padding: clamp(4rem, 9vw, 8rem) 1rem;
  border-block-start: 1px solid #1b2c51;
}

.ecosystem header {
  text-align: center;
}

h2 {
  max-inline-size: 24ch;
  margin: 0;
  color: #d2e2ff;
  font: 700 clamp(2rem, 5.7vw, 4.25rem) / 1.05 var(--pixel);
  text-wrap: balance;
}

.ecosystem header p {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.demo {
  box-sizing: border-box;
  inline-size: min(100%, 49rem);
  margin: 0;
  padding: clamp(0.75rem, 3vw, 1.75rem);
  border: 1px solid #2a4071;
  background: #0b152e;
  box-shadow: 0 1.1rem 3rem #01051180;
}

.demo figcaption {
  margin-block-end: 1rem;
  color: var(--muted);
  font: 700 0.875rem var(--pixel);
}

.workflow {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  padding: clamp(0.55rem, 2vw, 1.25rem);
  background-color: #07112a;
  background-image:
    linear-gradient(#1c315a45 1px, transparent 1px),
    linear-gradient(90deg, #1c315a45 1px, transparent 1px);
  background-size: 1.5rem 1.5rem;
}

.research-question,
.research-result {
  display: grid;
  gap: 0.25rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid #355489;
  background: #0d1b39;
  text-align: center;
}

.research-question span,
.research-result span,
.agent span {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.25;
}

.research-question strong,
.research-result strong {
  font-size: clamp(0.875rem, 2vw, 1rem);
}

.research-result {
  border-color: #4c80d4;
}

.connections {
  --travel: 2.3rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  position: relative;
  inline-size: 100%;
  block-size: var(--travel);
}

.connections::before {
  position: absolute;
  inset: 50% calc(100% / 6 - 1px) auto;
  block-size: 1px;
  background: var(--line);
  content: "";
}

.connections i {
  position: relative;
  justify-self: center;
  inline-size: 1px;
  block-size: 50%;
  background: var(--line);
}

.connections--out i:not(:nth-child(2)),
.connections--in i:nth-child(2) {
  align-self: end;
}

.connections i:nth-child(2) {
  block-size: 100%;
}

.connections i::after {
  position: absolute;
  inset: 0 auto auto -2px;
  inline-size: 5px;
  block-size: 5px;
  background: #8fbaff;
  box-shadow: 0 0 10px #5893ff;
  opacity: 0;
  content: "";
}

.agents {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.25rem, 2vw, 1rem);
  inline-size: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.agent {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.3rem;
  padding: clamp(0.35rem, 1.75vw, 0.9rem);
  border: 1px solid var(--line);
  background: #0e1b39;
  overflow-wrap: anywhere;
}

.agent strong {
  color: #8db8ff;
  font: 700 clamp(1rem, 3.4vw, 1.5rem) / 1 var(--pixel);
}

.signal {
  display: flex;
  align-items: end;
  gap: 3px;
  block-size: 1.45rem;
  margin-block-start: 0.45rem;
}

.signal i {
  --level: 55%;
  flex: 1;
  max-inline-size: 1rem;
  block-size: var(--level);
  transform-origin: bottom;
  background: #477bd3;
}

.signal i:nth-child(3n + 1) { --level: 30%; }
.signal i:nth-child(3n + 2) { --level: 78%; }
.agent--model .signal i:nth-child(odd) { --level: 92%; }
.agent--review .signal i:nth-child(-n + 3) { --level: 88%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  .title > span {
    animation: type-letter 1ms step-end calc(280ms + 85ms * var(--letter)) backwards;
  }

  .demo.is-playing .connections i::after {
    animation: transfer 0.62s ease-in both;
  }

  .demo.is-playing .connections i:nth-child(2)::after {
    animation-name: transfer-middle;
  }

  .demo.is-playing .connections--out i:not(:nth-child(2))::after {
    animation-delay: 0.36s;
  }

  .demo.is-playing .connections--in i::after {
    animation-delay: 3.3s;
  }

  .demo.is-playing .connections--in i:nth-child(2)::after {
    animation-delay: 3.64s;
  }

  .demo.is-playing .agent {
    animation: activity 2.35s ease 0.9s both;
  }

  .demo.is-playing .agent--model { animation-delay: 1.1s; }
  .demo.is-playing .agent--review { animation-delay: 1.3s; }

  .demo.is-playing .signal i {
    animation: signal 1.75s ease-in-out 1.05s both;
  }

  .demo.is-playing .signal i:nth-child(even) {
    animation-delay: 1.48s;
  }

  .demo.is-playing .research-result {
    animation: activity 0.65s ease 4.15s both;
  }

  @keyframes type-letter {
    from { visibility: hidden; }
    to { visibility: visible; }
  }

  @keyframes transfer {
    0% { opacity: 0; }
    25%, 70% { opacity: 1; }
    100% { opacity: 0; transform: translateY(calc(var(--travel) / 2)); }
  }

  @keyframes transfer-middle {
    0% { opacity: 0; }
    25%, 70% { opacity: 1; }
    100% { opacity: 0; transform: translateY(var(--travel)); }
  }

  @keyframes activity {
    0%, 100% { box-shadow: none; }
    42%, 70% { border-color: #7daaff; box-shadow: 0 0 1rem #347aff45; }
  }

  @keyframes signal {
    0%, 100% { transform: scaleY(1); }
    24%, 68% { transform: scaleY(0.28); }
    48%, 86% { transform: scaleY(1.17); background: #83b4ff; }
  }
}
