.page-hero-sequence {
  --inner-travel: clamp(315px, 65svh, 585px);
}
.page-hero-sequence[data-motion="pinned"]::after {
  content: "";
  display: block;
  height: var(--inner-travel);
}

.page-hero[data-inner-hero] {
  --inner-progress: 0;
  --hero-focus: 0;
  --hero-out: 0;
  --hero-light: 109 77 174;
  --handoff-color: #100e18;
  display: grid;
  padding-block: clamp(18px, 3vw, 41px) clamp(24px, 3.1vw, 46px);
  overflow: clip;
  background:
    radial-gradient(ellipse at calc(81% - 20% * var(--hero-focus)) 46%, rgb(var(--hero-light) / .29), transparent 68%),
    radial-gradient(ellipse at 90% 73%, rgb(88 182 158 / calc(.13 * var(--hero-focus))), transparent 53%),
    var(--ink);
}

.page-hero-sequence[data-motion="pinned"] .page-hero {
  position: sticky;
  top: var(--header-height);
  min-height: calc(100svh - var(--header-height) - 1px);
}

.page-hero[data-scene-profile="ui-ux"],
.page-hero[data-scene-profile="process"] { --hero-light: 140 89 164; }
.page-hero[data-scene-profile="app-development"],
.page-hero[data-scene-profile="web-saas"] { --hero-light: 90 101 183; }
.page-hero[data-scene-profile="ai-agents"],
.page-hero[data-scene-profile="digital-transformation"] { --hero-light: 53 131 144; }
.page-hero[data-scene-profile="localization"],
.page-hero[data-scene-profile="about"],
.page-hero[data-scene-profile="contact"] { --hero-light: 110 88 190; }
.page-hero[data-scene-profile="case"],
.page-hero[data-scene-profile="cases"] { --handoff-color: var(--paper); }

.page-hero[data-inner-hero]::before {
  background-image: radial-gradient(#dec8ff3d .7px, transparent 1px);
  background-size: 21px 21px;
  background-position: calc(-34px * var(--hero-focus)) calc(18px * var(--hero-focus));
  mask-image: radial-gradient(ellipse at 77% 60%, #000a, transparent 70%);
}

.page-hero[data-inner-hero]::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  height: 5px;
  content: "";
  pointer-events: none;
  background: linear-gradient(to top, var(--handoff-color), transparent);
  opacity: var(--hero-out);
}

.page-hero-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: center;
  min-width: 0;
}
.page-hero-shell .breadcrumbs { margin-bottom: clamp(22px, 3vw, 45px); }
.page-hero-shell .page-hero-grid {
  align-self: center;
  grid-template-columns: minmax(0, 1.03fr) minmax(0, 1fr);
  gap: clamp(21px, 3.5vw, 54px);
}

.page-hero[data-inner-hero] .page-intro {
  animation: none;
  transform: translate3d(var(--title-x, 0px), var(--title-y, 0px), 0);
  opacity: var(--title-alpha, 1);
}
.page-hero[data-inner-hero] .page-intro:focus-within { opacity: 1; }
.page-hero[data-inner-hero] .page-intro h1 { font-size: clamp(35px, 5.15vw, 74px); }

