/* Round 6 · 04 Faces: a living orbit of 18 sample freelancers.
   Two rings turn in opposite directions (JS writes only --a on each ring); every face stays upright through
   rotate(θ) translateX(r) rotate(−θ). The spotlight walks the faces on its own; the centre card flips to show
   who is lit, and the orbit's wash takes that person's category colour. Phone: one ring of all 18. */

.faces { position: relative; padding: calc(var(--sec) * .8) 0; background: #fff; overflow: clip; }
.faces__grid { display: grid; gap: 44px; align-items: center; }
.faces__title { font-size: clamp(46px, 4.4vw + 6px, 70px); }
.faces__title .title__light { display: block; max-width: none; margin-top: .04em; font-size: 1em; line-height: .98; letter-spacing: -.035em; color: var(--fcd, var(--cat-design-d)); transition: color .7s ease; }
.faces__lead { margin-top: 22px; max-width: 24em; font-size: 19px; line-height: 1.5; color: var(--text); }
.faces__tag { margin-top: 18px; }
.faces__tag .tagline { margin-left: 0; }
.faces__copy .link { margin-top: 18px; }
.faces__cap { margin-top: 4px; }

/* ── the orbit box ── */
.orb { --orb: min(100vw - 32px, 380px); --so: 40px; --si: 40px; --ro: calc(var(--orb) * .44); --ri: var(--ro);
  position: relative; width: var(--orb); height: var(--orb); margin: 0 auto; }
.orb__glow { position: absolute; left: 50%; top: 50%; width: calc(var(--ro) * 2 - var(--so) - 18px); height: calc(var(--ro) * 2 - var(--so) - 18px); border-radius: 50%;
  transform: translate(-50%, -50%); background: color-mix(in srgb, var(--cs) 62%, #fff); transition: background-color .7s ease, box-shadow .7s ease; }
.orb__guide { position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 1.5px dashed rgba(3, 21, 20, .12); transform: translate(-50%, -50%); pointer-events: none; }
.orb__guide--o { width: calc(var(--ro) * 2); height: calc(var(--ro) * 2); }
.orb__guide--i { display: none; width: calc(var(--ri) * 2); height: calc(var(--ri) * 2); }

/* six tiny coloured dots drifting between the rings (decoration, live only) */
.orb__dots { position: absolute; inset: 0; margin: 0; pointer-events: none; }
.orb__dots li { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%;
  transform: rotate(calc(var(--k) * 60deg + 30deg)) translateX(calc(var(--ro) + var(--so) / 2 + 14px)); }
.orb__dots li:nth-child(1) { background: var(--cat-tech); }
.orb__dots li:nth-child(2) { background: var(--sun); width: 12px; height: 12px; margin: -6px; }
.orb__dots li:nth-child(3) { background: var(--cat-writing); }
.orb__dots li:nth-child(4) { background: var(--cat-admin); width: 6px; height: 6px; margin: -3px; }
.orb__dots li:nth-child(5) { background: var(--coral); }
.orb__dots li:nth-child(6) { background: var(--cat-design); width: 11px; height: 11px; margin: -5.5px; }
.is-live .orb__dots { animation: orb-dots 48s linear infinite; }
@keyframes orb-dots { to { transform: rotate(-360deg); } }

/* ── the rings ── */
.orb__ring { position: absolute; inset: 0; margin: 0; --a: 0deg; pointer-events: none; }
.orb__ring li { position: absolute; left: 50%; top: 50%; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  --t: calc(var(--a) - 90deg + var(--j) * 20deg);
  transform: rotate(var(--t)) translateX(var(--r)) rotate(calc(var(--t) * -1)); pointer-events: auto; }
.orb__ring--o li { --s: var(--so); --r: var(--ro); }
.orb__ring--i li { --s: var(--si); --r: var(--ri); }
.orb__ring li.is-spot { z-index: 3; }

.orb__f { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 50%; background: #fff; cursor: pointer;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4.5px var(--c), 0 10px 20px -10px rgba(3, 21, 20, .5);
  transition: transform .55s var(--spring), box-shadow .45s ease; -webkit-tap-highlight-color: transparent; }
.orb__f img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.orb__f:hover { transform: scale(1.12); }
.is-spot > .orb__f { transform: scale(1.25); box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--c), 0 0 0 12px color-mix(in srgb, var(--c) 22%, transparent), 0 16px 30px -10px color-mix(in srgb, var(--c) 80%, #000); }
.orb__f:focus-visible { outline: 3px solid var(--ink); outline-offset: 6px; border-radius: 50%; }
.orb__tip { position: absolute; left: 50%; bottom: calc(100% + 10px); padding: 5px 10px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: 12.5px; line-height: 1.2; white-space: nowrap;
  opacity: 0; transform: translate(-50%, 4px); transition: opacity .2s, transform .3s var(--spring); pointer-events: none; }
.orb__f:hover .orb__tip, .orb__f:focus-visible .orb__tip { opacity: 1; transform: translate(-50%, 0); }

/* ── the centre card ── */
.orb__card { position: absolute; left: 50%; top: 50%; z-index: 2; width: 206px; transform: translate(-50%, -50%); perspective: 900px; }
.oc { display: grid; justify-items: center; padding: 16px 14px 18px; border-radius: 36%; background: #fff; text-align: center;
  box-shadow: 0 0 0 1px rgba(3, 21, 20, .05), 0 26px 50px -26px color-mix(in srgb, var(--cd) 70%, #000); transform-origin: 50% 50%; }
.oc.is-flip { animation: oc-flip 380ms cubic-bezier(.2, .8, .2, 1); }
@keyframes oc-flip { from { transform: rotateY(90deg); opacity: .35; } }
.oc__ph { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2.5px #fff, 0 0 0 5px var(--c); }
.oc__name { display: flex; align-items: center; gap: 5px; margin-top: 10px; font-family: var(--display); font-size: 20px; line-height: 1; letter-spacing: -.02em; color: var(--ink); }
.oc__name .vf { width: 17px; height: 17px; }
.oc__craft { margin-top: 4px; max-width: 17em; font-size: 12.5px; line-height: 1.3; color: var(--muted); }
/* the level chip is the app's (LevelBadge chip: rung tint + coin; badges.css carries the tints) */
.lvl { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 3px; border-radius: 999px; font-weight: 700; font-size: 11.5px; }
.lvl__coin { width: 18px; height: 18px; }
.oc__lvl { margin-top: 8px; }
.oc__price { display: grid; margin-top: 7px; line-height: 1.2; }
.oc__price small { font-size: 11.5px; color: var(--muted); }
.oc__price small:empty { display: none; }
.oc__price b { font-family: var(--display); font-size: 15.5px; letter-spacing: -.01em; color: var(--cd); }
.oc__skills { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 190px; margin-top: 8px; }
.oc__skills li { padding: 3px 8px; border-radius: 999px; background: var(--cs); color: var(--cd); font-weight: 700; font-size: 10.5px; line-height: 1.3; white-space: nowrap; }

@media (max-width: 959px) {
  .orb__card { width: 170px; }
  .oc { padding: 12px 10px 14px; }
  .oc__ph { width: 42px; height: 42px; }
  .oc__name { margin-top: 7px; font-size: 17px; }
  .oc__name .vf { width: 15px; height: 15px; }
  .oc__craft { font-size: 11.5px; }
  .oc__lvl { margin-top: 6px; transform: scale(.92); }
  .oc__price { margin-top: 4px; }
  .oc__price small { display: none; }
  .oc__price b { font-size: 13.5px; }
  .oc__skills { max-width: 150px; margin-top: 6px; gap: 3px; }
  .oc__skills li { padding: 2px 7px; font-size: 9.5px; }
}

/* ── desktop: two rings, bigger faces ── */
@media (min-width: 960px) {
  .faces { padding: calc(var(--sec) * .7) 0; }
  .faces__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; }
  .orb { --orb: min(640px, 46vw, calc(100svh - 180px)); --so: 66px; --si: 54px; --ro: calc(var(--orb) * .44); --ri: calc(var(--orb) * .285); margin-right: 0; }
  .orb__ring--o li { --t: calc(var(--a) - 90deg + var(--i) * 360deg / 11); }
  .orb__ring--i li { --t: calc(var(--a) - 90deg + var(--i) * 360deg / 7); }
  .orb__guide--i { display: block; }
  .orb__glow { width: calc(var(--ri) * 2 - var(--si) - 14px); height: calc(var(--ri) * 2 - var(--si) - 14px);
    box-shadow: 0 0 0 calc(var(--ro) - var(--ri) + var(--si) / 2 + 7px - var(--so) / 2 - 9px) color-mix(in srgb, var(--cs) 30%, #fff); }
  .orb__card { width: min(236px, calc(var(--orb) * .42)); }
}
@media (min-width: 960px) and (max-height: 800px) {
  .faces { padding: 64px 0; }
  .faces__title { font-size: clamp(44px, 3.6vw + 8px, 62px); }
  .faces__lead { font-size: 17.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .is-live .orb__dots { animation: none; }
  .oc.is-flip { animation: none; }
}
