/* Orchestration and command (#orchestration): resources orbit a purpose; switch to Command and a gold ring
   of five duties closes round the whole arrangement. */
.orch { overflow: clip; isolation: isolate; padding: clamp(72px, 7vw, 104px) 0; }
.orch__bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(48% 62% at 72% 52%, rgba(59, 127, 224, .2), transparent 70%),
    radial-gradient(30% 40% at 72% 52%, rgba(226, 176, 98, .08), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--navy) 22%, var(--navy) 78%, var(--night) 100%);
  transition: opacity .8s;
}
.orch[data-mode="command"] .orch__bg { background:
    radial-gradient(48% 62% at 72% 52%, rgba(226, 176, 98, .14), transparent 70%),
    radial-gradient(30% 40% at 72% 52%, rgba(59, 127, 224, .12), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--navy) 22%, var(--navy) 78%, var(--night) 100%); }

.orch__grid {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  grid-template-areas: "head stage" "panel stage";
  grid-template-rows: auto 1fr;
  column-gap: clamp(32px, 4vw, 72px); align-items: start;
}
.orch__head { grid-area: head; align-self: end; }
.orch__lede { margin-top: 20px; }

/* the switch: two real buttons, a gold thumb slides between them */
.orch__toggle {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; margin-top: 30px; padding: 4px;
  border: 1px solid rgba(226, 176, 98, .45); border-radius: var(--r-btn); background: rgba(6, 11, 24, .5);
}
.orch__thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 0;
  background: var(--gold); box-shadow: 0 0 24px rgba(226, 176, 98, .35); transition: transform .6s var(--ease-out);
}
.orch[data-mode="command"] .orch__thumb { transform: translateX(100%); }
.orch__btn {
  position: relative; z-index: 1; min-height: 50px; padding: 0 26px; border: 0; background: none; cursor: pointer;
  font-family: var(--f-body); font-weight: 600; font-size: 1rem; color: var(--white); border-radius: 0;
  transition: color .4s;
}
.orch__btn.is-on { color: var(--night); background-color: var(--gold); transition: color .4s, background-color .12s .5s; }
.orch__btn:not(.is-on) { transition: color .4s, background-color .1s; }
.orch__btn:not(.is-on):hover { color: var(--gold); }

/* the panel beside the diagram */
.orch__panel { grid-area: panel; display: grid; margin-top: 34px; position: relative; padding: 26px 0 0; }
.orch__panel::before { content: ''; position: absolute; left: 0; top: 0; width: 120px; height: 1px; background: linear-gradient(90deg, var(--gold), transparent); }
.orch__def { grid-area: 1 / 1; }
.js .orch__def { opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .45s, transform .6s var(--ease-out), visibility 0s .45s; }
.js .orch__def.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity .45s .08s, transform .6s .08s var(--ease-out), visibility 0s; }
.no-js .orch__def--node, .oc-fallback .orch__def--node { display: none; }
.no-js .orch__def + .orch__def, .oc-fallback .orch__def + .orch__def { grid-area: auto; margin-top: 22px; }
.orch__def-title { color: var(--gold); }
.orch__def-text { margin-top: 10px; color: var(--white); font-size: 1.0625rem; max-width: 60ch; }
.orch__def-note { margin-top: 14px; padding-left: 18px; position: relative; font-family: var(--f-display); font-style: italic; font-size: 1.12rem; color: var(--mist); }
.orch__def-note::before { content: ''; position: absolute; left: 0; top: .6em; width: 7px; height: 7px; background: var(--gold); transform: rotate(45deg); }

