/* Shared interactive product demos */

.demo-section {
  background: rgba(255, 255, 255, 0.45);
}

.demo-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.demo-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.demo-tab {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.demo-tab:hover {
  border-color: rgba(13, 148, 136, 0.25);
}

.demo-tab.is-active {
  background: rgba(13, 148, 136, 0.08);
  border-color: rgba(13, 148, 136, 0.35);
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.12);
}

.demo-tab .icon-wrap,
.demo-tab .icon {
  width: 2.25rem;
  height: 2.25rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.demo-tab strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text, #0f172a);
  margin-bottom: 0.15em;
}

.demo-tab span.desc {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  line-height: 1.35;
}

.demo-stage {
  padding: 1.25rem;
  min-height: 420px;
  position: relative;
  overflow: hidden;
}

.demo-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 1rem;
}

.demo-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal, #0d9488);
}

.demo-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal, #0d9488);
  animation: demo-pulse 1.5s ease infinite;
}

@keyframes demo-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.demo-progress {
  display: flex;
  gap: 0.35rem;
}

.demo-progress button {
  width: 28px;
  height: 4px;
  border: none;
  border-radius: 999px;
  padding: 0;
  background: rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: background 0.2s, width 0.2s;
}

.demo-progress button.is-active {
  background: var(--teal, #0d9488);
  width: 40px;
}

.demo-caption {
  font-size: 0.88rem;
  color: var(--text-secondary, #334155);
  margin: 0;
  min-height: 2.6em;
}

.demo-caption strong { color: var(--text, #0f172a); }

/* App chrome mock */
.app-mock {
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.app-mock.desktop {
  display: grid;
  grid-template-columns: 160px 1fr;
  min-height: 300px;
}

.app-sidebar {
  background: rgba(15, 23, 42, 0.03);
  border-right: 1px solid rgba(15, 23, 42, 0.06);
  padding: 0.85rem 0.65rem;
}

.app-sidebar .brand {
  font-family: var(--font-display, sans-serif);
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--text, #0f172a);
  margin-bottom: 0.85rem;
  padding-left: 0.35rem;
}

.app-nav-item {
  font-size: 0.62rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.2rem;
}

.app-nav-item.on {
  background: rgba(13, 148, 136, 0.12);
  color: var(--teal, #0d9488);
  font-weight: 600;
}

.app-main {
  padding: 0.85rem;
  position: relative;
}

.app-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text, #0f172a);
  margin-bottom: 0.65rem;
}

.app-mock.phone-frame {
  max-width: 260px;
  margin: 0 auto;
  border-radius: 28px;
  padding: 10px;
  background: #1e293b;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

.app-mock.phone-frame .app-screen {
  border-radius: 20px;
  background: #f8fafc;
  overflow: hidden;
  min-height: 280px;
}

.phone-notch {
  height: 22px;
  background: #f8fafc;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: 4px;
}

.phone-notch span {
  width: 60px;
  height: 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.12);
}

.phone-status {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0.75rem 0;
  font-size: 0.55rem;
  color: var(--text-muted, #64748b);
}

/* UI components inside mock */
.ui-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 600;
  padding: 0.2em 0.55em;
  border-radius: 6px;
  font-family: var(--font-mono, monospace);
}

.ui-badge.pending { background: rgba(217, 119, 6, 0.15); color: #b45309; }
.ui-badge.progress { background: rgba(37, 99, 235, 0.12); color: #1d4ed8; }
.ui-badge.problem { background: rgba(225, 29, 72, 0.12); color: #be123c; }
.ui-badge.done { background: rgba(13, 148, 136, 0.12); color: #0f766e; }

.ui-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.45rem;
  font-size: 0.68rem;
  color: var(--text, #0f172a);
  transition: transform 0.5s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.4s, box-shadow 0.3s;
}

.ui-card.highlight {
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.45), 0 8px 24px rgba(13, 148, 136, 0.15);
}

.ui-card .meta {
  font-size: 0.58rem;
  color: var(--text-muted, #64748b);
  margin-top: 0.25rem;
}

.ui-form {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 0.75rem;
}

.ui-field {
  margin-bottom: 0.5rem;
}

.ui-field label {
  display: block;
  font-size: 0.55rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.2rem;
}

.ui-field .value {
  font-size: 0.68rem;
  color: var(--text, #0f172a);
  padding: 0.35rem 0.5rem;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 6px;
}

.ui-btn-row {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.ui-btn {
  font-size: 0.58rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: none;
}

.ui-btn.primary { background: linear-gradient(135deg, #0d9488, #7c3aed); color: #fff; }
.ui-btn.ghost { background: rgba(15, 23, 42, 0.06); color: var(--text, #0f172a); }
.ui-btn.danger { background: rgba(225, 29, 72, 0.1); color: #be123c; }

.ui-btn.pulse {
  animation: demo-btn-pulse 1.2s ease infinite;
}

@keyframes demo-btn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(13, 148, 136, 0); }
}

.ui-kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.ui-col {
  background: rgba(15, 23, 42, 0.03);
  border-radius: 8px;
  padding: 0.45rem;
  min-height: 140px;
}

.ui-col-title {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.ui-col.drop-target {
  background: rgba(13, 148, 136, 0.08);
  outline: 2px dashed rgba(13, 148, 136, 0.35);
}

.ui-gantt {
  padding: 0.5rem 0;
}

.ui-gantt-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  font-size: 0.58rem;
}

.ui-gantt-row .name { color: var(--text-muted, #64748b); }

.ui-gantt-bar-wrap {
  height: 14px;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.ui-gantt-bar {
  position: absolute;
  top: 2px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0d9488, #7c3aed);
  transition: width 0.8s ease, left 0.8s ease;
}

.ui-gantt-bar.warn { background: linear-gradient(90deg, #d97706, #e11d48); }

.ui-push {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  width: calc(100% - 1.5rem);
  background: rgba(255, 255, 255, 0.97);
  border-radius: 14px;
  padding: 0.65rem 0.75rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(15, 23, 42, 0.08);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.4s;
  z-index: 5;
}

.ui-push.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.ui-push .app { font-size: 0.55rem; color: var(--text-muted, #64748b); }
.ui-push .title { font-size: 0.68rem; font-weight: 700; color: var(--text, #0f172a); margin: 0.15rem 0; }
.ui-push .body { font-size: 0.6rem; color: var(--text-secondary, #334155); }

.ui-history {
  margin-top: 0.5rem;
  border-left: 2px solid rgba(13, 148, 136, 0.25);
  padding-left: 0.65rem;
}

.ui-history-item {
  font-size: 0.58rem;
  color: var(--text-muted, #64748b);
  margin-bottom: 0.35rem;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.4s, transform 0.4s;
}

.ui-history-item.show {
  opacity: 1;
  transform: translateX(0);
}

.ui-photo-grid {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.ui-photo {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: linear-gradient(135deg, #bae6fd, #a7f3d0);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.ui-cursor {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: top 0.6s cubic-bezier(0.34, 1.2, 0.64, 1), left 0.6s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.3s;
}

.ui-cursor.show { opacity: 1; }

.ui-cursor svg { width: 18px; height: 18px; color: var(--text, #0f172a); filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }

.demo-stage > .demo-scenes:not(.is-active) {
  display: none;
}

.demo-stage > .demo-scenes.is-active {
  display: block;
  position: relative;
  min-height: 300px;
}

.demo-scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.demo-scene.is-active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
}

/* Story cards below demo */
.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.story-card {
  padding: 1.25rem;
}

.story-card .story-role {
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--violet, #7c3aed);
  margin-bottom: 0.5rem;
}

.story-card h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.story-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.story-step {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.82rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.03);
  opacity: 0.55;
  transition: opacity 0.3s, background 0.3s;
}

.story-step.is-current {
  opacity: 1;
  background: rgba(13, 148, 136, 0.08);
}

.story-step-num {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(13, 148, 136, 0.15);
  color: var(--teal, #0d9488);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-step.is-current .story-step-num {
  background: var(--teal, #0d9488);
  color: #fff;
}

/* Mobile demo overrides */
.demo-layout.mobile-demo {
  grid-template-columns: 1fr;
}

.demo-tabs.mobile-tabs {
  flex-direction: row;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
}

.demo-tabs.mobile-tabs .demo-tab {
  flex: 0 0 78%;
  scroll-snap-align: start;
}

.demo-tabs.mobile-tabs::-webkit-scrollbar { display: none; }

.demo-stage.mobile-stage {
  min-height: 340px;
  padding: 1rem;
}

.story-grid.mobile-stories {
  grid-template-columns: 1fr;
}

@media (max-width: 900px) {
  .demo-layout:not(.mobile-demo) {
    grid-template-columns: 1fr;
  }

  .demo-tabs:not(.mobile-tabs) {
    flex-direction: row;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .demo-tabs:not(.mobile-tabs) .demo-tab {
    flex: 0 0 240px;
    scroll-snap-align: start;
  }

  .story-grid:not(.mobile-stories) {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-live-dot,
  .ui-btn.pulse { animation: none; }
  .ui-card, .ui-push, .ui-history-item, .ui-cursor, .demo-scene { transition: none; }
}
