/* /companies hero and story (#221, 26 Nov). The company sits in the middle. As the page scrolls, HUGO AI's wide,
   noisy field of the sector narrows: most of it fades and drifts out, the people, partners and investors that
   matter are pulled into orbit, their proofs land, and one introduction goes out. Five steps, then the button.
   Motion: /companies-story.js (transform and opacity only). Classes are prefixed cs- so nothing meets site.css.
   As the orbit forms, a line draws from the company to each node in turn: an investor, a partner, a hire, a
   supplier, a customer, an advisor and an event (Serge #1322).
   Without JS: the hero and the five steps as a plain list. Reduced motion: the five steps as still frames. */

.cs-scrolly { position: relative; }
.cs-js .cs-scrolly { height: 520vh; }
.cs-stage { position: relative; overflow: hidden; }
.cs-js .cs-stage { position: sticky; top: 0; height: 100vh; height: 100svh; }

/* The hero text, over the field at the start */
.cs-hero { position: relative; z-index: 6; text-align: center; padding: clamp(72px, 13vh, 150px) var(--pad) 0; }
.cs-js .cs-hero { position: absolute; inset: 0; }
.cs-hero .cs-in { max-width: 860px; margin: 0 auto; display: grid; justify-items: center; }
.cs-hero h1 { font-size: clamp(40px, 6.4vw, 88px); line-height: .98; font-weight: 600; letter-spacing: -.045em; }
.cs-hero .lead { margin: 22px auto 0; max-width: 46ch; font-size: clamp(17px, 1.6vw, 21px); line-height: 1.45; }
.cs-hero .ctas { justify-content: center; align-items: center; margin-top: 28px; }

/* The five steps. Without JS they are a plain list under the hero. */
.cs-steps { list-style: none; margin: 48px auto 0; padding: 0 var(--pad) 64px; max-width: 640px; display: grid; gap: 14px; counter-reset: cs; }
.cs-steps li { counter-increment: cs; display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: baseline; color: var(--bone); font-size: clamp(18px, 1.8vw, 22px); font-weight: 600; letter-spacing: -.01em; }
.cs-steps li::before { content: counter(cs, decimal-leading-zero); font: 600 13px var(--sans); color: var(--accent-soft); letter-spacing: .08em; }
.cs-js .cs-steps { position: absolute; inset: auto 0 clamp(36px, 9vh, 96px); z-index: 6; margin: 0 auto; padding: 0 var(--pad); display: block; pointer-events: none; }
.cs-js .cs-steps li { position: absolute; left: 0; right: 0; bottom: 0; display: block; text-align: center; opacity: 0; font-size: clamp(22px, 2.6vw, 34px); line-height: 1.15; }
.cs-js .cs-steps li::before { display: block; margin-bottom: 10px; }

/* The end state: the button, once the orbit is formed */
.cs-final { display: none; }
.cs-js .cs-final { display: block; position: absolute; z-index: 6; inset: auto 0 clamp(28px, 7vh, 80px); text-align: center; padding: 0 var(--pad); opacity: 0; pointer-events: none; }
.cs-final h2 { font-size: clamp(24px, 3vw, 40px); line-height: 1.1; }
.cs-final .ctas { justify-content: center; margin-top: 18px; }
.cs-final .caption { margin-top: 12px; }

/* The field: noise (dots and blank cards) and the ones that matter */
.cs-dot, .cs-noise, .cs-pick, .cs-co, .cs-link { position: absolute; left: 0; top: 0; will-change: transform, opacity; pointer-events: none; }
.cs-dot { width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: var(--ash); z-index: 1; }
.cs-noise { z-index: 2; }
.cs-noise .cs-o { transform: translate(-50%, -50%); display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.cs-noise i { width: 26px; height: 26px; border-radius: 50%; background: var(--raised); }
.cs-noise span { display: grid; gap: 5px; }
.cs-noise b { display: block; height: 7px; width: var(--w, 70px); border-radius: 4px; background: var(--line-strong); }
.cs-noise b + b { width: calc(var(--w, 70px) * .6); opacity: .6; }

.cs-pick { z-index: 4; }
/* Scale round the card's own centre (the point the script moves it to), so a smaller card stays where it's put. */
.cs-pick, .cs-co { transform-origin: 0 0; }
.cs-pick .cs-o { transform: translate(-50%, -50%); position: relative; }
.cs-card { display: flex; align-items: center; gap: 9px; padding: 8px 14px 8px 8px; border-radius: 14px; background: var(--card); border: 1px solid var(--line-strong); white-space: nowrap; font-size: 13px; line-height: 1.35; color: var(--ash); }
.cs-card img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--raised); }
.cs-card .mk { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 700 12px var(--sans); color: var(--night); background: var(--c, var(--accent-soft)); }
.cs-card b { display: block; color: var(--bone); font-weight: 600; }
.cs-card small { display: block; font: 600 10px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-soft); margin-bottom: 1px; }
.cs-card .mk.dt { display: grid; place-content: center; line-height: 1; font: 700 14px var(--sans); color: var(--bone); background: var(--raised); }
.cs-card .mk.dt small { margin: 2px 0 0; font-size: 9px; text-align: center; }
.cs-card { transition: border-color .3s; }
.cs-badge { position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 5px; border-radius: 999px; background: linear-gradient(rgba(93, 204, 255, .12), rgba(93, 204, 255, .12)), var(--card); border: 1px solid rgba(93, 204, 255, .35); color: var(--bone); font: 600 11px var(--sans); white-space: nowrap; opacity: 0; }
/* Chips are opaque, so a line never shows through one (#1393). */
.cs-badge.cs-badge-up { top: auto; bottom: calc(100% + 6px); }
.cs-badge.cs-badge-l { left: 0; transform: none; }
.cs-badge.cs-badge-r { left: auto; right: 0; transform: none; }
.cs-badge svg { width: 13px; height: 13px; color: var(--accent-soft); }

