/* /custom-software/#process: the agile delivery cycle as one ring (lab/pages/p_custom_software.py, agile_cycle()).
   Technique after Magic UI's Animated Circular Progress Bar (https://magicui.design/docs/components/animated-circular-progress-bar):
   an SVG circle with pathLength 100 whose dash fills the ring. Stage names sit in the four corners, never on a line.
   Violet = the sprint in progress, amber = the client's turn (the review node only), green = signed off and live.
   Default markup is the FINAL state (.is-live); agile-cycle.js resets and plays it while on screen. */
.erp .ac { --ac-v: #9a6bff; --ac-a: var(--amber, #e88122); --ac-g: #4ade80; --ac-ink: #f4f3ef; --ac-dim: #8f88a6;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px) minmax(0, 1fr);
  grid-template-areas: "s4 ring s1" "s3 ring s2"; column-gap: clamp(28px, 4vw, 64px); align-items: center;
  margin: clamp(40px, 6vh, 72px) auto 0; text-align: left; }

/* ---- the ring */
.erp .ac-ring { grid-area: ring; position: relative; aspect-ratio: 1; width: 100%; }
.erp .ac-ring svg { display: block; width: 100%; height: 100%; overflow: visible; }
.erp .ac-track { fill: none; stroke: rgb(255 255 255 / .1); stroke-width: 2; }
.erp .ac-chev path { fill: none; stroke: rgb(255 255 255 / .28); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.erp .ac-arc { fill: none; stroke: var(--ac-v); stroke-width: 3; stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgb(154 107 255 / .55)); transition: stroke .6s, filter .6s, opacity .5s; }
.erp .ac-head { fill: #fff; filter: drop-shadow(0 0 6px rgb(154 107 255 / .9)); opacity: 0; transition: opacity .3s; }
.erp .ac.is-run .ac-head { opacity: 1; }

.erp .ac-node__dot { fill: #120e22; stroke: rgb(255 255 255 / .28); stroke-width: 1.6; transition: fill .4s, stroke .4s; }
.erp .ac-node__halo { fill: var(--ac-v); opacity: 0; transform-box: fill-box; transform-origin: center; }
.erp .ac-node.done .ac-node__dot, .erp .ac.is-live .ac-node__dot { fill: var(--ac-v); stroke: var(--ac-v); }
.erp .ac-node.on .ac-node__dot { fill: var(--ac-v); stroke: #fff; }
.erp .ac-node.on .ac-node__halo { animation: ac-halo 1.6s cubic-bezier(.2, .6, .3, 1) infinite; }
.erp .ac-node[data-k="3"].on .ac-node__dot { fill: var(--ac-a); stroke: #fff; }
.erp .ac-node[data-k="3"].on .ac-node__halo { fill: var(--ac-a); }
@keyframes ac-halo { 0% { opacity: .45; transform: scale(.45); } 100% { opacity: 0; transform: scale(1.25); } }

.erp .ac.is-live .ac-arc { stroke: var(--ac-g); filter: drop-shadow(0 0 6px rgb(74 222 128 / .45)); }
.erp .ac.is-live .ac-node__dot { fill: var(--ac-g); stroke: var(--ac-g); }

/* ---- the centre: sprint count, or signed off */
.erp .ac-mid { position: absolute; inset: 22%; display: grid; place-items: center; text-align: center; }
.erp .ac-mid > p { grid-area: 1 / 1; margin: 0; display: grid; justify-items: center; transition: opacity .5s, transform .5s; }
.erp .ac-mid small { color: var(--ac-dim); font: 500 12px/1 var(--sc-font-mono); letter-spacing: .08em; text-transform: uppercase; }
.erp .ac-mid__sp b { margin: 10px 0 14px; color: var(--ac-ink); font: 500 clamp(76px, 8vw, 112px)/.85 var(--sc-font-display); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.erp .ac-mid__pips { display: flex; gap: 6px; }
.erp .ac-mid__pips i { width: 18px; height: 3px; border-radius: 2px; background: rgb(255 255 255 / .16); transition: background .4s; }
.erp .ac-mid__pips i.on { background: var(--ac-v); }
.erp .ac-mid__live svg { width: 40px; height: 40px; margin-bottom: 12px; fill: none; stroke: var(--ac-g); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.erp .ac-mid__live b { color: var(--ac-ink); font: 500 clamp(26px, 2.6vw, 34px)/1.05 var(--sc-font-display); letter-spacing: -.03em; }
.erp .ac-mid__live small { margin-top: 8px; }
.erp .ac:not(.is-live) .ac-mid__live, .erp .ac.is-live .ac-mid__sp { opacity: 0; transform: scale(.94); }

/* ---- the four stages, one per corner, clear of the ring */
.erp .ac-list { display: contents; list-style: none; }
.erp .ac-st { display: grid; gap: 8px; max-width: 290px; transition: opacity .5s; }
.erp .ac-st--1 { grid-area: s1; align-self: start; padding-top: 4%; }
.erp .ac-st--2 { grid-area: s2; align-self: end; padding-bottom: 4%; }
.erp .ac-st--3 { grid-area: s3; align-self: end; padding-bottom: 4%; justify-self: end; text-align: right; justify-items: end; }
.erp .ac-st--4 { grid-area: s4; align-self: start; padding-top: 4%; justify-self: end; text-align: right; justify-items: end; }
.erp .ac-st__n { color: var(--ac-v); font: 500 12.5px/1 var(--sc-font-mono); letter-spacing: .04em; transition: color .4s; }
.erp .ac-st b { color: var(--ac-ink); font: 500 clamp(19px, 1.6vw, 23px)/1.2 var(--sc-font-display); letter-spacing: -.02em; }
.erp .ac-st__d { color: #b9b2cc; font: 400 15px/1.5 var(--sc-font-text); text-wrap: pretty; }
.erp .ac.js .ac-st { opacity: .34; }
.erp .ac.js .ac-st.done { opacity: .6; }
.erp .ac.js .ac-st.on, .erp .ac.js.is-live .ac-st { opacity: 1; }
.erp .ac-st--3.on .ac-st__n { color: var(--ac-a); }
.erp .ac.is-live .ac-st__n { color: var(--ac-g); }

/* ---- phone: the ring first, then the stages in order */
@media (max-width: 860px) {
  .erp .ac { grid-template-columns: 1fr; grid-template-areas: none; row-gap: 0; max-width: 420px; }
  .erp .ac-ring { grid-area: auto; width: min(100%, 340px); justify-self: center; margin-bottom: 36px; }
  .erp .ac-list { display: grid; gap: 22px; margin: 0; padding: 0; }
  .erp .ac-st, .erp .ac-st--3, .erp .ac-st--4 { grid-area: auto; justify-self: start; justify-items: start; text-align: left; padding: 0; max-width: none;
    grid-template-columns: 34px minmax(0, 1fr); column-gap: 10px; row-gap: 4px; }
  .erp .ac-st__n { grid-row: span 2; padding-top: 5px; }
  .erp .ac-st b { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .erp .ac-node.on .ac-node__halo { animation: none; }
}
