/* BRAINDANCE · Services (Usluge)
   A lime arrow rides the thread from About and points at the active area.
   Desktop: the stage is pinned while scroll steps 01 → 04; hover, click and keys take over at any time.
   Mobile: an accordion; the arrow becomes a chevron per row. */

.services { position: relative; z-index: 2; background: var(--obsidian); }

/* intro */
.svc-intro { position: relative; padding-top: clamp(40px, 6vw, 96px); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: end; }
.svc-title { grid-column: 2 / span 6; margin: 0; font-family: var(--font-display); font-weight: 800; font-stretch: 104%; font-size: clamp(40px, 4.6vw, 72px); line-height: .94; letter-spacing: -.04em; }
.svc-title .row { display: block; overflow: hidden; padding-bottom: .08em; }
.svc-title .row > span { display: inline-block; transition: transform 900ms var(--ease-out); }
.svc-title .row:nth-child(2) > span { transition-delay: 120ms; color: var(--lime); }
.svc-lead { grid-column: 8 / -1; margin: 0; max-width: 40ch; color: var(--text-2); font-size: 17px; line-height: 1.6; font-weight: 500; }

.js .svc-title:not(.is-in) .row > span { transform: translateY(108%); }
.js .svc-lead:not(.is-in) { opacity: 0; transform: translateY(24px); }
.svc-lead { transition: opacity 700ms var(--ease-out) 120ms, transform 700ms var(--ease-out) 120ms; }

/* stage */
.svc-stage { position: relative; }
.svc-pin { position: relative; padding-block: clamp(48px, 6vw, 88px) clamp(64px, 8vw, 120px); }
.svc-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }

/* rail + arrow */
.svc-rail { grid-column: 1; grid-row: 1; position: relative; align-self: stretch; }
.rail-line { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: rgba(197, 255, 56, .28); transform-origin: top; transition: transform 900ms var(--ease-out); }
.rail-trail { position: absolute; left: 0; width: 2px; background: var(--lime); top: var(--trail-top, 0px); height: var(--trail-h, 0px); opacity: var(--trail-o, 0); transition: opacity 300ms var(--ease-out); }
.svc-arrow {
  position: absolute; left: -5px; top: 0; width: 72px; height: 28px; margin-top: -14px;
  transform: translateY(var(--ay, 0px)); transition: transform 560ms cubic-bezier(.22, 1, .36, 1), opacity 500ms var(--ease-out);
  will-change: transform;
}
.svc-arrow svg { display: block; width: 100%; height: 100%; overflow: visible; fill: none; stroke: var(--lime); transition: transform 360ms cubic-bezier(.22, 1, .36, 1); transform-origin: 6px 14px; }
.svc-arrow .shaft { stroke-width: 2; }
.svc-arrow .head { stroke-width: 6; stroke-linecap: square; stroke-linejoin: miter; }
.svc-arrow::before { content: ""; position: absolute; left: 0; top: 9px; width: 10px; height: 10px; background: var(--lime); }
.svc-arrow.is-nudge svg { transform: translateX(6px); }
/* pivot sits on the rail (x = 6 in arrow space), so the turned arrow stays centred on the line */
.js .svc-stage:not(.is-in) .rail-line { transform: scaleY(0); }
.js .svc-stage:not(.is-in) .svc-arrow { opacity: 0; }

