/* HUMAN FORCE — 3D storyline & hero motion scene.
   Layers on top of the compiled bundle. No image assets required. */

/* ---------------------------------------------------------------- *
 * 1. Hero: the talent network scene
 * ---------------------------------------------------------------- */
.hero-visual .talent-scene {
  position: absolute;
  inset: 26px -8px 8px -18px;
  perspective: 900px;
  border-radius: 50%;
  transform:
    translate3d(var(--px, 0px), var(--py, 0px), 0)
    rotate(-5deg) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) rotateZ(var(--rz, 0deg));
  background:
    radial-gradient(120% 90% at 28% 18%, #fbfcf7 0%, #eaf0e6 46%, #d8e4c6 100%);
  overflow: hidden;
  will-change: transform;
}

/* Scene members glide against the pointer for depth. */
.hero-visual .orbit-text,
.hero-visual .top-card,
.hero-visual .bottom-card {
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  will-change: transform;
}

.talent-scene .scene-glow {
  position: absolute;
  inset: auto -20% -35% -20%;
  height: 70%;
  background: radial-gradient(60% 100% at 50% 100%, rgba(212, 239, 121, 0.95), transparent 70%);
  filter: blur(6px);
  pointer-events: none;
}

/* Spokes: every specialism connects back to the same bench of people. */
.talent-scene .spokes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.talent-scene .spokes path {
  fill: none;
  stroke: rgba(22, 59, 49, 0.3);
  stroke-width: 2;
  stroke-dasharray: 5 8;
  animation: hfs-flow 3.4s linear infinite;
}
.talent-scene .spokes path.is-lime {
  stroke: var(--lime);
  stroke-width: 4;
  animation-duration: 2.6s;
}

.talent-scene .hub {
  position: absolute;
  left: 50%;
  top: 47%;
  width: 96px;
  height: 96px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(160deg, #1c4639, var(--green));
  color: var(--lime);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 20px 40px rgba(21, 54, 44, 0.28);
}
.talent-scene .hub::before,
.talent-scene .hub::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px solid rgba(22, 59, 49, 0.3);
  animation: hfs-hub 4.2s ease-out infinite;
}
.talent-scene .hub::after { animation-delay: -2.1s; }

.talent-scene .node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 253, 246, 0.95);
  box-shadow: 0 14px 30px rgba(21, 54, 44, 0.15);
  color: var(--green);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  animation: hfs-bob 3.8s ease-in-out infinite;
}
.talent-scene .node svg { flex-shrink: 0; color: #6f8f38; }
.talent-scene .node-1 { top: 22%; left: 14%; }
.talent-scene .node-2 { top: 24%; right: 12%; animation-delay: -0.9s; }
.talent-scene .node-3 { bottom: 30%; left: 12%; animation-delay: -1.8s; }
.talent-scene .node-4 { bottom: 30%; right: 12%; animation-delay: -2.7s; }

.talent-scene .badge {
  position: absolute;
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 253, 246, 0.94);
  box-shadow: 0 16px 36px rgba(21, 54, 44, 0.14);
}
.talent-scene .badge-check {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--green);
}
.talent-scene .badge strong { display: block; font-size: 13px; }
.talent-scene .badge small { display: block; margin-top: 3px; font-size: 11px; color: #737c70; }

/* ---------------------------------------------------------------- *
 * 2. Services: 3D scroll storyline
 * ---------------------------------------------------------------- */
.story-track {
  position: relative;
  height: 320vh;
}

.story-sticky {
  position: sticky;
  top: 96px;
  height: min(78vh, 700px);
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 38px;
  align-items: stretch;
}

.story-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.story-copy-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.story-rail {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.story-rail span {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: #dfe5dc;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.story-rail span.is-on {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(212, 239, 121, 0.55);
}

.story-eyebrow {
  letter-spacing: 1.7px;
  font-size: 11px;
  font-weight: 600;
  color: #74806c;
}
.story-title {
  letter-spacing: -1.6px;
  font-size: clamp(30px, 2.6vw, 44px);
  line-height: 1.05;
}
.story-text {
  color: #667067;
  font-size: 16px;
  line-height: 1.8;
  max-width: 44ch;
}
.story-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
  padding: 14px 20px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #f8fbf1;
  font-size: 14px;
  font-weight: 500;
}
.story-link:hover { transform: translateY(-2px); }
.story-link svg { flex-shrink: 0; }

.story-stage {
  position: relative;
  perspective: 1400px;
  perspective-origin: 50% 45%;
  transform-style: preserve-3d;
  min-width: 0;
}

.story-ring {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  --active: 0;
  transform:
    translate3d(var(--px, 0px), var(--py, 0px), 0)
    rotateX(var(--rx, 6deg))
    rotateY(var(--ry, 0deg));
  will-change: transform;
}

.story-ring .story-scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  inset: 12px 6px;
  opacity: 0;
  visibility: hidden;
  --d: calc(var(--i) - var(--active, 0));
  transform:
    translate3d(0, calc(var(--d) * 46%), calc(var(--d) * -320px))
    rotateY(calc(var(--d) * -26deg))
    rotateX(-4deg);
  transition: opacity 0.55s ease, transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.55s;
}
.story-ring .story-scene.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.55s ease, transform 0.7s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

