/* KZ Theme partial: cps-graph.css
   Owner: HP-04, rebuilt HP-13 (Concept 3, perspective rings). The diagram inside the dark CPS panel (ruling N10): three tilted rings around the globe, scoped to .cr.
   Rings: outer X Domain (orange), middle Y Altitude (light orange), inner Z Depth (blue-grey). Nodes are real buttons (cps-axes.js) laid over an SVG; every node takes its exact
   Cosmos Leap Registry colour (ruling N11, exception in R-COL-1) via --node-color / --node-ink set by inc/cps-data.php. Selected = orange ring, glow and a check mark.
   Sizes follow the container (1cqw = 10 viewBox units): the diagram viewBox is 1000 by 660 and never wider than 1100px. Motion only when cps-graph.js adds .is-live (not under reduced motion).
   Contrast (computed on #0A0A0A): tags X 5.62, Y 8.70, Z 9.07, labels 13.96 (text >= 4.5); grey node ring 4.18, orange ring 8.70, rings at 75% 3.59 to 5.45 (graphics >= 3). See docs/design/DESIGN_RULES.md, CPS rings. */
.cr { --ax-x: var(--orange); --ax-y: var(--orange-dark); --ax-z: #8FB3D9; --cr-bg: var(--ink); --cr-grey: #6B7480; --cr-text: #D5D9DE;
  position: relative; container-type: inline-size; max-width: 1100px; margin: 0 auto; font-family: var(--f-head); }
.cr__stage { position: relative; aspect-ratio: 1000 / 660; }
.cr__svg { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; overflow: visible; }

