/* ============================================================
   Epicurus Pro — The Living Product Theater
   A rendered chat environment (Teams dark / Slack light) that
   REPLAYS real product moments. Pure HTML/CSS/JS — no video,
   no interactivity. Rides the landing design system. 2026.
   ============================================================ */

/* ─── Section shell ─── */
.theater-section { position: relative; overflow: hidden; }
.theater-aura {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(42% 34% at 18% 18%, rgba(136,61,255,.10), transparent 66%),
    radial-gradient(38% 30% at 84% 78%, rgba(160,107,255,.09), transparent 66%);
  filter: blur(4px);
}
.theater-wrap { position: relative; z-index: 1; max-width: 780px; margin: 0 auto; }

/* surface tabs — Teams / Slack pills, active follows the playing scenario */
.th-tabs { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; }
.th-tab {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 100px;
  padding: 8px 16px 8px 12px; box-shadow: var(--shadow);
  font-family: var(--font-display); font-weight: 600; font-size: .88rem; color: var(--ink-faint);
  transition: color .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease);
}
.th-tab svg { width: 18px; height: 18px; display: block; opacity: .45; transition: opacity .3s; filter: grayscale(1); }
.th-tab.is-active { color: var(--ink); transform: translateY(-1px); }
.th-tab.is-active svg { opacity: 1; filter: none; }
.th-tab--teams.is-active { border-color: rgba(80,89,201,.45); box-shadow: 0 14px 30px -16px rgba(77,85,189,.5); }
.th-tab--slack.is-active { border-color: rgba(224,30,90,.35); box-shadow: 0 14px 30px -16px rgba(74,21,75,.45); }
.th-tabs-sep { font-size: .78rem; font-weight: 600; color: var(--ink-faint); }

/* ─── The stage (fixed height = zero layout shift) + sliding columns ───
   Teams lives in the left column, Slack in the right: entering Slack the frame
   glides in from the right, returning to Teams it glides back from the left —
   a free-floating slide (drift + fade), no clipping, no 3D. */
.th-stage { position: relative; height: clamp(460px, 62vh, 560px); }
.th-frame {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  border-radius: 22px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  pointer-events: none; user-select: none;
  transform: translateX(0); opacity: 1;
  transition: transform .55s var(--ease), opacity .55s var(--ease);
  will-change: transform, opacity;
}
/* pre-entry states (set before the frame joins the stage) */
.th-frame.th-enter--from-right { transform: translateX(11%); opacity: 0; }
.th-frame.th-enter--from-left  { transform: translateX(-11%); opacity: 0; }
/* exit states (the outgoing frame drifts away in the travel direction) */
.th-frame.th-exit--to-left  { transform: translateX(-11%); opacity: 0; }
.th-frame.th-exit--to-right { transform: translateX(11%); opacity: 0; }

