.theater-act {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  padding: calc(var(--space-5) + 40px) 0 var(--space-5);
}
/* The wipe fades to fully transparent at its own top/bottom edges — an
   opaque fill there (even black) paints over the site's grid right at
   the seam and reads as a hard cut; fading the color's own alpha to 0
   keeps the grid visible through the whole transition on both sides. */
.theater-act--explorator .theater-wipe {
  background: linear-gradient(
    180deg,
    rgba(47, 111, 212, 0) 0%,
    rgba(47, 111, 212, 0.35) 20%,
    rgba(47, 111, 212, 0.35) 80%,
    rgba(47, 111, 212, 0) 100%
  );
}
.theater-act--expert .theater-wipe {
  background: linear-gradient(
    180deg,
    rgba(15, 174, 127, 0) 0%,
    rgba(15, 174, 127, 0.35) 20%,
    rgba(15, 174, 127, 0.35) 80%,
    rgba(15, 174, 127, 0) 100%
  );
}
.theater-act--explorator { color: #ffffff; }
.theater-act--expert { color: #eafff5; }

.theater-wipe {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
}
.theater-act > .container { position: relative; z-index: 1; }

/* align-items: start (not center) — centering re-anchors every time the
   chat column grows a new bubble, which drags the specimen title upward
   as the conversation plays; anchoring from the top means only the
   bottom of the block grows, the title never moves. */
.theater-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); align-items: start; }
/* Chat reads on the left, mascot sits on the right — the mascot column
   is reordered visually via grid `order` rather than moving it in the
   DOM, so markup/timeline wiring stays untouched. */
.theater-mascot-wrap { order: 2; position: relative; }
.theater-layout > div:last-child { order: 1; }

/* aspect-ratio is set per-mascot below (their proportions differ slightly)
   so the rendered image always matches the source file's real shape,
   regardless of how the surrounding grid column happens to size itself. */
.theater-mascot { width: 100%; max-width: 380px; height: auto; display: block; object-fit: contain; opacity: 0; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.35)); }
.theater-act--explorator .theater-mascot { aspect-ratio: 340 / 560; }
.theater-act--expert .theater-mascot { aspect-ratio: 356 / 590; }
.theater-mascot-scan {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 0;
  height: 5px;
  background: linear-gradient(90deg, transparent, #eaf6ff, #4d90c9, #eaf6ff, transparent);
  box-shadow: 0 0 16px 4px rgba(120, 190, 255, 0.7);
  opacity: 0;
  pointer-events: none;
}

.theater-chat { display: flex; flex-direction: column; gap: var(--space-2); max-width: 480px; }

/* Hidden by default (matches the JS reset) so a page load that lands with
   an act already partly in the initial viewport, before any scroll event
   has fired ScrollTrigger's onEnter, doesn't flash fully-typed text. */
.theater-bubble { display: flex; align-items: flex-end; gap: 10px; opacity: 0; }
.theater-bubble--dev { align-self: flex-start; }
.theater-bubble--specimen { align-self: flex-end; flex-direction: row-reverse; }

.theater-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
  opacity: 0;
}
.theater-avatar img { width: 100%; height: 100%; object-fit: cover; }
.theater-avatar--dev { color: inherit; }
.theater-avatar--specimen { background: rgba(255, 255, 255, 0.28); }
.theater-avatar--explorator { color: #dbe9fb; }
.theater-avatar--expert { color: #d8fff0; }

/* Real messaging-app bubble shape: mostly rounded, flat only at the corner
   nearest the avatar (the "tail" corner), a timestamp + status row tucked
   into the bottom-right of each bubble — modeled directly on a WhatsApp
   conversation rather than a generic rounded box. */
.theater-line {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  padding: 8px 12px 6px;
  min-height: 1.6em;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.theater-line--dev { background: #1f2c34; color: #e9edef; border-radius: 12px 12px 12px 3px; }
.theater-line--specimen { border-radius: 12px 12px 3px 12px; color: #e9edef; }
.theater-act--explorator .theater-line--specimen { background: #12496b; }
.theater-act--expert .theater-line--specimen { background: #025c4c; }

.theater-line-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  align-self: flex-end;
  font-family: var(--font-body);
  font-size: 11px;
  color: rgba(233, 237, 239, 0.6);
}
.theater-ticks { flex-shrink: 0; color: #53bdeb; }

/* Lives inside .theater-mascot-wrap now (below the image), not the text
   column — it needs to stay put as the chat grows taller, not drift down
   with it. */
.theater-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.85;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.theater-cta:hover { opacity: 1; text-decoration: none; }

@media (max-width: 900px) {
  .theater-layout { grid-template-columns: 1fr; text-align: center; }
  .theater-mascot { max-width: 240px; margin: 0 auto; }
  .theater-chat { margin: 0 auto; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .theater-mascot, .theater-bubble, .theater-wipe, .theater-avatar { opacity: 1 !important; }
}
