/* Supply-chain circle — Figma 6253:12571 (1288x1288 board, 11 steps around the GoTrace core).
   Desktop: every size is expressed in board units (--u = 1/1288 of the board width) so the
   whole composition scales as one piece. <=1024px: board becomes a normal stacked layout. */

.sc-board {
  --u: calc(100cqw / 1288);
  container-type: inline-size;
  position: relative;
  width: 100%;
  max-width: 1288px;
  margin: 0 auto;
  border-radius: 40px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 50%, #f0fdfa 100%);
  box-shadow: 0 2px 4px rgba(16, 24, 40, 0.06), 0 4px 8px rgba(16, 24, 40, 0.1);
  overflow: hidden;
}

.sc-board__canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
}

/* Đông Sơn drum motif, 15% (Figma Frame 57: 1240 square inset 24 on the 1288 board) */
.sc-board__drum {
  position: absolute;
  left: calc(24 * var(--u));
  top: calc(24 * var(--u));
  width: calc(1240 * var(--u));
  height: calc(1240 * var(--u));
  opacity: 0.15;
  pointer-events: none;
}

.sc-board__rings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  overflow: visible;
  z-index: 1;
}

.sc-board__rings .sc-board__orbit {
  stroke: #88b0f9;
  stroke-width: 2;
  stroke-dasharray: 8 8;
  opacity: 0.7;
}

/* Motion guides for the data dots; the dashed orbit above is what people see */
.sc-track {
  stroke: none;
}

/* —— Core: blurred halo + gradient disc + logo —— */
.sc-core {
  position: absolute;
  left: calc(435 * var(--u));
  top: calc(435 * var(--u));
  width: calc(418 * var(--u));
  height: calc(418 * var(--u));
  z-index: 1;
}

.sc-core__glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #2062ff;
  opacity: 0.2;
  filter: blur(calc(32 * var(--u)));
  animation: sc-core-pulse 2.8s ease-in-out infinite;
}

@keyframes sc-core-pulse {
  0%, 100% { transform: scale(0.94); opacity: 0.16; }
  50% { transform: scale(1.04); opacity: 0.28; }
}

.sc-core__disc {
  position: absolute;
  inset: calc(33 * var(--u));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(6 * var(--u));
  border-radius: 50%;
  background: linear-gradient(180deg, #0f3e9d 0%, #3676f5 100%);
  color: #fff;
  text-align: center;
}

/* White GoTrace lockup, 200x188 (Figma "Logo company") */
.sc-core__disc img {
  width: calc(200 * var(--u));
  height: auto;
}

/* —— Value chips around the core —— */
.sc-values {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sc-value {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
  height: calc(48 * var(--u));
  padding: 0 calc(16 * var(--u));
  border: 1px solid #88b0f9;
  border-radius: calc(12 * var(--u));
  background: #fff;
  box-shadow: 0 4px 6px -2px rgba(16, 24, 40, 0.03), 0 12px 16px -4px rgba(16, 24, 40, 0.08);
  color: var(--c);
  font-size: calc(16 * var(--u));
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  z-index: 2;
}

.sc-value i {
  width: calc(24 * var(--u));
  font-size: calc(17 * var(--u));
  text-align: center;
}

/* —— Step cards —— */
.sc-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sc-card {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(240 * var(--u));
  display: flex;
  flex-direction: column;
  gap: calc(8 * var(--u));
  padding: calc(8 * var(--u));
  border: 1px solid #e4e7ec;
  border-radius: calc(16 * var(--u));
  background: #fff;
  z-index: 2;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.45s ease;
}

/* Step lit by the arriving data packet */
.sc-card.is-active {
  border-color: #2062ff;
  box-shadow: 0 0 0 4px rgba(32, 98, 255, 0.16), 0 0 28px 2px rgba(69, 182, 255, 0.45), 0 16px 32px -8px rgba(32, 98, 255, 0.3);
  transform: translateY(calc(-6 * var(--u)));
  z-index: 3;
}

.sc-card.is-active .sc-card__media img {
  filter: brightness(1.08) saturate(1.1);
}

.sc-card.is-active .sc-card__badge {
  animation: sc-badge-ping 0.6s ease-out;
}

@keyframes sc-badge-ping {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.9); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
}

.sc-card .sc-card__media img {
  transition: filter 0.4s ease;
}

.sc-card__media {
  position: relative;
  margin: 0;
  aspect-ratio: 224 / 96;
  border-radius: calc(8 * var(--u));
  overflow: hidden;
  background: #f2f4f7;
}

.sc-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sc-card__badge {
  position: absolute;
  left: calc(8 * var(--u));
  top: calc(8 * var(--u));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: calc(24 * var(--u));
  height: calc(24 * var(--u));
  border-radius: calc(4 * var(--u));
  background: var(--badge);
  color: #fff;
  font-size: calc(12 * var(--u));
  font-weight: 600;
  line-height: 1;
}

.sc-card h3 {
  margin: 0;
  padding: 0 calc(4 * var(--u));
  color: #000;
  font-size: calc(16 * var(--u));
  font-weight: 500;
  line-height: 1.5;
}

.sc-card p {
  margin: 0;
  padding: 0 calc(4 * var(--u)) calc(4 * var(--u));
  color: #344054;
  font-size: calc(14 * var(--u));
  line-height: 1.43;
}

/* Reveal before the loop starts (JS adds .is-ready; without JS everything is visible) */
.sc-board.is-armed .sc-card,
.sc-board.is-armed .sc-value {
  opacity: 0;
  transform: translateY(calc(16 * var(--u)));
}

.sc-board.is-ready .sc-card,
.sc-board.is-ready .sc-value {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease var(--d, 0ms), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0ms), border-color 0.3s ease, box-shadow 0.45s ease;
}

.sc-board.is-ready .sc-card.is-active {
  transform: translateY(calc(-6 * var(--u)));
}

/* —— Tablet / mobile: stacked layout —— */
@media (max-width: 1024px) {
  .sc-board {
    --u: 1px;
    container-type: normal;
    padding: 24px 16px;
    border-radius: 24px;
  }

  .sc-board__canvas {
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
  }

  .sc-board__rings,
  .sc-board__drum {
    display: none;
  }

  .sc-core {
    position: relative;
    left: auto;
    top: auto;
    width: 260px;
    height: 260px;
    order: 1;
  }

  .sc-core__disc {
    inset: 20px;
  }

  .sc-core__disc img {
    width: 150px;
  }

  .sc-values {
    order: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }

  .sc-value {
    position: static;
    height: 40px;
    font-size: 14px;
  }

  .sc-steps {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
  }

  .sc-card {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
  }
}

@media (max-width: 480px) {
  .sc-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .sc-card {
    padding: 6px;
    border-radius: 12px;
  }

  .sc-card h3 {
    font-size: 14px;
  }

  .sc-card p {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sc-core__glow,
  .sc-card.is-active .sc-card__badge {
    animation: none;
  }

  .sc-card {
    transition: none;
  }
}
