/* BRAINDANCE · Process (Proces)
   One lime line carries the project: it arrives from the Work call-to-action, climbs through five stages and leaves into Contact.
   Base layout (tablet, mobile, reduced motion, no JS): vertical timeline with a filling rail.
   Desktop with motion: pinned journey, a stepped path drawn by scroll, an arrow riding its tip, and a panel for the active stage. */

.process { position: relative; z-index: 2; background: var(--obsidian); padding-bottom: clamp(120px, 14vw, 200px); }

/* entry thread (continues the Work thread at the same x) */
.proc-entry { position: relative; height: clamp(96px, 14vh, 180px); }
.proc-entry-line { position: absolute; left: var(--tx, 50%); top: 0; bottom: 0; width: 2px; margin-left: -1px; }
.proc-entry-line i { position: absolute; inset: 0 0 6px; background: var(--lime); clip-path: inset(0 0 calc((1 - var(--t, 0)) * 100%) 0); }
.proc-entry-line b { position: absolute; left: 50%; bottom: 0; width: 10px; height: 10px; margin-left: -5px; background: var(--lime); transform: scale(var(--t-end, 0)); transition: transform 400ms var(--ease-out); }

/* intro */
.proc-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.proc-head { grid-column: 1 / span 7; }
.proc-eyebrow { margin: 0 0 22px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); display: flex; gap: 12px; }
.proc-eyebrow span { color: var(--lime); }
.proc-h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-stretch: 104%; font-size: clamp(44px, 5.4vw, 88px); line-height: .94; letter-spacing: -.04em; }
.proc-h2 .row { display: block; overflow: hidden; padding-bottom: .08em; }
.proc-h2 .row > span { display: inline-block; transition: transform 900ms var(--ease-out); }
.proc-h2 .row:nth-child(2) > span { transition-delay: 120ms; }
.proc-h2 em { font-style: normal; color: var(--lime); }
.proc-aside { grid-column: 8 / -1; align-self: end; display: grid; gap: 14px; }
.proc-lead { margin: 0; max-width: 42ch; font-size: 17px; line-height: 1.6; font-weight: 500; color: var(--text-2); }
.proc-note { margin: 0; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; color: var(--text-2); }
.proc-eyebrow, .proc-aside, .proc-exit { transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.js .proc-h2:not(.is-in) .row > span { transform: translateY(108%); }
.js .proc-eyebrow:not(.is-in), .js .proc-aside:not(.is-in), .js .proc-exit:not(.is-in) { opacity: 0; transform: translateY(24px); }

/* ── Base: vertical timeline ── */
.proc-journey { grid-column: 1 / -1; position: relative; margin-top: clamp(56px, 8vw, 96px); }
.proc-path, .proc-panel { display: none; }
.proc-steps { list-style: none; margin: 0; padding: 0 0 0 52px; position: relative; display: grid; gap: clamp(44px, 7vw, 72px); }
.proc-steps::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: repeating-linear-gradient(to bottom, rgba(119, 119, 119, .5) 0 3px, transparent 3px 8px); }
.proc-steps::after { content: ""; position: absolute; left: 15px; top: 8px; width: 2px; height: var(--fill, 0px); background: var(--lime); }
.proc-arrow { position: absolute; left: 0; top: 0; width: 40px; height: 16px; z-index: 2; pointer-events: none; }
.proc-arrow svg { display: block; width: 100%; height: 100%; fill: none; stroke: var(--lime); overflow: visible; }
.proc-arrow .shaft { stroke-width: 2; }
.proc-arrow .head { stroke-width: 4; stroke-linecap: square; }
/* vertical mode: arrow points down at the tip of the rail fill */
.proc-steps ~ .proc-arrow, .proc-journey > .proc-arrow { transform: translate(-4px, calc(var(--fill, 0px) - 12px)) rotate(90deg); transform-origin: 20px 8px; }

