/* ═══════════════════════════════════════════════════════════
   TUNEX — REMAINING SECTIONS
   Testimonials · Case Studies · Process · Marketplaces

   Each one deliberately uses a DIFFERENT mechanic, because the
   page already spends a lamp beam on the hero, a marquee on the
   FAQ and a 3D ring on services. Repeating any of those would
   make the page read as one trick applied four more times:

     Testimonials  — spotlight rotator (one quote at a time)
     Case studies  — sticky scroll-stacking cards (CSS only)
     Process       — timeline that draws itself as you scroll
     Marketplaces  — connection arcs that trace between markets

   Existing section backgrounds are kept so the page's dark/light
   rhythm is unchanged.
   ═══════════════════════════════════════════════════════════ */

/* ═══ 1. TESTIMONIALS — SPOTLIGHT ROTATOR (dark) ═══════════ */

.tst-section {
  background: var(--b);
  padding: 96px 56px 88px;
  overflow: hidden;
}

.tst-head {
  text-align: center;
  margin-bottom: 54px;
}

.tst-stage {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

/* all three quotes are stacked; only the active one is shown */
.tst-quotes {
  position: relative;
  min-height: 260px;
}

.tst-quote {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  pointer-events: none;
}
.tst-quote.is-on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.tst-mark {
  font-family: 'Bebas Neue', cursive, sans-serif;
  font-size: 92px;
  line-height: 0.6;
  color: var(--r);
  margin-bottom: 18px;
}

.tst-text {
  font-size: clamp(17px, 2.1vw, 27px);
  line-height: 1.6;
  font-weight: 300;
  color: #fff;
  max-width: 820px;
}
.tst-text strong {
  font-weight: 700;
  color: var(--r);
}

.tst-stars {
  display: flex;
  gap: 3px;
  margin-top: 22px;
  color: var(--gold);
  font-size: 15px;
}

/* ── avatar rail ── */

.tst-rail {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 44px;
}

.tst-av {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #141414;
  border: 1.5px solid #232323;
  color: rgba(255, 255, 255, 0.55);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease),
    background 0.3s var(--ease);
}
.tst-av:hover {
  color: #fff;
  border-color: #3a3a3a;
}
.tst-av.is-on {
  color: #fff;
  background: #191919;
  border-color: transparent;
}
.tst-av:focus-visible {
  outline: 2px solid var(--r);
  outline-offset: 4px;
}

/* the ring that fills over the life of the current slide */
.tst-ring {
  position: absolute;
  inset: -4px;
  transform: rotate(-90deg);
  pointer-events: none;
}
.tst-ring circle {
  fill: none;
  stroke: var(--r);
  stroke-width: 2;
  stroke-linecap: round;
  /* r=34 -> circumference ~213.6 */
  stroke-dasharray: 214;
  stroke-dashoffset: 214;
}
.tst-av.is-on .tst-ring circle {
  animation: tst-fill var(--tst-dur, 7s) linear forwards;
}
@keyframes tst-fill {
  to {
    stroke-dashoffset: 0;
  }
}
/* paused while the reader is hovering the section */
.tst-section:hover .tst-av.is-on .tst-ring circle {
  animation-play-state: paused;
}

.tst-meta {
  margin-top: 18px;
  text-align: center;
}
.tst-name {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.3px;
}
.tst-role {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

/* ═══ 2. CASE STUDIES — STICKY STACK (light) ═══════════════ */

.cs-section {
  background: var(--w);
  padding: 96px 56px 40px;
  border-top: 1.5px solid var(--border);
}

.cs-head {
  text-align: center;
  margin-bottom: 20px;
}
.cs-sub {
  max-width: 560px;
  margin: 14px auto 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
}

.cs-stack {
  max-width: 980px;
  margin: 0 auto;
}

/* No scroll maths and no JS: each card simply sticks a little lower than
   the one before it, so scrolling deals them into a pile you can still
   see the edge of. */
.cs-card {
  position: sticky;
  top: calc(96px + var(--i) * 22px);
  margin-bottom: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--w);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(12, 12, 12, 0.08);
}

.cs-media {
  position: relative;
  min-height: 300px;
  background: var(--off);
}
.cs-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* The case-study screenshots currently 404 on tunexmarketing.site, which
   would leave a broken-image box exactly where the proof should be. Until
   the files are restored, a branded placeholder stands in. */
