/* rn-rollcall.css: the roll call's layout and its last frame (rn-rollcall.js moves it).
   The heading is two lines: a lead that stays put, and a slot of fixed height that holds "you."
   Without the module, without motion, or once the call is over, this is all there is: the lead, then
   "you." a size up and a shade warmer, in a soft warm light. While the call plays, the module adds an
   aria-hidden layer of names inside the slot. The slot never changes size, so nothing around the
   heading moves while names come and go. */

.rn-rollcall {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  row-gap: 0.08em;
  width: 100%;
}
.rn-rollcall__lead {
  display: block;
  font-size: 0.6em;
  line-height: 1.12;
  font-weight: max(560, calc(var(--rw-display-wght) - 180));
  font-stretch: max(75%, calc(var(--rw-display-wdth) - 12%));
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.rn-rollcall__for { display: inline-block; }

.rn-rollcall__slot {
  position: relative;
  display: block;
  width: 100%;
  height: 2.08em;
  perspective: 760px;
  isolation: isolate;
}
/* "you.": its own weight and width, a little warmer than the text around it */
.rn-rollcall__you {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9em;
  line-height: 1;
  font-weight: min(900, calc(var(--rw-display-wght) + 80));
  font-stretch: min(150%, calc(var(--rw-display-wdth) + 10%));
  letter-spacing: -0.04em;
  color: color-mix(in oklab, var(--rw-text) 80%, var(--rw-warn));
  white-space: nowrap;
  transform-origin: 50% 56%;
}
/* The warm light behind it. Dark themes get a glow; light ones a wash, like lamplight on paper */
.rn-rollcall__warm {
  position: absolute;
  left: 50%;
  top: 54%;
  z-index: -1;
  width: 6.4em;
  height: 2.5em;
  margin: -1.25em 0 0 -3.2em;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rw-warn) 52%, transparent), color-mix(in srgb, var(--rw-warn) 14%, transparent) 58%, transparent);
  opacity: var(--rn-rollcall-rest, 0.36);
  pointer-events: none;
}
:root[data-scheme="light"] .rn-rollcall__warm {
  --rn-rollcall-rest: 0.55;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--rw-warn) 26%, transparent), color-mix(in srgb, var(--rw-warn) 8%, transparent) 60%, transparent);
}
@media (prefers-color-scheme: light) {
  :root:not([data-scheme]) .rn-rollcall__warm {
    --rn-rollcall-rest: 0.55;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--rw-warn) 26%, transparent), color-mix(in srgb, var(--rw-warn) 8%, transparent) 60%, transparent);
  }
}
/* High Contrast keeps every edge sharp: no light, a gold rule under the word instead */
[data-theme="high-contrast"] .rn-rollcall__warm { display: none; }
[data-theme="high-contrast"] .rn-rollcall__you {
  color: var(--rw-text);
  text-decoration: underline var(--rw-warn) 0.07em;
  text-underline-offset: 0.1em;
}
@media (prefers-contrast: more) {
  :root:not([data-theme]) .rn-rollcall__warm { display: none; }
  :root:not([data-theme]) .rn-rollcall__you { color: var(--rw-text); text-decoration: underline var(--rw-warn) 0.07em; text-underline-offset: 0.1em; }
}

/* With scripts and motion on, "you." and its light wait for the module, so the call never gives its
   ending away. Like the system's reveals, a failsafe shows them after 2.5 s whatever happens. */
html.rw-js[data-motion="full"] .rn-rollcall:not(.is-live):not(.is-done) .rn-rollcall__you {
  opacity: 0;
  animation: rn-rollcall-failsafe 0s linear 2.5s forwards;
}
html.rw-js[data-motion="full"] .rn-rollcall:not(.is-live):not(.is-done) .rn-rollcall__warm {
  opacity: 0;
  animation: rn-rollcall-failsafe-warm 0s linear 2.5s forwards;
}
@keyframes rn-rollcall-failsafe { to { opacity: 1; } }
@keyframes rn-rollcall-failsafe-warm { to { opacity: var(--rn-rollcall-rest, 0.36); } }

/* The names, while the call plays. They pass through the slot as if through a window */
.rn-rollcall__crowd {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: clip;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 15%, #000 85%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 15%, #000 85%, transparent);
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}
.rn-rollcall.is-live .rn-rollcall__crowd { visibility: visible; }
.rn-rollcall__beat {
  grid-area: 1 / 1;
  max-width: 96%;
  font-size: var(--rn-beat-size, 1em);
  line-height: 1.04;
  color: var(--rw-accent-strong);
  text-align: center;
  text-wrap: balance;
}
.rn-rollcall__w { display: inline-block; white-space: nowrap; }
.rn-rollcall__u { display: inline-block; opacity: 0; transform-origin: 50% 30%; }

@media (max-width: 599px) {
  .rn-rollcall__slot { height: 2.4em; }
  .rn-rollcall__you { font-size: 1.85em; }
}
@media (prefers-reduced-motion: reduce) {
  .rn-rollcall__crowd { display: none; }
}
@media (forced-colors: active) {
  .rn-rollcall__warm { display: none; }
  .rn-rollcall__you, .rn-rollcall__beat { color: CanvasText; }
}
