/* #process, "How we work" (SOLCO-575 F14). Bone world, one sticky 100svh stage on desktop and phone.
   One line enters from the left and passes eight stations; each resolves into a ring, a stroke glyph and one line of copy.
   Three blue diamonds are the client's calls (scope, go-live, what comes next); five small rings are our own checks. Operate returns over the top to Discover.
   Default (no JS, reduced motion, fx-fail) is the composed, fully drawn state: every rule that dims or hides lives under
   #process[data-live], which the scene sets only once it is scrubbing. */

#process { --proc-top: 76px; --proc-bottom: calc(var(--seam) + 16px); }
.proc { display: grid; gap: clamp(.6rem, 1.6svh, 1.5rem); align-content: center; min-height: 100%; padding-top: var(--proc-top); padding-bottom: var(--proc-bottom); }
.proc__head { display: grid; gap: .6rem; max-width: 56rem; }
@media (min-width: 901px) {
  .proc__head { max-width: none; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); column-gap: 4vw; align-items: end; }
  .proc__head .label { grid-column: 1 / -1; }
  .proc__aside { padding-bottom: .5rem; }
}
.proc__head h2 { font-size: clamp(1.8rem, min(3.5vw, 5.2svh), 3.4rem); }
.proc__aside { display: grid; gap: .9rem; }
.proc__sub { margin: 0; max-width: 40rem; font-size: clamp(1rem, min(1.15vw, 2.4svh), 1.2rem); line-height: 1.4; color: var(--mut); }

.proc__wrap { position: relative; }
.proc__svg { display: block; width: 100%; height: auto; overflow: visible; }
.proc__svg--narrow { display: none; }

