/* "How it works" pages: one simple animated flow per automation.
   Source (Instagram / Facebook / a customer) -> automation -> Google Business Profile. */

.ig-top { background: linear-gradient(160deg, var(--ultra-light), var(--ultra) 50%, var(--ultra-deep)); color: var(--white); padding: clamp(110px, 14vh, 140px) 20px 100px; text-align: center; border-radius: 0 0 clamp(28px, 5vw, 64px) clamp(28px, 5vw, 64px); }
.ig-top h1 { margin: 16px auto 14px; max-width: 18ch; font: 800 clamp(34px, 4.8vw, 64px)/.95 var(--f-display); letter-spacing: -.045em; }
.ig-top .ig-lead { max-width: 54ch; margin: 0 auto; color: rgba(255,255,255,.82); font-size: clamp(16px, 1.25vw, 18px); }
.ig-jump { margin-top: 26px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ig-jump a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: rgba(255,255,255,.12); color: var(--white); text-decoration: none; font-weight: 600; font-size: 14px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.ig-jump a:hover { background: rgba(255,255,255,.2); }
.ig-jump i { width: 9px; height: 9px; border-radius: 50%; }

.ig-wrap { max-width: 1080px; margin: -60px auto var(--section-y); padding: 0 var(--gutter); display: grid; gap: 22px; position: relative; z-index: 1; }

.ig-flow { --accent: var(--coral); background: var(--white); border-radius: 28px; border: 1px solid var(--line); padding: clamp(22px, 3.4vw, 40px); box-shadow: 0 30px 60px -40px rgba(45,8,110,.35); scroll-margin-top: 90px; }
.ig-flow--media { --accent: var(--mint); }
.ig-flow--posts { --accent: var(--sun); }
.ig-head { text-align: center; margin-bottom: clamp(26px, 4vw, 40px); }
.ig-head span { display: block; font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ig-head h2 { margin-top: 10px; font: 800 clamp(24px, 2.8vw, 34px)/1.1 var(--f-display); letter-spacing: -.02em; text-wrap: balance; }
.ig-head p { max-width: 62ch; margin: 12px auto 0; color: var(--muted); font-size: 15px; }
.ig-head h2 i { display: inline-block; width: 12px; height: 12px; margin-right: 12px; border-radius: 50%; background: var(--accent); vertical-align: .18em; }

/* --- the track: three nodes with a moving item between them ---
   how.js measures the icon centres into --x1..--x3 / --y1..--y3 (px), so the road
   and the moving item line up in both the horizontal and the stacked (phone) layout. */
.ig-track { --dur: 5s; --x1: 16.6%; --x2: 50%; --x3: 83.3%; --y1: 56px; --y2: 56px; --y3: 56px;
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr); }
.ig-track::before { /* the road between nodes */
  content: ""; position: absolute; left: var(--x1); top: var(--y1); width: calc(var(--x3) - var(--x1)); height: 4px; translate: 0 -50%; border-radius: 2px;
  background: repeating-linear-gradient(90deg, rgba(121,54,230,.35) 0 8px, transparent 8px 16px);
}
.ig-node { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 8px; }
.ig-icon { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: var(--white); box-shadow: 0 0 0 1px var(--line), 0 18px 34px -20px rgba(13,16,51,.45); position: relative; }
.ig-node h3 { margin-top: 16px; font: 700 18px/1.15 var(--f-display); }
.ig-node p { margin-top: 6px; max-width: 24ch; font-size: 14px; color: var(--muted); }

/* source: Instagram + Facebook badges */
.ig-src { display: flex; align-items: center; }
.ig-src svg { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 6px 14px -6px rgba(0,0,0,.35); }
.ig-src svg + svg { margin-left: -10px; border-radius: 50%; border: 3px solid var(--white); width: 50px; height: 50px; }

/* source: a photo/video or a post, with small Instagram + Facebook badges in the corner */
.ig-left { width: 60px; height: 56px; }
.ig-social { position: absolute; left: 2px; top: 2px; display: flex; }
.ig-social svg { width: 26px; height: 26px; border-radius: 7px; box-shadow: 0 0 0 2px var(--white), 0 4px 10px -4px rgba(0,0,0,.35); }
.ig-social svg + svg { margin-left: -6px; border-radius: 50%; }

/* source: customer with a review */
.ig-person { width: 54px; height: 54px; border-radius: 50%; background: var(--coral); color: #fff; display: grid; place-items: center; font: 800 22px/1 var(--f-display); }
.ig-bubble { position: absolute; top: 6px; right: -14px; padding: 5px 8px; border-radius: 12px 12px 12px 4px; background: var(--white); box-shadow: 0 6px 16px -6px rgba(0,0,0,.3); color: var(--sun); font-size: 12px; letter-spacing: 1px; }

/* automation */
.ig-icon--auto { background: linear-gradient(160deg, var(--ultra-light), var(--ultra-deep)); box-shadow: 0 18px 34px -16px rgba(92,26,222,.7); }
.ig-icon--auto svg { width: 50px; height: 50px; fill: none; stroke: var(--white); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; animation: ig-spin 6s linear infinite; }
@keyframes ig-spin { to { transform: rotate(360deg); } }
.ig-icon--auto::after { /* pulse when the item arrives */
  content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid var(--ultra-light); opacity: 0;
  animation: ig-pulse var(--dur) var(--ease) infinite;
}
@keyframes ig-pulse { 0%, 36% { opacity: 0; transform: scale(.9); } 42% { opacity: .9; transform: scale(1); } 56%, 100% { opacity: 0; transform: scale(1.25); } }

/* destination: Google Business Profile */
.ig-dest { display: grid; justify-items: center; gap: 4px; }
.ig-dest svg { width: 46px; height: 46px; }
.ig-dest .ig-gbp { width: 52px; height: 48px; }
.ig-dest b { font: 700 11px/1.1 var(--f-body); color: var(--ink); }
/* small badge on the profile icon saying what landed there: reply, photo or post */
.ig-badge { position: absolute; left: 2px; top: 2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--white); box-shadow: 0 0 0 1px var(--line), 0 6px 14px -6px rgba(13,16,51,.4); }
.ig-badge svg { width: 18px; height: 18px; fill: none; stroke: #4285F4; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ig-done { position: absolute; right: 2px; top: 2px; width: 32px; height: 32px; border-radius: 50%; background: var(--mint); color: var(--ink); display: grid; place-items: center; font: 800 16px/1 var(--f-body); box-shadow: 0 0 0 4px var(--white); transform: scale(0); animation: ig-done var(--dur) var(--ease) infinite; }
@keyframes ig-done { 0%, 82% { transform: scale(0); } 88% { transform: scale(1.2); } 92%, 97% { transform: none; } 100% { transform: scale(0); } }

/* the item travelling along the road */
.ig-item { position: absolute; z-index: 2; left: var(--x1); top: var(--y1); translate: -50% -50%; animation: ig-move var(--dur) var(--ease) infinite; pointer-events: none; }
@keyframes ig-move {
  0% { left: var(--x1); top: var(--y1); opacity: 0; transform: scale(.6); }
  8% { opacity: 1; transform: scale(1); }
  12% { left: var(--x1); top: var(--y1); }
  38% { left: var(--x2); top: var(--y2); transform: scale(1); }
  44% { left: var(--x2); top: var(--y2); transform: scale(.75); }
  56% { left: var(--x2); top: var(--y2); transform: scale(1); }
  82% { left: var(--x3); top: var(--y3); opacity: 1; }
  88%, 100% { left: var(--x3); top: var(--y3); opacity: 0; transform: scale(.6); }
}
.ig-item > span { display: grid; place-items: center; background: var(--white); border-radius: 12px; box-shadow: 0 10px 22px -10px rgba(13,16,51,.55), 0 0 0 2px var(--accent); }
.ig-item--review > span { padding: 7px 10px; color: var(--sun); font-size: 13px; letter-spacing: 1px; white-space: nowrap; }
.ig-item--photo > span { width: 46px; height: 46px; background: linear-gradient(160deg, var(--ultra-light), var(--ultra-deep)); position: relative; }
.ig-item--photo > span::after { content: ""; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent #fff; margin-left: 3px; }
.ig-item--post > span { width: 52px; padding: 6px; gap: 4px; justify-items: stretch; }
.ig-item--post i { display: block; height: 18px; border-radius: 4px; background: linear-gradient(150deg, var(--sun), var(--coral)); }
.ig-item--post b { display: block; height: 4px; border-radius: 2px; background: #DCD8EC; }
.ig-item--post b + b { width: 70%; }

.ig-note { margin-top: clamp(24px, 3vw, 34px); display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: #FFF1EF; font-size: 14px; }
.ig-note b { font-family: var(--f-display); }
.ig-note::before { content: "!"; flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--coral); color: #fff; font: 800 13px/1 var(--f-display); }

.ig-cta { text-align: center; padding-top: 10px; }
.ig-cta h2 { font: 800 clamp(26px, 3.2vw, 40px)/1.05 var(--f-display); letter-spacing: -.03em; margin-bottom: 18px; }
.ig-cta .btn + .link-arrow { margin-left: 22px; }

/* phones: the flow runs top to bottom */
@media (max-width: 720px) {
  .ig-track { grid-template-columns: 1fr; row-gap: 44px; }
  .ig-track::before { width: 4px; height: calc(var(--y3) - var(--y1)); translate: -50% 0;
    background: repeating-linear-gradient(180deg, rgba(121,54,230,.35) 0 8px, transparent 8px 16px); }
  .ig-node h3, .ig-node p { background: var(--white); padding: 2px 6px; } /* keep the road from running through the text */
  .ig-cta .btn + .link-arrow { margin: 16px 0 0; display: flex; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .ig-item, .ig-icon--auto::after { display: none; }
  .ig-icon--auto svg { animation: none; }
  .ig-done { animation: none; transform: none; }
}