/* Storyline depth: scenes are positioned relative to the current step. */
.story-ring .story-scene:nth-child(1) { --i: 0; }
.story-ring .story-scene:nth-child(2) { --i: 1; }
.story-ring .story-scene:nth-child(3) { --i: 2; }
.story-ring .story-scene:nth-child(n + 4) { --i: 3; }

.story-panel {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: 30px;
  border-radius: 22px;
  border: 1px solid #dfe5d9;
  background: linear-gradient(160deg, #f2f4eb 0%, #e8eddc 100%);
  box-shadow: 0 30px 70px rgba(21, 54, 44, 0.14);
  overflow: hidden;
}
.story-ring .story-scene.is-active .story-panel { display: flex; }
/* Continuous roll: a scene is shown whenever it is near the current
   position, so neighbours cross-fade instead of snapping. */
.story-ring .story-scene.is-near .story-panel { display: flex; }
.story-panel::after {
  content: "✳";
  position: absolute;
  top: -18px;
  right: 8px;
  font-size: 110px;
  line-height: 1;
  color: rgba(183, 213, 119, 0.5);
  pointer-events: none;
}

.story-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.story-top svg { color: var(--green); }
.story-top span { opacity: 0.5; font-size: 13px; letter-spacing: 1px; }

.story-panel h3 {
  margin: 12px 0 10px;
  font-size: clamp(24px, 2vw, 30px);
  letter-spacing: -1px;
}
.story-panel > p {
  opacity: 0.78;
  font-size: 15px;
  line-height: 1.8;
}

.story-art {
  position: relative;
  flex: 1;
  min-height: 132px;
  margin-top: 22px;
  border-radius: 16px;
  overflow: hidden;
  transform-style: preserve-3d;
}
.story-art .glow {
  position: absolute;
  inset: -30% -10% -45%;
  background: radial-gradient(40% 60% at 30% 60%, rgba(212, 239, 121, 0.85), transparent 70%);
  animation: hfs-bob 5s ease-in-out infinite;
}
.story-art .grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(22, 59, 49, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 59, 49, 0.13) 1px, transparent 1px);
  background-size: 34px 34px;
  transform: rotateX(58deg) translateZ(-26px);
  transform-origin: center bottom;
  animation: hfs-grid 2.6s linear infinite;
}

.story-panel .service-impact {
  margin: 20px 0 0;
  padding: 0;
}

.story-panel .service-impact li {
  list-style: none;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  line-height: 1.6;
  color: #4f5d52;
}
.story-panel .service-impact li + li { margin-top: 7px; }
.story-panel .service-impact svg { color: #6f8f38; margin-top: 3px; }

.story-panel .motion-line {
  position: absolute;
  left: 30px;
  right: 30px;
  bottom: 18px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--lime), rgba(212, 239, 121, 0));
  animation: hfs-scan 3.2s ease-in-out infinite;
}