.page-scene, .page-media-slot { position: relative; min-width: 0; }
.page-scene {
  isolation: isolate;
  height: clamp(235px, min(32vw, 54svh), 480px);
}
.scene-atmosphere {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 47% 47% at 50% 48%, rgb(var(--hero-light) / .13), transparent 98%);
  transform: translateY(calc(-17px * var(--hero-focus))) scale(calc(1 + .09 * var(--hero-focus)));
}
.scene-atmosphere::before, .scene-atmosphere::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 73%;
  height: 53%;
  border: 1px solid #d5c6ff48;
  border-radius: 50%;
  box-shadow: inset 0 0 17px #d1b5ff1f, 0 0 24px #d1b5ff1c;
  content: "";
  transform: translate(-50%, -50%) rotate(-21deg);
}
.scene-atmosphere::after {
  width: 54%;
  height: 68%;
  border-color: #a5fce548;
  transform: translate(-50%, -50%) rotate(38deg);
}
.page-scene:has(#inner-scene.is-live) .scene-atmosphere::before,
.page-scene:has(#inner-scene.is-live) .scene-atmosphere::after { opacity: .22; }
#inner-scene {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity .62s cubic-bezier(.24,.68,.31,1);
}
#inner-scene.is-live { opacity: 1; }

.page-hero[data-inner-hero] .page-media {
  z-index: 2;
  width: 100%;
  max-width: none;
  animation: none;
  transform: translate3d(var(--media-x, 0px), var(--media-y, 0px), 0) scale(var(--media-scale, 1));
  box-shadow: 0 calc(14px + 23px * var(--hero-focus)) calc(35px + 27px * var(--hero-focus)) #0906114f;
}
.page-hero[data-inner-hero] .page-media::before {
  transform: rotate(calc(-9deg + 16deg * var(--hero-focus))) scale(calc(1 + .04 * var(--hero-focus)));
}
.page-hero[data-inner-hero] .page-media img {
  transform: translate3d(var(--image-x, 0px), var(--image-y, 0px), 0) scale(calc(1 + .048 * var(--hero-focus)));
}
.page-hero[data-inner-hero] .page-media::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: 56%;
  content: "";
  pointer-events: none;
  background: linear-gradient(113deg, transparent 22%, #ffffff35 46%, #c2ffec26 53%, transparent 79%);
  mix-blend-mode: soft-light;
  transform: translateX(calc(-110% + 300% * var(--hero-focus)));
  opacity: calc(.75 * var(--hero-focus));
}

.page-scene-rail {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 17px;
  width: min(100%, 315px);
  margin-top: clamp(23px, 3.7vw, 51px);
}
.page-scene-progress {
  position: relative;
  flex: 1 1 150px;
  min-width: 35px;
  height: 1px;
  background: #d4c5ff42;
}
.page-scene-progress::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, #bf9cff, #b8ffe4);
  box-shadow: 0 0 12px #b9fce86a;
  transform: scaleX(var(--inner-progress));
  transform-origin: left center;
}
.page-scene-rail a {
  flex: none;
  color: #d3cadf;
  font-size: 12px;
  font-weight: 630;
  letter-spacing: .04em;
  padding: 7px 0;
  text-underline-offset: 4px;
}
.page-scene-rail a:hover, .page-scene-rail a:focus-visible {
  color: var(--mint);
  text-decoration: underline;
}
.page-hero-sequence[data-motion="reduced"] .page-scene-progress::after { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .page-hero[data-inner-hero] .page-intro > :is(.eyebrow, h1, .page-lede, .page-actions) {
    animation: inner-type-reveal .83s cubic-bezier(.18,.72,.25,1) both;
  }
  .page-hero[data-inner-hero] .page-intro h1 { animation-delay: .055s; }
  .page-hero[data-inner-hero] .page-intro .page-lede { animation-delay: .12s; }
  .page-hero[data-inner-hero] .page-intro .page-actions { animation-delay: .17s; }
}
@keyframes inner-type-reveal {
  from { opacity: .22; transform: translateY(13px); clip-path: inset(58% -10px -7px -10px); }
  to { opacity: 1; transform: none; clip-path: inset(-8px -10px -7px -10px); }
}

@media (min-width: 821px) and (max-height: 750px) {
  .page-hero[data-inner-hero] { padding-block: 21px 26px; }
  .page-hero[data-inner-hero] .page-intro h1 { font-size: clamp(36px, min(5.1vw, 9.4svh), 68px); }
  .page-hero-shell .breadcrumbs { margin-bottom: 25px; }
  .page-scene { height: clamp(225px, 49svh, 365px); }
  .page-scene-rail { margin-top: 24px; }
}

@media (max-width: 820px) {
  .page-hero-sequence { --inner-travel: clamp(210px, 47svh, 450px); }
  .page-hero-shell .page-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 23px; }
  .page-scene, .page-media-slot { width: 100%; max-width: 580px; margin-inline: auto; }
  .page-scene { height: clamp(188px, min(34svh, 61vw), 305px); }
  .page-media-slot { max-width: min(560px, 80svh); }
  .page-hero[data-inner-hero] .page-intro h1 { font-size: clamp(33px, 8.5vw, 58px); }
  .page-hero[data-inner-hero] .page-lede { font-size: 15px; line-height: 1.72; }
  .page-scene-rail { margin-top: 23px; }
}

@media (max-width: 540px) {
  .page-hero-shell .breadcrumbs { margin-bottom: 23px; }
  .page-hero[data-inner-hero] .page-actions { margin-top: 19px; }
  .page-hero-shell .page-hero-grid { gap: 19px; }
  .page-hero[data-inner-hero] .page-intro h1 { font-size: clamp(31px, 9.3vw, 43px); }
  .page-hero[data-inner-hero] .page-lede { margin-top: 15px; }
  .page-scene-rail { margin-top: 18px; }
}

.scene-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  transition: opacity .52s ease;
}
.page-scene:has(.scene-poster) .scene-atmosphere { visibility: hidden; }
.page-scene:has(#inner-scene.is-live) .scene-poster { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .page-intro h1 { animation: intro-typeset .72s cubic-bezier(.16,.8,.24,1) backwards; }
  .page-intro .page-lede { animation: intro-lede .62s .09s ease-out backwards; }
}
@keyframes intro-typeset {
  from { clip-path: inset(0 0 100% -7px); translate: 0 .23em; }
  to { clip-path: inset(-6px); translate: 0; }
}
@keyframes intro-lede { from { opacity: .2; translate: 0 8px; } }
