/* =============================================================================
 * recruit.css — #recruitment, #careers, #contact (owner: RECRUIT builder; see reports-local/starkservices/SITE_SPEC.md).
 * Motion + visual layers only; tokens, type and the static layout come from base.css. Everything that hides content
 * before it moves is scoped to a class site-src/js/recruit adds, so without JS the sections stay exactly as base.css
 * draws them; under reduced motion the script puts every part in its final state.
 * ========================================================================== */

/* a drawing curve (a pen, not a reveal): gets going, then settles long into the end */
.recruit, .careers, .contact { --rc-draw: cubic-bezier(0.5, 0, 0.15, 1); }

/* ---------- 01 → 04: one engraved rail, a lapis comet, four stations ---------- */
.steps.rc { position: relative; }

.rc-rail {
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}
.rc-groove, .rc-charge { position: absolute; inset: 0; }
.rc-groove { background: var(--rule-2); box-shadow: 0 1px 0 var(--engrave-light); }
/* the groove behind the light stays charged: lapis, thinned */
.rc-charge { background: var(--lapis); opacity: 0.38; transform: scaleX(0); transform-origin: 0 50%; }
.rc-clip { position: absolute; left: 0; right: 0; top: -8px; height: 17px; overflow: hidden; }
.rc-comet { position: absolute; left: 0; top: 8px; width: 0; height: 0; opacity: 0; will-change: transform, opacity; }
.rc-tail {
  position: absolute;
  right: 0;
  top: -1px;
  width: 200px;
  height: 3px;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  background: linear-gradient(90deg, rgba(36, 51, 232, 0) 0%, rgba(36, 51, 232, 0.14) 36%, rgba(36, 51, 232, 0.9) 100%);
  -webkit-clip-path: polygon(0 50%, 100% 0, 100% 100%);
  clip-path: polygon(0 50%, 100% 0, 100% 100%);
}
/* the head: a lapis bead of light, white-hot at its leading edge (shared with the contact line) */
.rc-head, .rc-cta-head {
  position: absolute;
  top: -1px;
  width: 12px;
  height: 3px;
  border-radius: 1px 3px 3px 1px;
  background: linear-gradient(90deg, rgba(36, 51, 232, 0.55) 0%, #2433e8 38%, #4351ff 72%, #e4e7ff 100%);
  box-shadow: 0 0 0 0.5px rgba(36, 51, 232, 0.5), 0 0 6px rgba(36, 51, 232, 0.45);
}
.rc-head { right: -4px; transform-origin: 8px 50%; }

/* stations */
.rc-node {
  position: absolute;
  left: 0;
  top: -3px;
  z-index: 1;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--canvas);
  box-shadow: inset 0 0 0 1.25px var(--ink-4);
  transition: background-color 360ms var(--ease-out), box-shadow 360ms var(--ease-out);
}
/* the ring a station sends out when the light arrives (animated by the script) */
.rc-ring {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--lapis);
  opacity: 0;
  pointer-events: none;
}
.step.is-lit > .rc-node { background: var(--lapis); box-shadow: inset 0 0 0 1.25px var(--lapis), 0 0 0 3px var(--lapis-wash-2); }
/* the graduation: a canvas standing on the groove (drawn by the script) */
.rc-scale { position: absolute; left: 0; bottom: 100%; max-width: none; pointer-events: none; }
.steps.rc .step-num { transition: color 520ms var(--ease-out); }
.steps.rc .step.is-lit .step-num { color: var(--ink); }

/* desktop: the rail replaces the four separate rules */
@media not all and (max-width: 1000px) {
  .steps.rc .step::before { opacity: 0; }
}