.cs-media.is-missing img {
  display: none;
}
.cs-media.is-missing {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f4f4f4 0%, #ebebeb 100%);
}
.cs-media.is-missing::after {
  content: attr(data-fallback);
  max-width: 74%;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  line-height: 1.7;
  color: #b3b3b3;
}
.cs-badge {
  position: absolute;
  left: 16px;
  top: 16px;
  background: rgba(8, 8, 8, 0.82);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 7px 12px;
  border-radius: 100px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.cs-body {
  padding: 38px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cs-mkt {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--r);
}
.cs-title {
  font-family: 'Bebas Neue', cursive, sans-serif;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.5px;
  color: var(--b);
  margin: 10px 0 12px;
}
.cs-desc {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
}
.cs-stats {
  display: flex;
  gap: 28px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
.cs-stat-val {
  font-family: 'Bebas Neue', cursive, sans-serif;
  font-size: 34px;
  line-height: 1;
  color: var(--r);
}
.cs-stat-lbl {
  margin-top: 5px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}

/* ═══ 3. PROCESS — SELF-DRAWING TIMELINE (light) ═══════════ */

.pr-section {
  background: var(--off);
  padding: 96px 56px;
  border-top: 1.5px solid var(--border);
}

.pr-head {
  text-align: center;
  margin-bottom: 60px;
}

.pr-list {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding-left: 62px;
}

.pr-step {
  position: relative;
  padding-bottom: 46px;
}
.pr-step:last-child {
  padding-bottom: 0;
}

/* the connector that grows downward once the step is reached */
.pr-step::before {
  content: '';
  position: absolute;
  left: -40px;
  top: 26px;
  bottom: -4px;
  width: 2px;
  background: var(--r);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.9s var(--ease-out) 0.15s;
}
.pr-step:last-child::before {
  display: none;
}
.pr-step.is-in::before {
  transform: scaleY(1);
}

/* the track the connector draws over */
.pr-list::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 26px;
  bottom: 26px;
  width: 2px;
  background: var(--border);
}

.pr-dot {
  position: absolute;
  left: -62px;
  top: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--w);
  border: 2px solid var(--border);
  font-family: 'Bebas Neue', cursive, sans-serif;
  font-size: 19px;
  color: var(--muted);
  z-index: 1;
  transition: border-color 0.5s var(--ease), color 0.5s var(--ease),
    background 0.5s var(--ease), box-shadow 0.5s var(--ease);
}
.pr-step.is-in .pr-dot {
  border-color: var(--r);
  background: var(--r);
  color: #fff;
  box-shadow: 0 0 0 6px rgba(196, 30, 58, 0.12);
}

/* ── quantum pulse indicator on each active step ───────── */

/* Two sonar rings expanding out of the dot, offset in time so the pulse
   never fully dies, plus one electron on a tilted orbit. Staggered by step
   (--i) — four dots pulsing in unison reads as an error state, four pulsing
   out of phase reads as something running. */
.pr-dot::before,
.pr-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--r);
  opacity: 0;
  pointer-events: none;
}
.pr-step.is-in .pr-dot::before {
  animation: pr-ping 2.8s cubic-bezier(0, 0, 0.2, 1) infinite;
  animation-delay: calc(var(--i, 0) * 0.35s);
}
.pr-step.is-in .pr-dot::after {
  animation: pr-ping 2.8s cubic-bezier(0, 0, 0.2, 1) infinite;
  animation-delay: calc(var(--i, 0) * 0.35s + 1.4s);
}

@keyframes pr-ping {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(2.3);
    opacity: 0;
  }
}

.pr-orbit {
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  pointer-events: none;
}
/* the orbital path, foreshortened so it reads as a ring seen edge-on */
.pr-orbit::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(196, 30, 58, 0.4);
  transform: rotateX(66deg);
}
/* the electron */
.pr-orbit::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -3px;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--r);
  box-shadow: 0 0 8px rgba(196, 30, 58, 0.85);
}
.pr-step.is-in .pr-orbit {
  animation: pr-orbit-spin 3.6s linear infinite;
  animation-delay: calc(var(--i, 0) * 0.35s);
}
@keyframes pr-orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

.pr-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--b);
  letter-spacing: -0.2px;
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
.pr-desc {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity 0.6s var(--ease-out) 0.1s,
    transform 0.6s var(--ease-out) 0.1s;
}
.pr-step.is-in .pr-title,
.pr-step.is-in .pr-desc {
  opacity: 1;
  transform: none;
}

/* ═══ 4. MARKETPLACES — TRACING ARCS (dark) ════════════════ */

.mk-section {
  background: var(--b);
  padding: 96px 56px 88px;
  overflow: hidden;
}

