/* ============================================================
   Service Workflow — radial phone ecosystem (Section 3)
   Reusable across field / retail / BTL / OOH / loyalty / AI pages
   ============================================================ */

.section-workflow {
  --wf-navy: #071a2f;
  --wf-navy-2: #0b1f3a;
  --wf-accent: #f29a1f;
  --wf-white: #ffffff;
  --wf-muted: #aab8c8;
  --wf-card: rgba(11, 31, 58, 0.88);
  --wf-border: rgba(255, 255, 255, 0.12);

  position: relative;
  isolation: isolate;
  background: var(--wf-navy);
  color: var(--wf-white);
  overflow: clip;
}

.section-workflow__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 50% 40% at 50% 55%,
      rgba(242, 154, 31, 0.07),
      transparent 70%
    ),
    radial-gradient(
      ellipse 70% 55% at 50% 0%,
      rgba(11, 31, 58, 0.9),
      transparent 65%
    ),
    linear-gradient(
      180deg,
      var(--wf-navy) 0%,
      var(--wf-navy-2) 55%,
      var(--wf-navy) 100%
    );
}

.section-workflow__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  mask-image: radial-gradient(ellipse 92% 80% at 50% 42%, #000 32%, transparent 92%);
  -webkit-mask-image: radial-gradient(ellipse 92% 80% at 50% 42%, #000 32%, transparent 92%);
}

.section-workflow__pin {
  position: relative;
  z-index: 1;
  height: var(--workflow-pin-height, 520vh);
}

.section-workflow__sticky {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 850px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 36px 0 20px;
  overflow: hidden;
}

/* ---- Intro ---- */

.workflow-intro {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  max-width: 720px;
  margin: 0 auto 8px;
  text-align: center;
}

.workflow-intro__eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 8px;
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wf-accent);
}

.workflow-intro__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wf-accent);
  box-shadow: 0 0 0 4px rgba(242, 154, 31, 0.18);
}

.workflow-intro__title {
  margin: 0 0 8px;
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-weight: 700;
  font-size: clamp(1.55rem, 2vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--wf-white);
}

.workflow-intro__lede {
  margin: 0 auto;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--wf-muted);
}

/* ---- Stage ---- */

.workflow-stage {
  position: relative;
  z-index: 3;
  flex: 1 1 auto;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 0;
}

.workflow-orbit,
.workflow-glow {
  display: none;
}

.workflow-orbit__svg {
  width: 100%;
  height: 100%;
  display: block;
}

.workflow-orbit__ring {
  fill: none;
  stroke: rgba(170, 184, 200, 0.14);
  stroke-width: 1;
}

.workflow-orbit__ring--b {
  stroke: rgba(170, 184, 200, 0.1);
  stroke-dasharray: 4 10;
}

.workflow-orbit__ring--c {
  stroke: rgba(242, 154, 31, 0.12);
}

.workflow-orbit__dot {
  fill: rgba(242, 154, 31, 0.45);
}

.workflow-phones {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/*
 * STATIC FAN LAYOUT (reference match)
 * Scroll animation OFF — absolute left/top + rotate only.
 * Outer phones lower + more tilted; center highest + upright.
 * Outer z-index higher so the fan opens toward the viewer.
 */
.workflow-phone {
  position: absolute;
  width: 100%;
  max-width: 900px;
  margin: 0;
  filter: none !important;
  transform-origin: 50% 100%;
  will-change: auto;
}

.section-workflow.is-layout-mode .workflow-phone {
  opacity: 1 !important;
}

.workflow-phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22px;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* 01 — far left */
.workflow-phone:nth-child(1) {
  left: 2%;
  top: 149%;
  z-index: 8;
  transform: translate(-50%, -100%) rotate(331deg);
}

/* 02 */
.workflow-phone:nth-child(2) {
  left: 15%;
  top: 90%;
  z-index: 7;
  transform: translate(-50%, -100%) rotate(337deg);
}

/* 03 */
.workflow-phone:nth-child(3) {
  left: 29%;
  top: 48%;
  z-index: 5;
  transform: translate(-50%, -100%) rotate(344deg);
}

/* 04 — inner left (near peak) */
.workflow-phone:nth-child(4) {
  left: 43%;
  top: 25%;
  z-index: 3;
  transform: translate(-50%, -100%) rotate(351deg);
}

/* 05 — arc peak / center */
.workflow-phone:nth-child(5) {
  left: 57%;
  top: 16%;
  z-index: 2;
  transform: translate(-50%, -100%) rotate(0deg);
}

/* 06 — inner right */
.workflow-phone:nth-child(6) {
  left: 71%;
  top: 29%;
  z-index: 4;
  transform: translate(-50%, -100%) rotate(12deg);
}

/* 07 */
.workflow-phone:nth-child(7) {
  left: 86%;
  top: 62%;
  z-index: 6;
  transform: translate(-50%, -100%) rotate(15deg);
}

/* 08 — far right */
.workflow-phone:nth-child(8) {
  left: 99%;
  top: 103%;
  z-index: 8;
  transform: translate(-50%, -100%) rotate(27deg);
}

.workflow-phone__micro {
  display: none;
}

/* Empty slot — hidden while wheel scrolls */
.workflow-phone.is-empty {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none;
}

/* Center / front slot — active step */
.workflow-phone--center {
  z-index: 50 !important;
}

.workflow-phone--center img {
  transform: scale(1.08);
  opacity: 1;
  transform-origin: 50% 100%;
  transition: transform 0.45s ease, opacity 0.45s ease;
}

/* Past steps — left arc */
.workflow-phone--past img {
  transform: scale(0.94);
  opacity: 0.82;
  transform-origin: 50% 100%;
  transition: transform 0.45s ease, opacity 0.45s ease;
}

/* Upcoming steps — right arc */
.workflow-phone--future img {
  transform: scale(0.94);
  opacity: 0.82;
  transform-origin: 50% 100%;
  transition: transform 0.45s ease, opacity 0.45s ease;
}

.workflow-phone img {
  transition: transform 0.45s ease, opacity 0.45s ease;
}

.workflow-phone--center::after {
  content: "";
  position: absolute;
  inset: 8% 12%;
  z-index: -1;
  border-radius: 28px;
  background: radial-gradient(circle, rgba(242, 154, 31, 0.25), transparent 70%);
  filter: blur(16px);
  pointer-events: none;
}

.section-workflow.is-autoplay {
  overflow: hidden;
  height: 100vh;
  max-height: 100vh;
}

/* ---- Autoplay: same one-screen fan as layout mode, card at bottom ---- */
.section-workflow.is-autoplay .section-workflow__pin {
  height: 100vh !important;
  overflow: hidden;
}

.section-workflow.is-autoplay .section-workflow__sticky {
  position: relative;
  height: 100vh;
  min-height: 0;
  max-height: 100vh;
  overflow: hidden;
  padding: 28px 0 12px;
  display: flex;
  flex-direction: column;
}

.section-workflow.is-autoplay .section-workflow__pin .workflow-intro {
  flex: 0 0 auto;
  margin: 0 auto 500px;
  max-width: 720px;
}

.section-workflow.is-autoplay .workflow-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
  padding-bottom: 0;
}

