/**
 * Copyright (c) 2026 KDTech
 * Author: david@KDTech
 * All rights reserved.
 *
 * KDTechGroup website — product visuals
 *
 * One small looping illustration per product card, CSS and inline SVG only:
 *   Tilefold      a terminal of Blocks with a tile that assembles itself
 *   Social        a photo feed on a phone with hearts floating up
 *   Ensemble      a network of role agents with work flowing along the edges
 *   Personality   four type letters flipping, and a fifth tile still hidden
 * The Trading Bot and Agentic Browser visuals have their own stylesheets.
 * Reduced motion freezes every loop on a readable frame.
 */

/* ---------- Tilefold ---------- */

.v-tf {
  width: min(92%, 440px);
  padding: 16px;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 16px;
  background: #0c0d13;
  box-shadow: var(--shadow-lg);
  font-family: var(--font-mono);
  font-size: 12px;
}

.v-tf .bar {
  display: flex;
  gap: 6px;
  margin-block-end: 14px;
}

.v-tf .bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff5f57;
}

.v-tf .bar i:nth-child(2) {
  background: #febc2e;
}

.v-tf .bar i:nth-child(3) {
  background: #28c840;
}

.v-tf .blk {
  position: relative;
  margin-block-end: 8px;
  padding: 9px 12px;
  padding-inline-start: 18px;
  border: 1px solid rgb(255 255 255 / 0.06);
  border-radius: 9px;
  background: rgb(255 255 255 / 0.03);
  color: #e8eaf4;
  direction: ltr;
  text-align: left;
}

.v-tf .blk::before {
  content: "";
  position: absolute;
  inset-block: 7px;
  left: 6px;
  width: 3px;
  border-radius: 3px;
  background: var(--ok);
}

.v-tf .blk.run::before {
  background: linear-gradient(180deg, #7c5cff, #22d3ee, #f5b451, #7c5cff);
  background-size: 100% 300%;
  animation: shimmer 1.6s linear infinite;
}

.v-tf .blk b {
  color: var(--ok);
  font-weight: 500;
}

@keyframes shimmer {
  to {
    background-position: 0 300%;
  }
}

.v-tf .mark {
  display: grid;
  grid-template-columns: repeat(2, 26px);
  gap: 5px;
  margin: 16px auto 4px;
  width: max-content;
  transform: rotate(-8deg);
}

.v-tf .mark span {
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, #7c5cff, #22d3ee 55%, #f5b451);
  animation: snap 4s var(--ease-spring) infinite;
}

.v-tf .mark span:nth-child(1) {
  --fx: -30px;
  --fy: -20px;
}

.v-tf .mark span:nth-child(2) {
  --fx: 30px;
  --fy: -24px;
  animation-delay: 0.1s;
}

.v-tf .mark span:nth-child(3) {
  --fx: -28px;
  --fy: 26px;
  animation-delay: 0.2s;
}

.v-tf .mark span:nth-child(4) {
  --fx: 32px;
  --fy: 22px;
  animation-delay: 0.3s;
}

@keyframes snap {
  0%,
  8% {
    transform: translate(var(--fx), var(--fy)) rotate(30deg) scale(0.5);
    opacity: 0;
  }
  30%,
  85% {
    transform: none;
    opacity: 1;
  }
  100% {
    transform: translate(var(--fx), var(--fy)) scale(0.5);
    opacity: 0;
  }
}

/* ---------- Social Network ---------- */

.v-social {
  position: relative;
  width: 230px;
  padding: 14px;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 34px;
  background: #111018;
  box-shadow: var(--shadow-lg);
}

.v-social .post {
  padding: 10px;
  border-radius: 20px;
  background: rgb(255 255 255 / 0.04);
}

.v-social .who {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-1);
  font-size: 12px;
  font-weight: 600;
}

.v-social .who i {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f97316, #ec4899);
}

.v-social .photo {
  display: grid;
  place-items: center;
  height: 170px;
  margin-block: 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fdba74, #f472b6);
}

.v-social .photo svg {
  width: 74px;
  height: 74px;
  color: #fff;
  animation: wiggle 3s ease-in-out infinite;
}

@keyframes wiggle {
  50% {
    transform: rotate(-8deg) scale(1.06);
  }
}

.v-social .acts {
  display: flex;
  gap: 12px;
  color: var(--text-2);
  font-size: 12px;
}

.v-social .acts b {
  color: #f472b6;
}

.v-social .ai {
  margin-block-start: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--prism-soft);
  color: var(--text-1);
  font-size: 11.5px;
  line-height: 1.4;
}

.heart {
  position: absolute;
  bottom: 30%;
  width: 22px;
  height: 22px;
  color: #ec4899;
  opacity: 0;
  animation: float-up 3.6s ease-out infinite;
}

.heart:nth-of-type(1) {
  inset-inline-end: -14px;
}

.heart:nth-of-type(2) {
  inset-inline-end: 8px;
  animation-delay: 1.2s;
}

.heart:nth-of-type(3) {
  inset-inline-end: -30px;
  animation-delay: 2.4s;
}

@keyframes float-up {
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-160px) rotate(18deg) scale(1.3);
  }
}

/* ---------- Ensemble ---------- */

.v-ens {
  width: min(96%, 480px);
}

.v-ens .edge {
  stroke: url(#ens-g);
  stroke-width: 1.6;
  stroke-dasharray: 5 9;
  animation: flow 1.6s linear infinite;
}

@keyframes flow {
  to {
    stroke-dashoffset: -28;
  }
}

.v-ens .node {
  animation: pulse 3s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.v-ens .node:nth-of-type(2n) {
  animation-delay: 0.7s;
}

.v-ens .node:nth-of-type(3n) {
  animation-delay: 1.4s;
}

@keyframes pulse {
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 10px rgb(99 102 241 / 0.8));
  }
}

/* ---------- Personality App ---------- */

.v-mbti {
  display: flex;
  gap: 12px;
}

.v-mbti .tile {
  position: relative;
  width: 74px;
  height: 96px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--ink-4), var(--ink-3));
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 600;
}

.v-mbti .tile .reel {
  display: grid;
  animation: flip 6s var(--ease-emph) infinite;
  animation-delay: calc(var(--k) * 0.25s);
}

.v-mbti .tile .reel span {
  display: grid;
  place-items: center;
  height: 96px;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@keyframes flip {
  0%,
  40% {
    transform: translateY(0);
  }
  50%,
  90% {
    transform: translateY(-96px);
  }
  100% {
    transform: translateY(0);
  }
}

.v-mbti .tile.mystery {
  display: grid;
  place-items: center;
  border-style: dashed;
  border-color: rgb(236 72 153 / 0.6);
  color: #f9a8d4;
  animation: glow 2.4s ease-in-out infinite;
}

@keyframes glow {
  50% {
    box-shadow: 0 0 30px rgb(236 72 153 / 0.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .v-tf .mark span {
    opacity: 1;
    transform: none;
  }
}
