/* CueClass site — home components: hero + projector frame, the pinned "problem → one key → result"
   scrub, and the pinned feature tour. Pinned modes are switched on by scrollfx.js (.is-scrub /
   .is-pinned) only on wide, tall screens with motion allowed; otherwise everything is static. */

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  overflow-x: clip;
  padding: clamp(56px, 8vw, 120px) 0 clamp(72px, 9vw, 128px);
}

.hero-head {
  display: grid;
  gap: 28px;
}

@media (min-width: 1040px) {
  .hero-head {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    align-items: end;
    gap: 56px;
  }
}

.display {
  margin: 0;
  font-size: clamp(2.6rem, 6vw, 5.25rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.display .line {
  display: block;
}

.hero-aside .lead {
  margin-bottom: 0;
}

.hero-stage {
  position: relative;
  z-index: 0;
  margin-top: clamp(56px, 7vw, 96px);
}

.hero-burst {
  display: none;
}

/* the projector: a light title bar + the projected 16:9 screen + a caption row */
.projector {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

@media (min-width: 1040px) {
  .hero-stage .projector {
    width: min(100%, 980px);
    margin-inline: auto;
  }
}

.projector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.projector-bar .squares {
  display: flex;
  gap: 6px;
}

.projector-bar .squares i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.projector-screen {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #1b1f27;
}

.projector-screen > img,
.projector-screen > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* the recording fades in over its poster once it plays, and out over the loop seam (ui.js) */
.projector-screen > video {
  opacity: 0;
  transition: opacity 260ms linear;
}

.projector-screen.is-playing > video {
  opacity: 1;
}

.projector-screen.is-seam > video {
  opacity: 0;
}

.projector-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 10px 16px;
  font-size: 0.88rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* glyph field band behind the hero projector: no text ever sits on it */
.hero-stage .glyph-field {
  position: absolute;
  z-index: -1;
  left: calc(50% - 50vw);
  width: 100vw;
  top: -64px;
  bottom: calc(-1 * clamp(72px, 9vw, 128px));
  pointer-events: none;
  border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
  .projector-bar span:last-child {
    display: none;
  }
}

/* ---------------------------------------------------------------- 2. problem → one key → result (data-scrub) */

.scrub {
  position: relative;
  border-top: 1px solid var(--line);
}

.scrub-sticky {
  padding: var(--section) 0;
}

.scrub-grid {
  display: grid;
  gap: 48px;
}

@media (min-width: 960px) {
  .scrub-grid {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    align-items: center;
    gap: 72px;
  }
}

.scrub-acts {
  display: grid;
  gap: 20px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.scrub-acts li {
  padding-left: 20px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  transition: color 300ms var(--ease), border-color 300ms var(--ease);
}

.scrub-acts b {
  display: block;
  margin-bottom: 2px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--brand-ink);
}

.scrub-stage {
  position: relative;
  min-height: 340px;
}

.scrub-result {
  position: relative;
}

/* app windows of the "before" act (generic, unlabelled by product) */
.win {
  display: none;
}

/* keycaps */
.keys {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: -26px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transform: translateX(-50%);
}

.key {
  display: grid;
  place-items: center;
  min-width: 56px;
  height: 52px;
  padding: 0 14px;
  font-size: 1rem;
  font-weight: 650;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-bottom-width: 4px;
  border-radius: 10px;
}

.keys .plus {
  color: var(--muted);
}

/* pinned mode */
.scrub.is-scrub {
  padding: 0;
}

.scrub.is-scrub .scrub-sticky {
  position: sticky;
  top: var(--header-h);
  display: flex;
  align-items: center;
  min-height: calc(100vh - var(--header-h));
  padding: 48px 0;
}

.scrub.is-scrub .scrub-acts li {
  /* inactive acts stay readable: #6B7280 on white is 4.8:1 */
  color: #6b7280;
}

.scrub.is-scrub[data-act="1"] .scrub-acts li:nth-child(1),
.scrub.is-scrub[data-act="2"] .scrub-acts li:nth-child(2),
.scrub.is-scrub[data-act="3"] .scrub-acts li:nth-child(3) {
  opacity: 1;
  color: var(--ink);
  border-color: var(--brand);
}

.scrub.is-scrub .win {
  position: absolute;
  z-index: 2;
  display: block;
  width: 46%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  opacity: min(clamp(0, var(--p) * 7, 1), clamp(0, (0.62 - var(--p)) * 8, 1));
  transform: translate3d(calc(var(--dx) * (1 - clamp(0, var(--p) * 4, 1)) + var(--dx) * clamp(0, (var(--p) - 0.45) * 3, 1)), calc(var(--dy) * (1 - clamp(0, var(--p) * 4, 1))), 0) rotate(var(--rot));
}

.win i {
  display: block;
  height: 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.win b {
  display: block;
  margin: 14px 14px 8px;
  height: 10px;
  width: 55%;
  border-radius: 5px;
  background: var(--line-strong);
}

.win u {
  display: block;
  margin: 0 14px 16px;
  height: 52px;
  border-radius: 8px;
  background: var(--surface-2);
}

.win-1 { --dx: -60px; --dy: -40px; --rot: -3deg; left: 0; top: 0; }
.win-2 { --dx: 60px; --dy: -30px; --rot: 2deg; right: 0; top: 18px; }
.win-3 { --dx: -50px; --dy: 40px; --rot: 2deg; left: 6%; bottom: 40px; }
.win-4 { --dx: 60px; --dy: 50px; --rot: -2deg; right: 4%; bottom: 20px; }

.scrub.is-scrub .keys {
  opacity: min(clamp(0, (var(--p) - 0.22) * 8, 1), clamp(0, (0.92 - var(--p)) * 10, 1));
  transform: translate3d(-50%, calc(clamp(0, (var(--p) - 0.42) * 25, 1) * 4px), 0);
}

.scrub.is-scrub .key {
  border-bottom-width: calc(4px - clamp(0, (var(--p) - 0.42) * 25, 1) * 3px);
}

.scrub.is-scrub .scrub-result {
  opacity: clamp(0, (var(--p) - 0.5) * 5, 1);
  transform: scale(calc(0.82 + 0.18 * clamp(0, (var(--p) - 0.5) * 3, 1)));
  transform-origin: 50% 60%;
}
