/* Process stages as a rotary ring of glass segments (process-wheel.js). Without JS the numbered list stays in place. */
.has-wheel .process-list { display: none; }
.wheel {
  --size: min(460px, calc(100vw - 56px));
  --panel-w: calc(var(--size) * .5);
  --panel-h: calc(var(--size) * .4);
  /* Glass colours follow the palette; the night palette has its own, darker glass below. */
  --ring-face-a: color-mix(in oklab, var(--surface) 80%, var(--accent) 20%);
  --ring-face-b: color-mix(in oklab, var(--stone) 86%, var(--ink) 14%);
  --ring-side: color-mix(in oklab, var(--stone) 66%, var(--ink) 34%);
  --ring-edge: rgb(255 255 255 / .75);
  --ring-active-a: color-mix(in oklab, var(--accent), #fff 40%);
  --ring-active-b: color-mix(in oklab, var(--accent) 68%, var(--accent-ink) 32%);
  --ring-glass: .85;
  --pointer: var(--accent-ink);
  position: relative;
  width: var(--size);
  height: var(--size);
  margin: 28px auto 0;
  user-select: none;
  -webkit-user-select: none;
}
:root[data-theme=night] .wheel {
  --ring-face-a: color-mix(in oklab, var(--accent) 24%, #26322b);
  --ring-face-b: #111815;
  --ring-side: #050806;
  --ring-edge: rgb(222 239 152 / .34);
  --ring-glass: .74;
  --pointer: var(--accent);
}

/* The drawn ring: segments, their sides, crystal facets on the active one and one fixed light from the top left. */
.wheel-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ring-face-a { stop-color: var(--ring-face-a); }
.ring-face-b { stop-color: var(--ring-face-b); }
.ring-active-a { stop-color: var(--ring-active-a); }
.ring-active-b { stop-color: var(--ring-active-b); }
.ring-light-a { stop-color: #fff; stop-opacity: .4; }
.ring-light-b { stop-color: #fff; stop-opacity: 0; }
.ring-light-c { stop-color: #000; stop-opacity: .3; }
.ring-side { fill: var(--ring-side); }
.ring-face { fill: url(#wheel-face); fill-opacity: var(--ring-glass); }
.ring-facets { opacity: .3; }
.ring-facets path { fill: #fff; }
.ring-edge { fill: none; stroke: var(--ring-edge); stroke-width: 1.2; }
.ring-segment.is-active .ring-face { fill: url(#wheel-active); fill-opacity: 1; }
.ring-segment.is-active .ring-facets { opacity: 1; }
.ring-segment.is-active .ring-edge { stroke: rgb(255 255 255 / .85); }
.ring-light { fill: url(#wheel-light); }
.ring-dots { fill: none; stroke: var(--chip-line); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: .1 5.6; }
.ring-ticks { fill: none; stroke: var(--chip-line); stroke-width: 7; stroke-dasharray: 1.4 55.68; }

/* Numbers: glass discs riding on the segments, always upright. */
.wheel-dial { --turn: 180deg; position: absolute; inset: 0; border-radius: 50%; touch-action: none; cursor: grab; }
.wheel.is-dragging, .wheel.is-dragging .wheel-dial { cursor: grabbing; }
.wheel-node {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  padding: 0;
  border: 1px solid var(--ring-edge);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, rgb(255 255 255 / .5), rgb(255 255 255 / 0) 55%), color-mix(in oklab, var(--surface) 72%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: inset 0 -3px 6px rgb(0 0 0 / .16), 0 4px 10px rgb(0 0 0 / .18);
  transform: rotate(calc(var(--a) + var(--turn))) translateY(calc(var(--size) * -.375)) rotate(calc(-1 * (var(--a) + var(--turn))));
  transition: width 200ms ease, height 200ms ease, margin 200ms ease, background-color 200ms ease, color 200ms ease;
}
:root[data-theme=night] .wheel-node { background: radial-gradient(circle at 35% 28%, rgb(255 255 255 / .22), rgb(255 255 255 / 0) 55%), rgb(8 13 11 / .55); color: var(--accent); }
.wheel-node[aria-pressed=true], :root[data-theme=night] .wheel-node[aria-pressed=true] {
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-color: rgb(255 255 255 / .85);
  background: radial-gradient(circle at 35% 28%, rgb(255 255 255 / .75), rgb(255 255 255 / 0) 60%), var(--ring-active-a);
  color: var(--on-accent);
  font-size: 17px;
}
.wheel-node:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; }

/* Centre: the active stage; the pointer below marks its segment. */
.wheel-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--panel-w);
  height: var(--panel-h);
  margin: calc(var(--panel-h) / -2) 0 0 calc(var(--panel-w) / -2);
  touch-action: pan-y;
}
.wheel-panel { display: grid; align-content: center; justify-items: center; gap: 6px; height: 100%; padding: 14px 18px; text-align: center; }
.wheel-marker { position: absolute; left: 50%; top: calc(50% + var(--panel-h) / 2 + 3px); width: 0; height: 0; margin-left: -8px; border: 8px solid transparent; border-top: 10px solid var(--pointer); pointer-events: none; }
.wheel-count { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--muted); }
.wheel-title { font-size: clamp(20px, 2vw, 26px); }
.wheel-text { max-width: 24ch; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* Arrows as round knobs. */
.wheel-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 26px; }
.wheel-arrow {
  display: grid;
  place-items: center;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  background: radial-gradient(circle at 50% 30%, color-mix(in oklab, var(--surface), #fff 14%), var(--stone) 72%);
  box-shadow: inset 0 0 0 5px color-mix(in oklab, var(--stone), var(--ink) 7%), inset 0 0 0 6px var(--line), 0 10px 20px -10px var(--shadow);
  transition: border-color 180ms ease, transform 120ms ease;
}
.wheel-arrow:hover { border-color: var(--ink); }
.wheel-arrow:active { transform: translateY(1px); }
.wheel-hint { max-width: 24ch; font-size: 13px; line-height: 1.5; text-align: center; color: var(--muted); }
@media (max-width: 599px) {
  .wheel { --panel-w: calc(var(--size) * .54); --panel-h: calc(var(--size) * .44); }
  .wheel-panel { gap: 4px; padding: 10px 14px; }
  .wheel-title { font-size: 19px; }
  .wheel-text { font-size: 12.5px; }
  .wheel-node { width: 40px; height: 40px; margin: -20px 0 0 -20px; font-size: 13px; }
  .wheel-node[aria-pressed=true], :root[data-theme=night] .wheel-node[aria-pressed=true] { width: 46px; height: 46px; margin: -23px 0 0 -23px; font-size: 15px; }
  /* Arrows side by side in the middle, clear of the floating contact button in the corner. */
  .wheel-controls { flex-wrap: wrap; row-gap: 12px; }
  .wheel-hint { order: 3; flex-basis: 100%; max-width: none; }
}
/* Wide screens: heading and controls on the left, the ring on the right. */
@media (min-width: 1000px) {
  .process-section.has-wheel { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; column-gap: 64px; }
  .has-wheel .section-heading { grid-column: 1; grid-row: 1; margin-bottom: 0; }
  .has-wheel .wheel { --size: min(460px, 38vw); grid-column: 2; grid-row: 1 / span 2; margin: 0; }
  .has-wheel .wheel-controls { grid-column: 1; grid-row: 2; align-self: end; justify-content: flex-start; margin: 0 0 12px; }
  .has-wheel .wheel-hint { order: 3; text-align: left; }
}