/* The company in the middle */
.cs-co { z-index: 5; }
.cs-co .cs-o { transform: translate(-50%, -50%); display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px; border-radius: 18px; background: var(--card); border: 1px solid rgba(93, 204, 255, .45); box-shadow: 0 0 0 6px rgba(93, 204, 255, .06), 0 0 60px rgba(0, 175, 255, .25); white-space: nowrap; }
.cs-co .mk { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font: 700 15px var(--sans); color: var(--night); background: #5dccff; }
.cs-co b { display: block; color: var(--bone); font: 600 17px var(--sans); }
.cs-co small { color: var(--ash); font-size: 13px; }
.cs-ring { position: absolute; left: 0; top: 0; z-index: 3; border: 1px solid rgba(166, 168, 174, .22); border-radius: 50%; pointer-events: none; opacity: 0; }

/* The connections: a line from the company to each node. A dashed guide first, then the solid line draws over it
   (scaleX, tied to scroll), then a small pulse travels along it now and then. */
.cs-link { z-index: 3; height: 2px; margin-top: -1px; transform-origin: 0 50%; opacity: 0; }
.cs-link i { position: absolute; inset: 0; border-radius: 2px; }
.cs-dash { background: repeating-linear-gradient(90deg, rgba(166, 168, 174, .45) 0 5px, transparent 5px 11px); }
.cs-solid { transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, rgba(93, 204, 255, .75), rgba(93, 204, 255, .3)); }
.cs-link .cs-pulse { inset: -2px auto auto -3px; width: 6px; height: 6px; border-radius: 50%; background: #bfeaff; box-shadow: 0 0 10px 2px rgba(93, 204, 255, .7); opacity: 0; }
/* #1571: the web between the connections, thinner and quieter than the lines from the company. */
.cs-link.cs-web { z-index: 2; height: 1px; margin-top: -.5px; }
.cs-web .cs-dash { background: repeating-linear-gradient(90deg, rgba(166, 168, 174, .3) 0 4px, transparent 4px 10px); }
.cs-web .cs-solid { background: rgba(93, 204, 255, .32); }
.cs-link.cs-lit .cs-solid { background: #5dccff; box-shadow: 0 0 12px rgba(93, 204, 255, .6); }
.cs-pick.cs-on .cs-card { border-color: rgba(93, 204, 255, .45); }
.cs-sent { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; opacity: 0; }
.cs-sent span { display: inline-flex; transform: translate(-50%, -50%); align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border-radius: 999px; background: var(--bone); color: var(--night); font: 600 13px var(--sans); white-space: nowrap; }
.cs-sent.cs-side span { transform: translate(0, -50%); }
.cs-sent.cs-above span { transform: translate(-50%, -100%); }
.cs-sent svg { width: 16px; height: 16px; padding: 2px; border-radius: 50%; background: #5dccff; color: var(--night); }

@media (max-width: 720px) {
  .cs-card { font-size: 12px; padding: 6px 10px 6px 6px; gap: 7px; }
  .cs-card img, .cs-card .mk { width: 28px; height: 28px; }
  /* The relation label stays at 9 px or more once the end state scales the cards down at 360 (#1830). */
  .cs-card small { font-size: var(--lab, 11.5px); }
  .cs-co .cs-o { padding: 10px 14px 10px 10px; gap: 10px; }
  .cs-co .mk { width: 36px; height: 36px; }
  .cs-co b { font-size: 15px; }
  .cs-pick.cs-wide, .cs-noise.cs-wide, .cs-link.cs-wide { display: none; }
}

/* Reduced motion: no scroll run; the five steps are still frames, one under the other (built by the script). */
.cs-frames { display: grid; gap: 28px; padding: 8px var(--pad) 64px; max-width: 1200px; margin: 0 auto; }
.cs-frame { position: relative; height: min(72vh, 620px); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; }
.cs-frame .cs-cap { position: absolute; z-index: 7; left: 0; right: 0; bottom: 22px; text-align: center; padding: 0 var(--pad); color: var(--bone); font-size: clamp(18px, 2.2vw, 26px); font-weight: 600; }
.cs-frame .cs-cap small { display: block; margin-bottom: 6px; font: 600 13px var(--sans); color: var(--accent-soft); letter-spacing: .08em; }
/* Phones (#1830): each still frame is as tall and as wide as the live stage, so it shows the same layout as that
   moment of the scroll run instead of squeezing it into a shorter box. */
@media (max-width: 720px) {
  .cs-frames { padding-inline: 0; gap: 16px; }
  .cs-frame { height: 100vh; height: 100svh; border-radius: 0; border-inline: 0; }
}
/* The step list stays for screen readers when the frames replace it. */
.cs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
