/* ===== product-demo.css — animated "RFQ → quote draft" demo card ===== */

.anim-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.anim-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule-soft);
}
.anim-toolbar .mock-brand-logo {
  width: 22px;
  height: 22px;
}
.anim-toolbar .mock-brand {
  font-size: 14px;
  gap: 8px;
}
.anim-step {
  display: flex;
  align-items: center;
  gap: 6px;
}
.anim-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rule);
  transition: background 0.3s ease;
}
.anim-step-dot.on {
  background: var(--accent);
}
.anim-stage {
  position: relative;
  height: 320px;
}
.anim-scene {
  position: absolute;
  inset: 0;
  padding: 22px 22px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease;
  display: flex;
  flex-direction: column;
}
.anim-scene.active {
  opacity: 1;
  visibility: visible;
}
/* Frozen resting state: scene is visible but its animations don't run
   (they key off .active), so it holds still until scrolled into view. */
.anim-scene.preview {
  opacity: 1;
  visibility: visible;
}
.scene-label {
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0;
  color: var(--accent);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.scene-label .loading-dots > span {
  width: 4px;
  height: 4px;
}
.scene-label-done {
  color: #1f8a4f;
}
.scene-check {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Loading dots */
.loading-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.loading-dots > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-mute);
  animation: dot-pulse 1.2s ease-in-out infinite;
}
.loading-dots > span:nth-child(2) {
  animation-delay: 0.15s;
}
.loading-dots > span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes dot-pulse {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.85);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Scene 1: Upload */
.upload-list {
  border: 1px dashed var(--rule);
  border-radius: 2px;
  padding: 4px 14px;
  margin-bottom: 14px;
  background: var(--bg);
  position: relative;
}
.upload-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  pointer-events: none;
}
.upload-placeholder svg {
  width: 14px;
  height: 14px;
  stroke: var(--ink-mute);
}
.scene-upload.active .upload-placeholder {
  animation: placeholder-out 0.3s ease-out 2.25s forwards;
}
@keyframes placeholder-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
.upload-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule-soft);
  opacity: 0;
}
.upload-file:last-child {
  border-bottom: none;
}
.scene-upload.active .upload-file {
  animation: row-in 0.35s ease-out forwards;
}
.scene-upload.active .upload-file:nth-child(2) {
  animation-delay: 2.45s;
}
.scene-upload.active .upload-file:nth-child(3) {
  animation-delay: 2.7s;
}
.scene-upload.active .upload-file:nth-child(4) {
  animation-delay: 2.95s;
}
.upload-file-icon {
  width: 18px;
  height: 22px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
  position: relative;
  flex-shrink: 0;
}
.upload-file-icon::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 3px;
  right: 3px;
  height: 1px;
  background: var(--rule);
  box-shadow:
    0 3px 0 var(--rule),
    0 6px 0 var(--rule);
}
.upload-file-meta {
  flex: 1;
  min-width: 0;
}
.upload-file-name {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 1px;
}
.upload-file-kind {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.upload-file-status {
  width: 14px;
  height: 14px;
  color: #1f8a4f;
  flex-shrink: 0;
}
.upload-progress {
  height: 4px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
  opacity: 0;
}
.scene-upload.active .upload-progress {
  animation: status-fade-in 0.4s ease-out 2.4s forwards;
}
.upload-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0;
  border-radius: 999px;
}
.scene-upload.active .upload-progress-bar {
  animation: progress 3s ease-out 3s forwards;
}
@keyframes progress {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}
.upload-status {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
}
.scene-upload.active .upload-status {
  animation: status-fade-in 0.4s ease-out 2.4s forwards;
}
@keyframes status-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Cursor drag-and-drop intro */
.anim-cursor-group {
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
}
.scene-upload.active .anim-cursor-group {
  animation: cursor-drop 1.8s ease-out 1s forwards;
}
@keyframes cursor-drop {
  0% {
    opacity: 0;
    transform: translate(40px, -28px);
  }
  20% {
    opacity: 1;
  }
  58% {
    opacity: 1;
    transform: translate(-200px, 100px);
  }
  72% {
    opacity: 1;
    transform: translate(-200px, 100px) scale(0.86);
  }
  82% {
    opacity: 1;
    transform: translate(-200px, 100px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-200px, 100px);
  }
}
.anim-cursor {
  position: absolute;
  width: 18px;
  height: 18px;
  top: 0;
  left: 0;
  filter: drop-shadow(0 2px 4px rgba(20, 22, 28, 0.3));
}
.anim-drag-file {
  position: absolute;
  top: 8px;
  left: 10px;
  width: 30px;
  height: 36px;
  opacity: 0;
  filter: drop-shadow(0 6px 14px rgba(20, 22, 28, 0.22));
}
.drag-sheet {
  position: absolute;
  width: 22px;
  height: 28px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.drag-sheet-back {
  top: 6px;
  left: 6px;
}
.drag-sheet-mid {
  top: 3px;
  left: 3px;
}
.drag-sheet-front {
  top: 0;
  left: 0;
}
.drag-sheet-front::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 4px;
  right: 4px;
  height: 1px;
  background: var(--rule);
  box-shadow:
    0 3px 0 var(--rule),
    0 6px 0 var(--rule),
    0 9px 0 var(--rule);
}
.scene-upload.active .anim-drag-file {
  animation: drag-file-fade 1.8s ease-out 1s forwards;
}
@keyframes drag-file-fade {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  10% {
    opacity: 0.96;
    transform: scale(1);
  }
  62% {
    opacity: 0.96;
    transform: scale(1);
  }
  72% {
    opacity: 0;
    transform: scale(1.18);
  }
  100% {
    opacity: 0;
  }
}

