/*
 * BrainyTech - process story v3, full flow (/onizleme/surec-3/tam only; loaded after Story.css).
 * StoryFull.js adds .fx to the stage and walks a beat clock inside scenes 1-5:
 *   data-b  = the beat in front     data-at = the beats already played
 * Three tools, all scoped to .sv.fx so the storyboard and the other previews stay as they are:
 *   spotlight - the beat's pieces at full strength, the rest step back (--d)
 *   reveal    - a piece is hidden until its beat (--d:0), then drops in
 *   hold      - a piece keeps its previous place and surface until its beat, so each change is seen on its own
 * Scene 6 drops data-b and hands over to the final motion (.play, Story.js).
 */

/* ── spotlight base ── */
.sv.fx[data-b] .e{--d:var(--dim,.62)}
.sv.fx.k1{--dim:.72}
.sv.fx.k2{--dim:.7}
.gp b{transition:opacity .45s ease}

/* ═════ 1 · listening: the notes arrive one by one, the questions last ═════ */
.sv.fx.k1[data-b="1"] :is(.n1,.cY),
.sv.fx.k1[data-b="2"] :is(.n2,.cY),
.sv.fx.k1[data-b="3"] :is(.n3,.cY),
.sv.fx.k1[data-b="4"] :is(.n4,.n5,.cY),
.sv.fx.k1[data-b="5"] :is(.q,.cB){--d:1}
.sv.fx.k1 .n5{transition-delay:.25s}
.sv.fx.k1 .q2{transition-delay:.35s}
.sv.fx.k1 .q3{transition-delay:.7s}
/* the client's cursor drops each note */
.sv.fx.k1:is([data-b="0"],[data-b="1"]) .cY{--x:55%;--y:34%}
.sv.fx.k1[data-b="2"] .cY{--x:74%;--y:25%}
.sv.fx.k1[data-b="3"] .cY{--x:88%;--y:39%}
.sv.fx.k1[data-b="4"] .cY{--x:61%;--y:70%}
.sv.fx.k1:not([data-at~="1"]) :is(.n1,.cY),
.sv.fx.k1:not([data-at~="2"]) .n2,
.sv.fx.k1:not([data-at~="3"]) .n3,
.sv.fx.k1:not([data-at~="4"]) :is(.n4,.n5),
.sv.fx.k1:not([data-at~="5"]) :is(.q,.cB){--d:0;--s:1.12}

/* ═════ 2 · the path: first release lines up, then the path and the later notes, then approval ═════ */
.sv.fx.k2[data-b="1"] :is(.n1,.n2,.n3,.l1,.cB),
.sv.fx.k2[data-b="2"] :is(.rt,.rs,.re,.l2,.n4,.n5),
.sv.fx.k2[data-b="3"] :is(.ok,.cY){--d:1}
.sv.fx.k2 .n2{transition-delay:.2s}
.sv.fx.k2 .n3{transition-delay:.4s}
.sv.fx.k2 :is(.rs,.re){transition-delay:.5s}
.sv.fx.k2 .rt{transition-duration:1.2s}
.sv.fx.k2:not([data-at~="2"]) .rt{--w:0%}
.sv.fx.k2:not([data-at~="2"]) .n4{--x:48%;--y:52%;--w:17%;--h:22%;--r:2deg;--o:1}
.sv.fx.k2:not([data-at~="2"]) .n5{--x:70%;--y:56%;--w:13%;--h:18%;--r:5deg;--o:1}
.sv.fx.k2:not([data-at~="2"]) :is(.rt,.rs,.re,.l2),
.sv.fx.k2:not([data-at~="3"]) .ok{--d:0}
.sv.fx.k2:not([data-at~="3"]) .ok{--s:1.15}

/* ═════ 3 · design: each note turns into its part on its own beat ═════
   1 the system note becomes the system box · 2 the report note becomes the report screen ·
   3 the first note becomes the shared record and the screens rise out of it · 4 the client's comment */