/* stroke language: the same 1.4 to 2.4 hairlines as the gate circuit, on --fg */
.proc__svg .pline { fill: none; stroke: var(--fg); stroke-opacity: .8; stroke-width: 2.6; stroke-linecap: round; }
.proc__svg .parc { fill: none; stroke: var(--fg); stroke-opacity: .85; stroke-width: 2.6; stroke-linecap: round; }
.proc__svg .pguide { fill: none; stroke: var(--fg); stroke-opacity: .28; stroke-width: 1.4; stroke-dasharray: 2 7; stroke-linecap: round; }
.proc__svg .pbg { fill: var(--bg); }
.proc__svg .pfill { fill: var(--fg); fill-opacity: .07; transform-box: fill-box; transform-origin: center; transition: fill-opacity .35s; }
.proc__svg .pst.is-now .pfill { fill-opacity: .12; }
.proc__svg .plab { font-family: var(--font-display); font-weight: 700; font-size: 15px; fill: var(--fg); letter-spacing: -.05em; }
.proc__svg--wide .plab { display: none; }
.proc__svg .pghost { fill: none; stroke: var(--fg); stroke-opacity: .4; stroke-width: 1.4; }
.proc__svg .phalo { fill: none; stroke: var(--fg); stroke-opacity: 0; stroke-width: 1.4; transform-box: fill-box; transform-origin: center; transition: stroke-opacity .4s, transform .4s; }
.proc__svg .pst.is-now .phalo { stroke-opacity: .55; transform: scale(1.12); }
.proc__svg .pst.is-now .pr { stroke-opacity: 1; stroke-width: 2.8; }
.proc__svg .pst.is-now .pg { stroke-width: 2.8; }
.proc__svg .parrow { fill: none; stroke: var(--fg); stroke-opacity: .8; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.proc__svg .pr { fill: none; stroke: var(--fg); stroke-opacity: .8; stroke-width: 1.8; }
.proc__svg .pg { fill: none; stroke: var(--fg); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.proc__svg .pgate { fill: var(--bg); stroke: var(--fg); stroke-width: 1.6; transform-box: fill-box; transform-origin: center; }
.proc__svg .pgate[data-kind="you"] { fill: var(--signal); stroke: var(--bg); stroke-width: 3; paint-order: stroke; }
.proc__svg .pbead { fill: var(--signal); stroke: var(--bg); stroke-width: 1.6; paint-order: stroke; opacity: 0; pointer-events: none; }
.proc__svg .ppack { fill: var(--fg); opacity: 0; }
/* the exposures trailing a packet are the strobe: signal beads with a bone halo, so they read over the line */
.proc__svg .ppack--tail { fill: var(--signal); stroke: var(--bg); stroke-width: 1.4; paint-order: stroke; }
/* the dwell ping and the loop-closure ring are drawn by the scene only; the seal is the parked end of the return and shows in every static frame */
.proc__svg .pping, .proc__svg .pclose { fill: none; stroke: var(--signal); stroke-width: 2; opacity: 0; pointer-events: none; }
.proc__svg .pseal__plate { fill: var(--bg); }
.proc__svg .prel path { fill: none; stroke: var(--fg); stroke-opacity: .32; stroke-width: 2; stroke-linecap: round; transition: stroke .35s, stroke-opacity .35s; }
.proc__svg .prel path.is-lit { stroke: var(--signal); stroke-opacity: 1; }
.proc__svg--narrow .prel { display: none; }
.proc__svg--narrow .pline { stroke-width: 1.5; }
.proc__svg--narrow .pr { stroke-width: 1.8; }
.proc__svg--narrow .pg { stroke-width: 2.2; }
.proc__svg--narrow .pgate[data-kind="you"] { stroke-width: 2; }

.proc__phases { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.proc__phases li { display: grid; gap: .3rem; align-content: start; padding-inline: .6rem; text-align: center; justify-items: center; min-width: 0; }
.proc__n { font-family: var(--font-mono); font-size: var(--t-data); letter-spacing: .12em; color: var(--mut); }
.proc__phases b { font-family: var(--font-display); font-size: clamp(.9rem, 1.2vw, 1.15rem); font-weight: 700; letter-spacing: -.01em; }
.proc__t { font-size: max(16px, min(1.15vw, 2.3svh)); line-height: 1.4; color: var(--mut); }

.proc__loop { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); margin: 0; display: grid; gap: .4rem; justify-items: center; text-align: center; width: max-content; max-width: 92%; padding: .3rem .8rem; background: var(--bg); box-shadow: 0 0 0 10px var(--bg); }
.proc__loop-lead { padding: 0 0 .3rem; border-bottom: 2px solid var(--signal); color: var(--fg); font-family: var(--font-mono); font-size: max(15px, min(1.15vw, 2.3svh)); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.proc__loop-sub { font-size: max(16px, min(1.15vw, 2.3svh)); line-height: 1.3; color: var(--fg); }
.proc__chip { display: inline-flex; align-items: center; gap: .45em; margin-top: .15rem; padding: .22em .6em; border: 1px solid var(--line); font-family: var(--font-mono); font-size: var(--t-data); letter-spacing: .06em; line-height: 1.25; color: var(--fg); text-align: left; }
.proc__chip::before { content: ''; flex: none; width: 8px; height: 8px; background: var(--signal); transform: rotate(45deg); }
.proc__key { margin: 0; display: flex; align-items: center; gap: .6rem; font-family: var(--font-mono); font-size: var(--t-data); letter-spacing: .08em; color: var(--mut); }
.proc__diamond { flex: none; width: 10px; height: 10px; background: var(--signal); transform: rotate(45deg); }

/* ---- cinematic: what the scrub dims, the scene then lights ---- */
#process[data-live] .pline, #process[data-live] .parc, #process[data-live] .parrow, #process[data-live] .pr { stroke-dasharray: 1; stroke-dashoffset: 1; }
#process[data-live] .pgate { opacity: 0; }
#process[data-live] .pseal { opacity: var(--cl, 0); }
/* the loop closes: Discover takes a ring as the return arc lands on it (a pure function of the scrub, --cl 0..1) */
#process[data-live] .pst[data-st="0"] .phalo { stroke-opacity: calc(var(--cl, 0) * .6); transform: scale(calc(1 + .12 * var(--cl, 0))); }
#process[data-live] .pst[data-st="0"].is-now .phalo { stroke-opacity: .55; transform: scale(1.12); }
#process[data-live] .pfill, #process[data-live] .plab { opacity: 0; }
#process[data-live] .proc__phases li { opacity: calc(.62 + .38 * var(--a, 0)); transform: translateY(calc((1 - var(--a, 0)) * 12px)); }
#process[data-live] .proc__phases li.is-reached b { color: var(--fg); }
#process[data-live] .proc__loop { opacity: calc(.6 + .4 * var(--loop, 0)); }
#process[data-live] .proc__phases li.is-now b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
#process[data-live] .proc__phases li.is-now .proc__n { color: var(--fg); }
#process[data-live] .proc__phases li.is-now .proc__t { color: var(--fg); }
#process[data-live] .proc__phases li:not(.is-reached) .proc__t { color: var(--mut); }

@media (max-width: 900px) {
  #process { --proc-top: 64px; }
  .proc { gap: .6rem; }
  .proc__head h2 { font-size: clamp(1.4rem, min(7.4vw, 4.6svh), 2rem); }
  .proc__svg--wide { display: none; }
  .proc__svg--narrow { display: block; }
  .proc__loop { position: static; transform: none; margin-top: .2rem; width: auto; max-width: none; text-align: left; justify-items: start; gap: .25rem; padding: 0; box-shadow: none; background: none; }
  .proc__loop-lead { font-size: 14px; white-space: normal; }
  .proc__loop-sub { font-size: 16px; padding: 0; background: none; }
  .proc__phases { grid-template-columns: 1fr; gap: .9rem; margin-top: 0; }
  .proc__t { font-size: 1rem; }
  .proc__phases li { grid-template-columns: 2.4rem 1fr; text-align: left; justify-items: start; padding: 0; column-gap: .6rem; }
  .proc__phases li .proc__n { grid-row: 1 / span 3; padding-top: .2rem; }
  .proc__chip { grid-column: 2; justify-self: start; }
  /* pinned phone: the eight lines do not fit one screen, so the stage shows the phase the line has reached */
  #process[data-live] .proc__phases li { display: none; }
  #process[data-live] .proc__phases li.is-current { display: grid; opacity: 1; transform: none; padding: .8rem; border: 1px solid var(--line); background: var(--bone-2); }
  #process[data-live] .proc__phases b { font-size: 1.4rem; }
  #process[data-live] .proc__t { font-size: 1rem; color: var(--fg); }
  .proc__svg--narrow .plab { display: block; }
  #process[data-live] .proc__loop { opacity: 1; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  /* a narrow desktop: the band between the return arc and the stations is shorter, so the caption rides higher and tighter */
  .proc__loop { top: 37%; gap: .15rem; padding: .2rem .8rem; box-shadow: 0 0 0 6px var(--bg); }
  .proc__loop-lead { padding-bottom: .15rem; font-size: 14px; letter-spacing: .05em; }
  .proc__loop-sub { font-size: 15px; line-height: 1.25; }
}
@media (max-height: 800px) and (min-width: 901px) {
  /* a laptop screen: the head tightens so the larger station copy still fits the pinned stage */
  #process { --proc-top: 58px; }
  .proc__head h2 { font-size: clamp(1.8rem, min(3.5vw, 4svh), 3.4rem); }
  .proc { gap: .5rem; }
  .proc__aside { gap: .45rem; }
  .proc__phases { margin-top: 0; }
  .proc__t { font-size: 16px; line-height: 1.32; }
  .proc__chip { padding: .12em .5em; font-size: 11px; line-height: 1.2; letter-spacing: .02em; }
}
@media (max-height: 560px) and (min-width: 901px) {
  .proc__t { display: none; }
}
@media (max-width: 900px) and (max-height: 700px) {
  /* a short pinned phone: the gate key steps aside (it stays in every static frame) and the loop drawing narrows */
  #process[data-live] .proc__key { display: none; }
  #process[data-live] .proc__svg--narrow { width: 62%; margin-inline: auto; }
  #process[data-live] .proc__sub { font-size: .9375rem; line-height: 1.3; }
  #process[data-live] .proc__loop-lead { padding: 0 0 .2rem; }
  #process { --proc-top: 56px; }
  #process[data-live] .proc { gap: .4rem; }
  #process[data-live] .proc__phases li.is-current { padding: .6rem .8rem; }
  #process[data-live] .proc__phases b { font-size: 1.2rem; }
  #process[data-live] .proc__t { font-size: .9375rem; }
  .proc__head h2 { font-size: clamp(1.25rem, min(6.6vw, 3.9svh), 1.8rem); }
}
