/* post-edit-journey.css — "The Reveal Studio"
 * Full-viewport, gallery-grade staging for the post-edit treatment journey.
 * Dark warm studio stage; the user's edit is the hero on a floating 3D card.
 * Two-column cinematic bands. Editorial Plus Jakarta Sans + JetBrains Mono.
 * Loaded conditionally; only the treatment arm opens #postEditJourneyModal.
 */

/* ---- Suppress control-arm sibling surfaces while the journey is active --- */
body.is-journey-active #designerSummary,
body.is-journey-active #paywallSavingsAnchor,
body.is-journey-active #designerInvoice {
  display: none !important;
}

/* ============================================================================
   STAGE — full-screen dark studio takeover
   ============================================================================ */
#postEditJourneyModal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  opacity: 0;
  visibility: hidden;
  /* ETP dark theater: deep brand-ink base (#1a1a2e), one soft violet pool of
     light behind the stage. Flat brand violet only — no amber, no rainbow. */
  background:
    radial-gradient(110% 85% at 66% 44%, rgba(124, 92, 252, 0.20), transparent 56%),
    linear-gradient(165deg, #20203a 0%, #1a1a2e 55%, #121221 100%);
  color: #f5f4fa;
  font-family: var(--font-body, 'Plus Jakarta Sans', system-ui, sans-serif);
  transition: opacity 0.6s ease, visibility 0.6s ease;
  overflow: hidden;
}
/* Seamless handoff from the edit reveal: during entrance the studio washes in
   over a blurred view of the result (the editor is still behind while opacity
   ramps), then the stage lifts into place — reads as a handoff, not a cut. */
#postEditJourneyModal.is-entering {
  backdrop-filter: blur(12px) saturate(0.9);
  -webkit-backdrop-filter: blur(12px) saturate(0.9);
}
#postEditJourneyModal.is-entering .pej-stage {
  animation: pejStageEnter 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes pejStageEnter {
  from { opacity: 0.25; transform: translateY(20px) scale(1.025); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  #postEditJourneyModal.is-entering .pej-stage { animation: none; }
}
#postEditJourneyModal[hidden] { display: none; }
#postEditJourneyModal.visible {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  z-index: 2147483647;
}

/* faint film grain for atmosphere (pure CSS, cheap) */
#postEditJourneyModal::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  #postEditJourneyModal { transition: none; }
}

/* ---- Corner close (discreet) -------------------------------------------- */
.pej-close {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 22px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(245, 244, 250, 0.14);
  background: rgba(245, 244, 250, 0.04);
  color: rgba(245, 244, 250, 0.55);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.pej-close:hover {
  background: rgba(245, 244, 250, 0.1);
  color: #f5f4fa;
  transform: rotate(90deg);
}
/* Cooldown state: ✕ hidden + non-interactive for the first 3s of each screen.
   It fades in once the cooldown clears (the class is removed). */
.pej-close--pending {
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none;
}
.pej-close {
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease, opacity 0.3s ease, visibility 0.3s ease;
}

/* ============================================================================
   PANEL LAYOUT
   ============================================================================ */
.pej-stage {
  position: relative;
  width: 100%;
  max-width: 1240px;
  height: 100%;
  max-height: 860px;
  padding: 64px 56px 48px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* progress rail — top-center */
.pej-rail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0 auto 8px;
  height: 18px;
}
.pej-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(245, 244, 250, 0.18);
  transition: background 0.3s ease, width 0.3s ease, transform 0.3s ease;
}
.pej-dot.is-done { background: rgba(245, 244, 250, 0.4); }
.pej-dot.is-active {
  width: 26px;
  border-radius: 99px;
  background: #7C5CFC;
}
.pej-rail-line {
  width: 26px;
  height: 1px;
  background: rgba(245, 244, 250, 0.14);
  margin: 0 4px;
}
.pej-dot--offer {
  width: 9px;
  height: 9px;
  background: rgba(245, 244, 250, 0.22);
  box-shadow: 0 0 0 3px rgba(245, 244, 250, 0.05);
}
.pej-dot--offer.is-active {
  background: #7C5CFC;
  box-shadow: 0 0 0 4px rgba(124, 92, 252, 0.18);
}

/* two-column band */
.pej-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 0.82fr 1fr;
  align-items: center;
  gap: 56px;
  min-height: 0;
}

/* ---- Content column ----------------------------------------------------- */
.pej-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 460px;
}
.pej-eyebrow {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: #a594ff;
  text-transform: uppercase;
}
.pej-headline {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin: 0;
  color: #fbfaff;
}
.pej-body {
  font-size: 17px;
  line-height: 1.55;
  color: rgba(245, 244, 250, 0.68);
  margin: 0;
  max-width: 420px;
}
.pej-fine {
  font-size: 13px;
  color: rgba(245, 244, 250, 0.45);
  margin: 2px 0 0;
}
.pej-mono {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-feature-settings: 'tnum' 1;
  letter-spacing: -0.02em;
}
.pej-strike {
  text-decoration: line-through;
  text-decoration-color: rgba(124, 92, 252, 0.7);
  text-decoration-thickness: 2px;
  color: rgba(245, 244, 250, 0.85);
}

/* ---- CTA ---------------------------------------------------------------- */
.pej-cta {
  -webkit-appearance: none;
  appearance: none;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 16px 26px;
  border: 0;
  border-radius: 99px;
  background: #fbfaff;
  color: #15141d;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.25s ease, filter 0.25s ease;
}
.pej-cta svg { transition: transform 0.2s ease; }
.pej-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px -8px rgba(0, 0, 0, 0.6), 0 3px 8px rgba(0, 0, 0, 0.3);
}
.pej-cta:hover svg { transform: translateX(4px); }
.pej-cta:active { transform: translateY(0) scale(0.985); }
/* The money/"go" moment — ETP's violet pill (flat brand violet, white text).
   Distinguishes the buy from neutral white "Continue" advances. */
.pej-cta--buy {
  background: #7C5CFC;
  color: #fff;
  box-shadow: 0 14px 34px -10px rgba(124, 92, 252, 0.6), 0 2px 6px rgba(0, 0, 0, 0.25);
}
.pej-cta--buy:hover {
  background: #6a45f5;
  box-shadow: 0 20px 46px -10px rgba(124, 92, 252, 0.7), 0 3px 8px rgba(0, 0, 0, 0.25);
}
.pej-cta--inline { margin-top: 0; }
.pej-cta:disabled { opacity: 0.6; cursor: not-allowed; }

/* 2s screen-cooldown: the forward button reads as "inactive" (dimmed) and a
   violet fill CHARGES across it left→right; when it tops out the class drops
   and the button eases to its active state. */
.pej-cta--cooldown {
  pointer-events: none;
  position: relative;
  overflow: hidden;
  filter: grayscale(0.45);
  opacity: 0.7;
}
.pej-cta--cooldown > * { position: relative; z-index: 1; }   /* label/icon above the fill */
.pej-cta--cooldown::after {
  content: '';
  position: absolute; inset: 0;
  z-index: 0;
  transform-origin: left center;
  transform: scaleX(0);
  background: rgba(124, 92, 252, 0.5);
  animation: pejCtaFill 2s linear forwards;
}
@keyframes pejCtaFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .pej-cta--cooldown::after { animation: none; transform: scaleX(1); }
}