.sv.fx.k3[data-b="1"] :is(.n3,.cB),
.sv.fx.k3[data-b="2"] :is(.n2,.cB),
.sv.fx.k3[data-b="3"] :is(.n1,.sA,.sB,.ar1,.ar2,.lk,.cB),
.sv.fx.k3[data-b="4"] :is(.cm,.cY,.sA,.sB){--d:1}
.sv.fx.k3[data-b="1"] .cB{--x:80%;--y:72%}
.sv.fx.k3[data-b="3"] .cB{--x:60%;--y:73%}
.sv.fx.k3 :is(.sA,.ar1){transition-delay:.25s}
.sv.fx.k3 :is(.sB,.ar2){transition-delay:.4s}
/* screens wait inside the first note */
.sv.fx:is(.k1,.k2) :is(.sA,.sB),
.sv.fx.k3:not([data-at~="3"]) :is(.sA,.sB){--x:37%;--y:21%;--w:13%;--h:28%;--s:.7}
.sv.fx.k3:not([data-at~="3"]) :is(.sA,.sB,.ar1,.ar2,.lk),
.sv.fx.k3:not([data-at~="4"]) :is(.cm,.cY){--d:0}
/* hold: place and paper of a note until its beat */
.sv.fx.k3:not([data-at~="3"]) .n1{--x:37%;--y:21%;--w:17%;--h:28%}
.sv.fx.k3:not([data-at~="2"]) .n2{--x:56%;--y:21%;--w:17%;--h:28%}
.sv.fx.k3:not([data-at~="3"]) .n1,
.sv.fx.k3:not([data-at~="2"]) .n2{display:grid;padding:1.3cqw 1.4cqw;border-radius:4px;background:var(--c-white);border:1.5px solid transparent;
  box-shadow:0 1.2cqw 2.4cqw -1.2cqw rgba(10,44,91,.28)}
.sv.fx.k3:not([data-at~="3"]) .n1::before,
.sv.fx.k3:not([data-at~="2"]) .n2::before{opacity:.85}
.sv.fx.k3:not([data-at~="3"]) .n1 .t,
.sv.fx.k3:not([data-at~="2"]) .n2 .t{opacity:1;position:static;width:auto}
.sv.fx.k3:not([data-at~="3"]) .n1 :is(.w,u),
.sv.fx.k3:not([data-at~="2"]) .n2 :is(.w,.bar,.bars){opacity:0}

/* ═════ 4 · building: one short development ═════
   1 the two screens merge (the comment) · 2 the parts take their states in one sweep: Ready, In progress, Next · 3 shared preview */
.sv.fx.k4{--dim:.6}
.sv.fx.k4[data-b="1"] :is(.sA,.sB,.cd,.cB),
.sv.fx.k4[data-b="2"] :is(.sA,.n2,.n3,.lk,.st1,.st2,.st3,.cB),
.sv.fx.k4[data-b="3"] :is(.pv,.cY){--d:1}
.sv.fx.k4:not([data-b="1"]) .cd{--d:.4}
.sv.fx.k4 .st2{transition-delay:.3s}
.sv.fx.k4 .st3{transition-delay:.6s}
.sv.fx.k4:not([data-at~="2"]) :is(.st1,.st2,.st3),
.sv.fx.k4:not([data-at~="3"]) :is(.pv,.cY){--d:0;--s:1.2}
.sv.fx.k4:not([data-at~="2"]) .sA .cr{opacity:0}

/* ═════ 5 · verifying: 1 the use case runs and passes two checks · 2 a gap is found · 3 fixed ═════ */
.sv.fx.k5[data-b="1"] :is(.spd,.spm,.sA,.ck1,.ck2,.cY),
.sv.fx.k5[data-b="2"] :is(.rg,.gp,.n2,.cB),
.sv.fx.k5[data-b="3"] :is(.gp,.n2,.cB){--d:1}
.sv.fx.k5[data-b="1"] .cY{--x:59%;--y:69%;transition-duration:1.5s}
.sv.fx.k5 .ck1{transition-delay:.45s}
.sv.fx.k5 .ck2{transition-delay:1s}
.sv.fx.k5:not([data-at~="1"]) :is(.ck1,.ck2),
.sv.fx.k5:not([data-at~="2"]) :is(.rg,.gp){--d:0;--s:1.6}
.sv.fx.k5:not([data-at~="3"]) .gp b{display:none}

