/* ==========================================================================
   People: "Constellation of experts" (src/features/people/sky.js,
   public/assets/js/people-sky.js). A night sky in the site's ink, starlight
   in lilac and lavender. Without JavaScript the server-drawn SVG shows
   and the names are listed under it; with it a canvas takes over.
   ========================================================================== */

.pp-sky-wrap {
  --sky-lilac: #BDA1E0;
  --sky-lilac-soft: #E2D7EF;
  --sky-lav: #C9B8DE;
  position: relative; overflow: hidden;
  padding: var(--s-5) 0 var(--s-4);
  color: var(--on-ink);
  background:
    radial-gradient(60% 55% at 22% 30%, rgba(110, 66, 166, 0.34), transparent 70%),
    radial-gradient(45% 50% at 82% 70%, rgba(189, 161, 224, 0.12), transparent 70%),
    radial-gradient(120% 90% at 50% 0%, #2A1B45 0%, #1A1030 55%, #0E0820 100%);
  border-top: 1px solid rgba(201, 184, 222, 0.12);
}
.pp-sky-wrap::before { /* faint celestial graticule, decoration only */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background:
    repeating-radial-gradient(circle at 50% 120%, transparent 0 119px, rgba(201, 184, 222, 0.05) 119px 120px);
}

.pp-sky-head { position: relative; max-width: 64ch; }
.pp-sky-kicker {
  display: inline-block; margin-bottom: 0.6rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sky-lilac);
}
.pp-sky-title {
  margin: 0 0 0.4em; color: #fff;
  font-family: var(--font-serif); font-weight: 500; font-size: clamp(2rem, 3.6vw, 3rem); letter-spacing: -0.015em; line-height: 1.08;
}
.pp-sky-lede { margin: 0; font-family: var(--font-serif); font-size: 1.12rem; line-height: 1.55; color: var(--on-ink); }

