/* 2 · PRODUCT LOOP — the orbit: Schedule → Complete → Earned → repeats, with Paid as a separate branch.
   Desktop is an SVG ellipse with a travelling comet; mobile becomes a vertical rail. Logic: js/sections/loop.js */

.loop { padding-top: clamp(72px, 9vh, 110px); padding-bottom: clamp(72px, 9vh, 110px); }
.orbit-head { position: absolute; left: 50%; top: 49%; z-index: 1; width: 52%; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: calc(18px * var(--k)); text-align: center; }
.orbit-head .h2 { font-size: calc(80px * var(--k)); }
.orbit-head .sec-note { margin: 0; max-width: none; font-size: calc(17px * max(var(--k), .85)); }
/* --k scales the whole composition with its width (set by loop.js) */
.orbit { position: relative; max-width: 1200px; margin: 0 auto; aspect-ratio: 1200 / 640; --k: 1; }
.orbit-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.o-track { fill: none; stroke: rgba(243, 238, 227, .1); stroke-width: 1.2; }
.o-draw { fill: none; stroke-width: 1.6; transition: stroke-dashoffset 1800ms var(--ease-io) 200ms; }
.o-branch { fill: none; stroke: var(--brass-hi); stroke-width: 1.4; stroke-dasharray: 3 7; stroke-linecap: round; opacity: 0; transition: opacity 900ms ease 1500ms; }
.orbit.in .o-branch { opacity: .75; }
.comet { opacity: 0; transition: opacity 600ms ease; }
.orbit.running .comet { opacity: 1; }
.c-trail { fill: none; stroke: var(--volt); stroke-linecap: round; }
.c-trail:nth-of-type(1) { stroke-width: 2; opacity: .18; }
.c-trail:nth-of-type(2) { stroke-width: 2.4; opacity: .45; }
.c-trail:nth-of-type(3) { stroke-width: 3; opacity: .9; }
.c-glow { fill: var(--volt); opacity: .7; }
.c-head { fill: #EFFFF7; }
.rail { display: none; }

.node { position: absolute; left: var(--x); top: var(--y); z-index: 2; display: grid; justify-items: center; gap: 12px;
  transform: translate(-50%, -50%) scale(var(--k)); }
.node > * { opacity: 0; translate: 0 16px; transition: opacity 900ms var(--ease-out), translate 1000ms var(--ease-out); transition-delay: calc(500ms + var(--d)); }
.orbit.in .node > * { opacity: 1; translate: 0 0; }
.node-tag { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--tx-2); }
.node-tag span { color: var(--volt); font-variant-numeric: tabular-nums; letter-spacing: .1em; }
.n-done { --tag-gap: 14px; }
.n-sched .ui-sched, .n-done .ui-job, .n-earned .earned-badge { transition: box-shadow 500ms ease, transform 600ms var(--ease-out), opacity 600ms ease; }
.node.hit .ui-sched, .node.hit .ui-job { box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .65), 0 0 0 2px rgba(108, 255, 192, .9), 0 0 50px -6px rgba(108, 255, 192, .55); }
.n-earned .earned-badge { opacity: .5; }
.n-earned.lit .earned-badge { opacity: 1; transform: scale(1.04); box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .2) inset, 0 0 0 2px rgba(108, 255, 192, .85), 0 0 60px -6px rgba(108, 255, 192, .6); }
.eb-total { font-size: 14px; color: var(--tx-3); }
.eb-total b { color: var(--tx); font-weight: 600; font-variant-numeric: tabular-nums; }
.next-chip { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 18px; border-radius: 999px; font-size: 14px; color: var(--tx-2);
  background: rgba(4, 25, 21, .55); box-shadow: 0 0 0 1px var(--hair) inset; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: box-shadow 500ms ease, color 500ms ease; }
.next-chip svg { width: 17px; height: 17px; color: var(--mint); }
.next-chip b { color: var(--tx); font-weight: 600; }
.n-next.hit .next-chip { box-shadow: 0 0 0 1.5px rgba(108, 255, 192, .7) inset, 0 0 30px -6px rgba(108, 255, 192, .45); color: var(--tx); }
.n-paid { justify-items: start; grid-template-columns: auto auto; align-items: center; gap: 16px; transform: translate(-30%, -50%) scale(var(--k)); }
.stamp { display: inline-block; padding: 5px 12px 4px; border: 2px solid var(--brass-hi); border-radius: 9px; color: var(--brass-hi); font-weight: 700; font-size: 15px; letter-spacing: .24em; rotate: -8deg; }
.n-paid p { margin: 0; color: var(--tx-3); font-size: 13.5px; line-height: 1.45; white-space: nowrap; }

/* ---------- mobile: the loop becomes a vertical rail ---------- */
@media (max-width: 900px) {
  .orbit { aspect-ratio: auto; display: grid; gap: 34px; padding-left: 40px; }
  .orbit-svg { display: none; }
  .orbit-head { position: relative; left: auto; top: auto; width: auto; transform: none; justify-items: start; text-align: left; margin: 0 0 8px -40px; gap: 18px; }
  .orbit-head .h2 { font-size: clamp(44px, 12vw, 72px); }
  .rail { display: block; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: rgba(243, 238, 227, .12); }
  .rail i { position: absolute; left: 50%; top: calc(var(--u, 0) * 100%); width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #EFFFF7; box-shadow: 0 0 0 4px rgba(108, 255, 192, .25), 0 0 24px 4px rgba(108, 255, 192, .7); opacity: 0; transition: opacity 400ms ease; }
  .orbit.running .rail i { opacity: 1; }
  .node, .n-paid { position: relative; left: auto; top: auto; transform: none; justify-items: start; }
  .n-paid { grid-template-columns: auto 1fr; }
  .orbit .ui-sched, .orbit .ui-job { width: 100%; max-width: 330px; }
}

/* ---------- reduced motion ---------- */
.rm .node > * { transform: none !important; translate: none !important; transition-property: opacity; transition-duration: 400ms; }