/* accent variants reusing the existing palette */
.story-scene-1 .story-panel { background: linear-gradient(160deg, #eef2e4 0%, #e0e8d0 100%); }
.story-scene-2 .story-panel {
  background: linear-gradient(160deg, #1c4639 0%, var(--green) 100%);
  color: #f8fbf1;
  border-color: var(--green);
}
.story-scene-2 .story-panel h3,
.story-scene-2 .story-panel > p,
.story-scene-2 .story-panel .service-impact li { color: #f8fbf1; }
.story-scene-2 .story-panel > p { opacity: 0.82; }
.story-scene-2 .story-top svg,
.story-scene-2 .story-panel .service-impact svg { color: var(--lime); }
.story-scene-2 .story-art .grid {
  background-image:
    linear-gradient(rgba(248, 251, 241, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(248, 251, 241, 0.16) 1px, transparent 1px);
}

/* ---------------------------------------------------------------- *
 * 3. Keyframes
 * ---------------------------------------------------------------- */
@keyframes hfs-flow {
  to { stroke-dashoffset: -52; }
}
@keyframes hfs-hub {
  0% { transform: scale(0.82); opacity: 0.85; }
  100% { transform: scale(1.35); opacity: 0; }
}
@keyframes hfs-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}
@keyframes hfs-grid {
  to { background-position: 0 34px; }
}
@keyframes hfs-scan {
  0%, 100% { transform: scaleX(0.35); opacity: 0.6; transform-origin: left center; }
  50% { transform: scaleX(1); opacity: 1; transform-origin: left center; }
}

/* ---------------------------------------------------------------- *
 * 4. Responsive
 * ---------------------------------------------------------------- */
@media (max-width: 1023px) {
  .story-track { height: auto; }
  .story-sticky {
    position: static;
    height: auto;
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .story-stage { display: none; }
  .story-copy { gap: 26px; }
}

@media (max-width: 767px) {
  .hero-visual .talent-scene { inset: 18px 0 0; border-radius: 42px; }
  .talent-scene .badge { bottom: 8%; padding: 8px 11px; max-width: 88%; }
  .talent-scene .badge strong { font-size: 12px; }
  .talent-scene .badge small { font-size: 10px; }
  .talent-scene .node { font-size: 11px; padding: 6px 10px; }
  .talent-scene .hub { width: 78px; height: 78px; font-size: 18px; }
}

/* No transform support: show every scene as a normal stacked card. */
html:not(.hfs-3d) .story-ring .story-scene {
  position: relative;
  inset: auto;
  opacity: 1;
  visibility: visible;
  transform: none;
}
html:not(.hfs-3d) .story-ring { position: static; }
html:not(.hfs-3d) .story-stage { display: block; perspective: none; }
html:not(.hfs-3d) .story-sticky { position: static; height: auto; }
html:not(.hfs-3d) .story-track { height: auto; }
html:not(.hfs-3d) .story-panel { position: relative; inset: auto; display: flex; }
html:not(.hfs-3d) .story-copy-block { display: flex; }

/* While the 3D stage is active, the left column shows only the current
   step; everywhere else every step stays readable. */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  html.hfs-3d .story-copy-block { display: none; }
  html.hfs-3d .story-copy-block.is-current { display: flex; }
}

/* ---------------------------------------------------------------- *
 * 5. Accessibility
 * ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .story-track { height: auto !important; }
  .story-sticky { position: static !important; height: auto !important; }
  .story-ring .story-scene {
    position: relative;
    inset: auto;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
  }
  .story-ring { position: static; transform: none !important; }
  .story-stage { display: block; perspective: none; }
  .story-panel { position: relative; inset: auto; display: flex; }
  .talent-scene .spokes path,
  .talent-scene .hub::before,
  .talent-scene .hub::after,
  .talent-scene .node,
  .story-art .glow,
  .story-art .grid,
  .story-panel .motion-line { animation: none !important; }

  .hero-visual .talent-scene {
    transform: rotate(-5deg) !important;
  }
  .hero-visual .orbit-text,
  .hero-visual .top-card,
  .hero-visual .bottom-card {
    transform: none !important;
  }
}

/* Small screens never show the stage, reduced motion or not. */
@media (max-width: 1023px) and (prefers-reduced-motion: reduce) {
  .story-stage { display: none !important; }
}
