/* ============================================================================
   Animated demo-tile styles — CSS for the 6 product mocks
   ============================================================================ */

.demo-stage {
  position: absolute; inset: 0;
  color: #fff;
  font-family: var(--font-sans);
  overflow: hidden;
}

/* Shared chrome */
.dm-chrome {
  height: 30px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dm-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.2); }
.dm-dot.r { background: #EF4444; } .dm-dot.y { background: #F59E0B; } .dm-dot.g { background: #02E3A7; }
.dm-url {
  flex: 1; text-align: center;
  font: 500 10px var(--font-mono);
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.02em;
}

/* ── Dashboard mock ──────────────────────────────────────────────────── */
.demo-dashboard .dm-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.demo-dashboard .dm-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.demo-dashboard .dm-kpi {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
}
.demo-dashboard .dm-kpi .k {
  font: 600 8px var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.5); margin-bottom: 4px;
}
.demo-dashboard .dm-kpi .v {
  font: 700 22px var(--font-heading); letter-spacing: -0.02em; line-height: 1;
}
.demo-dashboard .dm-kpi .v.grad {
  background: var(--brand-gradient);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.demo-dashboard .dm-kpi .spark {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 20px;
  background: no-repeat center / 100% 100%;
  opacity: 0.6;
}
.demo-dashboard .spark.s1 { background-image: linear-gradient(90deg, transparent, rgba(2,227,167,0.5)); clip-path: polygon(0% 80%, 20% 60%, 40% 70%, 60% 40%, 80% 30%, 100% 20%, 100% 100%, 0% 100%); }
.demo-dashboard .spark.s2 { background: linear-gradient(90deg, transparent, rgba(245,158,11,0.35)); clip-path: polygon(0% 40%, 20% 50%, 40% 30%, 60% 50%, 80% 40%, 100% 60%, 100% 100%, 0% 100%); }
.demo-dashboard .spark.s3 { background: linear-gradient(90deg, transparent, rgba(2,227,167,0.5)); clip-path: polygon(0% 30%, 20% 50%, 40% 40%, 60% 60%, 80% 70%, 100% 80%, 100% 100%, 0% 100%); }
.demo-dashboard .dm-chart {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  height: 90px; padding: 10px;
}
.dm-line { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 3s ease-out forwards infinite alternate; }
.dm-area { opacity: 0; animation: fade-in-area 2s ease-out 0.8s forwards infinite alternate; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade-in-area { to { opacity: 1; } }

/* ── AI Chat mock ────────────────────────────────────────────────────── */
.demo-ai {
  background: linear-gradient(180deg, #0A1425 0%, #091122 100%);
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.demo-ai .ai-head { display: flex; align-items: center; gap: 10px; }
.demo-ai .ai-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-gradient);
  display: inline-flex; align-items: center; justify-content: center;
  font: 800 11px var(--font-heading); color: #fff;
  box-shadow: 0 4px 12px -2px rgba(2,227,167,0.4);
}
.demo-ai .ai-title { font: 700 13px var(--font-heading); }
.demo-ai .ai-sub {
  font: 500 10px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.demo-ai .ai-msgs { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.demo-ai .ai-msg {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12px; line-height: 1.4;
  max-width: 82%;
  animation: slide-up 400ms ease-out both;
}
.demo-ai .ai-msg.user {
  align-self: flex-end;
  background: var(--brand-gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
  animation-delay: 0.2s;
}
.demo-ai .ai-msg.bot {
  align-self: flex-start;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom-left-radius: 4px;
  animation-delay: 1s;
}
.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.5);
  animation: type-bounce 1.2s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes type-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 1; }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Credits mock ─────────────────────────────────────────────────────── */
.demo-credits { padding: 14px 16px; }
.demo-credits .cr-head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 12px;
}
.demo-credits .cr-title { font: 700 12px var(--font-heading); }
.demo-credits .cr-pill {
  padding: 3px 8px; border-radius: 999px;
  background: rgba(2,227,167,0.15); color: var(--primary);
  font: 600 9px var(--font-mono); letter-spacing: 0.08em;
}
.demo-credits .cr-list { display: flex; flex-direction: column; gap: 10px; }
.demo-credits .cr-row {
  display: grid;
  grid-template-columns: 40px 1fr 60px 60px;
  align-items: center; gap: 10px;
  font-size: 11px;
  opacity: 0;
  animation: slide-up 500ms ease-out both;
}
.demo-credits .cr-id { font: 700 10px var(--font-mono); color: rgba(255,255,255,0.5); }
.demo-credits .cr-name { font-weight: 600; color: rgba(255,255,255,0.9); }
.demo-credits .cr-bar {
  height: 6px; border-radius: 3px;
  background: rgba(255,255,255,0.08);
  position: relative; overflow: hidden;
}
.demo-credits .cr-bar span {
  display: block; height: 100%; border-radius: 3px;
  animation: fill-bar 1.4s ease-out both;
  transform-origin: left;
}
.demo-credits .cr-bar.on span { background: var(--primary); }
.demo-credits .cr-bar.behind span { background: #F59E0B; }
.demo-credits .cr-bar.risk span { background: #EF4444; }
.demo-credits .cr-status {
  font: 600 9px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  text-align: right;
}
.demo-credits .cr-status.on { color: var(--primary); }
.demo-credits .cr-status.behind { color: #F59E0B; }
.demo-credits .cr-status.risk { color: #EF4444; }
@keyframes fill-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ── Docs/Evidence mock ──────────────────────────────────────────────── */
.demo-docs { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.demo-docs .dc-head {
  display: flex; justify-content: space-between;
  font: 700 12px var(--font-heading);
}
.demo-docs .dc-count { font: 500 10px var(--font-mono); color: rgba(255,255,255,0.5); }
.demo-docs .dc-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  flex: 1;
}
.demo-docs .dc-tile {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
  opacity: 0;
  animation: slide-up 400ms ease-out both;
}
.demo-docs .dc-ic {
  color: var(--primary);
  width: 22px; height: 22px;
  border-radius: 5px;
  background: rgba(2,227,167,0.15);
  display: inline-flex; align-items: center; justify-content: center;
}
.demo-docs .dc-lines { display: flex; flex-direction: column; gap: 3px; }
.demo-docs .dc-lines span {
  height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.15);
}
.demo-docs .dc-scan {
  position: absolute; left: 16px; right: 16px; bottom: 16px;
  height: 2px; border-radius: 2px;
  overflow: hidden;
}
.demo-docs .dc-scan span {
  display: block; width: 30%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: scan-slide 2.4s ease-in-out infinite;
}
@keyframes scan-slide {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(320%); }
  100% { transform: translateX(-100%); }
}

/* ── Map mock ────────────────────────────────────────────────────────── */
.demo-map {
  background: #091122;
}
.mp-pin {
  animation: pin-pop 400ms ease-out both;
}
.mp-pin circle:nth-child(1) {
  animation: pulse-ring 2.5s ease-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
@keyframes pin-pop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(2.2); opacity: 0; }
}
.mp-chip {
  position: absolute; bottom: 14px; left: 14px;
  background: rgba(11,19,34,0.85);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 6px 10px;
  border-radius: 8px;
  font: 500 10px var(--font-mono);
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
}

/* ── Report mock ─────────────────────────────────────────────────────── */
.demo-report {
  background: linear-gradient(180deg, #0A1425 0%, #050B1A 100%);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 26px 20px 0;
}
.rp-pages {
  display: flex; align-items: flex-end; gap: -30px;
  perspective: 800px;
  position: relative;
  margin-bottom: -10px;
}
.rp-page {
  width: 110px; height: 150px;
  background: #fff;
  border-radius: 6px 6px 0 0;
  padding: 12px 10px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
  animation: rp-float 4s ease-in-out infinite;
}
.rp-page.p1 { transform: translateY(20px) rotate(-4deg); z-index: 1; animation-delay: 0s; }
.rp-page.p2 { transform: translateY(0) rotate(0deg); z-index: 3; animation-delay: 0.3s; margin: 0 -18px; }
.rp-page.p3 { transform: translateY(20px) rotate(4deg); z-index: 1; animation-delay: 0.6s; }
@keyframes rp-float {
  0%, 100% { transform: translateY(20px) rotate(-4deg); }
  50% { transform: translateY(10px) rotate(-4deg); }
}
.rp-page.p2 { animation-name: rp-float-mid; }
@keyframes rp-float-mid {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(0deg); }
}
.rp-page.p3 { animation-name: rp-float-r; }
@keyframes rp-float-r {
  0%, 100% { transform: translateY(20px) rotate(4deg); }
  50% { transform: translateY(10px) rotate(4deg); }
}
.rp-head {
  height: 20px; border-radius: 3px;
  background: linear-gradient(90deg, #2563EB, #02E3A7);
}
.rp-row {
  height: 4px; border-radius: 2px;
  background: rgba(15,23,42,0.15);
}
.rp-row.short { width: 60%; }
.rp-chart {
  margin-top: auto;
  height: 40px; border-radius: 4px;
  background: linear-gradient(135deg, rgba(37,99,235,0.15), rgba(2,227,167,0.15));
  position: relative;
}
.rp-chart::after {
  content: ''; position: absolute; inset: 8px;
  background:
    linear-gradient(to top, rgba(2,227,167,0.8) 2px, transparent 2px) no-repeat bottom / 20% 40%,
    linear-gradient(to top, rgba(37,99,235,0.6) 2px, transparent 2px) no-repeat 25% bottom / 20% 60%,
    linear-gradient(to top, rgba(2,227,167,0.8) 2px, transparent 2px) no-repeat 50% bottom / 20% 80%,
    linear-gradient(to top, rgba(37,99,235,0.6) 2px, transparent 2px) no-repeat 75% bottom / 20% 50%;
}
.rp-img {
  margin-top: auto;
  height: 60px; border-radius: 4px;
  background:
    linear-gradient(135deg, #1E3A8A 0%, #065F46 100%);
  position: relative; overflow: hidden;
}
.rp-img::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 8px 8px;
}
.rp-pdf-badge {
  position: absolute; top: 14px; right: 14px;
  font: 600 10px var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--primary);
  padding: 5px 10px;
  background: rgba(2,227,167,0.12);
  border: 1px solid rgba(2,227,167,0.25);
  border-radius: 999px;
  animation: glow-pulse 2.5s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(2,227,167,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(2,227,167,0); }
}

/* Respect motion off */
body.motion-off .demo-stage *,
body.motion-off .dm-line,
body.motion-off .dm-area,
body.motion-off .rp-page,
body.motion-off .rp-pdf-badge,
body.motion-off .mp-pin,
body.motion-off .mp-pin circle {
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .demo-stage *, .dm-line, .dm-area, .rp-page, .rp-pdf-badge, .mp-pin circle { animation: none !important; }
  .dm-line { stroke-dashoffset: 0; }
  .dm-area { opacity: 1; }
}