/* list */
.svc-list { grid-column: 2 / span 6; grid-row: 1; position: relative; }
.svc-item { position: relative; border-top: 1px solid var(--border); }
.svc-item:last-child { border-bottom: 1px solid var(--border); }
.svc-item::before { content: ""; position: absolute; left: 0; top: -1px; width: 100%; height: 1px; background: var(--lime); transform: scaleX(0); transform-origin: left; transition: transform 800ms var(--ease-out), opacity 800ms var(--ease-out) 600ms; opacity: 0; }
.svc-stage.is-in .svc-item::before { animation: line-in 1400ms var(--ease-out) both; animation-delay: calc(var(--n) * 80ms); }
@keyframes line-in { 0% { transform: scaleX(0); opacity: 1; } 55% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
.svc-item:nth-child(1) { --n: 0; } .svc-item:nth-child(2) { --n: 1; } .svc-item:nth-child(3) { --n: 2; } .svc-item:nth-child(4) { --n: 3; }

.svc-tab {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; column-gap: 20px;
  background: none; border: 0; padding: clamp(10px, 1.4vw, 18px) 0; margin: 0; cursor: pointer; text-align: left; color: inherit;
}
.svc-tab:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }
.svc-tab .idx { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .1em; color: var(--muted); transition: color 400ms var(--ease-out); align-self: start; padding-top: .9em; }
.svc-tab .name {
  font-family: var(--font-display); font-weight: 800; font-stretch: 104%;
  font-size: clamp(44px, 6vw, 100px); line-height: .95; letter-spacing: -.04em;
  color: rgba(245, 245, 242, .22); transition: color 400ms var(--ease-out), transform 560ms cubic-bezier(.22, 1, .36, 1);
}
.svc-tab:hover .name { color: rgba(245, 245, 242, .4); }
.svc-tab[aria-selected="true"] .name { color: var(--text); transform: translateX(24px); }
.svc-tab[aria-selected="true"] .idx { color: var(--lime); }
.svc-tab .chev { display: none; }

.js .svc-stage:not(.is-in) .svc-tab { opacity: 0; transform: translateY(24px); }
.svc-tab { transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: calc(var(--n) * 80ms); }

