/* ==========================================================================
   Components – Growth System rail + data visualisations
   ATTRACT ─── ENGAGE ─── CONVERT ─── AUTOMATE ─── GROW
   Desktop: horizontal connected rail. Mobile: vertical connected rail.
   Progression is communicated with a line that draws in and a node that
   advances; JS (growth-system module) only toggles classes.
   ========================================================================== */

.vg-gs { --gs-line: var(--vg-line); --gs-node: var(--vg-bg); position: relative; }

.vg-gs__rail { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 0; }

/* Vertical (mobile-first) */
.vg-gs__rail::before {
  content: ""; position: absolute; left: 11px; top: 12px; bottom: 12px; width: 2px; background: var(--gs-line);
}
.vg-gs__rail::after {
  content: ""; position: absolute; left: 11px; top: 12px; width: 2px; height: 0; background: var(--vg-green);
  transition: height 1.6s var(--vg-ease-out);
}
.vg-gs.is-visible .vg-gs__rail::after { height: calc(100% - 24px); }

.vg-gs__stage { position: relative; padding: 0 0 2rem 2.5rem; }
.vg-gs__stage:last-child { padding-bottom: 0; }
.vg-gs__node {
  position: absolute; left: 0; top: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gs-node); border: 2px solid var(--gs-line); z-index: 1;
  display: grid; place-items: center; transition: border-color var(--vg-dur) var(--vg-ease), background var(--vg-dur) var(--vg-ease), transform var(--vg-dur) var(--vg-ease);
}
.vg-gs__node::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--vg-green); transform: scale(0); transition: transform var(--vg-dur) var(--vg-ease-out); }
.vg-gs__stage.is-active .vg-gs__node, .vg-gs__stage:hover .vg-gs__node, .vg-gs__stage:focus-within .vg-gs__node { border-color: var(--vg-green); }
.vg-gs__stage.is-active .vg-gs__node::after, .vg-gs__stage:hover .vg-gs__node::after, .vg-gs__stage:focus-within .vg-gs__node::after { transform: scale(1); }
.vg-gs__stage--grow .vg-gs__node { border-color: var(--vg-black); background: var(--vg-black); }
.vg-gs__stage--grow .vg-gs__node::after { background: var(--vg-yellow); }

.vg-gs__head { display: flex; align-items: baseline; gap: .75rem; }
.vg-gs__index { font-family: var(--vg-font-display); font-size: var(--vg-text-xs); color: var(--vg-text-muted); font-variant-numeric: tabular-nums; }
.vg-gs__label { margin: 0; font-family: var(--vg-font-display); font-size: var(--vg-text-xl); font-weight: 700; letter-spacing: var(--vg-tracking-tight); line-height: 1; text-transform: uppercase; }
.vg-gs__summary { margin: .5rem 0 0; font-weight: 500; }
.vg-gs__detail { margin: .35rem 0 0; font-size: var(--vg-text-sm); color: var(--vg-text-muted); max-width: 36ch; }
.vg-gs__links { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .75rem; }
.vg-gs__signal { display: inline-flex; align-items: center; gap: .4rem; margin-top: .75rem; font-family: var(--vg-font-display); font-size: var(--vg-text-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--vg-accent-text); }
.vg-gs__signal::before { content: ""; width: 6px; height: 6px; background: currentColor; }

/* Horizontal (desktop) */
@media (min-width: 1024px) {
  .vg-gs__rail { grid-template-columns: repeat(5, 1fr); column-gap: var(--vg-gap); padding-top: 2.25rem; }
  .vg-gs__rail::before { left: 12px; right: 12px; top: 11px; bottom: auto; width: auto; height: 2px; }
  .vg-gs__rail::after { left: 12px; top: 11px; height: 2px; width: 0; transition: width 2.2s var(--vg-ease-out); }
  .vg-gs.is-visible .vg-gs__rail::after { width: calc(100% - 24px); height: 2px; }
  .vg-gs__stage { padding: 0; }
  .vg-gs__node { top: -2.25rem; left: 0; }
  .vg-gs__stage:last-child .vg-gs__node { }
  .vg-gs__detail { max-width: none; }
}

/* Compact rail (used in About / Services intro) */
.vg-gs--compact .vg-gs__detail, .vg-gs--compact .vg-gs__links, .vg-gs--compact .vg-gs__signal { display: none; }
.vg-gs--compact .vg-gs__label { font-size: var(--vg-text-lg); }
.vg-gs--compact .vg-gs__stage { padding-bottom: 1.25rem; }

/* Inline text rail (used in headings/footers): ATTRACT → ENGAGE … */
.vg-gs-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; font-family: var(--vg-font-display); font-size: var(--vg-text-sm); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--vg-text-muted); }
.vg-gs-inline span:last-child { color: var(--vg-accent-text); }
.vg-gs-inline .vg-icon { width: 14px; height: 14px; }

