/* Homepage motion journey: one restrained signal from Graz to Pristina. */
.home-page {
  --journey-progress: 0;
  --journey-edge: clamp(22px, calc((100vw - 1200px) / 2 + 12px), 400px);
  --journey-blue: var(--kosovo-blue);
  --journey-ease: cubic-bezier(.22, 1, .36, 1);
}
[data-theme="dark"] .home-page { --journey-blue: var(--kosovo-blue-bright); }
.home-page main { position: relative; isolation: isolate; }
.home-page main > section { position: relative; z-index: 1; }

.journey-rail {
  position: absolute;
  top: var(--journey-top, 100vh);
  right: var(--journey-edge);
  width: 1px;
  height: var(--journey-height, 0px);
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s ease;
}
.journey-ready .journey-rail { opacity: .88; }
.journey-rail-track,
.journey-rail-fill {
  position: absolute;
  inset: 0;
  width: 1px;
  transform-origin: top;
}
.journey-rail-track { background: color-mix(in srgb, var(--journey-blue) 22%, var(--ridge)); }
.journey-rail-fill {
  height: calc(var(--journey-progress) * 100%);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--journey-blue) 45%, transparent), var(--journey-blue));
  box-shadow: 0 0 12px color-mix(in srgb, var(--journey-blue) 30%, transparent);
}
.journey-signal {
  position: absolute;
  left: 50%;
  top: calc(var(--journey-progress) * 100%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--journey-blue);
  box-shadow:
    0 0 0 5px color-mix(in srgb, var(--journey-blue) 12%, transparent),
    0 0 18px color-mix(in srgb, var(--journey-blue) 70%, transparent);
  transform: translate(-50%, -50%);
}

.journey-marker {
  position: absolute;
  top: clamp(86px, 9vw, 122px);
  right: var(--journey-edge);
  z-index: 6;
  width: 1px;
  height: 1px;
  color: var(--muted-2);
  pointer-events: none;
}
.journey-marker::before {
  content: '';
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--journey-blue) 44%, var(--ridge));
  transform: translate(-50%, -50%);
  transition: background .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.journey-marker::after {
  content: '';
  position: absolute;
  right: 5px;
  top: 0;
  width: clamp(34px, 4vw, 62px);
  height: 1px;
  background: var(--journey-blue);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .72s var(--journey-ease);
}
.journey-marker span {
  position: absolute;
  right: 13px;
  top: 8px;
  font-family: 'Manrope', ui-sans-serif, system-ui, sans-serif;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .12em;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  transition: color .35s ease;
}
[data-motion-scene].is-active .journey-marker::before {
  background: var(--journey-blue);
  border-color: var(--journey-blue);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--journey-blue) 10%, transparent);
}
[data-motion-scene].is-active .journey-marker::after { transform: scaleX(1); }
[data-motion-scene].is-active .journey-marker span { color: var(--journey-blue); }
.band--ink .journey-marker::before { background: var(--ink-band); }

.journey-handoff {
  position: absolute;
  right: var(--journey-edge);
  bottom: -1px;
  width: 1px;
  height: 72px;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}
.journey-handoff::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--journey-blue) 60%, transparent));
  transform: translateY(-100%);
  animation: journey-handoff 1.05s var(--journey-ease) 1.35s both;
}
.journey-handoff::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--journey-blue);
  box-shadow: 0 0 14px color-mix(in srgb, var(--journey-blue) 75%, transparent);
  transform: translate(-50%, -8px);
  animation: journey-handoff-dot 1.05s var(--journey-ease) 1.35s both;
}
@keyframes journey-handoff { to { transform: translateY(0); } }
@keyframes journey-handoff-dot { to { transform: translate(-50%, 68px); } }

/* Journey scenes replace the generic one-size-fits-all reveal. */
.journey-ready [data-motion-scene] .reveal { opacity: 1; transform: none; }
.journey-ready [data-motion-scene] .section-head,
.journey-ready [data-motion-scene] .section-head--split {
  opacity: 0;
  transform: translateY(16px);
  clip-path: inset(0 0 9% 0);
  transition: opacity .7s var(--journey-ease), transform .78s var(--journey-ease), clip-path .78s var(--journey-ease);
}
.journey-ready [data-motion-scene].is-active .section-head,
.journey-ready [data-motion-scene].is-active .section-head--split {
  opacity: 1;
  transform: none;
  clip-path: inset(0);
}