.mk-head {
  text-align: center;
  margin-bottom: 40px;
}

.mk-map {
  position: relative;
  max-width: 900px;
  margin: 0 auto 46px;
  aspect-ratio: 900 / 260;
}
.mk-map svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.mk-arc {
  fill: none;
  stroke: var(--r);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: var(--len);
  stroke-dashoffset: var(--len);
  opacity: 0.85;
}
.mk-map.is-in .mk-arc {
  animation: mk-trace 2.6s var(--ease-out) forwards;
  animation-delay: calc(var(--d) * 0.45s);
}
@keyframes mk-trace {
  to {
    stroke-dashoffset: 0;
  }
}

.mk-node {
  fill: var(--r);
}
/* transform-box/origin are load-bearing: on an SVG shape, scale() pivots
   around the SVG canvas origin (0,0) by default, so the pulsing halos fly
   away from their nodes instead of expanding around them. */
.mk-halo {
  fill: var(--r);
  opacity: 0.18;
  transform-box: fill-box;
  transform-origin: center;
}
.mk-map.is-in .mk-halo {
  animation: mk-pulse 2.6s ease-in-out infinite;
  animation-delay: calc(var(--d) * 0.45s);
}
@keyframes mk-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.18;
  }
  50% {
    transform: scale(1.9);
    opacity: 0.04;
  }
}

.mk-label {
  fill: rgba(255, 255, 255, 0.72);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.mk-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 980px;
  margin: 0 auto;
}
.mk-card {
  background: #101010;
  border: 1px solid #1e1e1e;
  border-radius: 12px;
  padding: 22px 20px;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease-out);
}
.mk-card:hover {
  border-color: rgba(196, 30, 58, 0.45);
  transform: translateY(-3px);
}
.mk-flag {
  font-size: 26px;
  line-height: 1;
}
.mk-name {
  font-family: 'Bebas Neue', cursive, sans-serif;
  font-size: 26px;
  line-height: 1;
  color: #fff;
  margin: 12px 0 4px;
}
.mk-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--r);
  letter-spacing: 0.5px;
}
.mk-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 14px;
}
.mk-tags span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  background: #171717;
  border: 1px solid #222;
  border-radius: 100px;
  padding: 4px 9px;
}

/* ═══ RESPONSIVE ═══════════════════════════════════════════ */

@media (max-width: 900px) {
  .tst-section,
  .cs-section,
  .pr-section,
  .mk-section {
    padding-left: 24px;
    padding-right: 24px;
  }

  .tst-quotes {
    min-height: 320px;
  }
  .tst-mark {
    font-size: 66px;
  }

  /* stacking needs a tall viewport to read; on a phone the cards just flow */
  .cs-card {
    position: static;
    grid-template-columns: 1fr;
    margin-bottom: 22px;
  }
  .cs-media {
    min-height: 210px;
  }
  .cs-body {
    padding: 26px 22px;
  }
  .cs-stats {
    gap: 20px;
  }

  .pr-list {
    padding-left: 54px;
  }
  .pr-dot {
    left: -54px;
    width: 40px;
    height: 40px;
    font-size: 17px;
  }
  .pr-step::before {
    left: -34px;
  }
  .pr-list::before {
    left: 19px;
  }

  .mk-map {
    display: none;
  }
  .mk-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .mk-cards {
    grid-template-columns: 1fr;
  }
  .cs-stats {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tst-quote,
  .pr-title,
  .pr-desc,
  .pr-step::before,
  .pr-dot,
  .cs-card,
  .mk-card {
    transition: none;
  }
  .tst-av.is-on .tst-ring circle,
  .mk-map.is-in .mk-arc,
  .mk-map.is-in .mk-halo,
  .pr-step.is-in .pr-dot::before,
  .pr-step.is-in .pr-dot::after,
  .pr-step.is-in .pr-orbit {
    animation: none;
  }
  .pr-orbit {
    display: none;
  }
  .mk-arc {
    stroke-dashoffset: 0;
  }
  .pr-step::before {
    transform: scaleY(1);
  }
  .pr-title,
  .pr-desc {
    opacity: 1;
    transform: none;
  }
}

/* ═══ CTA BAND — NEURAL VORTEX BACKGROUND ══════════════════ */

/* The canvas is injected by tunex-vortex.js only when the guardrails pass,
   so the band still looks right with the script absent. */
.cta-band.has-vortex {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.cta-vortex {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}
.cta-band.has-vortex > *:not(.cta-vortex) {
  position: relative;
  z-index: 1;
}