/* panel */
.svc-panel { grid-column: 8 / -1; grid-row: 1; display: grid; gap: 22px; align-content: center; }
.js .svc-stage:not(.is-in) .svc-show { clip-path: inset(0 50% 0 50%); opacity: 0; }
.svc-show {
  position: relative; width: min(100%, calc(56vh * .8)); aspect-ratio: 4 / 5; overflow: hidden;
  border: 1px solid var(--border-strong); border-radius: 6px; background: #0d0d0d;
  clip-path: inset(0 0 0 0); transition: clip-path 1100ms var(--ease-out) 300ms, opacity 400ms var(--ease-out) 300ms;
  --px: 0; --py: 0;
}
.show { position: absolute; inset: 0; visibility: hidden; }
.show.is-shown { visibility: visible; }
.show-tag { position: absolute; z-index: 3; left: 12px; bottom: 12px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); background: rgba(9, 9, 9, .72); padding: 5px 9px; border-radius: 2px; }
.show-tag-dark { color: #3b3b37; background: rgba(245, 245, 242, .8); }
.par { transform: translate3d(calc(var(--px) * var(--d, 8) * 1px), calc(var(--py) * var(--d, 8) * 1px), 0); }

/* 01 Digital */
.show-digital { background: radial-gradient(70% 60% at 70% 30%, #1b1b19, #0b0b0b 70%); }
.sd-browser { position: absolute; left: 7%; top: 9%; width: 86%; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; background: #111; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .9); transform: translate3d(calc(var(--px) * 6px), calc(var(--py) * 6px), 0); }
.sd-chrome { height: 22px; display: flex; align-items: center; gap: 5px; padding: 0 9px; background: #141414; border-bottom: 1px solid var(--border); }
.sd-chrome i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.sd-chrome span { margin-left: 8px; font-family: var(--font-mono); font-size: 9px; color: var(--text-2); }
.sd-screen { position: relative; aspect-ratio: 16 / 11; overflow: hidden; background: #fff; }
.sd-phone { position: absolute; right: 7%; bottom: 9%; width: 31%; aspect-ratio: 9 / 19.5; border-radius: 16px; border: 4px solid #1d1d1d; background: #000; overflow: hidden; box-shadow: 0 30px 60px -16px rgba(0, 0, 0, .95), 0 0 0 1px var(--border-strong); transform: translate3d(calc(var(--px) * 14px), calc(var(--py) * 14px), 0); }
.sd-phone-screen { position: absolute; inset: 0; overflow: hidden; background: #fff; }
.web-col-phone { width: 100%; animation-duration: 18s; }

/* 02 Brending */
.show-brand { background: var(--text); color: var(--obsidian); }
.sb-grid { position: absolute; inset: 0; background-image: linear-gradient(to right, rgba(9, 9, 9, .06) 1px, transparent 1px), linear-gradient(to bottom, rgba(9, 9, 9, .06) 1px, transparent 1px); background-size: 12.5% 10%; }
.sb-logo { position: absolute; left: 50%; top: 8%; width: 54%; height: auto; transform: translateX(-50%) translate3d(calc(var(--px) * 6px), calc(var(--py) * 6px), 0); }
.sb-swatches { position: absolute; left: 7%; right: 7%; bottom: 25%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sb-swatches span { display: grid; gap: 4px; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .04em; color: #55554f; }
.sb-swatches span::before { content: ""; aspect-ratio: 1.3 / 1; background: var(--c); border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(9, 9, 9, .14); }
.sb-swatches b { font-family: var(--font-body); font-weight: 700; font-size: 10px; color: var(--obsidian); }
.sb-type { position: absolute; left: 7%; right: 7%; bottom: 7%; display: flex; align-items: flex-end; justify-content: space-between; border-top: 1px solid rgba(9, 9, 9, .15); padding-top: 10px; }
.sb-type .aa { font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: clamp(28px, 3vw, 44px); line-height: .9; letter-spacing: -.04em; }
.sb-type .gl { font-family: var(--font-mono); font-size: 9px; color: #55554f; text-align: right; line-height: 1.6; }
.show-brand .show-tag { left: auto; right: 12px; top: 12px; bottom: auto; }

/* 03 Marketing */
.show-mkt { background: #111; }
.sm-reel { position: absolute; left: 7%; top: 7%; width: 41%; aspect-ratio: 9 / 16; background: var(--obsidian); border: 1px solid var(--border-strong); border-radius: 6px; padding: 7%; display: flex; flex-direction: column; transform: translate3d(calc(var(--px) * 10px), calc(var(--py) * 10px), 0); }
.sm-reel-bar { display: flex; gap: 3px; }
.sm-reel-bar i { flex: 1; height: 2px; background: rgba(245, 245, 242, .25); }
.sm-reel-bar i:first-child { background: var(--text); }
.sm-reel-words { margin-top: auto; display: flex; flex-direction: column; font-family: var(--font-display); font-weight: 800; font-stretch: 112%; font-size: clamp(13px, 1.3vw, 19px); line-height: 1; letter-spacing: -.03em; }
.sm-reel-words .hl { color: var(--lime); }
.sm-reel-foot { margin-top: 10%; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.sm-post { position: absolute; right: 7%; top: 7%; width: 44%; aspect-ratio: 1; background: var(--lime); color: var(--obsidian); border-radius: 6px; padding: 7%; display: flex; flex-direction: column; transform: translate3d(calc(var(--px) * 6px), calc(var(--py) * 6px), 0); }
.sm-post img { width: 30%; height: auto; }
.sm-post p { margin: auto 0 0; font-family: var(--font-display); font-weight: 800; font-stretch: 106%; font-size: clamp(12px, 1.15vw, 17px); line-height: 1.05; letter-spacing: -.02em; }
.sm-post span { margin-top: 8px; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; }
.sm-ad { position: absolute; right: 7%; bottom: 13%; width: 56%; background: #fff; color: #202124; border-radius: 6px; padding: 5%; font-family: Arial, Helvetica, sans-serif; display: grid; gap: 4px; box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .9); transform: translate3d(calc(var(--px) * 14px), calc(var(--py) * 14px), 0); }
.sm-ad-sp { font-size: 9px; font-weight: 700; color: #202124; }
.sm-ad b { font-size: clamp(10px, .9vw, 13px); font-weight: 400; color: #1a0dab; line-height: 1.25; }
.sm-ad p { margin: 0; font-size: clamp(9px, .75vw, 11px); color: #4d5156; line-height: 1.4; }
.sm-ad-fmt { margin-top: 4px; font-family: var(--font-mono); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; color: #777; }

/* 04 Video Produkcija */
.show-prod { background: #0b0b0b; }
.sp-film { position: absolute; left: 7%; right: 7%; top: 7%; height: 46%; overflow: hidden; border-radius: 4px; background: #050505; border: 1px solid var(--border-strong); }
.sp-tc { position: absolute; right: 8px; top: 8px; z-index: 3; font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; color: rgba(245, 245, 242, .78); font-variant-numeric: tabular-nums; }
.sp-timeline { position: absolute; left: 7%; right: 7%; top: 57%; height: 18%; display: grid; gap: 5px; align-content: start; padding: 8px; border: 1px solid var(--border); border-radius: 4px; background: #101010; }
.sp-track { position: relative; height: 12px; background: #161616; border-radius: 2px; }
.sp-track i { position: absolute; top: 1px; bottom: 1px; left: var(--a); width: var(--b); background: rgba(197, 255, 56, .16); border: 1px solid rgba(197, 255, 56, .55); border-radius: 2px; }
.sp-track.audio i { background: repeating-linear-gradient(90deg, rgba(245, 245, 242, .35) 0 1px, transparent 1px 3px); border-color: var(--border-strong); }
/* playhead: a full-width carrier moves by transform (no per-frame layout); its ::before is the 2px line */
.sp-timeline { overflow: hidden; }
.sp-head { position: absolute; top: 4px; bottom: 4px; left: 8px; right: 10px; pointer-events: none; animation: playhead 6s linear infinite; }
.sp-head::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--lime); }
@keyframes playhead { from { transform: translateX(0); } to { transform: translateX(100%); } }
.sp-photos { position: absolute; left: 7%; right: 7%; top: 79%; bottom: 14%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sp-photos span { border: 1px dashed rgba(245, 245, 242, .25); border-radius: 4px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* copy */
.svc-copy { display: grid; gap: 16px; max-width: 46ch; }
.svc-desc { margin: 0; font-size: 18px; line-height: 1.55; font-weight: 500; color: var(--text); min-height: 4.65em; }
.svc-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.svc-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; opacity: 1; transform: none; transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out); transition-delay: calc(var(--k, 0) * 30ms); }
.svc-desc { transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out); }
.svc-copy.is-out .svc-desc, .svc-copy.is-out .svc-tags li { opacity: 0; transform: translateY(-12px); transition-delay: 0ms; }
.svc-copy.is-pre .svc-desc, .svc-copy.is-pre .svc-tags li { opacity: 0; transform: translateY(12px); transition: none; }
.svc-link { justify-self: start; margin-top: 4px; font-weight: 600; color: var(--text); text-decoration: none; padding-bottom: 4px; background: linear-gradient(var(--lime), var(--lime)) 0 100% / 0 2px no-repeat, linear-gradient(var(--border-strong), var(--border-strong)) 0 100% / 100% 1px no-repeat; transition: background-size var(--dur-ui) var(--ease-out); }
.svc-link:hover { background-size: 100% 2px, 100% 1px; }

/* exit into the light section */
.svc-exit { position: relative; height: 2px; }
.svc-exit i { position: absolute; inset: 0; background: var(--lime); transform: scaleX(var(--x, 0)); transform-origin: left; }
.next-up-light { background: var(--text); color: var(--obsidian); border-top: 0; clip-path: inset(0 0 calc((1 - var(--r, 1)) * 100%) 0); }
.next-up-light p { color: #55554f; }

/* ── Desktop: pinned stage, scroll steps through 01 → 04 ── */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .svc-stage { height: 300vh; }
  .svc-pin { position: sticky; top: 0; height: 100vh; padding-block: calc(var(--header-h) + 24px) 32px; display: flex; align-items: center; }
  .svc-pin > .container { width: 100%; }
}

/* ── Tablet ── */
@media (max-width: 1023px) {
  .svc-title { grid-column: 2 / -1; }
  .svc-lead { grid-column: 2 / -1; margin-top: 20px; }
  .svc-intro { align-items: start; }
  .svc-list { grid-column: 2 / -1; }
  .svc-panel { grid-column: 2 / -1; grid-row: 2; margin-top: 40px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .svc-rail { grid-row: 1; }
  .svc-show { width: 100%; }
  .svc-tab .name { font-size: clamp(44px, 9vw, 84px); }
  .svc-arrow { width: 40px; height: 16px; margin-top: -8px; }
  .svc-arrow::before { top: 3px; }
}

/* ── Mobile: accordion, arrow becomes a chevron per row ── */
@media (max-width: 639px) {
  .svc-intro { display: block; padding-top: 24px; }
  .svc-title { font-size: clamp(36px, 11vw, 52px); }
  .svc-lead { margin-top: 18px; }
  .svc-grid { display: block; }
  .svc-rail { display: none; }
  .svc-tab { grid-template-columns: auto 1fr auto; min-height: 72px; align-items: center; padding: 16px 0; column-gap: 14px; }
  .svc-tab .idx { padding-top: 0; align-self: center; }
  .svc-tab .name { font-size: clamp(34px, 10.5vw, 48px); }
  .svc-tab[aria-selected="true"] .name { transform: none; }
  .svc-tab .chev { display: block; width: 28px; height: 28px; position: relative; }
  .svc-tab .chev::before { content: ""; position: absolute; inset: 7px 9px 7px 5px; border: solid var(--muted); border-width: 3px 3px 0 0; transform: rotate(45deg); transition: transform 360ms cubic-bezier(.22, 1, .36, 1), border-color 300ms; }
  .svc-tab[aria-selected="true"] .chev::before { border-color: var(--lime); transform: rotate(135deg); }
  .svc-item.is-open::after { content: ""; position: absolute; left: -10px; top: 20px; height: 40px; width: 2px; background: var(--lime); } /* marker beside the open row only, so it never crosses the panel dividers */
  .svc-panel { display: grid; grid-template-columns: 1fr; gap: 18px; margin: 0 0 28px; }
  .svc-copy { max-width: none; }
  .svc-show { width: auto; margin-inline: calc(-1 * max(var(--gutter), env(safe-area-inset-left, 0px))); border-radius: 0; border-inline: 0; }
  .svc-desc { font-size: 17px; min-height: 0; }
  .svc-item.is-open .svc-tab .name { color: var(--text); }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .js .svc-title:not(.is-in) .row > span, .js .svc-lead:not(.is-in), .js .svc-stage:not(.is-in) .svc-tab { opacity: 1; transform: none; }
  .js .svc-stage:not(.is-in) .rail-line { transform: none; }
  .js .svc-stage:not(.is-in) .svc-arrow { opacity: 1; }
  .js .svc-stage:not(.is-in) .svc-show { clip-path: none; opacity: 1; }
  .next-up-light { clip-path: none; }
}

/* five areas on the English site */
.svc-item:nth-child(5) { --n: 4; }
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .svc-stage:has(.svc-item:nth-child(5)) { height: 375vh; }
}
/* Motion Design scene: real motion work */
.show-motion { background: #0b0b0b; }
.smo-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

/* English names are longer ("Motion Design", "Video Editing"): one line, slightly smaller type */
html[lang="en"] .svc-tab .name { white-space: nowrap; font-size: clamp(40px, 5.2vw, 88px); }
@media (max-width: 1023px) { html[lang="en"] .svc-tab .name { font-size: clamp(36px, 7.6vw, 72px); } }
@media (max-width: 639px) { html[lang="en"] .svc-tab .name { font-size: clamp(26px, 8.2vw, 40px); } }