/* Trust: the commercial promise is written in, not counted up. */
.journey-ready #trust .trust-stat,
.journey-ready #trust .trust-grid > div,
.journey-ready #trust .ledger-row {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .68s var(--journey-ease), transform .74s var(--journey-ease);
}
.journey-ready #trust .trust-stat .num { clip-path: inset(0 0 100% 0); transition: clip-path .82s var(--journey-ease); }
.journey-ready #trust.is-active .trust-stat,
.journey-ready #trust.is-active .trust-grid > div,
.journey-ready #trust.is-active .ledger-row { opacity: 1; transform: none; }
.journey-ready #trust.is-active .trust-stat .num { clip-path: inset(0); }
.journey-ready #trust .trust-stat:nth-child(2),
.journey-ready #trust .ledger-row:nth-child(2) { transition-delay: 80ms; }
.journey-ready #trust .trust-stat:nth-child(3),
.journey-ready #trust .ledger-row:nth-child(3) { transition-delay: 160ms; }
.journey-ready #trust .ledger-row:nth-child(4) { transition-delay: 240ms; }
.journey-ready #trust .ledger-row:nth-child(5),
.journey-ready #trust .trust-grid > div:nth-child(2) { transition-delay: 320ms; }

/* Bench: four named people arrive as one shortlist. */
.journey-ready #bench .profile-tile {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .68s var(--journey-ease), transform .76s var(--journey-ease), background .25s var(--ease-out);
}
.journey-ready #bench .profile-tile img { filter: grayscale(.38) saturate(.78); transition: filter .8s var(--journey-ease); }
.journey-ready #bench .profile-spec .avail { text-decoration-color: transparent; transition: color .5s ease, text-decoration-color .5s ease; }
.journey-ready #bench.is-active .profile-tile { opacity: 1; transform: none; }
.journey-ready #bench.is-active .profile-tile img { filter: none; }
.journey-ready #bench.is-active .profile-spec .avail { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, var(--journey-blue) 48%, transparent); }
.journey-ready #bench .profile-tile:nth-child(2) { transition-delay: 80ms; }
.journey-ready #bench .profile-tile:nth-child(3) { transition-delay: 160ms; }
.journey-ready #bench .profile-tile:nth-child(4) { transition-delay: 240ms; }

/* Services: the route branches before each discipline settles in. */
.service-route {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: var(--journey-blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .58s var(--journey-ease);
  pointer-events: none;
}
.journey-ready #services .service-slab {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .66s var(--journey-ease), transform .74s var(--journey-ease), background-color .3s var(--ease-out);
}
.journey-ready #services.is-active .service-slab { opacity: 1; transform: none; }
.journey-ready #services.is-active .service-route { transform: scaleX(1); }
.journey-ready #services .service-slab:nth-child(2),
.journey-ready #services .service-slab:nth-child(2) .service-route { transition-delay: 80ms; }
.journey-ready #services .service-slab:nth-child(3),
.journey-ready #services .service-slab:nth-child(3) .service-route { transition-delay: 160ms; }
.journey-ready #services .service-slab:nth-child(4),
.journey-ready #services .service-slab:nth-child(4) .service-route { transition-delay: 240ms; }
.journey-ready [data-motion-scene]:not(.is-complete) .service-slab:hover { transform: none; }

/* Model: the only sticky scene below the hero. */
@media (min-width: 1024px) and (min-height: 700px) {
  .journey-ready #model { min-height: max(940px, 140vh); overflow: clip; }
  .journey-ready #model > .container { position: sticky; top: 14vh; }
  .journey-ready #model .steps {
    position: relative;
    overflow: visible;
    --model-progress: 0;
  }
  .journey-ready #model .model-dispatch {
    position: absolute;
    z-index: 4;
    left: 12%;
    right: 12%;
    top: -24px;
    height: 8px;
    pointer-events: none;
  }
  .journey-ready #model .model-dispatch-track,
  .journey-ready #model .model-dispatch-fill {
    position: absolute;
    top: 3px;
    left: 0;
    height: 2px;
  }
  .journey-ready #model .model-dispatch-track { width: 100%; background: color-mix(in srgb, var(--journey-blue) 20%, var(--ridge)); }
  .journey-ready #model .model-dispatch-fill {
    width: calc(var(--model-progress) * 100%);
    background: var(--journey-blue);
    box-shadow: 0 0 12px color-mix(in srgb, var(--journey-blue) 45%, transparent);
  }
  .journey-ready #model .model-dispatch-pulse {
    position: absolute;
    top: 0;
    left: calc(var(--model-progress) * 100%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--paper);
    border: 2px solid var(--journey-blue);
    box-shadow: 0 0 18px color-mix(in srgb, var(--journey-blue) 62%, transparent);
    transform: translateX(-50%);
    transition: left .08s linear;
  }
  .journey-ready #model .step { opacity: .42; transition: opacity .55s ease, background .4s ease, transform .55s var(--journey-ease); }
  .journey-ready #model .step.is-current { opacity: 1; transform: translateY(-4px); background: var(--paper-2); }
  .journey-ready #model .step.is-past { opacity: .82; }
  .journey-ready #model .step.is-terminal { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--journey-blue) 58%, var(--ridge)), 0 12px 26px -22px color-mix(in srgb, var(--journey-blue) 72%, transparent); }
  .journey-ready #model .step.is-current::after,
  .journey-ready #model .step.is-past::after { width: 100%; }
  [data-theme="dark"] .journey-ready #model .step.is-current { background: rgba(255,255,255,.035); }
}

