/* ============================================================
   HERO + AGENT RELAY
   ============================================================ */
.hero {
  position: relative;
  padding-top: clamp(54px, 7vw, 96px);
  padding-bottom: clamp(40px, 6vw, 72px);
  overflow: hidden;
}
/* faint institutional grid wash behind hero */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(14,138,107,0.05), transparent 60%),
    linear-gradient(transparent 0 calc(100% - 1px), var(--hair-soft) 100%) 0 0 / 100% 64px,
    linear-gradient(90deg, transparent 0 calc(100% - 1px), var(--hair-soft) 100%) 0 0 / 64px 100%;
  -webkit-mask-image: radial-gradient(100% 75% at 50% 30%, #000 55%, transparent 100%);
          mask-image: radial-gradient(100% 75% at 50% 30%, #000 55%, transparent 100%);
  pointer-events: none;
}
.hero-inner { position: relative; text-align: center; }
.hero .eyebrow { justify-content: center; margin-bottom: 26px; }
.hero h1 { margin: 0 auto; max-width: 16ch; }
.hero h1 .ital { font-style: italic; font-weight: 420; }
.hero-sub {
  margin: 26px auto 0;
  max-width: 56ch;
  font-size: clamp(1.05rem, 1.55vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-70);
  text-wrap: pretty;
}
.hero-sub strong { color: var(--ink); font-weight: 600; }
.hero-roles {
  margin-top: 14px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.02rem, 1.45vw, 1.28rem);
  color: var(--ink-55);
  letter-spacing: -0.01em;
}
.hero-roles em { font-style: italic; color: var(--teal-deep); }
.relay-caption {
  margin: 24px auto 0;
  max-width: 60ch;
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--ink-55);
  text-wrap: pretty;
}
.relay-caption b { color: var(--ink); font-weight: 600; }
.hero-cta { margin-top: 34px; display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero-trust {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--ink-40);
  display: inline-flex; gap: 18px; flex-wrap: wrap; justify-content: center;
}
.hero-trust span { display: inline-flex; align-items: center; gap: 7px; }
.hero-trust .tick { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }

/* ---------------- the relay ---------------- */
.relay-shell {
  margin-top: clamp(48px, 6vw, 84px);
  position: relative;
}
.relay-frame {
  position: relative;
  background: linear-gradient(180deg, #fff, #fdfdfb);
  border: 1px solid var(--hair);
  border-radius: 20px;
  box-shadow: var(--shadow-2);
  padding: clamp(20px, 3vw, 36px) clamp(16px, 3vw, 40px) clamp(24px, 3vw, 40px);
}
.relay-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 26px; flex-wrap: wrap;
}
.relay-title {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-40); display: flex; align-items: center; gap: 9px;
}
.relay-live {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em;
  color: var(--teal-deep);
  background: var(--teal-soft);
  padding: 5px 11px; border-radius: 100px;
}
.relay-live .blip {
  width: 7px; height: 7px; border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 0 0 rgba(14,138,107,0.5);
  animation: blip 1.6s infinite var(--ease);
}
@keyframes blip {
  0% { box-shadow: 0 0 0 0 rgba(14,138,107,0.5); }
  70% { box-shadow: 0 0 0 7px rgba(14,138,107,0); }
  100% { box-shadow: 0 0 0 0 rgba(14,138,107,0); }
}

/* scroll container for small screens */
.relay-scroll { overflow-x: auto; overflow-y: visible; scrollbar-width: none; padding-bottom: 4px; }
.relay-scroll::-webkit-scrollbar { display: none; }

.relay {
  position: relative;
  min-width: 760px;
  padding-top: 96px; /* lane for the document */
}

/* the travelling document */
.doc {
  position: absolute;
  top: 6px; left: 0;
  width: 132px;
  transform: translateX(0);
  transition: transform 0.72s var(--ease), opacity 0.4s ease;
  z-index: 6;
  will-change: transform;
}
.doc-card {
  background: #fff;
  border: 1px solid var(--hair-2);
  border-radius: 10px;
  padding: 11px 12px 13px;
  box-shadow: 0 10px 26px -12px rgba(22,36,61,0.4);
  transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease), border-color 0.3s;
  position: relative;
}
.doc.active .doc-card { box-shadow: 0 16px 34px -12px rgba(14,138,107,0.5); border-color: rgba(14,138,107,0.4); transform: translateY(6px); }
.doc-tab {
  font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.06em;
  color: var(--teal-deep); background: var(--teal-soft);
  display: inline-block; padding: 2px 7px; border-radius: 5px; margin-bottom: 8px;
}
.doc-title { font-size: 0.78rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; }
.doc-lines { display: grid; gap: 5px; }
.doc-lines i { height: 4px; border-radius: 2px; background: var(--hair); display: block; }
.doc-lines i:nth-child(1) { width: 100%; }
.doc-lines i:nth-child(2) { width: 82%; }
.doc-lines i:nth-child(3) { width: 64%; }
/* little pointer beneath doc */
.doc::after {
  content: "";
  position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px; background: #fff;
  border-right: 1px solid var(--hair-2); border-bottom: 1px solid var(--hair-2);
  transition: border-color 0.3s;
}
.doc.active::after { border-color: rgba(14,138,107,0.4); }

/* the row of agents */
.agents { display: flex; align-items: stretch; gap: 0; }