/* ---- Data visualisation: the growth line ---- */
.vg-viz { position: relative; width: 100%; }
.vg-viz svg { width: 100%; height: auto; overflow: visible; }
.vg-viz__grid { stroke: var(--vg-line); stroke-width: 1; }
.vg-viz__line { fill: none; stroke: var(--vg-green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; transition: stroke-dashoffset 2.4s var(--vg-ease-out) .2s; }
.vg-viz__line--base { stroke: var(--vg-grey-300); stroke-width: 2; stroke-dasharray: 6 8; transition-delay: 0s; }
.vg-viz.is-visible .vg-viz__line { stroke-dashoffset: 0; }
.vg-viz__area { fill: url(#vg-viz-fill); opacity: 0; transition: opacity 1.2s var(--vg-ease) 1.4s; }
.vg-viz.is-visible .vg-viz__area { opacity: 1; }
.vg-viz__dot { fill: var(--vg-bg); stroke: var(--vg-green); stroke-width: 3; opacity: 0; transition: opacity var(--vg-dur) var(--vg-ease); }
.vg-viz.is-visible .vg-viz__dot { opacity: 1; transition-delay: var(--d, 1s); }
.vg-viz__dot--end { fill: var(--vg-yellow); stroke: var(--vg-black); }
.vg-viz__label { font-family: var(--vg-font-display); font-size: 14px; font-weight: 500; fill: var(--vg-text-muted); letter-spacing: .06em; text-transform: uppercase; opacity: 0; transition: opacity var(--vg-dur) var(--vg-ease); }
.vg-viz.is-visible .vg-viz__label { opacity: 1; transition-delay: var(--d, 1s); }
.vg-viz__axis { font-family: var(--vg-font-mono); font-size: 10px; fill: var(--vg-text-muted); }
@media (prefers-reduced-motion: reduce) {
  .vg-viz__line { stroke-dashoffset: 0; transition: none; }
  .vg-viz__area, .vg-viz__dot, .vg-viz__label { opacity: 1; transition: none; }
  .vg-gs__rail::after { transition: none; }
}

/* ---- Bars (used in Google Ads / results visuals) ---- */
.vg-bars { display: flex; align-items: flex-end; gap: .5rem; height: 160px; }
.vg-bars__bar { flex: 1; background: var(--vg-grey-200); border-radius: 2px 2px 0 0; height: var(--h, 40%); transform-origin: bottom; transform: scaleY(0); transition: transform var(--vg-dur-slow) var(--vg-ease-out); transition-delay: calc(var(--i, 0) * 80ms); position: relative; }
.vg-bars__bar--accent { background: var(--vg-green); }
.vg-bars__bar--highlight { background: var(--vg-yellow); }
.is-visible .vg-bars__bar { transform: scaleY(1); }
@media (prefers-reduced-motion: reduce) { .vg-bars__bar { transform: none; transition: none; } }

/* ---- UI mock frames (used by service hero visuals) ---- */
.vg-ui { background: var(--vg-white); border: var(--vg-border); border-radius: var(--vg-radius-md); box-shadow: var(--vg-shadow-md); overflow: hidden; font-size: var(--vg-text-sm); }
.vg-section--dark .vg-ui { background: var(--vg-grey-900); border-color: var(--vg-line-on-dark); }
.vg-ui__bar { display: flex; align-items: center; gap: .5rem; padding: .6rem .9rem; border-bottom: var(--vg-border); font-family: var(--vg-font-mono); font-size: var(--vg-text-xs); color: var(--vg-text-muted); }
.vg-ui__bar::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--vg-green); box-shadow: 14px 0 0 var(--vg-yellow), 28px 0 0 var(--vg-grey-300); margin-right: 1.75rem; }
.vg-ui__body { padding: 1rem; display: grid; gap: .75rem; }
.vg-ui__row { display: grid; gap: .35rem; }
.vg-ui__title { font-weight: 600; color: var(--vg-text); }
.vg-ui__url { font-family: var(--vg-font-mono); font-size: var(--vg-text-xs); color: var(--vg-green-deep); }
.vg-ui__text { color: var(--vg-text-muted); font-size: var(--vg-text-xs); }
.vg-ui__skeleton { height: 8px; border-radius: 4px; background: var(--vg-grey-100); width: var(--w, 100%); }
.vg-ui__pill { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .55rem; border-radius: var(--vg-radius-pill); background: var(--vg-green-tint); color: var(--vg-green-deep); font-size: .6875rem; font-weight: 600; width: max-content; }
.vg-ui__pill--yellow { background: var(--vg-yellow-tint); color: var(--vg-black); }
.vg-ui__pill--grey { background: var(--vg-grey-100); color: var(--vg-grey-700); }
.vg-ui__flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; align-items: center; }
.vg-ui__box { border: var(--vg-border); border-radius: var(--vg-radius-sm); padding: .6rem; font-size: var(--vg-text-xs); display: grid; gap: .3rem; }
.vg-ui__box--accent { border-color: var(--vg-green); background: var(--vg-green-tint); }
.vg-ui__box strong { font-family: var(--vg-font-display); }
