/* Orchestra: one message, the conductor, the models it calls in, and the one that writes the answer. */

.routing { background: radial-gradient(60% 40% at 80% 10%, rgba(78, 142, 184, 0.08), transparent 70%); }
.router {
  border: 1px solid var(--line); border-radius: var(--r-l); padding: clamp(18px, 3vw, 34px);
  background: linear-gradient(180deg, rgba(18, 29, 51, 0.7), rgba(10, 17, 31, 0.55));
  box-shadow: 0 50px 120px -50px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.router-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.router-examples { display: flex; flex-wrap: wrap; gap: 8px; }
/* The techniques behind the demo, as a strip under it. */
.router-ways { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 30px; border-top: 1px solid var(--line); }
.router-ways li { padding: 22px 22px 4px 0; }
.router-ways li + li { padding-left: 22px; border-left: 1px solid var(--line); }
.router-ways svg { display: block; width: 22px; height: 22px; margin-bottom: 12px; color: var(--copper-lite); }
.router-ways h3 { margin-bottom: 6px; font-size: 1.02rem; }
.router-ways p { max-width: 30ch; font-size: 0.9rem; line-height: 1.5; color: var(--mist); }
@media (max-width: 1099px) {
  .router-ways { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .router-ways li:nth-child(3) { padding-left: 0; border-left: 0; }
}
@media (max-width: 599px) {
  .router-ways { grid-template-columns: minmax(0, 1fr); border-top: 0; }
  .router-ways li, .router-ways li + li { display: grid; grid-template-columns: 34px 1fr; padding: 16px 0; border-left: 0; border-top: 1px solid var(--line); }
  .router-ways svg { margin: 1px 0 0; }
}

.orch { display: grid; align-items: center; grid-template-columns: minmax(0, 0.82fr) 40px minmax(0, 1.34fr) 40px minmax(0, 1fr); }
.o-card {
  position: relative; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--line);
  background: rgba(6, 10, 18, 0.6); opacity: 0.22; transform: translateY(8px);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease), border-color 0.5s, box-shadow 0.6s;
}
.o-card.on, .orch.done .o-card { opacity: 1; transform: none; }
.orch.reset, .orch.reset * { transition: none !important; animation: none !important; }
.o-who { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 0.8125rem; font-weight: 600; color: var(--fog); }
.o-who svg { width: 16px; height: 16px; color: var(--copper-lite); }
.o-text { font-size: 1.0625rem; line-height: 1.45; color: var(--frost); }
.o-photo { width: min(100%, 220px); aspect-ratio: 1; margin: 14px 0 0; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); }
.o-photo img { width: 100%; height: 100%; object-fit: cover; }
.o-file {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 7px 12px 7px 9px;
  border-radius: 10px; border: 1px solid var(--line); background: rgba(232, 238, 246, 0.05); font-size: 0.8125rem; color: var(--mist);
}
.o-file svg { width: 16px; height: 16px; color: var(--copper-lite); }
.o-file small { font-size: 0.75rem; color: var(--fog); white-space: nowrap; }