/* rings, path, moons */
.cr__ring { stroke-width: 2; stroke-opacity: .75; }
.cr__ring--x { stroke: var(--ax-x); fill: color-mix(in srgb, var(--ax-x) 7%, transparent); }
.cr__ring--y { stroke: var(--ax-y); fill: color-mix(in srgb, var(--ax-y) 7%, transparent); }
.cr__ring--z { stroke: var(--ax-z); fill: color-mix(in srgb, var(--ax-z) 7%, transparent); }
.cr__sp { fill: none; stroke: var(--ax-x); stroke-width: 4; stroke-linecap: round; filter: url(#cr-glow); }
.cr__moon { fill: #E8E2DA; stroke: var(--cr-bg); stroke-width: 1.5; offset-rotate: 0deg; }

/* globe: orange sphere, meridians, wobbling outlines and a halo */
.cr__g0 { stop-color: #FFC48F; } .cr__g1 { stop-color: var(--primary); } .cr__g2 { stop-color: var(--primary-active); } .cr__g3 { stop-color: #6B2A06; }
.cr__h0 { stop-color: var(--primary-active); stop-opacity: .55; } .cr__h1 { stop-color: var(--primary-active); stop-opacity: 0; }
.cr__halo { fill: url(#cr-ha); }
.cr__globe { fill: url(#cr-gl); }
.cr__mer ellipse, .cr__lat { fill: none; stroke: #0A0A0A; stroke-opacity: .35; stroke-width: 1.2; }
.cr__rim { fill: none; stroke: var(--primary); stroke-width: 2; stroke-opacity: .8; }
.cr__wr { fill: none; stroke: var(--primary); stroke-width: 1.5; }
.cr__wr--0 { stroke-opacity: .45; } .cr__wr--1 { stroke-opacity: .6; }

/* nodes: real buttons once JS runs (li before). 44px minimum hit area, the disc inside may be smaller. */
.cr__nodes { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.cr__n { position: absolute; transform: translate(-50%, -50%); inline-size: max(44px, calc(var(--d) * .1cqw)); block-size: max(44px, calc(var(--d) * .1cqw)); margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--cr-text); font: inherit; cursor: pointer; pointer-events: auto; appearance: none; display: grid; place-items: center; }
li.cr__n { cursor: default; }
.cr__d { grid-area: 1 / 1; display: grid; place-items: center; inline-size: max(16px, calc(var(--d) * .1cqw)); aspect-ratio: 1; border-radius: 50%; background: var(--node-color, var(--orange)); border: 2px solid var(--cr-grey); opacity: var(--far, 1); box-sizing: border-box; transition: transform .15s ease, border-color .15s ease; }
.cr__d .cps-disc { inline-size: 68%; block-size: 68%; font-size: max(9px, calc(var(--d) * .042cqw)); box-shadow: none; } /* R-CHIP-1: icon on a round white disc */
.cr__l { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: -3px; font: 500 .875rem/1.2 var(--f-body); color: var(--cr-text); white-space: nowrap; text-shadow: 0 0 3px var(--cr-bg), 0 0 6px var(--cr-bg), 0 0 6px var(--cr-bg); pointer-events: none; }
.cr__n:hover .cr__d { border-color: #fff; transform: scale(1.14); opacity: 1; }
.cr__n:hover .cr__l { color: #fff; text-decoration: underline; text-underline-offset: .2em; }
.cr__n[aria-checked="true"] .cr__d { border: 3px solid var(--primary); opacity: 1; box-shadow: 0 0 0 3px rgb(245 148 78 / .35), 0 0 18px rgb(223 100 12 / .75); }
.cr__n[aria-checked="true"] .cr__l { color: var(--primary); font-weight: 700; }
.cr__tick { display: none; position: absolute; inset-block-start: calc(50% - max(8px, var(--d) * .05cqw) - 7px); inset-inline-start: calc(50% + max(8px, var(--d) * .05cqw) - 9px); inline-size: 16px; block-size: 16px; border-radius: 50%; background: #fff; color: var(--cr-bg); font: 700 11px/16px var(--f-body); text-align: center; pointer-events: none; }
.cr__n[aria-checked="true"] .cr__tick { display: block; }
.cr__n:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* axis tags with arrowheads, one per ring */
.cr__tag { position: absolute; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; border: 1.5px solid currentColor; background: var(--cr-bg); font: 700 .875rem/1.25 var(--f-head); white-space: nowrap; pointer-events: none; }
.cr__tag--x { color: var(--ax-x); } .cr__tag--y { color: var(--ax-y); } .cr__tag--z { color: var(--ax-z); }
.cr__arw { inline-size: 16px; block-size: 10px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* corner triad: the marker follows the three picks */
.cr__triad { position: absolute; inset-inline-start: 1%; inset-block-end: 1%; inline-size: min(164px, 16.4cqw); block-size: auto; overflow: visible; font: 700 14px var(--f-head); pointer-events: none; }
.cr__tbox { fill: #111; stroke: #2F3944; }
.cr__ta { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.cr__ta--x { stroke: var(--ax-x); } .cr__ta--y { stroke: var(--ax-y); } .cr__ta--z { stroke: var(--ax-z); }
.cr__th--x { fill: var(--ax-x); } .cr__th--y { fill: var(--ax-y); } .cr__th--z { fill: var(--ax-z); }
.cr__tt--x { fill: var(--ax-x); } .cr__tt--y { fill: var(--ax-y); text-anchor: middle; } .cr__tt--z { fill: var(--ax-z); }
.cr__tg { stroke: #fff; stroke-opacity: .55; stroke-dasharray: 3 3; }
.cr__tm { fill: #fff; stroke: var(--ax-x); stroke-width: 2.5; }

/* narrow container: icons only; the lists carry the words */
@container (max-width: 699px) { .cr__l, .cr__tag, .cr__triad, .cr__tick { display: none; } .cr__d { border-width: 1.5px; } .cr__n[aria-checked="true"] .cr__d { border-width: 2px; box-shadow: 0 0 6px rgb(223 100 12 / .9); } }
/* phones: display-only (the rows are the selector) */
@media (max-width: 899px) { .cr__stage, .cr__stage * { pointer-events: none !important; } }

/* motion: only once cps-graph.js marks the figure live */
@keyframes cr-orbit { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@keyframes cr-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes cr-wob { from { transform: rotate(0deg) scale(1); } 50% { transform: rotate(180deg) scale(1.07); } to { transform: rotate(360deg) scale(1); } }
@keyframes cr-merid { to { transform: translateX(16px); } }
@keyframes cr-draw { from { stroke-dashoffset: 700; } to { stroke-dashoffset: 0; } }
.cr__wr, .cr__globe, .cr__halo { transform-box: fill-box; transform-origin: center; }
.cax.is-live .cr__moon { animation: cr-orbit var(--dur, 60s) linear infinite; animation-delay: calc(var(--p, 0) * var(--dur, 60s) * -1); }
.cax.is-live .cr__globe, .cax.is-live .cr__halo { animation: cr-pulse 4.6s ease-in-out infinite; }
.cax.is-live .cr__wr--0 { animation: cr-wob 21s linear infinite; }
.cax.is-live .cr__wr--1 { animation: cr-wob 15s linear infinite reverse; }
.cax.is-live .cr__mer { animation: cr-merid 6s linear infinite; }
.cax.is-live .cr__sp.is-draw { stroke-dasharray: 700; animation: cr-draw 1.1s cubic-bezier(.2, .6, .2, 1) both; }
.cax.is-paused .cr__stage *, .cax.is-off .cr__stage * { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { .cax .cr__stage *, .cax .cr__stage *::before { animation: none !important; transition: none !important; } .cr__pause { display: none; } }