.ps { position: relative; }
.ps-node { position: absolute; left: -42px; top: 8px; width: 12px; height: 12px; background: var(--obsidian); border: 2px solid var(--muted); transition: background-color 400ms var(--ease-out), border-color 400ms var(--ease-out), transform 400ms var(--ease-out); }
.ps.is-reached .ps-node { background: var(--lime); border-color: var(--lime); }
.ps.is-active .ps-node { transform: scale(1.25); }
.ps-title { margin: 0; }
.ps-jump { all: unset; display: inline-flex; align-items: baseline; gap: 14px; cursor: default; font-family: var(--font-display); font-weight: 800; font-stretch: 108%; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.05; letter-spacing: -.03em; color: var(--muted); transition: color 500ms var(--ease-out); }
.ps-jump:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
.ps-num { font-family: var(--font-mono); font-weight: 500; font-size: 12px; letter-spacing: .1em; color: var(--muted); transition: color 500ms var(--ease-out); }
.ps.is-reached .ps-jump { color: var(--text); }
.ps.is-active .ps-name { color: var(--lime); }
.ps.is-reached .ps-num { color: var(--lime); }
.ps-more { margin-top: 14px; display: grid; gap: 14px; max-width: 58ch; transition: opacity 600ms var(--ease-out); }
.ps-desc { margin: 0; color: var(--text-2); font-size: 17px; line-height: 1.6; }
.js .ps:not(.is-reached) .ps-more { opacity: .78; }
.ps-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ps-tags li { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); border: 1px solid var(--border-strong); border-radius: 2px; padding: 5px 8px; }

/* exit */
.proc-exit { margin-top: clamp(96px, 10vw, 160px); position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 28px; border-top: 1px solid var(--border); padding-top: clamp(40px, 5vw, 64px); }
.proc-exit-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-stretch: 104%; font-size: clamp(30px, 3.6vw, 56px); letter-spacing: -.035em; line-height: 1; }
.proc-exit-title em { font-style: normal; color: var(--lime); }
.proc-exit-sub { margin: 12px 0 0; color: var(--text-2); font-size: 16.5px; }
.proc-thread { position: absolute; z-index: 1; left: var(--tx, 75%); top: var(--ty, 0px); height: var(--th, 0px); width: 2px; margin-left: -1px; pointer-events: none; }
.proc-thread i { position: absolute; inset: 0; background: var(--lime); clip-path: inset(0 0 calc((1 - var(--t, 0)) * 100%) 0); }

