/* ════════════════════════════════════════════════════════════════════════
   Program-loop showcase  ·  Invisible (individual-program marketing pages)
   ────────────────────────────────────────────────────────────────────────
   Shared styles for the bespoke looping product animations on:
     · executive-ai-fluency.html   (#loop-exec   · iMessage ⇄ Claude)
     · learn-claude.html           (#loop-claude · Claude desktop)
     · career-growth.html          (#loop-career · iMessage ⇄ voice practice)

   The loop CONTENT is authored statically in each page (every beat is a
   .pl-enter element with data-step="N"); assets/program-loops.js reveals
   them on a timeline and crossfades between .pl-surface layers. This file
   provides: the centered stage, the surface-crossfade primitive, the
   entrance utilities, and the net-new mock components (prompt card, copied
   pill, tapback, link card, habit card, connector / tool chips, unlabeled
   bars, checkmarks, privacy banner, Claude-mobile screen, and the live
   orb/waveform motion the base practice screen lacks).

   Motion law: transform + opacity only, decelerate eases, no bounce.
   Honors prefers-reduced-motion (see the gate at the bottom).
   ════════════════════════════════════════════════════════════════════════ */

/* ── Stage: centers the animated device under the section header ───────── */
.program-loop-stage {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}
.program-loop-stage--wide { /* desktop Claude mock */
  width: 100%;
}
.program-loop-stage--wide .product-mock { max-width: 720px; margin: 0 auto; }

.program-loop {
  position: relative;
  width: 100%;
  transition: opacity .45s ease;
}
.program-loop-stage:not(.program-loop-stage--wide) .program-loop {
  width: min(340px, 100%);
}
.program-loop.is-resetting { opacity: 0; }

/* ── Surface crossfade primitive ──────────────────────────────────────── */
/* Phone loops stack two .device-screen surfaces in one grid cell so the
   outer phone frame never resizes during a crossfade. */
.pl-stack { display: grid; width: 100%; }
.pl-stack > .pl-surface { grid-area: 1 / 1; }

.pl-surface {
  opacity: 0;
  transition: opacity .45s ease;
  pointer-events: none;
}
.pl-surface.is-active {
  opacity: 1;
  pointer-events: auto;
}
/* incoming practice surface eases in with a hair of scale (transform only) */
.pl-surface--practice { transform: scale(.985); transition: opacity .45s ease, transform .45s cubic-bezier(.25,1,.5,1); }
.pl-surface--practice.is-active { transform: scale(1); }

/* ── Entrance utilities (revealed by .is-in) ──────────────────────────── */
.pl-enter {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .28s ease, transform .34s cubic-bezier(.25, 1, .5, 1);
}
.pl-enter.is-in {
  opacity: 1;
  transform: none;
}
.pl-enter--bar { transform: translateX(-6px); }
.pl-enter--pop { transform: scale(.82); transition: opacity .24s ease, transform .3s cubic-bezier(.25, 1, .5, 1); }
/* cleared beats are dropped from flow so the next frame starts at the top */
.pl-gone { display: none !important; }

/* ── SMS thread tweaks for the loop (bubbles + receipts pre-authored) ──── */
.program-loop .sms-thread { gap: 7px; display: flex; flex-direction: column; overflow: hidden; }
/* keep every pre-authored beat at its natural height: the thread holds more
   content than the screen, so without this flex items shrink (a fixed-height
   card like the link preview collapses to its borders). */
.program-loop .sms-thread > * { flex-shrink: 0; }
.program-loop .sms-receipt.pl-enter { margin-top: -2px; }

/* iMessage rich link card (career frame 1) */
.pl-linkcard {
  align-self: flex-end;
  max-width: 78%;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--white);
  box-shadow: 0 6px 16px -10px rgba(18,28,26,.35);
}
.pl-linkcard-art {
  height: 64px;
  background:
    radial-gradient(circle at 30% 40%, color-mix(in oklab, var(--secondary) 55%, var(--white)) 0%, var(--secondary) 70%);
  position: relative;
}
.pl-linkcard-art::after {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.16) 1px, transparent 1.5px);
  background-size: 12px 12px;
}
.pl-linkcard-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  padding: 9px 12px 0;
}
.pl-linkcard-url {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--subtle);
  padding: 6px 12px 9px;
}

/* Prompt card inside the exec thread (a ready-to-copy prompt) */
.pl-prompt-card {
  align-self: flex-start;
  max-width: 84%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px 11px;
  box-shadow: 0 6px 16px -12px rgba(18,28,26,.35);
}
.pl-prompt-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 5px;
}
.pl-prompt-text {
  font-family: 'Newsreader', serif;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink);
}
.pl-prompt-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 9px;
}
.pl-prompt-copy {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--secondary);
  display: inline-flex; align-items: center; gap: 5px;
}
.pl-prompt-copy::before {
  content: ''; width: 11px; height: 11px; border-radius: 3px;
  border: 1.5px solid currentColor;
}

/* "Copied" pill */
.pl-pill {
  align-self: center;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--white);
  background: var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
}