/* ≤ 1000 px: one column, the rail runs down the left side and T-joins every step's rule */
@media (max-width: 1000px) {
  .steps.rc { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .steps.rc .step { padding: 30px 0 46px 34px; }
  .steps.rc .step:last-child { padding-bottom: 8px; }
  .steps.rc .step-num { margin-bottom: 24px; }
  .steps.rc .step p { max-width: 34em; }
  .rc-rail { right: auto; bottom: 0; width: 1px; height: auto; }
  .rc-groove { box-shadow: 1px 0 0 var(--engrave-light); }
  .rc-charge { transform: scaleY(0); transform-origin: 50% 0; }
  .rc-clip { left: -8px; right: auto; top: 0; bottom: 0; width: 17px; height: auto; }
  .rc-comet { left: 9px; top: 0; }
  .rc-scale { display: none; }
  .rc-node { left: -3px; top: 49px; }
}
@media (max-width: 560px) {
  .steps.rc .step { padding: 28px 0 40px 30px; }
  .steps.rc .step-num { margin-bottom: 20px; }
  .rc-node { top: 43px; }
}

/* ---------- roles: two serif rows drifting with the scroll ---------- */
/* ink-4 is not a text colour (contrast): the italic names take ink-3, the lowest text step */
.roles span:nth-child(even) { color: var(--ink-3); }
.roles.rc-kinetic > p {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.rc-rows {
  --rc-fade: clamp(40px, 11vw, 210px);
  position: relative;
  display: grid;
  gap: 0.04em;
  padding: 0.08em 0 0.16em;
  font-size: clamp(46px, 6vw, 96px);
}
/* the rows fade out at both ends under the page colour (an overlay, not a mask: the rows move every frame) */
.rc-rows::before,
.rc-rows::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--rc-fade);
  z-index: 1;
  pointer-events: none;
}
.rc-rows::before { left: 0; background: linear-gradient(90deg, #efeeea 0%, rgba(239, 238, 234, 0) 100%); }
.rc-rows::after { right: 0; background: linear-gradient(270deg, #efeeea 0%, rgba(239, 238, 234, 0) 100%); }
.rc-line {
  display: flex;
  gap: 0.34em;
  width: max-content;
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: 1em;
  line-height: 1.12;
  letter-spacing: -0.018em;
  color: var(--ink);
  white-space: nowrap;
  will-change: transform;
}

/* ---------- careers: rows draw in once ---------- */
.rc-check {
  position: absolute;
  top: 29px;
  right: 1px;
  width: 16px;
  height: 16px;
  overflow: visible;
  fill: none;
  stroke: var(--lapis);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rc-check path { stroke-dasharray: 1; stroke-dashoffset: 0; }

.rc-reqs.rc-armed li::before,
.rc-reqs.rc-armed li:last-child::after {
  transform-origin: 0 50%;
  transition: transform 1150ms var(--rc-draw) calc(var(--rc-i, 0) * 170ms);
}
.rc-reqs.rc-armed li:last-child::after { transition-delay: calc(var(--rc-n, 2) * 170ms); }
.rc-reqs.rc-armed .req-label {
  transition: opacity 700ms var(--ease-out) calc(140ms + var(--rc-i, 0) * 170ms), transform 900ms var(--ease-out) calc(140ms + var(--rc-i, 0) * 170ms);
}
.rc-reqs.rc-armed .req-value {
  transition:
    opacity 900ms var(--ease-out) calc(220ms + var(--rc-i, 0) * 170ms),
    transform 1100ms var(--ease-out) calc(220ms + var(--rc-i, 0) * 170ms);
}
/* the check draws itself (a keyframe animation: Chrome does not transition a pathLength-scaled dash offset) */
.rc-reqs.rc-armed.rc-in .rc-check path { animation: rc-tick 640ms var(--rc-draw) calc(700ms + var(--rc-i, 0) * 170ms) both; }
@keyframes rc-tick {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

.rc-reqs.rc-armed:not(.rc-in) li::before,
.rc-reqs.rc-armed:not(.rc-in) li:last-child::after { transform: scaleX(0); }
.rc-reqs.rc-armed:not(.rc-in) .req-label { opacity: 0; transform: translateY(6px); }
.rc-reqs.rc-armed:not(.rc-in) .req-value { opacity: 0; transform: translateY(22px); }
.rc-reqs.rc-armed:not(.rc-in) .rc-check path { stroke-dashoffset: 1; }

/* ---------- contact: one lapis light line under the call to action ---------- */
.rc-cta {
  position: relative;
  display: block;
  width: var(--rc-w, 4.4em);
  max-width: 100%;
  height: 1px;
  margin: 0.32em 0 calc(-0.32em - 1px);
  font-size: clamp(54px, 7.4vw, 124px);
  pointer-events: none;
}
.rc-cta-draw { position: absolute; inset: 0; background: var(--lapis); box-shadow: 0 1px 0 var(--engrave-light); transform-origin: 0 50%; }
.rc-cta-head { left: 0; opacity: 0; }
.rc-cta.rc-armed .rc-cta-draw { transition: transform 1500ms var(--rc-draw) 420ms; }
.rc-cta.rc-armed:not(.rc-in) .rc-cta-draw { transform: scaleX(0); }
.rc-cta.rc-armed.rc-in .rc-cta-head { animation: rc-cta-run 1500ms var(--rc-draw) 420ms both; }
@keyframes rc-cta-run {
  0% { transform: translateX(-6px); opacity: 0; }
  8% { opacity: 1; }
  72% { opacity: 1; }
  100% { transform: translateX(calc(var(--rc-w, 4.4em) - 6px)); opacity: 0; }
}

/* ---------- reduced motion: nothing moves (the script also puts everything in its final state) ---------- */
@media (prefers-reduced-motion: reduce) {
  .rc-comet, .rc-cta-head { display: none; }
  .rc-node, .steps.rc .step-num { transition: none; }
  .rc-ring { display: none; }
}