/* ═════ NARROW (phone): the same beats, phone places ═════ */
@container sv (max-width: 640px){
  .sv.fx.k1:is([data-b="0"],[data-b="1"]) .cY{--x:50%;--y:19%}
  .sv.fx.k1[data-b="2"] .cY{--x:76%;--y:17%}
  .sv.fx.k1[data-b="3"] .cY{--x:40%;--y:49%}
  .sv.fx.k1[data-b="4"] .cY{--x:78%;--y:46%}
  /* the tall phone stage must not open empty: notes still to come wait as faint slots, then land on their beat */
  .sv.fx.k1:not([data-at~="1"]) .n1,
  .sv.fx.k1:not([data-at~="2"]) .n2,
  .sv.fx.k1:not([data-at~="3"]) .n3,
  .sv.fx.k1:not([data-at~="4"]) :is(.n4,.n5){--d:.14;--s:1}

  .sv.fx.k2:not([data-at~="2"]) .n4{--x:52%;--y:63%;--w:42%;--h:14%;--r:-3deg}
  .sv.fx.k2:not([data-at~="2"]) .n5{--x:8%;--y:60%;--w:38%;--h:12%;--r:4deg}

  .sv.fx.k3[data-b="1"] .cB{--x:68%;--y:66%}
  .sv.fx.k3[data-b="3"] .cB{--x:40%;--y:64%}
  .sv.fx:is(.k1,.k2) :is(.sA,.sB),
  .sv.fx.k3:not([data-at~="3"]) :is(.sA,.sB){--x:14%;--y:6%;--w:28%;--h:13%}
  .sv.fx.k3:not([data-at~="3"]) .n1{--x:14%;--y:6%;--w:52%;--h:13%}
  .sv.fx.k3:not([data-at~="2"]) .n2{--x:14%;--y:21%;--w:60%;--h:13%}
  .sv.fx.k3:not([data-at~="3"]) .n1,
  .sv.fx.k3:not([data-at~="2"]) .n2{padding:3cqw 3.4cqw}

  .sv.fx.k5[data-b="1"] .cY{--x:33%;--y:62%}
}

/* ═════ Home page controls: pause / watch again, ticks pick a scene, the steps list ═════ */
.sv.fx .sv-ticks i{padding:6px 0;margin:-6px 0;background-clip:content-box;cursor:pointer}
.sf-ctl{display:flex;flex-wrap:wrap;gap:10px;margin-top:28px}
.sf-btn{display:inline-flex;align-items:center;gap:8px;padding:9px 16px;border-radius:99px;border:1px solid var(--bt-hair);background:var(--bt-surface);
  color:var(--bt-ink);font-family:inherit;font-size:14px;font-weight:600;line-height:1;cursor:pointer;transition:border-color .2s ease}
.sf-btn:hover{border-color:var(--bt-ink2)}
.sf-btn[hidden]{display:none}
.sf-btn:focus-visible,.sf-steps summary:focus-visible,.sf-steps button:focus-visible{outline:2px solid var(--c-signal);outline-offset:2px}
.sf-steps{margin-top:18px;background-image:linear-gradient(90deg,var(--bt-hair),transparent 85%);background-size:100% 1px;background-position:top left;background-repeat:no-repeat}
.sf-steps summary{display:flex;align-items:center;gap:10px;padding:16px 0;cursor:pointer;list-style:none;
  font:500 12px/1 var(--bt-mono);letter-spacing:.08em;text-transform:uppercase;color:var(--bt-ink2)}
.sf-steps summary::-webkit-details-marker{display:none}
.sf-steps summary::after{content:"+";font-size:16px;color:var(--bt-ink2)}
.sf-steps[open] summary::after{content:"–"}
.sf-steps ol{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0;padding:0 0 8px;list-style:none}
.sf-steps button{display:flex;gap:14px;width:100%;height:100%;padding:16px 18px;border-radius:12px;border:1px solid var(--bt-hair);background:transparent;
  font-family:inherit;text-align:left;color:var(--bt-ink2);font-size:14px;line-height:1.5;cursor:pointer;transition:border-color .2s ease}
