/* ═══════════════════════════════════════════════════════════════
   ONBOARDING THEATER — styles for the PLG performance layer
   Companion to modules/onboarding-theater.js. Light theme, purple
   accent (--accent: #7C3AED). All animations are decorative and
   respect prefers-reduced-motion.
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. MISSION RAIL ─────────────────────────────────────────── */
.ot-rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 18px 12px;
  border-bottom: 1px solid var(--surface-border, rgba(0,0,0,0.08));
  background: linear-gradient(180deg, rgba(124,58,237,0.035), rgba(124,58,237,0));
  animation: otFadeIn 0.5s cubic-bezier(0.16,1,0.3,1) both;
}
.ot-rail-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.ot-rail-title-main {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary, #94a3b8);
  white-space: nowrap;
}
.ot-rail-status {
  font-size: 0.7rem;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.ot-rail-status.is-live { color: var(--accent, #7C3AED); font-weight: 600; }
.ot-live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent, #7C3AED); margin-right: 4px;
  animation: otPulse 1.4s ease infinite;
}
.ot-rail-track {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ot-rail-track::-webkit-scrollbar { display: none; }
.ot-rail-node {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  position: relative;
  padding: 2px 0;
}
.ot-rail-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--surface-border, rgba(0,0,0,0.12));
  background: #fff;
  color: var(--text-tertiary, #94a3b8);
  transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
}
.ot-rail-num { font-size: 0.62rem; font-weight: 700; }
.ot-rail-check { display: none; }
.ot-rail-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary, #94a3b8);
  white-space: nowrap;
  transition: color 0.3s ease;
}
.ot-rail-link {
  flex: 1 1 18px;
  min-width: 14px;
  height: 1.5px;
  margin-top: 12px;
  background: var(--surface-border, rgba(0,0,0,0.1));
  transition: background 0.4s ease;
}
.ot-rail-link.is-done { background: var(--accent, #7C3AED); }

.ot-rail-node.is-active .ot-rail-dot {
  border-color: var(--accent, #7C3AED);
  color: var(--accent, #7C3AED);
  box-shadow: 0 0 0 4px rgba(124,58,237,0.12);
  animation: otGlow 2s ease infinite;
}
.ot-rail-node.is-active .ot-rail-label { color: var(--text-primary, #111); }

.ot-rail-node.is-done .ot-rail-dot {
  border-color: var(--accent, #7C3AED);
  background: var(--accent, #7C3AED);
  color: #fff;
  animation: otPop 0.45s cubic-bezier(0.16,1,0.3,1);
}
.ot-rail-node.is-done .ot-rail-num { display: none; }
.ot-rail-node.is-done .ot-rail-check { display: block; }
.ot-rail-node.is-done .ot-rail-label { color: var(--text-secondary, #64748b); }

.ot-rail-launch .ot-rail-dot { border-style: dashed; }
.ot-rail-launch.is-active .ot-rail-dot { border-style: solid; }

/* Ground-work deliverable slots (5 dots under Act 2) */
.ot-rail-slots { display: inline-flex; gap: 3px; margin-left: 2px; }
.ot-rail-slot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--surface-border, rgba(0,0,0,0.12));
  transition: all 0.3s ease;
}
.ot-rail-slot.is-on  { background: var(--accent, #7C3AED); transform: scale(1.25); }
.ot-rail-slot.is-fail { background: #cbd5e1; }

/* ── 2. EMPLOYEE PRESENCE STRIP ──────────────────────────────── */
.ot-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--surface-border, rgba(0,0,0,0.08));
  background: linear-gradient(90deg, rgba(124,58,237,0.05), rgba(124,58,237,0.01));
  animation: otFadeIn 0.5s ease both;
  min-width: 0;
}
.ot-strip-avatar {
  position: relative;
  width: 30px; height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #a78bfa, #7C3AED 70%);
  overflow: visible;
}
.ot-strip-avatar video {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.ot-strip-pulse {
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 1.5px solid rgba(124,58,237,0.45);
  animation: otRing 2.2s ease-out infinite;
  pointer-events: none;
}
.ot-strip-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.ot-strip-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary, #111);
  display: flex; align-items: center; gap: 6px;
}
.ot-strip-state {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, #7C3AED);
  background: rgba(124,58,237,0.09);
  border-radius: 999px;
  padding: 1.5px 7px;
}
.ot-strip-activity {
  font-size: 0.74rem;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ot-strip-activity.ot-swap { animation: otSwap 0.35s ease; }
.ot-strip-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ot-strip-clock {
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary, #94a3b8);
}
.ot-strip-eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}
.ot-strip-eq i {
  width: 2.5px;
  background: var(--accent, #7C3AED);
  border-radius: 2px;
  animation: otEq 1.1s ease-in-out infinite;
  opacity: 0.85;
}
.ot-strip-eq i:nth-child(1) { height: 6px;  animation-delay: 0s; }
.ot-strip-eq i:nth-child(2) { height: 11px; animation-delay: 0.18s; }
.ot-strip-eq i:nth-child(3) { height: 8px;  animation-delay: 0.36s; }
.ot-strip-eq i:nth-child(4) { height: 12px; animation-delay: 0.54s; }

/* ── 3. PHASE MARKERS (chat dividers) ────────────────────────── */
.ot-act-marker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 4px 10px;
  animation: otFadeIn 0.5s ease both;
}
.ot-act-marker-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--surface-border, rgba(0,0,0,0.12)), transparent);
}
.ot-act-marker-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.ot-act-marker-eyebrow {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--accent, #7C3AED);
  text-transform: uppercase;
}
.ot-act-marker-sub {
  font-size: 0.68rem;
  color: var(--text-tertiary, #94a3b8);
  max-width: 300px;
}

/* ── 4. CAPABILITY TEASERS ───────────────────────────────────── */
.ot-caps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 10px;
}
.ot-caps.ot-caps-compact { grid-template-columns: 1fr 1fr; gap: 6px; }
.ot-cap-tile {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--surface-border, rgba(0,0,0,0.08));
  border-radius: 10px;
  background: #fff;
  position: relative;
  overflow: hidden;
}
.ot-cap-tile::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(124,58,237,0.05) 50%, transparent 60%);
  background-size: 220% 100%;
  animation: otShimmer 3.4s linear infinite;
  pointer-events: none;
}
.ot-cap-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: rgba(124,58,237,0.08);
  color: var(--accent, #7C3AED);
}
.ot-cap-icon svg { width: 14px; height: 14px; }
.ot-cap-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ot-cap-title { font-size: 0.74rem; font-weight: 700; color: var(--text-primary, #111); line-height: 1.25; }
.ot-cap-desc  { font-size: 0.66rem; color: var(--text-secondary, #64748b); line-height: 1.35; }
.ot-cap-lock {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--text-tertiary, #94a3b8);
  opacity: 0.75;
}
.ot-cap-lock svg { width: 11px; height: 11px; }
.ot-caps-foot {
  display: block;
  margin-top: 9px;
  font-size: 0.68rem;
  color: var(--text-tertiary, #94a3b8);
  text-align: center;
}
.ot-gate-caps { margin-top: 2px; }

/* ── 5. DELIVERABLE SHOWCASE CARDS ───────────────────────────── */
.ot-show-card {
  border: 1px solid rgba(124,58,237,0.18);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(124,58,237,0.06);
  animation: otPop 0.45s cubic-bezier(0.16,1,0.3,1) both;
}
.ot-show-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(90deg, rgba(124,58,237,0.06), rgba(124,58,237,0.015));
  border-bottom: 1px solid var(--surface-border, rgba(0,0,0,0.06));
}
.ot-show-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 7px;
  background: var(--accent, #7C3AED);
  color: #fff;
  flex-shrink: 0;
}
.ot-show-icon svg { width: 13px; height: 13px; }
.ot-show-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary, #111);
  line-height: 1.3;
  min-width: 0;
}
.ot-show-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent, #7C3AED);
  background: rgba(124,58,237,0.1);
  border-radius: 999px;
  padding: 2.5px 8px;
  white-space: nowrap;
}
.ot-show-body { padding: 6px 12px; }
.ot-show-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.ot-show-row:last-child { border-bottom: none; }
.ot-show-row-main { font-size: 0.76rem; font-weight: 600; color: var(--text-primary, #111); }
.ot-show-row-sub  { font-size: 0.7rem; color: var(--text-secondary, #64748b); line-height: 1.4; }
.ot-show-more {
  padding: 6px 0 2px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent, #7C3AED);
}
.ot-show-foot {
  padding: 9px 12px 11px;
  font-size: 0.7rem;
  color: var(--text-secondary, #64748b);
  line-height: 1.5;
  border-top: 1px solid rgba(0,0,0,0.04);
  background: rgba(0,0,0,0.012);
}
.ot-show-hint { color: var(--text-tertiary, #94a3b8); }
.ot-threat {
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: 1px;
}
.ot-threat-high   { background: rgba(220,38,38,0.1);  color: #dc2626; }
.ot-threat-medium { background: rgba(217,119,6,0.1);  color: #d97706; }
.ot-threat-low    { background: rgba(22,163,74,0.1);  color: #16a34a; }
.ot-show-gap {
  margin: 8px 0 4px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(124,58,237,0.06);
  border: 1px dashed rgba(124,58,237,0.3);
  font-size: 0.72rem;
  color: var(--text-primary, #111);
  line-height: 1.45;
}
.ot-show-gap-label {
  display: block;
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent, #7C3AED);
  margin-bottom: 3px;
}
.ot-show-site { display: flex; flex-direction: column; gap: 6px; padding: 6px 0; }
.ot-show-site-tag { font-size: 0.76rem; font-weight: 600; color: var(--text-primary, #111); }
.ot-show-site-themes { display: flex; gap: 5px; flex-wrap: wrap; }
.ot-show-site-themes span {
  font-size: 0.62rem;
  background: rgba(0,0,0,0.04);
  color: var(--text-secondary, #64748b);
  border-radius: 999px;
  padding: 2px 8px;
}
.ot-show-site-link {
  display: inline-block;
  align-self: flex-start;
  margin-top: 2px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff !important;
  background: var(--accent, #7C3AED);
  border-radius: 8px;
  padding: 7px 12px;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.ot-show-site-link:hover { opacity: 0.85; }

/* ── ANIMATIONS ──────────────────────────────────────────────── */
@keyframes otFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes otPop    { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes otPulse  { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes otGlow   { 0%, 100% { box-shadow: 0 0 0 4px rgba(124,58,237,0.12); } 50% { box-shadow: 0 0 0 7px rgba(124,58,237,0.06); } }
@keyframes otRing   { 0% { transform: scale(0.9); opacity: 0.8; } 100% { transform: scale(1.45); opacity: 0; } }
@keyframes otEq     { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }
@keyframes otSwap   { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes otShimmer { from { background-position: 200% 0; } to { background-position: -20% 0; } }

/* ── RESPONSIVE / MOTION ─────────────────────────────────────── */
@media (max-width: 640px) {
  .ot-rail { padding: 8px 12px 10px; }
  .ot-rail-label { font-size: 0.66rem; }
  .ot-rail-status { display: none; }
  .ot-caps { grid-template-columns: 1fr; }
  .ot-strip-clock { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ot-rail, .ot-strip, .ot-act-marker, .ot-show-card { animation: none; }
  .ot-strip-pulse, .ot-strip-eq i, .ot-live-dot, .ot-cap-tile::after { animation: none; }
  .ot-rail-node.is-active .ot-rail-dot { animation: none; }
}