/* Cases: source, route, result, explanation. */
.journey-ready #cases .case-row { opacity: 0; transform: translateY(14px); transition: opacity .64s var(--journey-ease), transform .72s var(--journey-ease); }
.journey-ready #cases .cr-metric .arr { display: inline-block; transform: scaleX(0); transform-origin: left; transition: transform .5s var(--journey-ease) 120ms; }
.journey-ready #cases .cr-metric .to { opacity: 0; clip-path: inset(0 100% 0 0); transition: opacity .45s ease 250ms, clip-path .65s var(--journey-ease) 250ms; }
.journey-ready #cases .cr-body { opacity: 0; transform: translateX(-10px); transition: opacity .55s ease 360ms, transform .65s var(--journey-ease) 360ms; }
.journey-ready #cases.is-active .case-row { opacity: 1; transform: none; }
.journey-ready #cases.is-active .cr-metric .arr { transform: scaleX(1); }
.journey-ready #cases.is-active .cr-metric .to { opacity: 1; clip-path: inset(0); }
.journey-ready #cases.is-active .cr-body { opacity: 1; transform: none; }
.journey-ready #cases .case-row:nth-child(2) { transition-delay: 90ms; }
.journey-ready #cases .case-row:nth-child(3) { transition-delay: 180ms; }

/* Kosovo: the signal resolves into the network composition. */
.journey-ready #why .why-points li,
.journey-ready #why .composition { opacity: 0; transform: translateY(14px); transition: opacity .65s var(--journey-ease), transform .72s var(--journey-ease); }
.journey-ready #why.is-active .why-points li,
.journey-ready #why.is-active .composition { opacity: 1; transform: none; }
.journey-ready #why .why-points li:nth-child(2) { transition-delay: 80ms; }
.journey-ready #why .why-points li:nth-child(3) { transition-delay: 160ms; }
.journey-ready #why .composition { transition-delay: 210ms; }
.journey-ready #why .bar-fill { width: 0 !important; }
.journey-ready #why.is-active .bar-fill { width: var(--w) !important; }
.journey-ready #why .bar:nth-child(3) .bar-fill { transition-delay: 90ms; }
.journey-ready #why .bar:nth-child(4) .bar-fill { transition-delay: 180ms; }
.journey-ready #why .bar:nth-child(5) .bar-fill { transition-delay: 270ms; }

/* Contact: the route terminates in a single invitation. */
.journey-ready #contact .cta-aside,
.journey-ready #contact .form-panel { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--journey-ease), transform .78s var(--journey-ease); }
.journey-ready #contact.is-active .cta-aside,
.journey-ready #contact.is-active .form-panel { opacity: 1; transform: none; }
.journey-ready #contact .form-panel { transition-delay: 100ms; }
.journey-ready #contact.is-complete .btn-primary { animation: journey-cta-arrival .72s var(--journey-ease) both; }
@keyframes journey-cta-arrival {
  45% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--journey-blue) 14%, transparent); }
  100% { box-shadow: var(--shadow-sm); }
}

@media (max-width: 1023px) {
  .home-page { --journey-edge: 22px; }
  .journey-marker::after { width: 30px; }
  .journey-marker span { display: none; }
  .journey-rail,
  .journey-marker,
  .journey-handoff { display: none; }
  .journey-ready [data-motion-scene] .section-head::after,
  .journey-ready [data-motion-scene] .section-head--split::after {
    content: '';
    display: block;
    width: 74px;
    height: 1px;
    margin-top: 18px;
    background: var(--journey-blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .72s var(--journey-ease) 100ms;
  }
  .journey-ready [data-motion-scene].is-active .section-head::after,
  .journey-ready [data-motion-scene].is-active .section-head--split::after { transform: scaleX(1); }
  .model-dispatch { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .journey-rail,
  .journey-marker,
  .journey-handoff,
  .model-dispatch { display: none !important; }
  .journey-ready [data-motion-scene] *,
  .journey-ready [data-motion-scene] *::before,
  .journey-ready [data-motion-scene] *::after {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    filter: none !important;
    animation: none !important;
    transition: none !important;
  }
  .journey-ready #why .bar-fill { width: var(--w) !important; }
  .journey-ready #model { min-height: 0 !important; }
  .journey-ready #model > .container { position: static !important; }
}
