/* Shared motion language: deliberate entrances, quiet depth, native interactions. */
:root{--motion-ease:cubic-bezier(.22,1,.36,1);--motion-soft:cubic-bezier(.16,1,.3,1)}

/* Authored title lines stay selectable, readable and in their original order. */
.motion-line{display:block;overflow:clip;padding-bottom:.14em;margin-bottom:-.14em}
.motion-line-ink{display:block;transform-origin:left bottom}
.motion-line-break{display:none}
.hero h1 .motion-line,.hero h1 .motion-line-ink,.contact h2 .motion-line,.contact h2 .motion-line-ink{color:inherit}
.section-label .label-line,.chapter-kicker>span:last-child{transform-origin:left center}

/* Requested desktop spacing correction: bring the artwork closer to the title. */
@media(min-width:1101px){
  .hero-grid{grid-template-columns:minmax(0,.88fr) minmax(0,1.12fr);gap:32px;padding-top:48px;padding-bottom:50px}
}

/* Passive reading progress, with no manual animation control. */
.motion-scroll-progress{position:fixed;z-index:70;left:0;right:0;top:0;height:2px;background:#8d85ff;pointer-events:none;transform:scaleX(0);transform-origin:left center}

/* Current location is also exposed to assistive technology through aria-current. */
#main-nav>a,.story-header nav>a{position:relative}
#main-nav>a:after,.story-header nav>a:after{content:"";position:absolute;left:0;right:0;bottom:-10px;height:1px;background:#aaa5ff;transform:scaleX(0);transform-origin:left;transition:transform .55s var(--motion-ease)}
#main-nav>a:hover:after,#main-nav>a:focus-visible:after,#main-nav>a.motion-nav-active:after,.story-header nav>a:hover:after,.story-header nav>a:focus-visible:after{transform:scaleX(1)}
#main-nav>a.motion-nav-active{color:#fff}
.story-contents li a{position:relative;transition:color .3s,padding-left .45s var(--motion-ease)}
.story-contents li a:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:#635bff;transform:scaleX(0);transform-origin:left}
.story-contents li a.motion-nav-active{color:#5146b2;padding-left:8px}
.story-contents li a.motion-nav-active:after{transform:scaleX(var(--motion-chapter-progress,0))}
.story-contents li a.motion-nav-active>span,.story-contents li a.motion-nav-read>span{color:#635bff}
.story-contents li a.motion-nav-read:after{transform:scaleX(1);opacity:.2}

/* Image motion never changes layout, captions, crop ratios or the original assets. */
.motion-depth{translate:0 var(--motion-parallax-y,0px)}
.motion-image-frame{overflow:hidden;position:relative;background:#e7e7ef}
.motion-image-frame>img{transform:scale(1.06);transition:transform 1.3s var(--motion-soft)}
.motion-enabled .country-photo,.motion-enabled .project-photo{transform:scale(1.06);transition:transform 1.3s var(--motion-soft),filter .65s}
.motion-enabled .art-grid{inset:-24px}

/* Structured reveals continue into the three chapters on the homepage. */
.history-dot:after{content:"";position:absolute;inset:0;background:#9086df;transform:scaleX(0);transform-origin:left;transition:transform 1.2s var(--motion-soft) .18s}
.history-step.motion-in-view .history-dot:after{transform:scaleX(1)}
.activity-card{transition:background .5s,box-shadow .7s var(--motion-ease),transform .7s var(--motion-ease)}
.country-card{transition:transform .7s var(--motion-ease),border-color .45s,box-shadow .7s var(--motion-ease)}
.project-card .project-meta,.project-card h3,.project-card>p{transition:translate .65s var(--motion-ease)}
.group-structure-link span,.story-button span,.story-home span,.story-toc-home span,.story-read span,.service-preview-link span,.dialog-back span,.story-footer-top>a>span{display:inline-block;transition:transform .5s var(--motion-ease)}
.service-preview-link{transition:background .3s,border-color .3s,transform .45s var(--motion-ease)}
.story-button{transition:background .3s,box-shadow .5s,transform .5s var(--motion-ease)}

/* Replaces the earlier generic modal/menu entrance with coordinated child motion. */
.motion-enabled dialog[open],.motion-enabled #main-nav.is-open{animation:none}
.motion-enabled dialog[open]::backdrop{animation:nexora-surface-backdrop .4s ease-out both}
@keyframes nexora-surface-backdrop{from{opacity:0}to{opacity:1}}

@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  .activity-card:hover,.activity-card:focus-within{transform:translateY(-4px);box-shadow:0 14px 28px #3430500b}
  .country-card:hover,.country-card:focus-visible{transform:translateY(-6px);box-shadow:0 18px 38px #0003}
  .country-card:hover .country-photo,.country-card:focus-visible .country-photo,.project-visual:hover .project-photo,.project-visual:focus-visible .project-photo{transform:scale(1.105)}
  .story-figure:hover .motion-image-frame>img{transform:scale(1.085)}
  .project-card:hover .project-meta,.project-card:hover h3,.project-card:hover>p{translate:0 -3px}
  .group-structure-link:hover span,.story-button:hover span,.story-home:hover span,.service-preview-link:hover span{transform:translate(3px,-3px)}
  .story-toc-home:hover span,.dialog-back:hover span{transform:translateX(-4px)}
  .story-footer-top>a:hover>span{transform:translateY(-4px)}
  .story-button:hover{transform:translateY(-3px);box-shadow:0 9px 24px #635bff26}
  .service-preview-link:hover{transform:translateX(2px)}
}

/* A short, finite arrival gives the emblem depth and then returns it to rest. */
@media(prefers-reduced-motion:no-preference){
  .motion-enabled .story-emblem.motion-in-view img{animation:nexora-story-float 3.6s ease-in-out 1}
  .motion-enabled .story-emblem.motion-in-view .emblem-orbit{animation:nexora-story-orbit 3.8s var(--motion-ease) 1}
  .motion-enabled .story-emblem.motion-in-view .orbit-two{animation:nexora-story-orbit-two 4.2s var(--motion-ease) 1}
  .motion-enabled .motion-ambient.motion-offscreen,.motion-enabled .motion-ambient.motion-offscreen:before,.motion-enabled .motion-ambient.motion-offscreen:after,.motion-enabled .motion-ambient.motion-offscreen *,.motion-enabled .motion-ambient.motion-offscreen *:before,.motion-enabled .motion-ambient.motion-offscreen *:after{animation-play-state:paused!important}
}
@keyframes nexora-story-float{0%,100%{transform:translateY(0) rotate(0)}45%{transform:translateY(-14px) rotate(1.8deg)}}
@keyframes nexora-story-orbit{from{transform:rotate(7deg)}to{transform:rotate(29deg)}}
@keyframes nexora-story-orbit-two{from{transform:rotate(49deg) translate(28px,10px)}to{transform:rotate(29deg) translate(20px,20px)}}
@media(max-width:800px) and (prefers-reduced-motion:no-preference){
  .motion-enabled .story-emblem.motion-in-view img{animation-name:nexora-story-float-mobile}
}
@keyframes nexora-story-float-mobile{0%,100%{transform:translateY(0)}45%{transform:translateY(-7px)}}

/* Progressive cross-document transitions; links, URLs and browser Back stay native. */
@view-transition{navigation:auto}
::view-transition-group(root){animation-duration:.24s}
::view-transition-old(root){animation:nexora-page-out .18s ease-out both}
::view-transition-new(root){animation:nexora-page-in .28s var(--motion-ease) both}
@keyframes nexora-page-out{to{opacity:0}}
@keyframes nexora-page-in{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}

/* Background tabs suspend finite decoration and release all WAAPI effects. */
html.motion-background *,html.motion-background *:before,html.motion-background *:after{animation-play-state:paused!important}
html.motion-background dialog::backdrop{animation:none!important}
@media(max-width:980px){#main-nav>a:after{bottom:-5px;right:auto;width:24px}}
@media(max-width:580px){.history-dot:after{display:none}}
/* Touch interactions have no sticky hover movement inherited from the first pass. */
@media(hover:none),(pointer:coarse){
  .country-card:hover,.country-card:focus-visible,.project-visual:hover,.project-visual:focus-visible,.button:hover,.button:focus-visible{transform:none}
  .country-card:hover .country-photo,.country-card:focus-visible .country-photo,.motion-enabled .country-card:hover .country-photo,.motion-enabled .country-card:focus-visible .country-photo{transform:scale(1.06)}
  .activity-card:hover .activity-top svg,.activity-card:focus-within .activity-top svg,.country-card:hover .country-art,.country-card:focus-visible .country-art,.country-card:hover .circle-arrow,.country-card:focus-visible .circle-arrow,.project-visual:hover .project-open,.project-visual:focus-visible .project-open,.contact-action:hover .contact-arrow,.contact-action:focus-visible .contact-arrow,.button:hover span,.button:focus-visible span,.text-link:hover span,.text-link:focus-visible span,.nav-contact:hover span,.back-top:hover span{transform:none}
  .project-visual:hover .building,.project-visual:focus-visible .building,.project-visual:hover .flow-line,.project-visual:focus-visible .flow-line,.project-visual:hover .market-grid,.project-visual:focus-visible .market-grid{translate:none}
  .contact-panel:hover .contact-grid,.contact-panel:focus-within .contact-grid{transform:rotate(31deg)}
}
@media(prefers-reduced-motion:reduce){
  @view-transition{navigation:none}
  html{scroll-behavior:auto}
  *,*:before,*:after{animation:none!important;transition:none!important}
  dialog::backdrop{animation:none!important}
  .motion-scroll-progress,.story-contents li a:after{display:none}
  ::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none!important}
  .motion-depth{translate:none!important}
  .motion-line{overflow:visible}
  .country-card:hover,.project-visual:hover,.activity-card:hover,.button:hover,.story-button:hover,.service-preview-link:hover{transform:none!important}
  .country-photo,.project-photo,.motion-image-frame>img{transform:none!important}
  .button span,.text-link span,.nav-contact span,.back-top span,.circle-arrow,.project-open,.contact-arrow,.activity-top svg,.country-art,.group-structure-link span,.story-button span,.story-home span,.story-toc-home span,.story-read span,.service-preview-link span,.dialog-back span{transform:none!important}
  .project-card .project-meta,.project-card h3,.project-card>p,.project-visual .building,.project-visual .flow-line,.project-visual .market-grid{translate:none!important}
  .contact-grid,.contact-panel:hover .contact-grid,.contact-panel:focus-within .contact-grid{transform:rotate(31deg)!important}
  .story-contents li a.motion-nav-active{padding-left:0}
}
@media print{.motion-scroll-progress{display:none!important}.motion-depth{translate:none!important}.motion-line{overflow:visible}*{animation:none!important;transition:none!important}}