/* Thumbs-up tapback on the last incoming bubble */
.pl-tapback {
  align-self: flex-start;
  margin: -3px 0 2px 6px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  box-shadow: 0 4px 10px -6px rgba(18,28,26,.4);
}

/* ── Claude (mobile) screen used by exec loop's second surface ────────────
   Real-Claude fidelity (shared mock): warm cream surface (#F4EFE4 ≈ Claude's
   #F0ECE0), the real sunburst "spark" mark from assets/logos/claude.svg, an
   upright serif "Claude" wordmark, cream user bubbles, a clay (#d97757) send
   button, and the model label "Claude Sonnet 4.5" (authored in the markup). */
.pl-claude-screen {
  background: var(--claude-cream, #F4EFE4);
  display: flex; flex-direction: column;
  border-radius: 30px; overflow: hidden;
}
/* exec phone Claude surface wraps .pl-claude-head/body/composer directly in
   .device-screen (no .pl-claude-screen wrapper) — cream the whole surface so
   the message area matches the header, like real Claude mobile. */
.pl-surface[data-surface="claude"] { background: var(--claude-cream, #F4EFE4); }
.pl-claude-head {
  display: flex; align-items: center; gap: 8px;
  padding: 42px 16px 12px;
  border-bottom: 1px solid var(--claude-line, #E4DCC9);
  background: var(--claude-cream-bar, #EFE8D7);
}
/* the sunburst spark — real Claude logo, no clay square, no letter */
.pl-claude-mark {
  width: 22px; height: 22px; flex-shrink: 0;
  background: center / 100% no-repeat url('logos/claude.svg');
}
.pl-claude-title { font-family: 'Newsreader', serif; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.1; }
.pl-claude-title span { display: block; font-family: 'DM Mono', monospace; font-weight: 400; font-size: 9.5px; color: var(--subtle); margin-top: 1px; }
.pl-claude-body { flex: 1; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.pl-claude-msg--user {
  align-self: flex-end; max-width: 82%;
  background: var(--claude-bubble, #ECE4D2);
  border: 1px solid var(--claude-line, #E4DCC9);
  border-radius: 14px 14px 4px 14px;
  padding: 8px 11px;
  font-family: 'Inter', system-ui, sans-serif; font-size: 12.5px; line-height: 1.4; color: var(--ink);
}
.pl-claude-msg--ai { align-self: flex-start; max-width: 88%; display: flex; gap: 8px; }
.pl-claude-msg--ai .pl-claude-ai-avatar { width: 20px; height: 20px; flex-shrink: 0; background: center / 100% no-repeat url('logos/claude.svg'); }
.pl-claude-ai-bars { display: flex; flex-direction: column; gap: 7px; padding-top: 2px; flex: 1; }
.pl-claude-composer {
  display: flex; align-items: center; gap: 8px;
  margin: 0 12px 14px; padding: 9px 12px;
  border: 1px solid var(--claude-line, #E4DCC9); border-radius: 999px;
  background: var(--white);
}
.pl-claude-composer-text { flex: 1; font-family: 'Inter', system-ui, sans-serif; font-size: 12px; color: var(--ink); min-height: 16px; }
.pl-claude-composer-text:empty::before { content: ''; }
.pl-claude-composer-send {
  width: 24px; height: 24px; border-radius: 50%;
  background: #d97757; color: var(--white); /* Claude clay */
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0;
}
.pl-claude-ai-text { font-family: 'Inter', system-ui, sans-serif; font-size: 12.5px; line-height: 1.4; color: var(--ink); }

/* ── Claude DESKTOP window (learn-claude single surface) ──────────────── */
.pl-claude-desk { display: flex; flex-direction: column; flex: 1; width: 100%; min-height: clamp(440px, 46vw, 520px); background: var(--claude-cream, #F4EFE4); text-align: left; }
.pl-claude-desk-bar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--claude-line, #E4DCC9); background: var(--claude-cream-bar, #EFE8D7); }
.pl-claude-desk-bar .pl-claude-mark { width: 24px; height: 24px; }
.pl-claude-deskname { font-family: 'Newsreader', serif; font-size: 15px; font-weight: 600; color: var(--ink); }
.pl-claude-deskmodel { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--subtle); margin-left: auto; }
.pl-claude-desk-thread { flex: 1; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; align-items: flex-start; }
.pl-claude-desk-thread .pl-session-card,
.pl-claude-desk-thread .pl-banner,
.pl-claude-desk-thread .pl-stepdone { margin: 0; align-self: stretch; }
.pl-claude-desk-thread .pl-claude-msg--user { font-size: 13px; }
.pl-claude-desk-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pl-claude-desk-composer { display: flex; align-items: center; gap: 10px; margin: 0 20px 18px; padding: 11px 14px; border: 1px solid var(--claude-line, #E4DCC9); border-radius: 12px; background: var(--white); }
.pl-claude-desk-composer-text { flex: 1; font-family: 'Inter', system-ui, sans-serif; font-size: 13px; color: var(--subtle); }

/* ── Claude DESKTOP extras (learn-claude) layered over .screen--tutorial ─ */
.pl-session-card {
  margin: 12px 14px 4px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--secondary);
  border-radius: 10px;
  background: var(--white);
  padding: 11px 13px;
}
.pl-session-eyebrow { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--secondary); margin-bottom: 4px; }
.pl-session-title { font-family: 'Newsreader', serif; font-size: 15px; color: var(--ink); margin-bottom: 4px; }
.pl-session-task { font-family: 'Inter', system-ui, sans-serif; font-size: 12px; line-height: 1.45; color: var(--body-color); }

/* connector / tool-use chips */
.pl-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'DM Mono', monospace; font-size: 11px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
}
.pl-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--secondary); }
.pl-chip-dot--connected { background: #2faa6a; }
.pl-chip--tool { color: var(--secondary); }
.pl-chip--tool .pl-chip-dot { background: var(--secondary); animation: pl-pulse 1.2s ease-in-out infinite; }

/* unlabeled gray document chips */
.pl-docchip {
  height: 30px; border-radius: 8px;
  border: 1px solid var(--line);
  background: color-mix(in oklab, var(--wash) 60%, var(--white));
  display: flex; align-items: center; gap: 8px; padding: 0 10px;
}
.pl-docchip::before { content: ''; width: 16px; height: 18px; border-radius: 3px; background: color-mix(in oklab, var(--secondary) 35%, var(--wash)); flex-shrink: 0; }
.pl-docchip span { height: 7px; border-radius: 4px; background: var(--wash); flex: 1; max-width: 120px; }

/* unlabeled content bars (response / agenda) */
.pl-bar { height: 8px; border-radius: 4px; background: var(--wash); }
.pl-bar--w90 { width: 90%; } .pl-bar--w80 { width: 80%; } .pl-bar--w70 { width: 70%; }
.pl-bar--w60 { width: 60%; } .pl-bar--w50 { width: 50%; } .pl-bar--w40 { width: 40%; }

/* a content row = check + bar (for the "owed decisions" list) */
.pl-bar-row { display: flex; align-items: center; gap: 8px; }

/* checkmark */
.pl-check {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--secondary); color: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; flex-shrink: 0;
}
.pl-check--done { background: #2faa6a; }

/* privacy banner */
.pl-banner {
  margin: 8px 14px 4px;
  background: color-mix(in oklab, var(--secondary) 14%, var(--white));
  border: 1px solid color-mix(in oklab, var(--secondary) 30%, var(--line));
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; gap: 9px; align-items: flex-start;
  font-family: 'Inter', system-ui, sans-serif; font-size: 12px; line-height: 1.4; color: var(--ink);
}
.pl-banner-lock { width: 16px; height: 16px; border-radius: 4px; background: var(--secondary); flex-shrink: 0; margin-top: 1px; }

/* step-complete tag on the session card */
.pl-stepdone {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'DM Mono', monospace; font-size: 11px; color: #2faa6a;
  margin: 8px 14px 0;
}

/* ── Habit card (career frame 5) ─────────────────────────────────────── */
.pl-habit-card {
  align-self: flex-start;
  max-width: 84%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  box-shadow: 0 6px 16px -12px rgba(18,28,26,.35);
}
.pl-habit-title { font-family: 'DM Mono', monospace; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--secondary); margin-bottom: 8px; }
.pl-check-row { display: flex; gap: 7px; }
.pl-check-row .pl-check { width: 18px; height: 18px; }

/* ── Live orb + waveform motion (practice screen lacks keyframes) ──────── */
@media (prefers-reduced-motion: no-preference) {
  .program-loop .practice-orb { animation: pl-orb 2.4s ease-in-out infinite; }
  .program-loop .practice-waveform span { animation: pl-wave 1.1s ease-in-out infinite; transform-origin: center bottom; }
  .program-loop .practice-waveform span:nth-child(2n) { animation-delay: .15s; }
  .program-loop .practice-waveform span:nth-child(3n) { animation-delay: .3s; }
  .program-loop .practice-waveform span:nth-child(4n) { animation-delay: .45s; }
  .pl-chip--tool .pl-chip-dot { animation: pl-pulse 1.2s ease-in-out infinite; }
}
@keyframes pl-orb { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes pl-wave { 0%, 100% { transform: scaleY(.6); } 50% { transform: scaleY(1); } }
@keyframes pl-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* ── Reduced motion: no crossfade/entrance motion; JS pins the static frame ─
   Transitions/animations are killed so the .is-in beats the JS reveals appear
   instantly. We deliberately do NOT force every .pl-enter visible — only the
   beats JS marks .is-in (the [data-static] composed frame) should show. */
@media (prefers-reduced-motion: reduce) {
  .program-loop,
  .pl-surface,
  .pl-surface--practice,
  .pl-enter,
  .program-loop .practice-orb,
  .program-loop .practice-waveform span,
  .pl-chip--tool .pl-chip-dot {
    transition: none !important;
    animation: none !important;
  }
  .pl-surface--practice { transform: none; }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .program-loop-stage--wide .product-mock { max-width: 100%; }
}