.pej-textlink {
  align-self: flex-start;
  background: none;
  border: 0;
  color: rgba(245, 244, 250, 0.42);
  font: 500 13px/1.4 inherit;
  cursor: pointer;
  padding: 6px 2px;
  margin-top: 2px;
}
.pej-textlink:hover { color: rgba(245, 244, 250, 0.7); }

.pej-or-sub {
  align-self: flex-start;
  background: none;
  border: 0;
  color: rgba(245, 244, 250, 0.5);
  font: 600 13px/1.4 inherit;
  cursor: pointer;
  padding: 4px 2px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(245, 244, 250, 0.25);
}
.pej-or-sub:hover { color: #a594ff; }

/* ============================================================================
   VISUAL COLUMN + 3D HERO CARD
   ============================================================================ */
.pej-visual {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1500px;
}
/* studio light pooled behind the card */
.pej-light {
  position: absolute;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(165, 148, 255, 0.4), rgba(124, 92, 252, 0.18) 45%, transparent 70%);
  filter: blur(50px);
  opacity: 0.85;
  z-index: 0;
}

.pej-card3d {
  position: relative;
  width: min(440px, 80%);
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  transform-style: preserve-3d;
  transform: perspective(1500px) rotateY(var(--pej-ry, -9deg)) rotateX(var(--pej-rx, 5deg));
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 2;
}
.pej-card3d-face {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #0c0b13;
  box-shadow:
    0 50px 90px -25px rgba(0, 0, 0, 0.7),
    0 18px 40px -10px rgba(0, 0, 0, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
/* the card's physical "thickness" — a darker slab behind, offset in Z */
.pej-card3d-edge {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  transform: translateZ(-22px);
  background: linear-gradient(135deg, #262638, #16161f);
  box-shadow: 0 60px 80px -30px rgba(0, 0, 0, 0.8);
}
.pej-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pej-card-img--ph {
  background: linear-gradient(135deg, #262638, #16161f);
}
/* glossy sheen sweeping across the card */
.pej-card3d-face::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, transparent 40%, rgba(255, 255, 255, 0.16) 48%, transparent 56%);
  pointer-events: none;
}

/* ---- Before / After tap-to-compare on the hero card -------------------- */
.pej-card-after, .pej-card-before {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pej-card-before { opacity: 0; transition: opacity 0.28s ease; }
.pej-card3d.is-before .pej-card-before { opacity: 1; }
.pej-card3d--compare .pej-card3d-face { cursor: pointer; }
.pej-compare-label {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 11px;
  border-radius: 8px;
  background: rgba(12, 11, 19, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(245, 244, 250, 0.85);
  z-index: 4;
  pointer-events: none;
}
.pej-card3d.is-before .pej-compare-label { color: #7C5CFC; }
.pej-compare-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 99px;
  background: rgba(12, 11, 19, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(245, 244, 250, 0.75);
  z-index: 4;
  pointer-events: none;
  animation: pejHintPulse 2.4s ease-in-out infinite;
}
.pej-compare-hint::before {
  content: '⇄';
  font-size: 13px;
  color: #a594ff;
}
@keyframes pejHintPulse { 0%,100% { opacity: 0.65; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pej-compare-hint { animation: none; } }

/* ---- Back chevron (top-left) ------------------------------------------- */
.pej-back {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: 24px;
  left: 26px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding: 0 16px 0 12px;
  border-radius: 99px;
  border: 1px solid rgba(245, 244, 250, 0.14);
  background: rgba(245, 244, 250, 0.04);
  color: rgba(245, 244, 250, 0.6);
  font: 600 13px/1 var(--font-body, system-ui, sans-serif);
  cursor: pointer;
  z-index: 6;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.pej-back:hover { background: rgba(245, 244, 250, 0.1); color: #f5f4fa; }
.pej-back:hover svg { transform: translateX(-3px); }
.pej-back svg { transition: transform 0.15s ease; }

/* value/price tag clipped to the card corner */
.pej-value-tag {
  position: absolute;
  bottom: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 14px;
  border-radius: 12px;
  background: rgba(12, 11, 19, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  z-index: 3;
}
.pej-value-tag em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(245, 244, 250, 0.5);
}
.pej-value-tag b {
  font-size: 22px;
  font-weight: 700;
  color: #7C5CFC;
}
.pej-value-tag--win { padding: 14px; }
.pej-value-tag--win b { font-size: 26px; color: #7ce0a3; }

/* ============================================================================
   PANEL 2 — receipt / invoice card
   ============================================================================ */
.pej-receipt {
  position: relative;
  width: min(380px, 86%);
  background: #faf9f5;
  color: #15141d;
  border-radius: 14px;
  padding: 26px 24px 30px;
  transform: perspective(1500px) rotateY(var(--pej-ry, -7deg)) rotateX(var(--pej-rx, 4deg));
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);
  box-shadow: 0 50px 90px -25px rgba(0, 0, 0, 0.7), 0 14px 34px -8px rgba(0, 0, 0, 0.5);
  z-index: 2;
}
.pej-receipt::before,
.pej-receipt::after {
  /* torn-paper zigzag top + bottom */
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 10px;
  background: radial-gradient(circle at 6px -2px, transparent 6px, #faf9f5 6px) repeat-x;
  background-size: 12px 10px;
}
.pej-receipt::before { top: -8px; transform: rotate(180deg); }
.pej-receipt::after { bottom: -8px; }
.pej-receipt-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(21, 20, 29, 0.45);
  padding-bottom: 14px;
  border-bottom: 1.5px dashed rgba(21, 20, 29, 0.18);
}
.pej-receipt-list { list-style: none; margin: 14px 0; padding: 0; }
.pej-receipt-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  opacity: 0;
  transform: translateY(6px);
  animation: pejRowIn 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: calc(0.18s + var(--i) * 0.09s);
}
.pej-receipt-label { font-size: 14px; font-weight: 500; }
.pej-receipt-min {
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  color: rgba(21, 20, 29, 0.4);
}
.pej-receipt-cost { font-size: 14px; font-weight: 700; }
.pej-receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 14px;
  border-top: 1.5px dashed rgba(21, 20, 29, 0.18);
  font-weight: 800;
}
.pej-receipt-total span:last-child { font-size: 24px; }
.pej-receipt-stamp {
  position: absolute;
  right: 20px;
  bottom: 18px;
  transform: rotate(-12deg);
  border: 2.5px solid rgba(124, 224, 163, 0.7);
  color: rgba(34, 140, 80, 0.85);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0;
  animation: pejStampIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 0.9s;
}
@keyframes pejRowIn { to { opacity: 1; transform: translateY(0); } }
@keyframes pejStampIn { from { opacity: 0; transform: rotate(-12deg) scale(1.6); } to { opacity: 1; transform: rotate(-12deg) scale(1); } }

/* ============================================================================
   PANEL 3 — version fan (hero + ghosts behind)
   ============================================================================ */
.pej-fan { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; z-index: 2; }
.pej-fan-ghost {
  position: absolute;
  width: min(440px, 80%);
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  filter: brightness(0.6) saturate(0.8);
  transition: transform 0.3s ease;
}
.pej-fan-ghost--1 { transform: rotate(6deg) translate(38px, 14px) scale(0.96); opacity: 0.85; }
.pej-fan-ghost--2 { transform: rotate(11deg) translate(70px, 30px) scale(0.92); opacity: 0.6; }
.pej-fan-ghost--3 { transform: rotate(16deg) translate(98px, 48px) scale(0.88); opacity: 0.4; }
.pej-fan-count {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(12, 11, 19, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 18px;
  font-weight: 800;
  color: #a594ff;
  z-index: 3;
}

/* ============================================================================
   PANEL 4 — Fast / Pro split card
   ============================================================================ */
.pej-split .pej-card3d-face { display: flex; }
.pej-split-half { position: relative; width: 50%; height: 100%; overflow: hidden; }
.pej-split-half img { width: 100%; height: 100%; object-fit: cover; }
/* Make the quality gap unmistakable: Fast is soft + flat, Pro is crisp + vivid. */
.pej-split-fast img { filter: saturate(0.6) brightness(0.92) contrast(0.92) blur(1.8px); }
.pej-split-pro  img { filter: saturate(1.14) contrast(1.1); }
/* Pro-side loupe — a circular zoom that reveals crisp detail. */
.pej-loupe {
  position: absolute;
  right: 14px;
  bottom: 44px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  z-index: 5;
}
.pej-loupe img {
  position: absolute;
  width: 280%;
  height: 280%;
  top: -90%;
  left: -90%;
  object-fit: cover;
  filter: saturate(1.2) contrast(1.15) !important;
}
.pej-split-divider {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 2px;
  transform: translateX(-1px);
  background: linear-gradient(180deg, transparent, #fbfaff, transparent);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.6);
  z-index: 4;
}
.pej-split-tag {
  position: absolute;
  bottom: 14px;
  left: 12px;
  padding: 5px 11px;
  border-radius: 8px;
  background: rgba(12, 11, 19, 0.78);
  font-size: 12px;
  font-weight: 700;
  color: rgba(245, 244, 250, 0.8);
  z-index: 3;
}
.pej-split-pro .pej-split-tag--pro { left: auto; right: 12px; color: #7C5CFC; }

/* ============================================================================
   PANEL 5 — animate (video card)
   ============================================================================ */
.pej-card3d--alive { animation: pejBob 4.5s ease-in-out infinite; }
@keyframes pejBob { 0%,100% { translate: 0 0; } 50% { translate: 0 -10px; } }
.pej-card-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.pej-card-img--under { z-index: 1; }
.pej-play-badge {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(12, 11, 19, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 22px;
  padding-left: 4px;
  z-index: 4;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2);
}
@media (prefers-reduced-motion: reduce) { .pej-card3d--alive { animation: none; } }

/* ---- Animate panel: CSS cinemagraph (motion without video gen) ---------- */
/* Ken Burns drift on the user's own edit — instantly reads as "this can move". */
.pej-cinema { overflow: visible; }
.pej-cinema .pej-card-img {
  transform-origin: 52% 42%;
  animation: pejKenBurns 7s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes pejKenBurns {
  0%   { transform: scale(1.06) translate(3%, 2%); }
  100% { transform: scale(1.26) translate(-6%, -5%); }
}
/* a brighter light bar sweeps across more often — frames coming alive */
.pej-cinema-sweep {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(100deg, transparent 38%, rgba(255,255,255,0.28) 50%, transparent 62%);
  transform: translateX(-120%);
  animation: pejCinemaSweep 3.6s ease-in-out infinite;
}
@keyframes pejCinemaSweep {
  0%, 50% { transform: translateX(-120%); }
  100%    { transform: translateX(120%); }
}
/* Animate cost — two emerald chips instead of cramped fine print */
.pej-anim-cost { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.pej-anim-chip {
  display: inline-flex; align-items: baseline; gap: 7px;
  padding: 8px 14px; border-radius: 99px;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.32);
  font-size: 13px; color: rgba(245,244,250,0.82);
}
.pej-anim-chip b { font-weight: 800; color: #34d399; }
/* emerald play badge with a breathing ring — ETP's animate-surface accent */
.pej-play-badge--motion {
  background: rgba(6, 24, 18, 0.5);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(16,185,129,0.95), 0 0 0 10px rgba(16,185,129,0.18);
  animation: pejPulseRing 2.4s ease-out infinite;
}
@keyframes pejPulseRing {
  0%   { box-shadow: 0 0 0 2px rgba(16,185,129,0.95), 0 0 0 6px rgba(16,185,129,0.28); }
  70%  { box-shadow: 0 0 0 2px rgba(16,185,129,0.95), 0 0 0 22px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 2px rgba(16,185,129,0.95), 0 0 0 6px rgba(16,185,129,0); }
}
/* faux timeline + playhead — loops 0:00→0:05 to imply playback */
.pej-cinema-bar {
  position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 4;
  display: flex; align-items: center; gap: 10px;
}
.pej-cinema-live {
  position: relative; padding-left: 13px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em;
  color: #34d399;
}
.pej-cinema-live::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: #10B981;
  box-shadow: 0 0 8px rgba(16,185,129,0.9);
  animation: pejLiveBlink 1.4s ease-in-out infinite;
}
@keyframes pejLiveBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.pej-cinema-track {
  flex: 1; height: 4px; border-radius: 99px;
  background: rgba(255,255,255,0.22); overflow: hidden;
}
.pej-cinema-track i {
  display: block; height: 100%; width: 0; border-radius: 99px;
  background: #10B981;
  animation: pejPlayhead 5s linear infinite;
}
@keyframes pejPlayhead { 0% { width: 0; } 95%,100% { width: 100%; } }
.pej-cinema-dur { font-size: 10.5px; color: rgba(255,255,255,0.82); }

/* The animate surface is ETP's one emerald-accented screen (per DESIGN.md).
   The emerald .pej-light override lives with the other per-panel lights below. */
.pej-stage--animate .pej-eyebrow { color: #34d399; }

@media (prefers-reduced-motion: reduce) {
  .pej-cinema .pej-card-img,
  .pej-cinema-sweep,
  .pej-play-badge--motion,
  .pej-cinema-live::before,
  .pej-cinema-track i { animation: none; }
  .pej-cinema-track i { width: 64%; }
}

/* ============================================================================
   PANEL 6/10 — save shelf + email form
   ============================================================================ */
.pej-shelf { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; z-index: 2; }
.pej-shelf-card {
  position: absolute;
  width: min(440px, 80%);
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  filter: brightness(0.55) saturate(0.7);
  box-shadow: 0 24px 50px -20px rgba(0,0,0,.6);
}
.pej-shelf-card--a { transform: translate(-58px, 26px) scale(0.84) rotate(-7deg); opacity: 0.7; }
.pej-shelf-card--b { transform: translate(56px, 22px) scale(0.88) rotate(6deg); opacity: 0.8; }

.pej-form { display: flex; gap: 10px; align-items: stretch; margin-top: 8px; max-width: 440px; }
.pej-input {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  padding: 15px 18px;
  border-radius: 14px;
  border: 1px solid rgba(245, 244, 250, 0.16);
  background: rgba(245, 244, 250, 0.06);
  color: #f5f4fa;
  font: 500 16px/1.2 inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pej-input::placeholder { color: rgba(245, 244, 250, 0.35); }
.pej-input:focus {
  outline: none;
  border-color: #a594ff;
  background: rgba(245, 244, 250, 0.09);
  box-shadow: 0 0 0 3px rgba(165, 148, 255, 0.2);
}

/* ============================================================================
   PANEL 7 — founder note
   ============================================================================ */
.pej-quote { display: block; font-size: 19px; line-height: 1.5; color: rgba(245,244,250,0.82); font-style: italic; }
.pej-sign { display: block; margin-top: 16px; font-size: 14px; font-weight: 600; color: rgba(245,244,250,0.55); }
.pej-team-stack { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.pej-team-stack .pej-card3d { width: min(360px, 72%); }

/* ============================================================================
   PANEL 8 — offer (range + growing credit stack + tier rail)
   ============================================================================ */
/* Edits = the hero number; price sits UNDER it as subtext (not beside it). */
.pej-offer-readout { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; max-width: 440px; margin-top: 4px; }
.pej-offer-credits { font-size: 32px; font-weight: 800; color: #fbfaff; letter-spacing: -0.02em; line-height: 1.04; }
.pej-offer-price { font-size: 16px; font-weight: 700; color: rgba(245,244,250,0.6); }

/* Tactile, detented slider. A custom rail + fill sit UNDER a transparent
   native range so the thumb position, the violet fill, and the notch ticks all
   share one geometry. --pej-thumb = thumb width; the rail/ticks are inset by
   half of it so 0%..100% of the rail maps exactly to the thumb-centre travel.
   --pej-fill (0..100, set in JS) is the fill % along that inset rail. */
.pej-slider-wrap {
  --pej-thumb: 30px;
  position: relative;
  width: 100%; max-width: 440px;
  margin: 14px 0 2px;
  height: 34px;
}
/* visible recessed rail, inset by half a thumb on each side */
.pej-slider-wrap::before {
  content: '';
  position: absolute;
  left: calc(var(--pej-thumb) / 2); right: calc(var(--pej-thumb) / 2);
  top: 12px; height: 10px;
  border-radius: 99px;
  background: rgba(8,7,14,0.55);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.05);
}
/* flat brand-violet fill (no gradient, no glow — ETP uses solid fills) */
.pej-track-fill {
  position: absolute;
  left: calc(var(--pej-thumb) / 2);
  top: 12px; height: 10px;
  width: calc((100% - var(--pej-thumb)) * (var(--pej-fill, 16) / 100));
  border-radius: 99px;
  background: #7C5CFC;
  transition: width 0.12s ease;
  pointer-events: none;
}
.pej-range {
  -webkit-appearance: none; appearance: none;
  position: absolute; left: 0; right: 0; top: 2px;
  width: 100%; height: 30px;
  background: transparent; margin: 0;
  cursor: pointer;
}
.pej-range::-webkit-slider-runnable-track { height: 30px; background: transparent; }
.pej-range::-moz-range-track { height: 30px; background: transparent; }
.pej-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 0; cursor: grab;
  box-shadow: 0 4px 12px rgba(0,0,0,.45), 0 0 0 4px rgba(124,92,252,0.9);
  transition: transform 0.1s ease;
}
.pej-range::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 0; cursor: grab; box-shadow: 0 4px 12px rgba(0,0,0,.45), 0 0 0 4px rgba(124,92,252,0.9); }
.pej-range:active::-webkit-slider-thumb { transform: scale(1.08); cursor: grabbing; }
.pej-range:active::-moz-range-thumb { cursor: grabbing; }

/* Notch ticks: container inset by half a thumb, zero-width markers spaced
   space-between → each marker centre lands exactly on a thumb stop. */
.pej-ticks {
  display: flex; justify-content: space-between;
  width: 100%; max-width: 440px;
  margin-top: 6px;
  padding: 0 15px;  /* half the 30px thumb — aligns markers to thumb stops */
}
.pej-tick {
  -webkit-appearance: none; appearance: none; background: none; border: 0;
  flex: 0 0 0; width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 4px 0; cursor: pointer; font-family: inherit;
  overflow: visible; white-space: nowrap;
}
.pej-tick-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(245,244,250,0.22); transition: background 0.15s ease, transform 0.15s ease; }
.pej-tick-num { font-family: var(--font-mono, 'JetBrains Mono', monospace); font-size: 10px; font-weight: 500; color: rgba(245,244,250,0.34); transition: color 0.15s ease; font-variant-numeric: tabular-nums; }
.pej-tick.is-passed .pej-tick-dot { background: rgba(124,92,252,0.6); }
.pej-tick.is-active .pej-tick-dot { background: #7C5CFC; transform: scale(1.7); }
.pej-tick.is-active .pej-tick-num { color: #fbfaff; }
.pej-value-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; min-height: 22px; }
.pej-per-edit { font-size: 12.5px; font-weight: 600; color: rgba(165,148,255,0.95); letter-spacing: 0.01em; }
.pej-save-pill {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  color: #fff; background: #7C5CFC;
  padding: 3px 9px; border-radius: 99px;
  animation: pejSavePop 0.28s cubic-bezier(0.34,1.4,0.5,1);
}
@keyframes pejSavePop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ============================================================================
   PANEL 8 — subscription plans slide-out drawer
   ============================================================================ */
.pej-drawer-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.pej-drawer-scrim {
  position: absolute; inset: 0;
  background: rgba(6,5,12,0); backdrop-filter: blur(0px);
  transition: background 0.32s ease, backdrop-filter 0.32s ease;
}
.pej-drawer-root.is-open { pointer-events: auto; }
.pej-drawer-root.is-open .pej-drawer-scrim { background: rgba(6,5,12,0.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.pej-drawer {
  position: absolute; top: 0; right: 0; height: 100%;
  width: min(400px, 88vw);
  background: linear-gradient(180deg, #20203a 0%, #1a1a2e 100%);
  box-shadow: -40px 0 90px -30px rgba(0,0,0,.8), inset 1px 0 0 rgba(255,255,255,.06);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.2,0.8,0.2,1);
  display: flex; flex-direction: column;
  padding: 26px 24px calc(20px + env(safe-area-inset-bottom));
  overflow: hidden;  /* the scroll area handles overflow; the CTA stays pinned */
}
/* middle scroll region — plan cards + includes; the foot stays out of it */
.pej-drawer-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
/* pinned commit button */
.pej-drawer-foot { flex: 0 0 auto; padding-top: 14px; }
.pej-drawer-cta { width: 100%; justify-content: center; margin-top: 0; }
.pej-drawer-cta #pejDrawerCtaLabel { font-size: 15px; }
.pej-drawer-root.is-open .pej-drawer { transform: translateX(0); }
.pej-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.pej-drawer-eyebrow { display: block; font-family: var(--font-mono, 'JetBrains Mono', monospace); font-size: 10.5px; font-weight: 500; letter-spacing: 0.16em; color: #a594ff; }
.pej-drawer-title { margin: 4px 0 0; font-size: 25px; font-weight: 800; color: #fbfaff; letter-spacing: -0.01em; }
.pej-drawer-x {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(245,244,250,0.14); background: rgba(245,244,250,0.05);
  color: rgba(245,244,250,0.75); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.pej-drawer-x:hover { background: rgba(245,244,250,0.12); color: #fff; }
.pej-drawer-plans { display: flex; flex-direction: column; gap: 12px; }
.pej-plan {
  position: relative; text-align: left;
  -webkit-appearance: none; appearance: none; font-family: inherit;
  display: grid; grid-template-columns: 1fr; gap: 5px;
  padding: 18px 44px 16px 18px; border-radius: 18px;
  border: 1.5px solid rgba(245,244,250,0.12);
  background: rgba(245,244,250,0.035);
  color: #f5f4fa; cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.1s ease;
}
.pej-plan:hover { border-color: rgba(124,92,252,0.6); background: rgba(124,92,252,0.07); }
.pej-plan:active { transform: scale(0.985); }
.pej-plan.is-popular { border-color: rgba(124, 92, 252,0.45); }
/* radio indicator (top-right) */
.pej-plan-check {
  position: absolute; top: 16px; right: 16px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(245,244,250,0.3);
  transition: border-color 0.16s ease, background 0.16s ease;
}
.pej-plan-check::after {
  content: ''; position: absolute; inset: 0; margin: auto;
  width: 8px; height: 8px; border-radius: 50%; background: #fff;
  transform: scale(0); transition: transform 0.16s cubic-bezier(0.34,1.4,0.5,1);
}
/* selected state — violet ring + filled radio */
.pej-plan.is-selected {
  border-color: #7C5CFC;
  background: rgba(124,92,252,0.12);
  box-shadow: 0 0 0 1px #7C5CFC, 0 14px 30px -16px rgba(124,92,252,0.6);
}
.pej-plan.is-selected .pej-plan-check { border-color: #7C5CFC; background: #7C5CFC; }
.pej-plan.is-selected .pej-plan-check::after { transform: scale(1); }
.pej-plan-flag {
  position: absolute; top: -10px; left: 18px;
  padding: 3px 10px; border-radius: 99px;
  background: #7C5CFC; color: #fff;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
}
.pej-plan-glyph { display: flex; gap: 3px; height: 16px; margin-bottom: 2px; }
.pej-plan-chip { width: 22px; height: 14px; border-radius: 3px; background: #7C5CFC; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); transform: translateX(calc(var(--i) * -8px)); opacity: calc(1 - var(--i) * 0.16); }
.pej-plan.is-popular .pej-plan-chip { background: #9d83ff; }
.pej-plan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pej-plan-name { font-size: 17px; font-weight: 800; }
.pej-plan-price b { font-size: 19px; font-weight: 800; color: #fbfaff; }
.pej-plan-credits { font-size: 13px; color: rgba(245,244,250,0.62); }
.pej-plan-peredit { font-size: 12px; font-weight: 600; color: rgba(165,148,255,0.92); }
.pej-plan-per { font-size: 12px; font-weight: 600; color: rgba(245,244,250,0.5); margin-left: 1px; }
.pej-plan-strike { font-size: 13px; color: rgba(245,244,250,0.4); text-decoration: line-through; margin-right: 6px; }

/* Annual / Monthly billing selector — the v3 sub-upsell mechanic */
.pej-billing-toggle {
  display: flex; gap: 4px;
  margin-bottom: 16px; padding: 4px;
  background: rgba(8,7,14,0.4); border-radius: 99px;
  border: 1px solid rgba(245,244,250,0.08);
}
.pej-billing-opt {
  -webkit-appearance: none; appearance: none; flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 12px; border: 0; border-radius: 99px;
  background: transparent; color: rgba(245,244,250,0.6);
  font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.pej-billing-opt.is-on { background: #fff; color: #15141d; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.pej-billing-save {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 9.5px; font-weight: 600; letter-spacing: 0.02em;
  padding: 2px 7px; border-radius: 99px;
  background: #7C5CFC; color: #fff;
}
.pej-billing-opt.is-on .pej-billing-save { background: #7C5CFC; color: #fff; }
.pej-drawer-includes { list-style: none; margin: 18px 0 0; padding: 16px 4px 0; border-top: 1px solid rgba(245,244,250,0.1); display: flex; flex-direction: column; gap: 8px; }
.pej-drawer-includes li { position: relative; padding-left: 22px; font-size: 12.5px; color: rgba(245,244,250,0.6); }
.pej-drawer-includes li::before { content: '✓'; position: absolute; left: 0; top: -1px; color: #9d83ff; font-weight: 800; }
@media (prefers-reduced-motion: reduce) {
  .pej-drawer { transition: none; }
  .pej-drawer-scrim { transition: none; }
}

/* The growing credit-card stack visual — a tidy deck that THICKENS down-right
   as the pack grows. Flat layering (z-index, not 3D) so it never goes lopsided;
   the photo always sits on top, cards recede neatly behind it. */
.pej-stack {
  position: relative;
  width: min(330px, 66%);
  aspect-ratio: 4 / 5;
  z-index: 2;
  transform: rotate(-1.5deg);
}
.pej-stack-card {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  /* receding violet credit cards — darker the deeper they sit, so the deck
     reads as depth, not bright blocks competing with the photo */
  background: linear-gradient(135deg, #3a2c86, #221a4e);
  box-shadow: inset 0 0 0 1px rgba(165,148,255,0.22);
  transform: translate(0, 0);
  opacity: 0;
  z-index: 1;
  transition: opacity 0.24s ease, transform 0.3s cubic-bezier(0.2,0.8,0.2,1);
}
.pej-stack-card.is-shown {
  opacity: 1;
  /* uniform small step → a clean thickening deck peeking at bottom-right */
  transform: translate(calc(var(--n) * 7px), calc(var(--n) * 8px));
}
.pej-stack-top {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  z-index: 5;  /* photo always frontmost over the deck */
  box-shadow: 0 50px 90px -25px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,0.1);
}
.pej-stack-top img { width: 100%; height: 100%; object-fit: cover; }

.pej-mini-pack {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(245,244,250,0.06);
  border: 1px solid rgba(245,244,250,0.12);
  font-size: 16px;
  font-weight: 600;
  margin-top: 4px;
  align-self: flex-start;
}
.pej-mini-pack .pej-mono { color: #7C5CFC; font-size: 20px; font-weight: 800; }

/* ============================================================================
   PANEL 12 — post-purchase routing
   ============================================================================ */
.pej-next-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; max-width: 440px; }
.pej-next-card {
  -webkit-appearance: none;
  appearance: none;
  padding: 13px 18px;
  border-radius: 99px;
  border: 1px solid rgba(245,244,250,0.16);
  background: rgba(245,244,250,0.05);
  color: #f5f4fa;
  font: 600 14px/1 inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pej-next-card:hover { border-color: #a594ff; background: rgba(165,148,255,0.12); }

/* ============================================================================
   ENTRANCE — staggered reveal on panel mount (.is-in)
   ============================================================================ */
.pej-content > * { opacity: 0; transform: translateY(14px); }
.pej-visual { opacity: 0; transform: scale(0.94); }
.pej-stage.is-in .pej-content > * {
  animation: pejUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.pej-stage.is-in .pej-content > *:nth-child(1) { animation-delay: 0.05s; }
.pej-stage.is-in .pej-content > *:nth-child(2) { animation-delay: 0.12s; }
.pej-stage.is-in .pej-content > *:nth-child(3) { animation-delay: 0.19s; }
.pej-stage.is-in .pej-content > *:nth-child(4) { animation-delay: 0.26s; }
.pej-stage.is-in .pej-content > *:nth-child(5) { animation-delay: 0.33s; }
.pej-stage.is-in .pej-visual {
  animation: pejCardIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s forwards;
}
@keyframes pejUp { to { opacity: 1; transform: translateY(0); } }
@keyframes pejCardIn { to { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .pej-content > *, .pej-visual { opacity: 1 !important; transform: none !important; animation: none !important; }
  .pej-receipt-row, .pej-receipt-stamp { opacity: 1 !important; animation: none !important; }
  .pej-card3d { transition: none; }
}

/* ============================================================================
   RESPONSIVE — collapse to single column on narrow viewports
   ============================================================================ */
@media (max-width: 880px) {
  /* Fill the viewport exactly — everything fits, NOTHING scrolls. The stage is
     a flex column: rail (fixed) → visual (flexes/shrinks) → content (fixed). */
  #postEditJourneyModal.visible { align-items: stretch; }
  .pej-stage {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding: 46px 20px max(18px, env(safe-area-inset-bottom));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .pej-rail { flex: 0 0 auto; margin-bottom: 6px; }
  /* Image on TOP, content below, primary action pinned to the bottom (thumb
     zone). The visual is order:0 so it leads; the CTA/form get margin-top:auto
     so they sit at the bottom of the viewport. */
  .pej-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Narrative default: center the image + text as ONE composition so there's
       no dead gap between a top-pinned visual and floating-centered copy. */
    justify-content: center;
    gap: 18px;
  }
  .pej-visual {
    order: 0;
    flex: 0 0 auto;
    height: auto;          /* size to the capped visual, NOT 100% of the grid */
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: none;
  }
  .pej-content {
    order: 1;
    flex: 0 1 auto;            /* size to content; the grid centers the group */
    min-height: 0;
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* copy sits directly under the image, no gap */
    text-align: center;
    gap: 10px;
  }
  /* Offer + email are control-heavy: image on top, the control block pinned to
     the bottom thumb-zone (margin-top:auto rules below). Visual shrinks here so
     the CTA + sub-link never clip off the bottom of the viewport. */
  .pej-stage--offer .pej-grid,
  .pej-stage--email .pej-grid { justify-content: flex-start; gap: 10px; }
  .pej-stage--offer .pej-content,
  .pej-stage--email .pej-content { flex: 1 1 auto; }
  /* The control block is pinned to the bottom (margin-top:auto), so the visual
     size only governs the gap above it — keep it generous to avoid an empty
     well. Extra bottom padding guarantees the sub-link clears the edge. */
  .pej-stage--offer .pej-stack,
  .pej-stage--offer .pej-card3d,
  .pej-stage--email .pej-envelope { height: min(33vh, 264px) !important; }
  .pej-stage--offer, .pej-stage--email { padding-bottom: max(30px, env(safe-area-inset-bottom)); }
  /* Offer screen: keep the whole pack-picker (readout → slider → CTA) together
     as one block pinned at the BOTTOM, under the image hero. The auto margin on
     the readout absorbs the free space, pushing the picker + CTA down. */
  .pej-stage--offer .pej-content > .pej-offer-readout { margin-top: auto; }
  /* Email screen: pin the form to the bottom too (image/envelope on top). */
  .pej-stage--email .pej-content > .pej-form { margin-top: auto; }
  .pej-content > .pej-or-sub,
  .pej-content > .pej-textlink { margin-top: 4px; }
  /* Staged visuals: cap to the available height, derive width from aspect-ratio
     (definite height + aspect-ratio → width). Kills the fixed widths that made
     the column overflow on small screens. Flat (no 3D) on touch. */
  .pej-card3d, .pej-stack, .pej-cinema, .pej-envelope,
  .pej-fan, .pej-takes, .pej-vault, .pej-mini {
    transform: none !important;
    width: auto !important;
    max-width: 84vw;
    height: min(44vh, 380px) !important;
  }
  .pej-fan-deck { width: auto; height: 100%; aspect-ratio: 4/5; }
  /* Receipt is text-bearing — size to its CONTENT, never a fixed image-height
     cap. The cap spilled the last rows + Total out the bottom of the cream card
     onto the dark stage (dark-on-dark). Compact the type so all rows fit. */
  .pej-receipt {
    transform: none !important;
    width: min(344px, 88vw) !important;
    max-width: 88vw;
    height: auto !important;
    padding: 18px 18px 42px;   /* room below the Total for the centered stamp */
  }
  .pej-receipt-head { font-size: 10px; padding-bottom: 11px; }
  .pej-receipt-list { margin: 11px 0; }
  .pej-receipt-row { padding: 5px 0; gap: 8px; }
  .pej-receipt-label { font-size: 12.5px; }
  .pej-receipt-min { font-size: 10px; }
  .pej-receipt-cost { font-size: 13px; }
  .pej-receipt-total span:last-child { font-size: 21px; }
  /* Centered in the padding below the Total — no longer overlapping the $ amount. */
  .pej-receipt-stamp { font-size: 11px; left: 50%; right: auto; bottom: 9px; padding: 3px 9px; transform: translateX(-50%) rotate(-6deg); }
  @keyframes pejStampIn { from { opacity: 0; transform: translateX(-50%) rotate(-6deg) scale(1.6); } to { opacity: 1; transform: translateX(-50%) rotate(-6deg) scale(1); } }
  /* VALUE tag → top-right so it never collides with the bottom-center "tap to
     compare" hint on the smaller mobile card (AFTER label keeps top-left). */
  .pej-value-tag { top: 12px; bottom: auto; left: auto; right: 12px; }
  /* The team-note letter is text-bearing — compact it hard so it fits. The
     polaroid does NOT float on mobile (floating squeezed the text into a 1-word
     column and blew up the height); it sits inline-left with text full-width. */
  .pej-letter { transform: none !important; width: min(330px, 88vw); padding: 16px 18px 18px; display: flex; flex-direction: column; }
  .pej-polaroid { float: none !important; width: 64px !important; margin: 0 0 8px !important; padding: 4px 4px 13px; align-self: flex-start; }
  .pej-polaroid-cap { font-size: 12px; margin-top: 4px; }
  .pej-letter-body { order: 2; }
  .pej-letter-body::after { content: none; }
  .pej-letter-body p { font-size: 12px; line-height: 1.4; margin-bottom: 6px; }
  .pej-letter-sign { font-size: 19px; margin-top: 3px; }

  .pej-headline { font-size: clamp(26px, 7.6vw, 38px); line-height: 1.0; }
  .pej-headline br { display: none; }
  .pej-eyebrow { font-size: 10px; }
  /* Team note on mobile: the letter carries the message, so drop the redundant
     headline body line to keep the screen scroll-free. */
  .pej-stage--team .pej-body { display: none; }
  .pej-body { font-size: 14px; line-height: 1.42; max-width: 100%; }
  .pej-fine { font-size: 12px; }
  .pej-cta { margin-top: 6px; padding: 14px 22px; font-size: 15px; }
  .pej-cta, .pej-textlink, .pej-or-sub, .pej-mini-pack { align-self: center; }
  .pej-textlink, .pej-or-sub { margin-top: 2px; }
  /* Stack the email field above the button on mobile — side-by-side clipped
     the placeholder and felt cramped. */
  .pej-form { width: 100%; max-width: 340px; flex-direction: column; gap: 8px; }
  .pej-form .pej-input { width: 100%; }
  .pej-form .pej-cta--inline { width: 100%; justify-content: center; }

  /* Slider screen: center + tighten so the readout, slider, ticks, value row,
     CTA and sub-link all fit under the capped visual without scrolling. */
  .pej-offer-readout, .pej-slider-wrap, .pej-ticks, .pej-value-row { margin-left: auto; margin-right: auto; }
  .pej-offer-readout { max-width: 320px; margin-top: 0; align-items: center; }
  .pej-offer-credits { font-size: 27px; }
  .pej-offer-price { font-size: 15px; }
  .pej-slider-wrap { max-width: 320px; margin: 10px auto 2px; }
  .pej-ticks { max-width: 320px; }
  .pej-tick-num { font-size: 9px; }
}

/* Very short viewports (landscape phones, small devices): shrink the visual
   further so the controls always win the space race. */
@media (max-width: 880px) and (max-height: 720px) {
  .pej-stage { padding-top: 38px; }
  .pej-card3d, .pej-stack, .pej-receipt, .pej-cinema, .pej-envelope,
  .pej-fan, .pej-takes, .pej-vault, .pej-mini { height: min(30vh, 240px) !important; }
  .pej-grid { gap: 8px; }
  .pej-content { gap: 7px; }
  .pej-headline { font-size: clamp(22px, 7vw, 30px); }
  /* Team note: drop the eyebrow, shrink the headline + letter so it never scrolls. */
  .pej-stage--team .pej-eyebrow { display: none; }
  .pej-stage--team .pej-headline { font-size: 20px; }
  .pej-letter { padding: 12px 14px 14px; }
  .pej-letter-body p { font-size: 11px; line-height: 1.32; margin-bottom: 4px; }
  .pej-letter-sign { font-size: 17px; }
  .pej-polaroid { width: 54px !important; padding: 3px 3px 11px; }
}

/* ============================================================================
   SHOW-DON'T-TELL visuals — distinct staging per screen (design pass 2)
   ============================================================================ */

/* ---- Panel 3: four visibly-different takes (2×2) ----------------------- */
.pej-takes {
  width: min(440px, 82%);
  aspect-ratio: 1 / 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
  z-index: 2;
  transform: perspective(1500px) rotateY(var(--pej-ry, -8deg)) rotateX(var(--pej-rx, 5deg));
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(0.2,0.7,0.2,1);
}
.pej-take {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,0.06);
  opacity: 0;
  animation: pejTakeIn 0.5s cubic-bezier(0.2,0.8,0.2,1) forwards;
}
.pej-take img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* four distinct looks, applied to the same source so "variations" reads instantly */
.pej-take--1 { animation-delay: 0.05s; }
.pej-take--1 img { filter: none; }
.pej-take--2 { animation-delay: 0.13s; }
.pej-take--2 img { filter: saturate(1.35) hue-rotate(-12deg) contrast(1.05); }
.pej-take--3 { animation-delay: 0.21s; }
.pej-take--3 img { filter: grayscale(0.7) contrast(1.12) brightness(1.04); }
.pej-take--4 { animation-delay: 0.29s; }
.pej-take--4 img { filter: sepia(0.5) saturate(1.2) hue-rotate(310deg); }
.pej-take.is-pick {
  outline: 2.5px solid #a594ff;
  outline-offset: 0;
  box-shadow: 0 24px 50px -16px rgba(124,92,252,.5), 0 0 0 6px rgba(124,92,252,0.12);
  z-index: 3;
}
.pej-take-pick {
  position: absolute;
  bottom: 8px; left: 8px;
  padding: 4px 9px;
  border-radius: 7px;
  background: #a594ff;
  color: #15141d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}
@keyframes pejTakeIn { from { opacity: 0; transform: scale(0.9) translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- Panel 6: edits dropping into a secure folder ---------------------- */
.pej-vault {
  position: relative;
  width: min(320px, 70%);
  aspect-ratio: 4 / 5;
  z-index: 2;
}
.pej-vault-drop { position: absolute; inset: 0; z-index: 1; }
/* each version card falls from the top, shrinks + fades as it enters the
   folder; staggered + looping so it reads as "everything is being saved". */
.pej-vault-item {
  position: absolute;
  left: 29%; right: 29%; top: 4%;
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 22px 44px -16px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,0.1);
  opacity: 0;
  animation: pejVaultDrop 3.6s cubic-bezier(0.4,0,0.5,1) infinite;
  animation-delay: calc(var(--k) * 0.85s);
}
.pej-vault-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes pejVaultDrop {
  0%   { opacity: 0; transform: translateY(-30%) scale(1) rotate(-4deg); }
  12%  { opacity: 1; transform: translateY(-18%) scale(1) rotate(-2deg); }
  55%  { opacity: 1; transform: translateY(78%) scale(0.34) rotate(2deg); }
  66%  { opacity: 0; transform: translateY(96%) scale(0.16) rotate(3deg); }
  100% { opacity: 0; transform: translateY(96%) scale(0.16); }
}
/* the secure folder at the bottom */
.pej-folder {
  position: absolute; left: 50%; bottom: 2%;
  width: 64%; margin-left: -32%; height: 38%;
  z-index: 2;
}
.pej-folder-tab {
  position: absolute; top: 0; left: 8%;
  width: 38%; height: 24%;
  border-radius: 9px 9px 0 0;
  background: #6a45f5;
}
.pej-folder-body {
  position: absolute; bottom: 0; left: 0; right: 0; height: 82%;
  border-radius: 6px 16px 16px 16px;
  background: linear-gradient(180deg, #8b6dff 0%, #5a3fd0 100%);
  box-shadow: 0 26px 50px -18px rgba(124,92,252,.6), inset 0 1px 0 rgba(255,255,255,.3);
}
.pej-folder-lock {
  position: absolute; bottom: 26%; left: 50%; transform: translateX(-50%);
  color: #fff; z-index: 3; opacity: 0.95;
  animation: pejLockTick 3.6s ease-in-out infinite;
}
/* the lock pulses each time a card lands */
@keyframes pejLockTick {
  0%,45%,100% { transform: translateX(-50%) scale(1); }
  56% { transform: translateX(-50%) scale(1.18); }
}
@media (prefers-reduced-motion: reduce) {
  .pej-vault-item { animation: none; opacity: 1; transform: translateY(-10%) scale(0.9); }
  .pej-vault-item:nth-child(n+2) { display: none; }
  .pej-folder-lock { animation: none; }
}

/* ---- Panel 7: intimate letter + pinned polaroid ------------------------ */
.pej-letter {
  position: relative;
  width: min(420px, 86%);
  background: #faf8f3;
  color: #1d1b16;
  border-radius: 4px;
  padding: 30px 30px 26px;
  box-shadow: 0 50px 90px -25px rgba(0,0,0,.7), 0 14px 30px -8px rgba(0,0,0,.4);
  transform: rotate(-1.2deg);
  z-index: 2;
}
.pej-letter-body p { font-size: 14.5px; line-height: 1.62; margin: 0 0 12px; color: #34302a; }
.pej-letter-body p:first-child { font-weight: 600; }
.pej-letter-sign {
  display: block;
  margin-top: 8px;
  font-family: 'Caveat', cursive;
  font-size: 26px;
  color: #1d1b16;
}
/* Floated right so the note text wraps AROUND it — never covered. */
.pej-polaroid {
  float: right;
  width: 136px;
  margin: 4px -6px 10px 16px;
  background: #fff;
  padding: 8px 8px 30px;
  border-radius: 3px;
  box-shadow: 0 16px 32px -12px rgba(0,0,0,.45);
  transform: rotate(3deg);
  shape-outside: margin-box;
}
.pej-polaroid-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; border-radius: 2px; }
.pej-polaroid-cap {
  display: block;
  margin-top: 8px;
  text-align: center;
  font-family: 'Caveat', cursive;
  font-size: 16px;
  color: #555049;
}
.pej-letter-body::after { content: ''; display: block; clear: both; }

/* ---- Panel 9: tiny top-up — photo + punch-card credit tokens ----------- */
/* ---- Panel 9: "just enough to finish" — a 3-card deck that fans out ----- */
.pej-fan {
  position: relative;
  width: min(300px, 72%);
  display: flex; flex-direction: column; align-items: center;
  z-index: 2;
}
.pej-fan-deck {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
}
.pej-fan-card {
  --mid: calc((var(--fan-n) - 1) / 2);
  --angle: calc((var(--f) - var(--mid)) * 17deg);
  --spread: calc((var(--f) - var(--mid)) * 30%);
  position: absolute;
  left: 12%; right: 12%; bottom: 4%;
  aspect-ratio: 4 / 5;
  border-radius: 16px;
  overflow: hidden;
  transform-origin: bottom center;
  background: linear-gradient(150deg, #262638, #16161f);
  box-shadow: 0 26px 50px -22px rgba(0,0,0,.75), inset 0 0 0 1px rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  z-index: var(--f);
  opacity: 0;
  animation: pejFanIn 0.52s cubic-bezier(0.34,1.32,0.5,1) forwards;
  animation-delay: calc(0.18s + var(--f) * 0.11s);
}
.pej-fan-card img { width: 100%; height: 100%; object-fit: cover; }
.pej-fan-credit {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font: 800 30px/1 var(--font-mono, monospace);
  color: #cdbfff;
}
.pej-fan-credit small { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(205,191,255,0.6); }
@keyframes pejFanIn {
  from { transform: translateX(0) translateY(14px) rotate(0deg) scale(0.92); opacity: 0; }
  to   { transform: translateX(var(--spread)) rotate(var(--angle)) scale(1); opacity: 1; }
}
.pej-fan-price {
  position: relative;
  margin-top: 14px;
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(12,11,19,.7);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 20px; font-weight: 800;
  color: #7C5CFC;
  box-shadow: 0 8px 22px -8px rgba(0,0,0,.6);
}
@media (prefers-reduced-motion: reduce) {
  .pej-fan-card { animation: none; opacity: 1; transform: translateX(var(--spread)) rotate(var(--angle)); }
}

/* ---- Panel 10: edit card emerging from a clean envelope pocket --------- */
.pej-envelope {
  position: relative;
  width: min(380px, 78%);
  aspect-ratio: 5 / 4;
  z-index: 2;
  transform: perspective(1500px) rotateY(var(--pej-ry, -8deg)) rotateX(var(--pej-rx, 5deg));
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(0.2,0.7,0.2,1);
}
/* Envelope BACK with its pointed flap — the triangular point sits BEHIND the
   card (peeks behind the photo), so it never cuts across the image. */
.pej-envelope-body {
  position: absolute;
  left: 9%; right: 9%; top: 5%; bottom: 5%;
  background: linear-gradient(180deg, #2e2e44, #1c1c2c);
  border-radius: 10px;
  /* rectangle with a triangular flap point at top-centre */
  clip-path: polygon(0 24%, 50% 0, 100% 24%, 100% 100%, 0 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 30px 60px -28px rgba(0,0,0,.75);
  z-index: 1;
}
/* The edit card — emerges, sitting in front of the back flap; its lower third
   tucks behind the flat front face. Subject (upper portion) stays clear. */
.pej-envelope-card {
  position: absolute;
  left: 27%; right: 27%;
  top: 0;
  aspect-ratio: 4 / 5;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 40px 70px -28px rgba(0,0,0,.75), inset 0 0 0 1px rgba(255,255,255,0.1);
  z-index: 2;
  animation: pejTuck 3.6s ease-in-out infinite;
}
.pej-envelope-card img { width: 100%; height: 100%; object-fit: cover; }
/* FLAT front face across the bottom, IN FRONT of the card's base. Crease seams
   run from the two bottom corners up to centre (the folded side flaps) — drawn
   as a stretched SVG so they read as a real envelope, no peak cutting the photo. */
.pej-envelope-flap {
  position: absolute;
  left: 9%; right: 9%; bottom: 5%;
  height: 44%;
  border-radius: 0 0 10px 10px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0 100 L50 6 L100 100' fill='none' stroke='%23000000' stroke-opacity='0.28' stroke-width='1.2'/%3E%3Cpath d='M0 99 L50 5 L100 99' fill='none' stroke='%23ffffff' stroke-opacity='0.10' stroke-width='1'/%3E%3C/svg%3E") center/100% 100% no-repeat,
    linear-gradient(180deg, #3a3556 0%, #262638 100%);
  box-shadow: 0 -6px 16px -6px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,0.08);
  z-index: 3;
}
@keyframes pejTuck { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4%); } }
@media (prefers-reduced-motion: reduce) { .pej-envelope-card { animation: none; } }

/* ---- Per-screen studio-light mood (each beat gets its own hue) --------- */
/* One brand light, every beat. ETP is violet — no per-panel rainbow. Subtle
   intensity variation gives each screen a little rhythm without changing hue.
   (rgba 165,148,255 = a lifted violet highlight; 124,92,252 = brand violet.) */
.pej-stage--reveal   .pej-light { background: radial-gradient(circle, rgba(165,148,255,.42), rgba(124,92,252,.16) 45%, transparent 70%); }
.pej-stage--invoice  .pej-light { background: radial-gradient(circle, rgba(165,148,255,.30), rgba(124,92,252,.12) 45%, transparent 70%); }
.pej-stage--versions .pej-light { background: radial-gradient(circle, rgba(165,148,255,.36), rgba(124,92,252,.15) 45%, transparent 70%); }
.pej-stage--pro      .pej-light { background: radial-gradient(circle, rgba(165,148,255,.40), rgba(124,92,252,.16) 45%, transparent 70%); }
.pej-stage--animate  .pej-light { background: radial-gradient(circle, rgba(52,211,153,.34), rgba(16,185,129,.14) 45%, transparent 70%); }
.pej-stage--save     .pej-light { background: radial-gradient(circle, rgba(165,148,255,.32), rgba(124,92,252,.13) 45%, transparent 70%); }
.pej-stage--team     .pej-light { background: radial-gradient(circle, rgba(165,148,255,.34), rgba(124,92,252,.14) 45%, transparent 70%); }
.pej-stage--offer    .pej-light { background: radial-gradient(circle, rgba(165,148,255,.44), rgba(124,92,252,.18) 45%, transparent 70%); }
.pej-stage--downsell .pej-light { background: radial-gradient(circle, rgba(165,148,255,.34), rgba(124,92,252,.14) 45%, transparent 70%); }
.pej-stage--email    .pej-light { background: radial-gradient(circle, rgba(165,148,255,.32), rgba(124,92,252,.13) 45%, transparent 70%); }

/* Mobile: flatten the new staged visuals' 3D + cap sizes */
/* (Mobile sizing for the staged visuals is handled in the main max-width:880px
   block above — height-capped + aspect-derived width, no fixed widths.) */