.sf-steps button:hover{border-color:var(--bt-ink2)}
.sf-steps button b{font:500 11px/1.9 var(--bt-mono);color:var(--bt-ink2)}
.sf-steps button strong{display:block;margin-bottom:4px;font-size:15px;font-weight:700;color:var(--bt-ink)}
.sf-steps button.on{border-color:var(--c-signal)}
.sf-steps button.on b{color:var(--c-signal)}
@media (max-width:900px){.sf-steps ol{grid-template-columns:1fr 1fr}}
@media (max-width:560px){.sf-steps ol{grid-template-columns:1fr}}

/* Home page: the story sits inside the collection, between Software and Integration (rhythm of .sec) */
.stp-in-coll{padding-top:192px;padding-bottom:0;scroll-margin-top:-110px}
@media (max-width:900px){.stp-in-coll{padding-top:84px;scroll-margin-top:-60px}}
/* On the home page the section already has its own title ("How we work together"): the scene kicker would be a third heading level */
.stp-in-coll .sv-cap .kick{display:none}
.stp-in-coll .stp-in{background:none;padding-top:56px}
@media (max-width:900px){.stp-in-coll .stp-in{padding-top:32px}}

/* ═════ The road (home page): six small stops instead of the swapping title. A stop appears when the flow
   reaches it and stays; the current one is larger and shows its sentence; the line grows stop to stop.
   Future stops keep their space (opacity 0) so nothing under the road jumps. ═════ */
.sv-road{display:none}
.stp-in-coll .sv-cap h3,.stp-in-coll .sv-cap .sv-p,.stp-in-coll .sv-cap .sv-ticks{display:none}
.stp-in-coll .sv-road{display:block;list-style:none;margin:0;padding:0}
.sv-road li{position:relative;opacity:0;transform:translateY(8px);transition:opacity .45s var(--bt-out),transform .45s var(--bt-out)}
.sv-road li.on,.sv-road li.done{opacity:1;transform:none}
/* the line to the next stop: drawn once this stop is behind */
.sv-road li:not(:last-child)::before{content:"";position:absolute;left:5px;top:17px;bottom:-5px;width:2px;border-radius:1px;background:currentColor;opacity:.22;
  transform:scaleY(0);transform-origin:top;transition:transform .5s var(--bt-out) .1s}
.sv-road li.done::before{transform:none}
.sv-road button{display:grid;grid-template-columns:12px 1fr;column-gap:14px;align-items:start;width:100%;padding:5px 0 9px;text-align:left;color:inherit;cursor:pointer}
.sv-road i{width:12px;height:12px;margin-top:5px;border-radius:50%;box-shadow:inset 0 0 0 2px currentColor;opacity:.35;transition:background .3s,opacity .3s,box-shadow .3s}
.sv-road li.done i{background:currentColor;box-shadow:none;opacity:.5}
.sv-road li.on i{background:var(--c-signal);box-shadow:0 0 0 4px color-mix(in srgb,var(--c-signal) 22%,transparent);opacity:1}
.sv-road b{font-size:max(14px,1.15cqw);font-weight:600;line-height:1.3;letter-spacing:-.01em;opacity:.55;transition:opacity .3s,font-size .3s}
.sv-road li.on b{font-size:max(17px,1.6cqw);font-weight:800;letter-spacing:-.025em;opacity:1}
.sv-road button:hover b{opacity:1}
.sv-road span{grid-column:2;display:none;margin-top:4px;font-size:max(13px,1cqw);line-height:1.45;color:var(--bt-ink2);max-width:24em}
.sv-road li.on span{display:block;animation:roadIn .4s var(--bt-out)}
.sv-road button:focus-visible{outline:2px solid var(--c-signal);outline-offset:3px;border-radius:6px}
@keyframes roadIn{from{opacity:0;transform:translateY(-3px)}}
@media (prefers-reduced-motion:reduce){.sv-road li,.sv-road li::before,.sv-road i,.sv-road b{transition:none}.sv-road li.on span{animation:none}}
