/* "From Abstract to Program", reworked (2026-11-20): one stage, three acts (Call, Review, Program).
   Pairs with program-flow.js. Every rule is gated on .pf-on, a class the script sets once it has mounted, so
   without the script (or after a failed mount) the shared stylesheet's old look stays untouched.
   Selectors start with "html " so they win against the shared stylesheet in either load order.
   Colours: the component's own variables (--ps-primary, --ps-bright, --ps-deep ...), so every site keeps its colour. */

html .program-slideshow.pf-on {
  --ps-primary: var(--primary-500, var(--primary, #40834d));
  --ps-bright: color-mix(in oklab, var(--ps-primary) 70%, white);
  --ps-deep: color-mix(in oklab, var(--primary-900, color-mix(in oklab, var(--ps-primary) 34%, black)) 70%, black);
  --ps-deeper: color-mix(in oklab, var(--ps-deep) 60%, black);
  --ps-glow: color-mix(in oklab, var(--ps-primary) 40%, transparent);
  --pf-ease: cubic-bezier(0.16, 1, 0.3, 1);
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
  background:
    radial-gradient(ellipse 70% 55% at 50% 44%, color-mix(in oklab, var(--ps-primary) 20%, transparent) 0%, transparent 70%),
    radial-gradient(ellipse at 14% 4%, color-mix(in oklab, var(--ps-bright) 13%, transparent) 0%, transparent 52%),
    radial-gradient(ellipse at 88% 96%, color-mix(in oklab, var(--ps-primary) 22%, transparent) 0%, transparent 55%),
    linear-gradient(160deg, var(--ps-deep) 0%, var(--ps-deeper) 52%, var(--ps-deep) 100%);
  box-shadow:
    0 40px 80px -48px rgba(0, 0, 0, 0.72),
    0 2px 6px -2px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* calmer background: a finer, fainter grid; the aurora only drifts while the stage plays */
html .program-slideshow.pf-on .ps-grid {
  background-size: 34px 34px;
  opacity: 0.32;
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 46%, #000 0%, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 60% at 50% 46%, #000 0%, transparent 78%);
}
html .program-slideshow.pf-on .ps-blob { opacity: 0.38; animation-play-state: paused; }
html .program-slideshow.pf-on.pf-run .ps-blob { animation-play-state: running; }

/* the stage: a spacer in the flow (it fixes the height), the canvas covers the whole panel behind tabs and text */
html .program-slideshow.pf-on .pf-stage {
  position: relative;
  z-index: 1;
  height: 330px;
  margin: 0.75rem 0 0;
  pointer-events: none;
}
html .program-slideshow.pf-on .pf-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
  pointer-events: none;
}

/* ── Steps: a quiet segmented rail ─────────────────────────── */
html .program-slideshow.pf-on .scene-tabs {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: stretch;
  gap: 4px;
  max-width: 470px;
  margin: 0 auto;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09), 0 12px 28px -18px rgba(0, 0, 0, 0.6);
}
html .program-slideshow.pf-on .scene-tab {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: 999px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.62);
  background: transparent;
  transition: background-color 0.45s var(--pf-ease), color 0.45s var(--pf-ease), box-shadow 0.45s var(--pf-ease);
  -webkit-tap-highlight-color: transparent;
}
html .program-slideshow.pf-on .scene-tab::before { display: none; }
html .program-slideshow.pf-on .scene-tab:hover { color: rgba(255, 255, 255, 0.88); background: rgba(255, 255, 255, 0.04); }
html .program-slideshow.pf-on .scene-tab.pf-cur {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 6px 16px -10px rgba(0, 0, 0, 0.7);
}
/* one pill slides from tab to tab (the script sets its width and position); the tabs themselves stay transparent */
html .program-slideshow.pf-on .pf-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  z-index: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 6px 16px -10px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}
html .program-slideshow.pf-on.pf-pill-on .pf-pill {
  transition: transform 0.75s cubic-bezier(0.65, 0, 0.3, 1), width 0.75s cubic-bezier(0.65, 0, 0.3, 1);
}
html .program-slideshow.pf-on.pf-pill-on .scene-tab,
html .program-slideshow.pf-on.pf-pill-on .scene-tab.pf-cur,
html .program-slideshow.pf-on.pf-pill-on .scene-tab:hover { background: transparent; box-shadow: none; z-index: 1; }
html .program-slideshow.pf-on.pf-pill-on .scene-tab:hover:not(.pf-cur) { color: #fff; }
html .program-slideshow.pf-on .pf-stats {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 4;
  padding: 5px 8px;
  border-radius: 8px;
  font: 600 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
html .program-slideshow.pf-on .scene-tab:focus { outline: none; }
html .program-slideshow.pf-on .scene-tab:focus-visible {
  outline: 2px solid var(--ps-bright);
  outline-offset: 2px;
}
html .program-slideshow.pf-on .scene-tab-dot {
  flex: none;
  width: 22px;
  height: 22px;
  border: 0;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  transform: none;
  transition: background-color 0.45s var(--pf-ease), color 0.45s var(--pf-ease), box-shadow 0.45s var(--pf-ease);
}
html .program-slideshow.pf-on .scene-tab.pf-done .scene-tab-dot { color: var(--ps-bright); background: color-mix(in oklab, var(--ps-bright) 16%, transparent); }
html .program-slideshow.pf-on .scene-tab.pf-cur .scene-tab-dot {
  color: var(--ps-deep);
  background: var(--ps-bright);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ps-bright) 22%, transparent), 0 4px 12px -2px var(--ps-glow);
  transform: none;
}
html .program-slideshow.pf-on .scene-tab-label {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.005em;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* progress line: a hairline along the bottom edge of the pill that fills while the act plays (the script sets scaleX) */
html .program-slideshow.pf-on .scene-tab-bar {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 3px;
  width: auto;
  max-width: none;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  background: transparent;
  transition: background-color 0.45s var(--pf-ease);
}
html .program-slideshow.pf-on .scene-tab.pf-cur .scene-tab-bar { background: rgba(255, 255, 255, 0.12); }
html .program-slideshow.pf-on .scene-tab-fill {
  width: 100%;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, color-mix(in oklab, var(--ps-bright) 55%, transparent), var(--ps-bright));
  transform: scaleX(0);
  transform-origin: 0 50%;
  animation: none !important;
  opacity: 0;
}
html .program-slideshow.pf-on .scene-tab.pf-cur .scene-tab-fill { opacity: 1; }