/* connector between agents */
.link {
  flex: 1 1 auto;
  align-self: flex-start;
  margin-top: 26px; /* aligns with status dot row */
  height: 2px;
  position: relative;
  background: var(--hair);
  border-radius: 2px;
  min-width: 26px;
}
.link .fill {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--teal), var(--teal));
  border-radius: 2px;
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.55s var(--ease);
}
.link.filled .fill { transform: scaleX(1); }
/* travelling spark on the active connector */
.link .spark {
  position: absolute; top: 50%; left: 0; width: 8px; height: 8px; margin-top: -4px;
  border-radius: 50%; background: var(--teal);
  box-shadow: 0 0 10px 2px rgba(14,138,107,0.7);
  opacity: 0; transform: translateX(0);
}
.link.flowing .spark { animation: spark 0.55s var(--ease) forwards; }
@keyframes spark {
  0% { opacity: 1; left: 0; }
  85% { opacity: 1; }
  100% { opacity: 0; left: 100%; }
}

/* agent card */
.agent {
  flex: 0 0 auto;
  width: 138px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.agent .node {
  height: 54px; display: flex; align-items: center; justify-content: center;
  position: relative;
}
.dot {
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff;
  border: 2px solid var(--hair-2);
  position: relative; z-index: 2;
  transition: border-color 0.35s, background 0.35s, box-shadow 0.35s;
}
.agent.active .dot {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(14,138,107,0.45);
  animation: dotPulse 1.1s infinite var(--ease);
}
@keyframes dotPulse {
  0% { box-shadow: 0 0 0 0 rgba(14,138,107,0.45); }
  70% { box-shadow: 0 0 0 12px rgba(14,138,107,0); }
  100% { box-shadow: 0 0 0 0 rgba(14,138,107,0); }
}
.agent.done .dot { border-color: var(--teal); background: var(--teal); }

.agent-card {
  width: 100%;
  background: #fff;
  border: 1px solid var(--hair);
  border-radius: 12px;
  padding: 13px 12px 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease), transform 0.35s var(--ease), background 0.35s;
}
.agent.active .agent-card {
  border-color: rgba(14,138,107,0.55);
  box-shadow: 0 14px 30px -14px rgba(14,138,107,0.5);
  transform: translateY(-3px);
}
.agent.done .agent-card { border-color: rgba(14,138,107,0.28); background: #fcfefd; }
/* working shimmer */
.agent-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(14,138,107,0.14) 50%, transparent 70%);
  transform: translateX(-120%);
  opacity: 0;
}
.agent.active .agent-card::after { animation: shimmer 1.25s linear infinite; opacity: 1; }
@keyframes shimmer { to { transform: translateX(120%); } }

.agent-step {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em;
  color: var(--ink-40); margin-bottom: 7px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.agent.active .agent-step, .agent.done .agent-step { color: var(--teal-deep); }
.agent-name {
  font-family: var(--sans); font-weight: 600; font-size: 0.95rem; letter-spacing: -0.012em;
  line-height: 1.15;
}
.agent-micro {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.01em;
  color: var(--teal-deep);
  margin-top: 7px; min-height: 1.4em; line-height: 1.35;
  opacity: 0; transform: translateY(3px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.agent.active .agent-micro, .agent.done .agent-micro { opacity: 1; transform: none; }
.agent.done .agent-micro { color: var(--ink-55); }
.agent-check {
  width: 11px; height: 11px; opacity: 0; transition: opacity 0.3s;
}
.agent.done .agent-check { opacity: 1; }

/* human node */
.agent.human { width: 168px; }
.agent.human .node { height: 54px; }
.agent.human .agent-card {
  background: var(--navy); border-color: var(--navy);
  box-shadow: var(--shadow-1);
}
.agent.human .agent-step { color: rgba(255,255,255,0.45); }
.agent.human .agent-name { color: #fff; }
.agent.human .agent-micro { color: rgba(255,255,255,0.6); }
.agent.human.active .agent-card {
  border-color: var(--teal);
  box-shadow: 0 0 0 0 rgba(14,138,107,0.4), 0 16px 34px -14px rgba(14,138,107,0.55);
  animation: humanPulse 1.8s infinite var(--ease);
  transform: none;
}
.agent.human.active .agent-card::after { display: none; }
@keyframes humanPulse {
  0% { box-shadow: 0 0 0 0 rgba(14,138,107,0.4), 0 16px 34px -14px rgba(14,138,107,0.55); }
  70% { box-shadow: 0 0 0 14px rgba(14,138,107,0), 0 16px 34px -14px rgba(14,138,107,0.55); }
  100% { box-shadow: 0 0 0 0 rgba(14,138,107,0), 0 16px 34px -14px rgba(14,138,107,0.55); }
}
.human-avatar {
  width: 30px; height: 30px; border-radius: 50%; margin: 0 auto 8px;
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  display: flex; align-items: center; justify-content: center;
}
.agent.human .dot { border-color: rgba(255,255,255,0.4); background: var(--navy); }
.agent.human.active .dot { border-color: var(--teal); background: var(--teal); }

/* input source node */
.agent.source .agent-card { background: var(--bg-2); }
.agent.source.done .agent-card { background: #fcfefd; }
.source-ic {
  width: 30px; height: 30px; border-radius: 8px; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--teal-soft); color: var(--teal-deep);
}
.source-ic svg { width: 17px; height: 17px; }
.agent.source .agent-micro { color: var(--ink-40); opacity: 1; transform: none; }
.agent.source.active .agent-micro, .agent.source.done .agent-micro { color: var(--teal-deep); }
.agent.source.done .agent-micro { color: var(--ink-55); }

@media (max-width: 560px) {
  .relay { min-width: 680px; }
}