/* The team */
.o-team { border-color: rgba(240, 196, 143, 0.2); background: linear-gradient(180deg, rgba(200, 144, 96, 0.08), rgba(6, 10, 18, 0.62)); }
.o-team.on { box-shadow: 0 0 0 1px rgba(240, 196, 143, 0.14), 0 24px 70px -24px rgba(200, 144, 96, 0.5); }
.o-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.o-head .o-who { margin: 0; color: var(--frost); }
.o-dots { display: flex; gap: 5px; }
.o-dots i {
  width: 8px; height: 8px; border-radius: 50%; background: rgba(232, 238, 246, 0.14);
  transition: background-color 0.35s, box-shadow 0.35s, transform 0.35s var(--ease);
}
.o-dots i.on, .orch.done .o-dots i { background: var(--c); box-shadow: 0 0 10px var(--c); transform: scale(1.12); }
.o-count { margin-left: auto; font-size: 0.8125rem; font-weight: 650; color: var(--copper-lite); opacity: 0; transition: opacity 0.5s; }
.orch.done .o-count { opacity: 1; }
.o-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 3px; }
.o-step {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center;
  padding: 8px 10px; border-radius: 11px; opacity: 0.28; transition: opacity 0.35s, background-color 0.35s;
}
.o-step.work, .o-step.done, .orch.done .o-step { opacity: 1; }
.o-step.work { background: rgba(232, 238, 246, 0.05); }
.o-ic { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: rgba(232, 238, 246, 0.06); color: var(--mist); transition: color 0.3s; }
.o-ic svg { width: 15px; height: 15px; }
.o-step.done .o-ic, .orch.done .o-ic { color: var(--copper-lite); }
.o-txt { display: grid; gap: 1px; min-width: 0; }
.o-txt b { font-size: 0.875rem; font-weight: 620; color: var(--frost); }
.o-txt span { font-size: 0.8rem; line-height: 1.35; color: var(--fog); }
.o-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: 240px; }
/* Several models in one step: the names go on their own line under the text. */
.o-step.multi .o-txt, .o-step.multi .o-chips { grid-column: 2 / -1; }
.o-step.multi .o-chips { justify-content: flex-start; max-width: none; margin-top: 3px; }
.mchip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 7px; overflow: hidden;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(6, 10, 18, 0.7);
  font-size: 0.75rem; font-weight: 560; color: var(--mist); white-space: nowrap;
}
.mchip i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--c); }
.o-conductor {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 7px; overflow: hidden;
  border-radius: 999px; border: 1px solid rgba(240, 196, 143, 0.45); background: rgba(200, 144, 96, 0.14);
  font-size: 0.75rem; font-weight: 650; color: var(--copper-lite); white-space: nowrap;
}
.o-conductor svg { width: 13px; height: 13px; flex: none; }
/* Models that stay unnamed: a dot each. */
.o-players {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; overflow: hidden;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(6, 10, 18, 0.7);
}
.o-players i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--c); }
.o-step.work .mchip::after, .o-step.work .o-conductor::after, .o-step.work .o-players::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 20%, rgba(240, 196, 143, 0.32) 50%, transparent 80%);
  animation: chip-run 0.9s linear infinite;
}
@keyframes chip-run { to { transform: translateX(100%); } }
.o-from { font-size: 0.75rem; color: var(--fog); }
.o-lead { background: rgba(200, 144, 96, 0.1); box-shadow: inset 0 0 0 1px rgba(240, 196, 143, 0.22); }
.o-lead .o-ic { background: rgba(240, 196, 143, 0.16); color: var(--copper-lite); }
.o-lead .o-players { border-color: rgba(240, 196, 143, 0.5); }
.o-sep { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; padding: 0 10px; font-size: 0.72rem; font-weight: 600; color: var(--fog); }
.o-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* The answer */
.o-out.on { border-color: rgba(232, 238, 246, 0.2); }
.o-writer { gap: 9px; margin-bottom: 2px; font-size: 0.875rem; }
.o-writer i { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
.o-writer strong { font-size: 1.05rem; font-weight: 650; color: var(--fog); transition: color 0.3s; }
.o-writer.on strong, .orch.done .o-writer strong { color: var(--frost); }
.o-cap { margin-bottom: 12px; font-size: 0.78rem; font-weight: 550; color: var(--copper-lite); }
.o-answer { min-height: 4.7em; font-size: 0.95rem; line-height: 1.55; color: var(--mist); }
.o-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; opacity: 0; transition: opacity 0.5s; }
.o-sources.on, .orch.done .o-sources { opacity: 1; }
.o-sources svg { width: 15px; height: 15px; color: var(--fog); }
.o-sources span { padding: 2px 8px; border-radius: 6px; background: rgba(232, 238, 246, 0.06); font-size: 0.72rem; color: var(--mist); }
.o-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.o-gallery figure { position: relative; margin: 0; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 10px; background: rgba(232, 238, 246, 0.05); }
.o-gallery img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.05); transition: opacity 0.6s, transform 0.9s var(--ease); }
.o-gallery figcaption {
  position: absolute; left: 6px; bottom: 6px; padding: 2px 7px; border-radius: 6px; background: rgba(6, 10, 18, 0.78);
  font-size: 0.68rem; font-weight: 560; color: var(--frost); opacity: 0; transition: opacity 0.4s 0.2s;
}
.o-gallery figure.on img, .orch.done .o-gallery img { opacity: 1; transform: none; }
.o-gallery figure.on figcaption, .orch.done .o-gallery figcaption { opacity: 1; }

.o-link { position: relative; height: 2px; margin: 0 6px; border-radius: 2px; background: var(--line); overflow: hidden; transition: background-color 0.3s 0.45s; }
.o-link i { position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--copper-lite), transparent); transform: translateX(-100%); }
.o-link.go i { animation: link-run 0.75s var(--ease) forwards; }
.o-link.go, .orch.done .o-link { background: rgba(240, 196, 143, 0.35); }
@keyframes link-run { to { transform: translateX(100%); } }
@keyframes link-run-v { to { transform: translateY(100%); } }

@media (max-width: 1023px) {
  .orch { grid-template-columns: minmax(0, 1fr); }
  .o-link { width: 2px; height: 24px; margin: 6px auto; }
  .o-link i { background: linear-gradient(180deg, transparent, var(--copper-lite), transparent); transform: translateY(-100%); }
  .o-link.go i { animation-name: link-run-v; }
}
@media (max-width: 599px) {
  .router-top { margin-bottom: 20px; }
  .o-card { padding: 16px; }
  .o-step { grid-template-columns: 26px minmax(0, 1fr); padding: 8px; }
  .o-chips { grid-column: 2; justify-content: flex-start; max-width: none; }
  .o-count { margin-left: 0; width: 100%; }
}