/* ── Text of the current act: all three stacked in one grid cell, so the box always has the height of the
      tallest one and nothing below ever jumps ─────────────────────────────────────────────────────────── */
html .program-slideshow.pf-on .scene-stage {
  position: relative;
  z-index: 2;
  display: grid;
  height: auto;
  margin: 0.5rem auto 0;
  max-width: 600px;
  isolation: auto;
}
html .program-slideshow.pf-on .scene {
  position: relative;
  inset: auto;
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  opacity: 0;
  visibility: hidden;
  filter: none;
  transform: translateY(4px);
  pointer-events: none;
  will-change: auto;
  transition:
    opacity 0.34s cubic-bezier(0.45, 0, 0.55, 1),
    transform 0.34s cubic-bezier(0.45, 0, 0.55, 1),
    visibility 0s linear 0.34s;
}
html .program-slideshow.pf-on .scene.pf-cur {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition:
    opacity 0.75s cubic-bezier(0.33, 0, 0.2, 1) 0.26s,
    transform 1s cubic-bezier(0.33, 0, 0.2, 1) 0.26s,
    visibility 0s linear 0s;
}
html .program-slideshow.pf-on .scene-icon-wrap { display: none; }
html .program-slideshow.pf-on .scene-eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ps-bright);
}
html .program-slideshow.pf-on .scene-title {
  margin: 0.35rem 0 0;
  font-size: clamp(1.4rem, 1.05rem + 1.1vw, 1.75rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
html .program-slideshow.pf-on .scene-body {
  margin: 0.55rem auto 0;
  max-width: 46ch;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.76);
  text-wrap: pretty;
}
html .program-slideshow.pf-on .program-slideshow-caption {
  margin: 1.1rem 0 0;
  padding: 0 2.5rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ── Pause / play ─────────────────────────────────────────── */
html .program-slideshow.pf-on .pf-ctrl {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
html .program-slideshow.pf-on .pf-ctrl:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
html .program-slideshow.pf-on .pf-ctrl:focus { outline: none; }
html .program-slideshow.pf-on .pf-ctrl:focus-visible { outline: 2px solid var(--ps-bright); outline-offset: 2px; }
html .program-slideshow.pf-on .pf-ctrl svg { width: 12px; height: 12px; display: block; fill: currentColor; }
html .program-slideshow.pf-on .pf-ctrl .pf-i-play { display: none; }
html .program-slideshow.pf-on.pf-paused .pf-ctrl .pf-i-play { display: block; }
html .program-slideshow.pf-on.pf-paused .pf-ctrl .pf-i-pause { display: none; }
html .program-slideshow.pf-on.pf-reduced .pf-ctrl { display: none; }

html .program-slideshow.pf-on ::selection { background: color-mix(in oklab, var(--ps-bright) 45%, transparent); color: #fff; }

@media (min-width: 640px) {
  html .program-slideshow.pf-on { padding-top: 2.25rem; padding-bottom: 2.25rem; }
  html .program-slideshow.pf-on .pf-stage { height: 364px; margin-top: 1rem; }
}
@media (max-width: 639.98px) {
  html .program-slideshow.pf-on { padding-left: 1rem; padding-right: 1rem; }
  html .program-slideshow.pf-on .pf-stage { height: 344px; }
  html .program-slideshow.pf-on .scene-tab { flex: 1 1 auto; gap: 0; padding: 0 0.6rem; height: 38px; }
  html .program-slideshow.pf-on .scene-tab-dot { display: none; }
  html .program-slideshow.pf-on .scene-tab-label { font-size: 12.5px; overflow: visible; }
  html .program-slideshow.pf-on .scene-tab-bar { left: 12px; right: 12px; }
  html .program-slideshow.pf-on .scene-body { font-size: 0.95rem; }
  html .program-slideshow.pf-on .pf-ctrl { right: 10px; bottom: 10px; width: 30px; height: 30px; }
}
@media (max-width: 359.98px) {
  html .program-slideshow.pf-on .scene-tab { padding: 0 0.4rem; }
  html .program-slideshow.pf-on .scene-tab-label { font-size: 12px; letter-spacing: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html .program-slideshow.pf-on .ps-blob { animation: none !important; }
  html .program-slideshow.pf-on.pf-pill-on .pf-pill { transition: transform 0.25s ease, width 0.25s ease; }
  html .program-slideshow.pf-on .scene,
  html .program-slideshow.pf-on .scene.pf-cur { transform: none; transition: opacity 0.35s ease, visibility 0s linear 0.35s; }
  html .program-slideshow.pf-on .scene.pf-cur { transition: opacity 0.35s ease 0.1s, visibility 0s; }
}