/* ── Desktop with motion: pinned journey ── */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .js .proc-stage { height: 400vh; }
  .js .proc-pin { position: sticky; top: 0; height: 100vh; padding-block: calc(var(--header-h) + 20px) 32px; display: flex; }
  .js .proc-pin > .container { height: 100%; grid-template-rows: auto minmax(0, 1fr); row-gap: clamp(24px, 4vh, 48px); }
  .js .proc-h2 { font-size: clamp(44px, min(5.2vw, 8.4vh), 84px); }

  .js .proc-journey { grid-column: 1 / span 7; margin: 0; min-height: 0; }
  .js .proc-path { display: block; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .js .proc-path path { fill: none; }
  .js .pp-base { stroke: rgba(119, 119, 119, .55); stroke-width: 1.5; stroke-dasharray: 3 6; }
  .js .pp-draw { stroke: var(--lime); stroke-width: 2; }
  .js .proc-journey > .proc-arrow { transform: none; transform-origin: 32px 8px; will-change: transform; }
  .js .proc-journey > .proc-arrow .shaft { display: none; } /* the drawn line is the shaft; only the head rides it */

  .js .proc-steps { position: absolute; inset: 0; padding: 0; display: block; }
  .js .proc-steps::before, .js .proc-steps::after { display: none; }
  .js .ps { position: absolute; left: var(--x, 0px); top: var(--y, 0px); width: 0; height: 0; }
  .js .ps-node { left: -7px; top: -7px; width: 14px; height: 14px; }
  .js .ps.is-active .ps-node { transform: scale(1.3); box-shadow: 0 0 0 6px rgba(197, 255, 56, .14); }
  .js .ps-title { position: absolute; left: -7px; bottom: 22px; width: var(--lw, 160px); }
  .js .ps-jump { cursor: pointer; display: grid; gap: 6px; font-size: clamp(15px, 1.25vw, 19px); line-height: 1.15; letter-spacing: -.015em; }
  .js .ps-jump:hover { color: var(--text-2); }
  .js .ps.is-reached .ps-jump:hover { color: var(--text); }
  .js .ps-more { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

  .js .proc-panel { display: grid; grid-column: 8 / -1; align-content: end; gap: 20px; min-height: 0; border-top: 1px solid var(--border); padding-top: 20px; }
  .pp-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
  .pp-num { font-family: var(--font-display); font-weight: 900; font-stretch: 125%; font-size: clamp(88px, min(9vw, 15vh), 160px); line-height: .8; letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 1.5px var(--border-strong); transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out); }
  .pp-art { width: clamp(120px, min(14vw, 24vh), 220px); height: auto; flex-shrink: 0; overflow: visible; }
  .pp-art * { fill: none; stroke: var(--text); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
  .pp-art .lime { stroke: var(--lime); stroke-width: 2; }
  .pp-art .art { opacity: 0; transform: scale(.86) rotate(-6deg); transform-origin: 120px 120px; transform-box: view-box; transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-out); }
  .pp-art .art.on { opacity: 1; transform: none; }
  .pp-art .chk.lime-fill { fill: var(--lime); stroke: var(--lime); }
  .pp-art .blk { transition: fill 400ms var(--ease-out), stroke 400ms var(--ease-out); }
  .pp-art .a3.on .blk:nth-child(-n+5) { fill: var(--lime); stroke: var(--lime); }
  .pp-art .a3.on .blk:nth-child(2) { transition-delay: 80ms; } .pp-art .a3.on .blk:nth-child(3) { transition-delay: 160ms; }
  .pp-art .a3.on .blk:nth-child(4) { transition-delay: 240ms; } .pp-art .a3.on .blk:nth-child(5) { transition-delay: 320ms; }
  .pp-art .ring { stroke: var(--muted); }
  .pp-art .a4.on .ring { animation: pp-pulse 2.4s var(--ease-out) infinite; transform-origin: 104px 136px; transform-box: view-box; }
  .pp-art .a4.on .r2 { animation-delay: .3s; } .pp-art .a4.on .r3 { animation-delay: .6s; }
  .pp-art .launch { stroke-dasharray: 160; stroke-dashoffset: 160; transition: stroke-dashoffset 900ms var(--ease-out) 200ms; }
  .pp-art .a4.on .launch { stroke-dashoffset: 0; }

  .pp-body { display: grid; gap: 12px; transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out); }
  .pp-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-stretch: 108%; font-size: clamp(26px, 2.4vw, 38px); line-height: 1; letter-spacing: -.035em; color: var(--lime); }
  .pp-desc { margin: 0; color: var(--text); font-size: clamp(15px, 1.15vw, 17px); line-height: 1.55; font-weight: 500; max-width: 44ch; }
  .proc-panel.is-out .pp-body, .proc-panel.is-out .pp-num { opacity: 0; transform: translateY(-10px); }
  .proc-panel.is-pre .pp-body, .proc-panel.is-pre .pp-num { opacity: 0; transform: translateY(10px); transition: none; }
}
@keyframes pp-pulse { 0% { opacity: .9; transform: scale(.9); } 70%, 100% { opacity: 0; transform: scale(1.25); } }

/* ── Tablet & mobile ── */
@media (max-width: 1023px) {
  .proc-head, .proc-aside { grid-column: 1 / -1; }
  .proc-aside { margin-top: 24px; }
}
@media (max-width: 639px) {
  .proc-h2 { font-size: clamp(38px, 11vw, 52px); }
  .proc-steps { padding-left: 44px; }
  .proc-steps::before, .proc-steps::after { left: 11px; }
  .ps-node { left: -38px; }
  .proc-journey > .proc-arrow { transform: translate(-8px, calc(var(--fill, 0px) - 12px)) rotate(90deg); }
  .ps-jump { font-size: 26px; flex-direction: column; gap: 6px; display: inline-flex; }
  .ps-desc { font-size: 16px; }
  .proc-exit { flex-direction: column; align-items: stretch; }
  .proc-exit .btn { justify-content: space-between; }
}

/* reduced motion: everything shown, nothing travels */
@media (prefers-reduced-motion: reduce) {
  .js .proc-h2:not(.is-in) .row > span { transform: none; }
  .js .proc-eyebrow:not(.is-in), .js .proc-aside:not(.is-in), .js .proc-exit:not(.is-in) { opacity: 1; transform: none; }
  .js .ps:not(.is-reached) .ps-more { opacity: 1; }
  .proc-entry-line i, .proc-thread i { clip-path: none; }
  .proc-entry-line b { transform: none; }
}