/* caption under the frame — narrates the current scenario */
.th-caption {
  margin: 20px auto 0; text-align: center; max-width: 560px; min-height: 52px;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.th-caption.is-swap { opacity: 0; transform: translateY(6px); }
.th-caption-title { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; letter-spacing: -.01em; color: var(--ink); }
.th-caption-sub { font-size: .9rem; color: var(--ink-soft); margin-top: 3px; }

/* ============================================================
   TEAMS CHROME — dark theme
   ============================================================ */
.th-frame--teams {
  --sf-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --t-bg: #1c1c22; --t-panel: #26262e; --t-line: rgba(255,255,255,.07);
  --t-bubble: #2b2b34; --t-own: #38345e;
  --t-ink: #e9e9f0; --t-soft: #a0a0b2; --t-accent: #7f85f5;
  background: var(--t-bg); font-family: var(--sf-font); color: var(--t-ink);
}
.th-frame--teams .th-chrome { background: var(--t-panel); border-bottom: 1px solid var(--t-line); }
.th-frame--teams .th-chrome-sub { color: var(--t-soft); }
.th-frame--teams .th-composer { background: var(--t-panel); border-top: 1px solid var(--t-line); }
.th-frame--teams .th-composer-box { background: #1f1f26; border: 1px solid rgba(255,255,255,.10); color: var(--t-ink); }
.th-frame--teams .th-composer-send { color: var(--t-accent); }
.th-frame--teams .th-meta b { color: var(--t-ink); }
.th-frame--teams .th-meta span { color: var(--t-soft); }
.th-frame--teams .th-bubble { background: var(--t-bubble); color: var(--t-ink); border-radius: 6px 12px 12px 12px; }
.th-frame--teams .th-msg--own .th-bubble { background: var(--t-own); border-radius: 12px 6px 12px 12px; }
.th-frame--teams .th-typing { color: var(--t-soft); }
.th-frame--teams .th-typing i { background: var(--t-soft); }
.th-frame--teams .th-react { background: #22222a; border: 1px solid rgba(255,255,255,.12); color: var(--t-ink); }
.th-frame--teams .th-fence { background: #17171d; border: 1px solid rgba(255,255,255,.10); color: #d6d6e2; }
.th-frame--teams .th-mention { color: var(--t-accent); background: rgba(127,133,245,.14); }

/* ============================================================
   SLACK CHROME — light theme
   ============================================================ */
.th-frame--slack {
  --sf-font: -apple-system, 'Segoe UI', 'Helvetica Neue', sans-serif;
  --s-ink: #1d1c1d; --s-soft: #616061; --s-line: rgba(29,28,29,.13);
  background: #fff; font-family: var(--sf-font); color: var(--s-ink);
}
.th-frame--slack .th-chrome { background: #fff; border-bottom: 1px solid var(--s-line); }
.th-frame--slack .th-chrome-title { color: var(--s-ink); }
.th-frame--slack .th-chrome-sub { color: var(--s-soft); }
.th-frame--slack .th-composer { background: #fff; border-top: 1px solid var(--s-line); }
.th-frame--slack .th-composer-box { background: #fff; border: 1px solid rgba(29,28,29,.28); color: var(--s-ink); }
.th-frame--slack .th-composer-send { color: #007a5a; }
.th-frame--slack .th-msg { padding: 5px 14px; }
/* Slack never right-aligns — neutralize the whole own-message treatment */
.th-frame--slack .th-msg--own { flex-direction: row; }
.th-frame--slack .th-msg--own .th-msg-body { align-items: flex-start; }
.th-frame--slack .th-msg--own .th-meta { flex-direction: row; }
.th-frame--slack .th-ava { border-radius: 7px; }
.th-frame--slack .th-meta b { color: var(--s-ink); }
.th-frame--slack .th-meta span { color: var(--s-soft); }
.th-frame--slack .th-bubble { background: transparent; padding: 1px 0 0; color: var(--s-ink); }
.th-frame--slack .th-typing { color: var(--s-soft); }
.th-frame--slack .th-typing i { background: #868686; }
.th-frame--slack .th-react { background: #f0f0f0; border: 1px solid transparent; color: var(--s-ink); }
.th-frame--slack .th-fence { background: #f8f8f8; border: 1px solid #ddd; color: #1d1c1d; }
.th-frame--slack .th-mention { color: #1264a3; background: rgba(29,155,209,.12); }
.th-app-badge {
  display: inline-block; font-size: .56rem; font-weight: 700; letter-spacing: .02em;
  color: #616061; background: #e8e8e8; border-radius: 3px; padding: 1px 4px;
  vertical-align: 1px; margin-left: 2px;
}

/* ============================================================
   SHARED CHAT ANATOMY
   ============================================================ */
.th-chrome { display: flex; align-items: center; gap: 11px; padding: 12px 16px; flex: none; }
.th-chrome-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.th-chrome-title { font-weight: 700; font-size: .92rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-chrome-sub { font-size: .74rem; line-height: 1.3; }
.th-chrome-dots { margin-left: auto; display: flex; gap: 4px; flex: none; }
.th-chrome-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .4; }

.th-thread {
  flex: 1; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none;
  padding: 16px 14px 10px; display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth; overscroll-behavior: contain;
}
.th-thread::-webkit-scrollbar { display: none; }

/* message row */
.th-msg { display: flex; gap: 9px; align-items: flex-start; }
.th-msg--own { flex-direction: row-reverse; }
.th-msg--own .th-msg-body { align-items: flex-end; }
.th-msg--own .th-meta { flex-direction: row-reverse; }
.th-msg-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 84%; }
.th-meta { display: flex; align-items: baseline; gap: 7px; }
.th-meta b { font-size: .8rem; font-weight: 700; }
.th-meta span { font-size: .68rem; }
.th-bubble { padding: 8px 12px; font-size: .84rem; line-height: 1.5; overflow-wrap: break-word; }
.th-bubble .th-b { font-weight: 700; }
.th-bubble .th-i { font-style: italic; }
.th-bubble .th-dim { opacity: .72; }

/* avatars — initials circles; the agent wears the brand mark */
.th-ava {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .66rem; font-weight: 700; color: #fff; letter-spacing: .02em;
  background: hsl(var(--hue, 262), 38%, 46%);
  position: relative;
}
/* the brand star rides a WHITE puck (Filip's rule) — hairline keeps it crisp per surface */
.th-ava--agent { background: #fff; border: 1px solid rgba(26,26,46,.12); }
.th-frame--teams .th-ava--agent { border-color: rgba(255,255,255,.22); }
.th-ava--agent img { width: 18px; height: 18px; object-fit: contain; }
.th-ava--agent::after {
  content: ""; position: absolute; right: -1px; bottom: -1px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #00d2a0; border: 2px solid var(--t-panel, #fff);
}
.th-frame--slack .th-ava--agent::after { border-color: #fff; }

/* fenced draft block (what-you-approve-is-what-sends) */
.th-fence {
  margin-top: 7px; border-radius: 9px; padding: 10px 12px;
  font-family: 'SF Mono', 'Cascadia Code', Consolas, monospace;
  font-size: .72rem; line-height: 1.55; white-space: pre-wrap;
}

/* mention pill */
.th-mention { font-weight: 600; border-radius: 4px; padding: 0 4px; }

/* reactions — pop onto a message (👀 at intake → ✅ on done) */
.th-reacts { display: flex; gap: 5px; margin-top: 2px; }
.th-react {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; line-height: 1; border-radius: 100px; padding: 4px 8px;
  animation: thReactPop .38s var(--ease) both;
}
@keyframes thReactPop { 0% { opacity: 0; transform: scale(.35); } 70% { transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }

/* typing indicator */
.th-typing { display: flex; align-items: center; gap: 8px; padding: 2px 14px 0 53px; font-size: .72rem; }
.th-frame--slack .th-typing { padding-left: 53px; }
.th-typing-dots { display: inline-flex; gap: 3px; }
.th-typing i { width: 5px; height: 5px; border-radius: 50%; animation: thDot 1.1s ease-in-out infinite; }
.th-typing i:nth-child(2) { animation-delay: .15s; }
.th-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes thDot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-3px); opacity: 1; } }

/* message arrival */
.th-pop { animation: thMsgIn .4s var(--ease) both; }
@keyframes thMsgIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

/* grouped follow-up message from the same person (Slack style) */
.th-msg--compact { margin-top: -8px; }
.th-msg--compact .th-ava { visibility: hidden; height: 0; }
.th-msg--compact .th-meta { display: none; }

/* composer — the ask gets typed here before it posts */
.th-composer { display: flex; align-items: center; gap: 10px; padding: 10px 14px; flex: none; }
.th-composer-box {
  flex: 1; min-width: 0; min-height: 36px; border-radius: 8px; padding: 8px 12px;
  font-size: .8rem; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.th-composer-box:empty::before { content: attr(data-placeholder); opacity: .45; }
.th-composer-box.is-typing::after {
  content: ""; display: inline-block; width: 1.5px; height: .95em; margin-left: 1px;
  background: currentColor; vertical-align: -2px; animation: thCaret 1s steps(1) infinite;
}
@keyframes thCaret { 50% { opacity: 0; } }
.th-composer-send { flex: none; display: grid; place-items: center; }

/* ============================================================
   CARDS — Adaptive Card (Teams) · Block Kit attachment (Slack)
   ============================================================ */
.th-card { margin-top: 7px; border-radius: 10px; overflow: hidden; font-size: .8rem; line-height: 1.5; }
.th-frame--teams .th-card { background: #232330; border: 1px solid rgba(255,255,255,.10); }
.th-frame--slack .th-card { background: #fff; border: 1px solid rgba(29,28,29,.16); border-left: 3px solid #883dff; }

.th-card-head { font-weight: 700; padding: 9px 12px 8px; }
.th-frame--teams .th-card-head { background: #2c2c3a; }  /* Container style:emphasis */
.th-frame--slack .th-card-head { padding-bottom: 0; }
.th-card-body { padding: 8px 12px 0; }
.th-card-hint { padding: 5px 12px 0; font-size: .7rem; opacity: .6; font-style: italic; }
.th-card-summary { padding: 4px 12px 0; }
.th-card-summary .th-sum-line { display: block; padding: 1px 0; }
.th-card-actions { display: flex; gap: 8px; padding: 11px 12px 12px; }

.th-btn {
  font-family: inherit; font-weight: 600; font-size: .76rem; line-height: 1;
  border-radius: 5px; padding: 8px 14px; border: 1px solid transparent;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
/* Teams: positive = accent-filled · destructive = quiet outline */
.th-frame--teams .th-btn--approve { background: var(--t-accent); color: #16162a; }
.th-frame--teams .th-btn--decline { background: transparent; border-color: rgba(255,255,255,.22); color: #f28ba8; }
.th-frame--teams .th-btn--open { background: transparent; border-color: rgba(255,255,255,.22); color: var(--t-accent); }
/* Slack: primary = green-filled · danger = red-filled */
.th-frame--slack .th-btn--approve { background: #007a5a; color: #fff; }
.th-frame--slack .th-btn--decline { background: #e01e5a; color: #fff; }
.th-frame--slack .th-btn--open { background: #fff; border-color: rgba(29,28,29,.3); color: #1d1c1d; }

/* simulated tap on Approve */
.th-btn.is-pressed { transform: scale(.94); box-shadow: 0 0 0 3px rgba(136,61,255,.28); }

/* card lifecycle: actions → running → done */
.th-card-status { padding: 0 12px 12px; font-weight: 600; display: none; }
.th-card.is-running .th-card-actions, .th-card.is-done .th-card-actions { display: none; }
.th-card.is-running .th-card-hint, .th-card.is-done .th-card-hint { display: none; }
.th-card.is-running .th-card-status, .th-card.is-done .th-card-status { display: block; animation: thMsgIn .3s var(--ease) both; }
.th-card.is-done .th-card-status { color: #00d2a0; }

/* transcript card icon row */
.th-card-file { display: flex; align-items: center; gap: 9px; padding: 10px 12px 0; }
.th-card-file-icon {
  flex: none; width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(136,61,255,.16); font-size: .82rem;
}

/* ============================================================
   EXPLAINER STRIP — departmental vs personal colleague
   ============================================================ */
.th-explainer { max-width: 920px; margin: clamp(48px, 7vw, 80px) auto 0; position: relative; z-index: 1; }
.th-explainer-head { text-align: center; margin-bottom: 26px; }
.th-explainer-head h3 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.35rem, 2.8vw, 1.75rem); letter-spacing: -.02em; }
.th-explainer-head p { color: var(--ink-soft); margin-top: 8px; font-size: .98rem; }
.th-explainer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.th-exp-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 28px 26px; box-shadow: var(--shadow);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.th-exp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.th-exp-tag {
  display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--violet); background: var(--accent-bg); border: 1px solid rgba(136,61,255,.22);
  padding: 4px 11px; border-radius: 100px; margin-bottom: 14px;
}
.th-exp-card h4 { font-family: var(--font-display); font-weight: 700; font-size: 1.14rem; letter-spacing: -.01em; margin-bottom: 8px; }
.th-exp-card p { color: var(--ink-soft); font-size: .93rem; }
.th-explainer-foot { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--ink-faint); }
.th-explainer-foot strong { color: var(--ink-soft); font-weight: 600; }

/* ============================================================
   ENTERPRISE COPY-EMAIL AFFORDANCE (pricing CTA)
   ============================================================ */
.flagship-mail {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 12px;
  background: none; border: 0; cursor: pointer; padding: 4px 2px;
  font-family: var(--font-body); font-size: .86rem; font-weight: 500; color: rgba(255,255,255,.62);
  transition: color .2s;
}
.flagship-mail:hover { color: #fff; }
.flagship-mail svg { width: 14px; height: 14px; flex: none; }
.flagship-mail.is-copied { color: #00d2a0; }

/* ============================================================
   REDUCED MOTION + RESPONSIVE
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .th-pop, .th-react, .th-card-status { animation: none !important; }
  .th-typing i { animation: none; }
  .th-frame, .th-caption, .th-tab { transition: none; }
}

@media (max-width: 900px) {
  .th-explainer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .th-stage { height: clamp(430px, 68vh, 520px); }
  .th-frame { border-radius: 18px; }
  .th-msg-body { max-width: 88%; }
  .th-bubble { font-size: .8rem; }
  .th-fence { font-size: .66rem; }
  .th-tabs { gap: 8px; }
  .th-tab { padding: 7px 13px 7px 10px; font-size: .82rem; }
  .th-caption { min-height: 64px; }
}
