/*
  Spotlight 2026: the speakers roster and its stage.
  The stage stays in view while the roster scrolls. For each speaker js/stage.js changes the
  colourway, moves the ring and the dot to a new composition and lets the portrait rise inside the dot.
*/

.speakers {
  padding-top: 8px;
}

.speakers__head {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: 0 var(--space-page) 24px;
}

.speakers__title {
  max-width: 9em;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 12.5vw, 4rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.012em;
}

/* ---------- Stage ---------- */

.stage {
  /* Dot diameter: viewport-based fallback first, then real stage units. */
  --dot-d: min(27vh, 60vw);
  --ring-d: calc(var(--dot-d) / var(--dot-ratio));
  --centre-y: 47%;

  position: sticky;
  top: 0;
  z-index: var(--layer-stage);
  height: 46vh;
  min-height: 260px;
  max-height: 480px;
  overflow: hidden;
  /* Start colourway (night). js/stage.js tweens these three colours between the identity's colourways. */
  background-color: var(--color-black);
  container-type: size;
}

@supports (height: 1svh) {
  .stage {
    height: 46svh;
  }
}

@supports (width: 1cqmin) {
  .stage {
    --dot-d: 60cqmin;
  }
}

/* Until js/stage.js takes over (no JavaScript, or GSAP failed to load) nothing drives the stage,
   so it stays out of the way and the roster stands alone. */
.speakers:not(.is-live) .stage {
  display: none;
}

/* The next colourway, poured out of the dot as a growing circle by js/stage.js. */
.stage__flood {
  position: absolute;
  inset: 0;
  clip-path: circle(0px at 50% 50%);
  pointer-events: none;
}

.stage__ring,
.stage__dot {
  position: absolute;
  left: 50%;
  top: var(--centre-y);
  border-radius: 50%;
  will-change: transform;
}

.stage__ring {
  width: var(--ring-d);
  height: var(--ring-d);
  margin: calc(var(--ring-d) / -2) 0 0 calc(var(--ring-d) / -2);
  border: calc(var(--ring-d) * var(--ring-stroke-ratio)) solid var(--color-blue);
}

.stage__dot {
  display: grid;
  place-items: center;
  width: var(--dot-d);
  height: var(--dot-d);
  margin: calc(var(--dot-d) / -2) 0 0 calc(var(--dot-d) / -2);
  /* Black in every colourway (project owner, 29 Nov 2026): the cut-out portraits carry straight
     frame edges and grey hair fringes from their photos, and on black those disappear. */
  background-color: var(--color-black);
}

/* Which speaker is in the light, of how many: "07 / 16". */
.stage__count {
  position: absolute;
  left: var(--space-page);
  top: 16px;
  color: var(--color-paper);
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}

.stage__total {
  opacity: 0.7;
}

/* Gaffer-tape spike mark: where a speaker with no photo yet will stand. */
.stage__mark {
  width: 36%;
}

/*
  The portrait window: exactly the dot, clipped to its circle. The whole portrait stays inside the
  black dot. When heads rose out of it, the photos' straight frame edges, Ana's curls and the grey
  hair fringes showed against the coloured field (project owner, 29 Nov 2026).
*/
.stage__window {
  position: absolute;
  inset: 0;
  pointer-events: none;
  clip-path: circle(50% at 50% 50%);
}

/* A portrait is as wide as the dot, and its frame's side edges (about 3 % in) fall outside the
   circle. The head sits low enough for headroom under the dot's top. js/stage.js only moves it
   vertically. */
.stage__figure {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  will-change: transform;
}

.stage__figure img {
  width: 100%;
}

.stage__caption {
  display: none;
}

.stage__talk[hidden] {
  display: none;
}

.stage__flag {
  position: absolute;
  left: var(--space-page);
  bottom: 12px;
}

/* ---------- Roster ---------- */

.roster {
  margin: 0;
  padding: 12px var(--space-page) 56px;
  list-style: none;
}

.speaker {
  padding: 12px 0 16px;
  scroll-margin-top: 50vh;
}

.speaker__name {
  color: var(--color-pink);
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 13vw, 3.5rem);
  font-weight: 400;
  line-height: var(--leading-display);
  letter-spacing: 0.015em;
  transition: color var(--duration-normal) linear;
}

.speaker__name .wipe__inner {
  padding-top: 0.05em;
}