/* ---- Layout mode: static fan tuning (all 8 visible) ---- */
.section-workflow.is-layout-mode .workflow-card,
.section-workflow.is-layout-mode .workflow-navigation {
  display: none !important;
}

.section-workflow.is-layout-mode .section-workflow__pin {
  height: auto !important;
}

.section-workflow.is-layout-mode .section-workflow__sticky {
  position: relative;
  height: 100vh;
  min-height: 0;
  max-height: 100vh;
  overflow: hidden;
  padding: 28px 0 12px;
  display: flex;
  flex-direction: column;
}

.section-workflow.is-layout-mode .workflow-intro {
  flex: 0 0 auto;
  margin: 0 auto 450px;
}

.section-workflow.is-layout-mode .workflow-phone.is-empty {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ---- Story mode: pinned scroll + image wheel ---- */
.section-workflow:not(.is-layout-mode):not(.is-autoplay) .section-workflow__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 850px;
  max-height: 100vh;
  overflow: hidden;
  padding: 28px 0 12px;
  display: flex;
  flex-direction: column;
}

.section-workflow:not(.is-layout-mode):not(.is-autoplay) .workflow-intro {
  flex: 0 0 auto;
  margin: 0 auto 450px;
}

.section-workflow:not(.is-layout-mode):not(.is-autoplay) .workflow-stage {
  flex: 1 1 auto;
  min-height: 0;
}

/* ---- Floating card — below active (center) phone ---- */

.workflow-card {
  position: absolute;
  z-index: 60;
  left: var(--wf-card-x, 50%);
  top: var(--wf-card-y, 62%);
  width: var(--wf-card-w, min(360px, 36vw));
  margin: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition:
    opacity 0.45s ease,
    visibility 0s linear 0.45s,
    left 0.45s ease,
    top 0.45s ease,
    transform 0.45s ease;
}

.section-workflow.is-storytelling .workflow-card,
.section-workflow.is-autoplay .workflow-card {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 0.45s ease,
    visibility 0s linear 0s,
    transform 0.45s ease;
}

.section-workflow.is-autoplay .workflow-card {
  left: 50%;
  top: auto;
  bottom: 12px;
  width: min(360px, 90%);
  transform: translateX(-50%);
}

.workflow-card__viewport {
  position: relative;
  overflow: hidden;
}

.workflow-card__inner {
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: var(--wf-card);
  border: 1px solid var(--wf-border);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  will-change: transform, opacity;
}

.workflow-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.workflow-card-number {
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--wf-accent);
}

.workflow-card__label {
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wf-muted);
}

.workflow-card-title {
  margin: 0 0 8px;
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1.2;
  color: var(--wf-white);
}

.workflow-card-description {
  margin: 0 0 14px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--wf-muted);
}

.workflow-problem {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(7, 26, 47, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.35;
}

.workflow-problem__from {
  color: var(--wf-muted);
}

.workflow-problem__arrow {
  color: rgba(170, 184, 200, 0.55);
}

.workflow-problem__to {
  color: var(--wf-accent);
}

.workflow-progress__meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-family: var(--font-display, "Bricolage Grotesque", sans-serif);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  color: var(--wf-muted);
}

.workflow-progress__track {
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.workflow-progress__fill {
  display: block;
  height: 100%;
  width: 12.5%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e8890f, var(--wf-accent));
  transform-origin: left center;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Right rail nav (hidden) ---- */

.workflow-navigation {
  display: none !important;
}

.workflow-navigation__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--wf-muted);
}

.workflow-navigation__num {
  display: none;
}

.workflow-navigation__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(170, 184, 200, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition:
    background 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.workflow-navigation__item.is-active .workflow-navigation__dot {
  background: var(--wf-accent);
  transform: scale(1.15);
  box-shadow: 0 0 0 4px rgba(242, 154, 31, 0.18);
}

.workflow-navigation__line {
  width: 1px;
  height: 14px;
  background: rgba(170, 184, 200, 0.22);
}

/* ---- Mobile stack (hidden on desktop) ---- */

.section-workflow__mobile {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .workflow-phone,
  .workflow-card,
  .workflow-progress__fill {
    transition: none !important;
    animation: none !important;
  }
}