/* the diagram */
.orch__stage {
  grid-area: stage; position: relative; justify-self: end; align-self: center;
  width: min(100%, calc(100vh - 230px)); width: min(100%, calc(100svh - 230px)); min-width: min(100%, 460px);
  aspect-ratio: 1;
}
.orch__lean { position: absolute; inset: 0; }
.orch__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.orch__guides circle { fill: none; stroke: rgba(122, 160, 230, .14); stroke-width: 1; }
.orch__guides .orch__orbit { stroke: rgba(122, 160, 230, .24); stroke-dasharray: 2 7; }
.orch__ring-faint { fill: none; stroke: rgba(226, 176, 98, .3); stroke-width: 1.4; stroke-dasharray: 3 9; }
.orch__ring { fill: none; stroke: var(--gold); stroke-width: 2.4; }
.orch__ring-glow { fill: none; stroke: rgba(226, 176, 98, .55); stroke-width: 10; }
.orch__duty-mark { fill: var(--gold); }
.orch__link { stroke: rgba(127, 176, 255, .55); stroke-width: 1.6; }
.orch__pulses rect { fill: #FFE6B8; filter: drop-shadow(0 0 4px rgba(255, 214, 150, .9)); }

/* HTML layer: the purpose, the resources and the duties. Only the buttons take the pointer. */
.orch__stage { container-type: inline-size; }
.orch__labels { position: absolute; inset: 0; pointer-events: none; --disc: 9.6cqw; }
.orch__node, .orch__purpose-btn { pointer-events: auto; }
.orch__node, .orch__purpose-btn, .orch__duty { position: absolute; }
.orch__node {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 0; border: 0; background: none; cursor: pointer; color: var(--white);
  transform: translate(-50%, calc(var(--disc) / -2));
}
.orch__disc {
  display: grid; place-items: center; width: var(--disc); height: var(--disc); border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1B3160, #0A142B 70%);
  border: 1.6px solid rgba(127, 176, 255, .8);
  box-shadow: 0 0 0 0 rgba(226, 176, 98, 0), 0 6px 18px rgba(0, 0, 0, .35);
  transition: border-color .4s, box-shadow .5s var(--ease-out), transform .5s var(--ease-out);
}
.orch[data-mode="command"] .orch__disc { border-color: var(--gold); }
.orch__node:hover .orch__disc, .orch__node.is-hot .orch__disc {
  border-color: var(--gold); transform: scale(1.14);
  box-shadow: 0 0 0 calc(var(--disc) * .14) rgba(226, 176, 98, .16), 0 0 30px rgba(226, 176, 98, .35);
}
.orch__icon { width: 46%; height: 46%; overflow: visible; fill: none; stroke: #CFE0FF; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: stroke .4s; }
.orch__icon .orch__ai { fill: #CFE0FF; stroke: none; font-family: var(--f-body); font-weight: 700; font-size: 9px; }
.orch__icon .orch__icon-gold { fill: var(--gold); stroke: none; }
.orch__node.is-hot .orch__icon, .orch__node:hover .orch__icon { stroke: #FFE6B8; }
.orch__node-label {
  display: inline-block; padding: 3px 9px; background: rgba(9, 17, 36, .86); color: var(--white);
  font-family: var(--f-body); font-weight: 600; font-size: .92rem; line-height: 1.2; white-space: nowrap; text-align: center;
  border: 1px solid rgba(127, 176, 255, .18); transition: color .3s, border-color .3s;
}
.orch__node:hover .orch__node-label, .orch__node.is-hot .orch__node-label { color: var(--gold); border-color: rgba(226, 176, 98, .6); }
.orch__node:focus-visible { outline: none; }
.orch__node:focus-visible .orch__disc { outline: 2px solid var(--gold); outline-offset: 4px; }

.orch__purpose-btn {
  left: 50%; top: 50%; width: 19.6cqw; height: 19.6cqw; margin: -9.8cqw 0 0 -9.8cqw;
  display: grid; place-items: center; padding: 0; cursor: pointer; border-radius: 50%;
  background: #12213F; border: 2px solid var(--gold); box-shadow: 0 0 40px rgba(226, 176, 98, .25);
  font-family: var(--f-display); font-weight: 600; font-size: clamp(1rem, 3.2cqw, 1.5rem); color: var(--white);
  transition: color .3s, box-shadow .5s;
}
.orch__purpose-btn::after {
  content: ''; position: absolute; inset: -14%; border-radius: 50%; border: 1px dashed rgba(226, 176, 98, .45);
  opacity: .5; transform: scale(.88); transition: opacity .8s, transform 1s var(--ease-out); pointer-events: none;
}
.orch[data-mode="command"] .orch__purpose-btn::after { opacity: 1; transform: none; }
.orch__purpose-disc { display: flex; flex-direction: column; align-items: center; gap: .2em; line-height: 1; }
.orch__purpose-mark { width: .42em; height: .42em; background: var(--gold); transform: rotate(45deg); }
.orch__purpose-btn:hover, .orch__purpose-btn.is-hot { color: var(--gold); box-shadow: 0 0 60px rgba(226, 176, 98, .45); }

.orch__duty {
  margin-top: -26px; padding: 4px 10px; white-space: nowrap;
  font-family: var(--f-display); font-style: italic; font-weight: 600; font-size: 1.02rem; color: var(--gold);
  background: rgba(9, 17, 36, .9); border: 1px solid rgba(226, 176, 98, .5);
}
.orch__duty[data-i="0"] { margin-top: -30px; }
.orch__duty[data-i="2"], .orch__duty[data-i="3"] { margin-top: 28px; }
.js .orch__duty, .js .orch__duty-mark { opacity: .35; }
.js .orch__ring, .js .orch__ring-glow { opacity: 0; }
.no-js .orch__duty, .oc-fallback .orch__duty { transform: translate(-50%, -50%); }
.no-js .orch__duty, .no-js .orch__duty-mark, .oc-fallback .orch__duty, .oc-fallback .orch__duty-mark { opacity: 1; }

@media (max-width: 999px) {
  .orch__grid { grid-template-columns: 1fr; grid-template-areas: "head" "stage" "panel"; grid-template-rows: auto; }
  .orch__stage { justify-self: center; width: min(100%, 640px); min-width: 0; margin-top: 30px; }
  .orch__panel { margin-top: 26px; }
}
@media (max-width: 600px) {
  .orch__toggle { display: grid; width: 100%; }
  .orch__btn { padding: 0 12px; }
  .orch__stage { width: 100vw; max-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); }
  .orch__labels { --disc: 10.6cqw; }
  .orch__node { gap: 3px; }
  .orch__node-label { font-size: .875rem; padding: 1px 5px; white-space: normal; max-width: 92px; line-height: 1.12; }
  .orch__purpose-btn { width: 20.5cqw; height: 20.5cqw; margin: -10.25cqw 0 0 -10.25cqw; font-size: .9rem; }
  .orch__duty { font-size: .875rem; padding: 2px 6px; margin-top: -18px; }
  .orch__duty[data-i="0"] { margin-top: -20px; }
  .orch__duty[data-i="2"], .orch__duty[data-i="3"] { margin-top: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .orch__thumb, .js .orch__def, .js .orch__def.is-on { transition: none; }
}