/* Topic chips: links to the filtered directory; with JS they light a constellation. */
.pp-sky-chips { position: relative; display: flex; flex-wrap: wrap; gap: 0.45rem; margin: var(--s-3) 0 0; }
.pp-sky-chip {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.42em 0.85em; border-radius: 999px;
  font-size: 0.82rem; font-weight: 500; letter-spacing: 0.01em; color: var(--on-ink); text-decoration: none;
  border: 1px solid rgba(201, 184, 222, 0.28); background: rgba(255, 255, 255, 0.03);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.pp-sky-chip:hover { color: #fff; border-color: rgba(226, 215, 239, 0.6); }
.pp-sky-chip:focus-visible { outline: 2px solid var(--sky-lilac); outline-offset: 2px; }
.pp-sky-chip[aria-pressed="true"] {
  color: #1A1030; background: var(--sky-lilac-soft); border-color: var(--sky-lilac-soft);
  box-shadow: 0 0 18px rgba(189, 161, 224, 0.45);
}
.pp-sky-chip-n { font-size: 0.72rem; font-variant-numeric: tabular-nums; opacity: 0.7; }

/* The sky itself: a fixed shape, so nothing moves when the canvas arrives. */
.pp-sky { position: relative; margin: var(--s-3) 0 0; }
.pp-sky-stage { position: relative; aspect-ratio: 2 / 1; width: 100%; }
.pp-sky.is-single .pp-sky-stage { aspect-ratio: 5 / 2; }
.pp-sky-svg, .pp-sky-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pp-sky-canvas { display: none; cursor: default; }
.pp-sky.is-live .pp-sky-canvas { display: block; }
.pp-sky.is-live .pp-sky-svg { visibility: hidden; }
.pp-sky.is-live.is-pointing .pp-sky-canvas { cursor: pointer; }

.pp-sky-lines line { stroke: rgba(201, 184, 222, 0.28); stroke-linecap: round; }
.pp-sky-dot { fill: #FAF8FC; }
.pp-sky-cluster {
  font: 600 11px var(--font); letter-spacing: 0.24em; text-transform: uppercase; fill: rgba(226, 215, 239, 0.55);
}
.pp-sky-label { font: 500 15px var(--font-serif); fill: #F1EDF7; }

/* Star colours by group (the same values people-sky.js draws with). */
.pp-sky-dot.is-leadership, .pp-sky-swatch.is-leadership { fill: #E2D7EF; background: #E2D7EF; }
.pp-sky-dot.is-staff, .pp-sky-swatch.is-staff { fill: #FAF8FC; background: #FAF8FC; }
.pp-sky-dot.is-fellows, .pp-sky-swatch.is-fellows { fill: #B998E6; background: #B998E6; }
.pp-sky-dot.is-advisory, .pp-sky-swatch.is-advisory { fill: #D3D7DE; background: #D3D7DE; }
.pp-sky-dot.is-editorial, .pp-sky-swatch.is-editorial { fill: #A9D1F0; background: #A9D1F0; }

/* Names under the sky: screen-reader only, except when scripting is off,
   where they are a readable index of links under the static chart. */
.pp-sky-list {
  position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; list-style: none;
}
.pp-sky-list a { color: var(--on-ink); text-decoration: none; font-size: 0.86rem; }
.pp-sky-n { font-family: var(--font-serif); font-size: 1rem; color: #fff; }
.pp-sky-f { margin-left: 0.4em; color: var(--on-ink-muted); }
@media (scripting: none) {
  .pp-sky-list {
    position: static; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal;
    display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; margin-top: 0.8rem;
  }
  .pp-sky-list a:hover .pp-sky-n { text-decoration: underline; text-underline-offset: 3px; }
}

/* Hover / focus card. */
.pp-sky-tip {
  position: absolute; z-index: 2; left: 0; top: 0;
  min-width: 180px; max-width: min(280px, 80%);
  padding: 0.75rem 0.95rem 0.8rem;
  color: var(--text); background: #F9F6FC;
  border-radius: 3px; border-top: 3px solid var(--sky-lilac);
  box-shadow: 0 18px 40px -12px rgba(8, 4, 20, 0.7), 0 0 0 1px rgba(42, 27, 69, 0.08);
  pointer-events: none; opacity: 0; transform: translate(-50%, calc(-100% - 16px)) translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.pp-sky-tip.is-on { opacity: 1; transform: translate(-50%, calc(-100% - 16px)); }
.pp-sky-tip.is-below { transform: translate(-50%, 18px); }
.pp-sky-tip.is-touch { pointer-events: auto; }
.pp-sky-tip b { display: block; font: 500 1.1rem/1.2 var(--font-serif); color: var(--ink); }
.pp-sky-tip span { display: block; margin-top: 0.2rem; font-size: 0.8rem; line-height: 1.4; color: var(--muted); }
.pp-sky-tip em { display: block; margin-top: 0.45rem; font-style: normal; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.pp-sky-tip a { color: var(--accent); }

.pp-sky-key {
  position: relative; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem;
  margin: var(--s-2) 0 0; padding: 0; list-style: none; font-size: 0.8rem; color: var(--on-ink-muted);
}
.pp-sky-key li { display: inline-flex; align-items: center; gap: 0.45rem; }
.pp-sky-swatch { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.pp-sky-legend { position: relative; margin: 0.5rem 0 0; font-size: 0.8rem; letter-spacing: 0.02em; color: var(--on-ink-muted); }
.pp-sky-soon { font-style: italic; }

@media (max-width: 640px) {
  .pp-sky-wrap { padding: var(--s-4) 0 var(--s-3); }
  .pp-sky-stage { aspect-ratio: 4 / 5; }
  .pp-sky.is-single .pp-sky-stage { aspect-ratio: 4 / 3; }
  .pp-sky-chips { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(-1 * var(--s-2)); padding-bottom: 0.3rem; scrollbar-width: none; }
  .pp-sky-chips::-webkit-scrollbar { display: none; }
  .pp-sky-chip { flex-shrink: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pp-sky-tip, .pp-sky-chip { transition: none; }
}
