/* ==========================================================================
   LAMBALI: HERO ORBIT (assets/css/orbit.css)
   Right side of the home page hero. Eight coloured petals turn slowly clockwise
   around a small fixed centre circle. Labels stay upright.
   Hover, focus or tap a petal: the flower pauses, the centre names the module
   and the line under the flower explains it.
   Loaded by index.php through $page_css, after home.css.
   ========================================================================== */

.hero-orbit { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; }

.orbit {
  --spin: 45s;
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 1 / 1;
  container-type: inline-size;
}

/* soft static glow under everything */
.orbit-halo {
  position: absolute; inset: 4%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(31, 91, 216, .14) 0%, rgba(15, 157, 154, .07) 50%, transparent 72%);
}

/* thin dotted ring outside the petals, turns the other way */
.orbit-dash { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; animation: orbitSpinRev 160s linear infinite; }
.orbit-dash circle { fill: none; stroke: var(--blue-line); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 0.1 11; }

/* ---------- Rotating flower ---------- */
.ring { position: absolute; inset: 0; animation: orbitSpin var(--spin) linear infinite; }
.oseg { position: absolute; inset: 0; pointer-events: none; }
.oseg.is-on { z-index: 6; }
.oseg-body { position: absolute; inset: 0; transition: transform .35s var(--ease); }
.oseg.is-on .oseg-body { transform: translate(calc(var(--dx) * 1%), calc(var(--dy) * 1%)); }

.oseg-shape, .oseg-hit { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.oseg-shape path, .oseg-cap path { fill: var(--c); }
.oseg-shape path { transition: filter .3s; }
/* the last petal's right half, drawn on top, so the first petal is also tucked under its neighbour */
.oseg-cap { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.oseg-cap svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.oseg.is-on .oseg-shape path { filter: brightness(1.1) saturate(1.1); }
.oseg-hit path { fill: transparent; stroke: none; pointer-events: all; cursor: pointer; }

/* label: the button sits on the petal, the inner span turns the opposite way so text stays upright */
.oseg-btn {
  position: absolute; left: var(--lx); top: var(--ly); transform: translate(-50%, -50%);
  background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--t, #fff); pointer-events: none;
  z-index: 4;   /* labels stay above every petal, including the closing cap */
}
.oseg-lbl {
  display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center;
  width: 92px; width: 17cqw; line-height: 1.15; font-weight: 700; font-family: var(--font-body);
  animation: orbitSpinRev var(--spin) linear infinite;
}
.oseg-ic { width: 28px; height: 28px; width: 5cqw; height: 5cqw; stroke-width: 1.7; }
.oseg-txt { font-size: 12px; font-size: max(11px, 2.5cqw); letter-spacing: -.005em; }
.oseg-btn:focus-visible { outline: none; }
.oseg-btn:focus-visible .oseg-lbl { outline: 2px solid currentColor; outline-offset: 5px; border-radius: 10px; }

/* pause everything while a petal is active, or while the hero is off screen */
.orbit.is-paused .ring, .orbit.is-paused .oseg-lbl { animation-play-state: paused; }
.orbit.is-away .ring, .orbit.is-away .oseg-lbl, .orbit.is-away .orbit-dash { animation-play-state: paused; }

/* ---------- Fixed centre (small, sits on top of the petal bases) ---------- */
.core {
  position: absolute; z-index: 2; left: 50%; top: 50%; width: 34%; aspect-ratio: 1 / 1; transform: translate(-50%, -50%);
  border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .55), 0 8px 24px rgba(10, 26, 63, .16);
}
.core-idle, .core-info {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 9%; transition: opacity .25s ease, transform .3s var(--ease);
}
.core-logo { width: 54px; height: 54px; width: 9.6cqw; height: 9.6cqw; object-fit: contain; margin-bottom: 6px; }
.core-name { font-family: var(--font-head); font-weight: 800; font-size: 26px; font-size: 5.4cqw; letter-spacing: -.02em; color: var(--navy); line-height: 1.1; }
.core-sub { margin-top: 3px; font-size: 13px; font-size: max(10px, 2.3cqw); line-height: 1.25; color: var(--muted); font-weight: 600; }
.core-sub + .core-sub { margin-top: 0; }

.core-info { opacity: 0; transform: scale(.94); pointer-events: none; }
.core-ic { display: grid; place-items: center; width: 34px; height: 34px; width: 6.2cqw; height: 6.2cqw; border-radius: 50%; background: var(--blue-soft); color: var(--blue); margin-bottom: 6px; }
.core-ic .ic { width: 56%; height: 56%; }
.core-t { font-family: var(--font-head); font-weight: 800; font-size: 17px; font-size: max(12px, 3.1cqw); letter-spacing: -.02em; color: var(--navy); line-height: 1.15; }
.core-b { margin-top: 7px; font-style: normal; font-weight: 700; font-size: 10px; font-size: max(8.5px, 1.8cqw); letter-spacing: .04em; text-transform: uppercase; color: var(--gold-dk); background: var(--gold-soft); border-radius: 99px; padding: 2px 8px; }
.core-b:empty { display: none; }

.orbit.has-active .core-idle { opacity: 0; transform: scale(.94); }
.orbit.has-active .core-info { opacity: 1; transform: none; }

/* line under the flower: hint by default, the module's explanation when a petal is active */
.orbit-hint { margin-top: 14px; min-height: 3em; max-width: 44ch; font-size: 14px; line-height: 1.5; color: var(--muted); text-align: center; transition: color .2s; }
.orbit.has-active + .orbit-hint { color: var(--ink-soft); }

/* ---------- Entrance: flower turns in, then rests into its slow spin ---------- */
.js .orbit { opacity: 0; transform: scale(.9) rotate(-24deg); }
.js.is-ready .orbit { animation: orbitIn 1.2s var(--ease) .15s forwards; }

@keyframes orbitIn { to { opacity: 1; transform: none; } }
@keyframes orbitSpin { to { transform: rotate(360deg); } }
@keyframes orbitSpinRev { to { transform: rotate(-360deg); } }

/* ---------- Smaller screens ---------- */
@media (max-width: 960px) {
  .hero-orbit { margin-inline: auto; width: 100%; }
  .orbit { width: min(100%, 500px); }
}
/* narrow phones: icons only on the petals, the name appears in the centre when a petal is tapped */
@media (max-width: 520px) {
  .oseg-txt { display: none; }
  .oseg-ic { width: 28px; height: 28px; width: 8cqw; height: 8cqw; }
  .core-logo { width: 11cqw; height: 11cqw; margin-bottom: 2px; }
  .core-name { font-size: 6.3cqw; }
  .core-sub { font-size: 3.1cqw; margin-top: 1px; }
  .core-ic { width: 8cqw; height: 8cqw; margin-bottom: 3px; }
  .core-t { font-size: 4cqw; }
  .core-b { font-size: 2.6cqw; margin-top: 4px; }
  .orbit-hint { font-size: 13.5px; }
}

/* ---------- Reduce motion: show the flower, keep it still ---------- */
@media (prefers-reduced-motion: reduce) {
  .js .orbit { opacity: 1; transform: none; animation: none; }
  .ring, .oseg-lbl, .orbit-dash { animation: none; }
}