/* Scene label crossfade: "Upload RFQ" → "Uploading RFQ package" */
.scene-label-wrap {
  display: grid;
  margin-bottom: 16px;
}
.scene-label-wrap .scene-label {
  grid-area: 1 / 1;
  margin-bottom: 0;
}
.scene-label-instruct {
  opacity: 1;
}
.scene-label-active {
  opacity: 0;
}
.scene-upload.active .scene-label-instruct {
  animation: label-fade-out 0.3s ease 2.2s forwards;
}
.scene-upload.active .scene-label-active {
  animation: label-fade-in 0.3s ease 2.3s forwards;
}
@keyframes label-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes label-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Drop zone flashes when files land */
.scene-upload.active .upload-list {
  animation: drop-flash 0.55s ease-out 2.3s;
}
@keyframes drop-flash {
  0%,
  100% {
    border-color: var(--rule);
    background: var(--bg);
  }
  35% {
    border-color: var(--accent);
    background: rgba(31, 78, 138, 0.06);
  }
}
.scene-progress {
  height: 4px;
  background: var(--bg-alt);
  border-radius: 999px;
  overflow: hidden;
  margin-top: auto;
}
.scene-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0;
  border-radius: 999px;
}
.scene-projects.active .scene-progress-bar {
  animation: progress 3.8s ease-out forwards;
}
.scene-costs.active .scene-progress-bar {
  animation: progress 3.3s ease-out forwards;
}

/* Card-level slide progress */
.anim-progress {
  height: 3px;
  background: var(--bg-alt);
  overflow: hidden;
  border-top: 1px solid var(--rule-soft);
}
.anim-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
}

/* Scene 2: Heritage table */
.heritage-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.01em;
  table-layout: fixed;
}
.heritage-table thead th {
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
  letter-spacing: 0;
  padding: 4px 6px 9px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.heritage-table thead th:first-child {
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  font-weight: 500;
  width: 78px;
}
.heritage-table tbody th {
  text-align: left;
  font-family: "JetBrains Mono", monospace;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  color: var(--ink-mute);
  padding: 9px 6px;
  border-bottom: 1px solid var(--rule-soft);
  white-space: nowrap;
  vertical-align: middle;
}
.heritage-table tbody td {
  padding: 9px 6px;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-soft);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.heritage-table tbody tr:last-child th,
.heritage-table tbody tr:last-child td {
  border-bottom: none;
}
.heritage-table tbody tr {
  opacity: 0;
}
.scene-projects.active .heritage-table tbody tr {
  animation: row-in 0.35s ease-out forwards;
}
.scene-projects.active .heritage-table tbody tr:nth-child(1) {
  animation-delay: 0.1s;
}
.scene-projects.active .heritage-table tbody tr:nth-child(2) {
  animation-delay: 0.8s;
}
.scene-projects.active .heritage-table tbody tr:nth-child(3) {
  animation-delay: 1.6s;
}
.scene-projects.active .heritage-table tbody tr:nth-child(4) {
  animation-delay: 2.4s;
}
.scene-projects.active .heritage-table tbody tr:nth-child(5) {
  animation-delay: 3.2s;
}
@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.mark {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: 1px;
  background: var(--rule);
}
.mark.ok {
  background: #1f8a4f;
}
.mark.warn {
  background: #d4a017;
}
.mark.fail {
  background: #b43c3c;
}

/* Scene 3: Costs */
.cost-list {
  display: flex;
  flex-direction: column;
}
.cost-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 13px;
  color: var(--ink-soft);
  opacity: 0;
}
.scene-costs.active .cost-row {
  animation: row-in 0.4s ease-out forwards;
}
.scene-costs.active .cost-row:nth-child(1) {
  animation-delay: 0.1s;
}
.scene-costs.active .cost-row:nth-child(2) {
  animation-delay: 0.9s;
}
.scene-costs.active .cost-row:nth-child(3) {
  animation-delay: 1.8s;
}
.scene-costs.active .cost-row:nth-child(4) {
  animation-delay: 2.7s;
}
.cost-row .cost-src {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--ink-mute);
  margin-left: 8px;
}
.cost-row strong {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}

/* Scene 4: Draft */
.draft-summary {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 4px 14px;
  margin-bottom: 12px;
}
.draft-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  font-size: 13px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule-soft);
}
.draft-row:last-child {
  border-bottom: none;
}
.draft-row strong {
  color: var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 500;
}
.draft-row.total strong {
  color: var(--accent);
  font-size: 13px;
}
.draft-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: auto;
}
.draft-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 2px;
  font-size: 12px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  pointer-events: none;
  white-space: nowrap;
}
.draft-btn.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.draft-btn-icon {
  width: 14px;
  height: 14px;
}

@media (max-width: 800px) {
  .anim-stage {
    height: 330px;
  }
  .anim-scene {
    padding: 18px 18px 24px;
  }
  .draft-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .draft-btn {
    justify-content: center;
  }
  .draft-row {
    padding: 6px 0;
  }
  .draft-summary {
    margin-bottom: 10px;
  }
  @keyframes cursor-drop {
    0% {
      opacity: 0;
      transform: translate(30px, -24px);
    }
    20% {
      opacity: 1;
    }
    58% {
      opacity: 1;
      transform: translate(-140px, 90px);
    }
    72% {
      opacity: 1;
      transform: translate(-140px, 90px) scale(0.86);
    }
    82% {
      opacity: 1;
      transform: translate(-140px, 90px) scale(1);
    }
    100% {
      opacity: 0;
      transform: translate(-140px, 90px);
    }
  }
}