.speaker__role {
  max-width: 24rem;
  margin-top: 6px;
  color: var(--color-paper-soft);
  font-size: var(--text-small);
  line-height: 1.38;
  transition: color var(--duration-normal) linear;
}

/* The talk: time in the label face, then the topic. Shown only once the organisers fill them in. */
.speaker__talk {
  display: grid;
  gap: 2px;
  max-width: 24rem;
  margin-top: 8px;
  color: var(--color-paper-soft);
  font-size: var(--text-small);
  line-height: 1.38;
  transition: color var(--duration-normal) linear;
}

.speaker__time {
  color: var(--color-lime);
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

/* Once the stage is live, only the speaker in the spotlight keeps the colour. */
.speakers.is-live .speaker__name {
  color: var(--color-paper-dim);
}

.speakers.is-live .speaker__role,
.speakers.is-live .speaker__talk {
  color: var(--color-paper-muted);
}

.speakers.is-live .speaker:not(.is-active) .speaker__time {
  color: var(--color-paper-muted);
}

.speakers.is-live .speaker.is-active .speaker__name {
  color: var(--color-pink);
}

.speakers.is-live .speaker.is-active .speaker__role,
.speakers.is-live .speaker.is-active .speaker__talk {
  color: var(--color-paper);
}

/*
  Phones: names scroll up under the stage. In the night colourway the stage is as black as the
  page, so its edge is invisible and names would look sliced in mid-air: a black shadow below
  the stage dissolves them first. The roster starts below that shadow.
*/
@media (max-width: 899.98px) {
  .stage {
    box-shadow: 0 34px 26px 0 var(--color-black);
  }

  .roster {
    padding-top: 56px;
  }
}

/* Landscape phones: too short to keep a stage in view above the roster, so it scrolls with the page. */
@media (max-width: 899.98px) and (max-height: 520px) {
  .stage {
    position: relative;
  }
}

@media (min-width: 900px) {
  .speakers {
    padding-top: 0;
  }

  .speakers__grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: auto 1fr;
    align-items: start;
  }

  .speakers__head {
    grid-column: 1;
    grid-row: 1;
    padding: 12vh var(--space-page) 4vh;
  }

  .speakers__title {
    font-size: clamp(3.5rem, 5.6vw, 6rem);
  }

  .stage {
    --dot-d: min(54vh, 34vw);
    --centre-y: 46%;

    grid-column: 2;
    grid-row: 1 / -1;
    height: 100vh;
    max-height: none;
  }

  @supports (height: 1svh) {
    .stage {
      height: 100svh;
    }
  }

  @supports (width: 1cqmin) {
    .stage {
      --dot-d: 60cqmin;
    }
  }

  /* The live poster caption, set like the speaker posters: name, role. */
  .stage__caption {
    position: absolute;
    left: 40px;
    right: 40px;
    bottom: 40px;
    display: grid;
    justify-items: start;
    gap: 10px;
  }

  .stage__name {
    color: var(--color-pink);
    font-family: var(--font-display);
    font-size: clamp(4rem, 7vw, 8rem);
    line-height: var(--leading-display);
    letter-spacing: 0.02em;
  }

  .stage__name .wipe__inner {
    padding-top: 0.05em;
  }

  .stage__talk {
    display: grid;
    gap: 4px;
    max-width: 32rem;
    font-size: 1.0625rem;
    line-height: 1.35;
  }

  .stage__time {
    color: var(--color-lime);
    font-family: var(--font-label);
    font-weight: 700;
    letter-spacing: 0.06em;
  }

  .stage__time:empty,
  .stage__topic:empty {
    display: none;
  }

  .stage__role {
    max-width: 28rem;
    font-family: var(--font-label);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .stage__flag {
    left: auto;
    right: 40px;
    top: 40px;
    bottom: auto;
  }

  .stage__count {
    left: 40px;
    top: 40px;
    font-size: 0.9375rem;
  }

  .roster {
    grid-column: 1;
    grid-row: 2;
    padding-bottom: 45vh;
  }

  .speaker {
    position: relative;
    padding: 16px 0 20px;
  }

  .speaker__name {
    font-size: clamp(3.25rem, 5.4vw, 5.75rem);
  }

  .speaker__role {
    max-width: 26rem;
    margin-top: 8px;
    font-size: 1.0625rem;
  }
}
