/* Recursive Human Systems Model diagram — 2026-11-25 refresh (homepage).
   Styling only: the React markup is untouched. */

section[aria-labelledby="model"] .relative:has(> svg[viewBox="0 0 340 340"])::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle,
    color-mix(in srgb, var(--color-sapphire) 26%, transparent) 0%,
    color-mix(in srgb, var(--color-sapphire) 8%, transparent) 45%,
    transparent 70%);
  pointer-events: none;
}

/* the loop: a slow current flowing around the ring */
section[aria-labelledby="model"] svg[viewBox="0 0 340 340"] circle[r="122"] {
  stroke: var(--color-sapphire);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1.5 12;
  stroke-opacity: 0.85;
  animation: yei-rhsm-flow 26s linear infinite;
}
@keyframes yei-rhsm-flow { to { stroke-dashoffset: -767; } }

/* arcs between stages; the active one glows */
section[aria-labelledby="model"] svg[viewBox="0 0 340 340"] path[marker-end] {
  stroke-width: 1.5;
}
section[aria-labelledby="model"] svg[viewBox="0 0 340 340"] path[stroke="var(--color-sapphire)"] {
  stroke-width: 3;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--color-sapphire) 85%, transparent));
}

/* the travelling point of light */
section[aria-labelledby="model"] svg[viewBox="0 0 340 340"] circle:has(> animateMotion) {
  r: 4.5;
  filter: drop-shadow(0 0 6px var(--color-sapphire));
}

/* stage dots; the active one breathes */
section[aria-labelledby="model"] svg[viewBox="0 0 340 340"] circle[r="5.5"] { r: 6.5; stroke-width: 1.75; }
section[aria-labelledby="model"] svg[viewBox="0 0 340 340"] circle[r="8"] {
  r: 9;
  filter: drop-shadow(0 0 8px var(--color-sapphire));
  animation: yei-rhsm-pulse 2.4s ease-out infinite;
}
@keyframes yei-rhsm-pulse {
  0% { stroke-width: 1.25; stroke-opacity: 0.7; }
  100% { stroke-width: 22; stroke-opacity: 0; }
}

/* stage labels */
section[aria-labelledby="model"] .rm-labels button {
  border: 1px solid color-mix(in srgb, var(--color-platinum) 14%, transparent);
  cursor: pointer;
  transition: color 0.5s, background-color 0.5s, border-color 0.4s, box-shadow 0.4s;
}
section[aria-labelledby="model"] .rm-labels button:hover,
section[aria-labelledby="model"] .rm-labels button:focus-visible {
  border-color: var(--color-sapphire);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-sapphire) 22%, transparent);
}
section[aria-labelledby="model"] .rm-labels button[aria-pressed="true"] {
  border-color: var(--color-sapphire);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--color-sapphire) 22%, transparent),
    0 8px 24px color-mix(in srgb, var(--color-sapphire) 35%, transparent);
}

/* the reading panel follows the active stage */
section[aria-labelledby="model"] [aria-live] { border-left-width: 2px; border-left-color: var(--color-sapphire); }
section[aria-labelledby="model"] [aria-live] > * { animation: yei-rhsm-in 0.45s ease-out; }
@keyframes yei-rhsm-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  section[aria-labelledby="model"] svg[viewBox="0 0 340 340"] circle[r="122"],
  section[aria-labelledby="model"] svg[viewBox="0 0 340 340"] circle[r="8"],
  section[aria-labelledby="model"] [aria-live] > * { animation: none; }
}
