/*
 * Profile motion: ambient life, micro-interactions and below-the-fold reveals for the
 * signature profile layout. Loaded after profile-header.css.
 *
 * Rules this file keeps:
 *  - Transform, translate, scale and opacity only, so nothing ever shifts the layout.
 *  - The header and anything above the fold never animates in. Reveals apply only to
 *    sections the script (profile-motion.js) found below the fold and marked .mo-rv,
 *    and only once it has put .js-anim on <html>. No script, reduced motion, or a
 *    screenshot without scrolling = every section visible as it was.
 *  - body[data-motion] sets the character: calm | balanced | lively (off for gallery
 *    pictures and embeds). Each level only changes the amounts below.
 *  - prefers-reduced-motion: reduce turns every effect here off.
 */
body{--mo-lift:-2px;--mo-press:.97;--mo-pop:1.08;--mo-rise:16px;--mo-dur:.7s;--mo-kb:1.04;--mo-amb-lo:.18;--mo-amb-hi:.34;--mo-drift:18s}
body[data-motion=calm]{--mo-lift:-1px;--mo-press:.985;--mo-pop:1.04;--mo-rise:10px;--mo-dur:.85s;--mo-kb:1.025;--mo-amb-lo:.1;--mo-amb-hi:.2;--mo-drift:26s}
body[data-motion=lively]{--mo-lift:-3px;--mo-press:.95;--mo-pop:1.12;--mo-rise:22px;--mo-dur:.6s;--mo-kb:1.05;--mo-amb-lo:.24;--mo-amb-hi:.46;--mo-drift:13s}

@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

@media (prefers-reduced-motion:no-preference){

/* ── 1. Ambient life in the header ── */
/* Photo, cover and compact headers: an accent-tinted glow drifting under the scrim, over the picture. */
body:not([data-motion=off]) .id:not(.centered):not(.plain) .id-photo::before{content:"";position:absolute;inset:-14%;pointer-events:none;background:radial-gradient(48% 40% at 18% 74%,var(--accent),transparent 70%),radial-gradient(44% 36% at 86% 26%,var(--accent-2,var(--accent)),transparent 70%);mix-blend-mode:soft-light;opacity:var(--mo-amb-lo);animation:mo-drift var(--mo-drift) ease-in-out infinite alternate;will-change:transform,opacity}
/* Text-led headers: a soft halo breathing behind the avatar, under everything else. */
body:not([data-motion=off]) .id.centered .id-photo,body:not([data-motion=off]) .id.plain .id-photo{isolation:isolate}
body:not([data-motion=off]) .id.centered .id-photo::before,body:not([data-motion=off]) .id.plain .id-photo::before{content:"";position:absolute;inset:-10%;z-index:-1;pointer-events:none;background:radial-gradient(34% 30% at 50% 22%,color-mix(in srgb,var(--accent) 55%,transparent),transparent 72%);opacity:var(--mo-amb-lo);animation:mo-drift var(--mo-drift) ease-in-out infinite alternate;will-change:transform,opacity}
body:not([data-motion=off]) .id.plain .id-photo::before{background:radial-gradient(30% 34% at 88% 46%,color-mix(in srgb,var(--accent) 55%,transparent),transparent 72%)}
@keyframes mo-drift{0%{transform:translate3d(-3%,1%,0) scale(1);opacity:var(--mo-amb-lo)}50%{opacity:var(--mo-amb-hi)}100%{transform:translate3d(3%,-2%,0) scale(1.08);opacity:var(--mo-amb-lo)}}
/* Cover and portrait photos: a very slow Ken Burns. It waits two seconds, so the first paint is the photo as it is. */
body:not([data-motion=off]) .id:not(.centered):not(.plain):not(.compact) img.avatar{animation:mo-kb 30s ease-in-out 2s infinite alternate;transform-origin:50% 30%}
@keyframes mo-kb{from{scale:1}to{scale:var(--mo-kb)}}

/* ── 2. Micro-interactions ── */
body:not([data-motion=off]) .btn{transition:transform .2s,background .2s,border-color .2s,color .2s,box-shadow .25s,translate .25s cubic-bezier(.2,.7,.2,1),scale .15s ease}
body:not([data-motion=off]) .btn:active{scale:var(--mo-press)}
/* The primary pill: a light sweep across it. */
body:not([data-motion=off]) .btn.pop{position:relative;overflow:hidden}
body:not([data-motion=off]) .btn.pop::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(110deg,transparent 32%,rgba(255,255,255,.42) 50%,transparent 68%);translate:-135% 0}
body[data-motion=lively] .id .btn.pop::after{animation:mo-sheen 7s ease-in-out 3s infinite}
@keyframes mo-sheen{0%,80%{translate:-135% 0}100%{translate:135% 0}}
body:not([data-motion=off]) .social-icon{transition:border-color .2s,transform .2s,background .2s,scale .25s cubic-bezier(.3,1.6,.5,1),translate .25s}
body:not([data-motion=off]) .social-icon:active{scale:.92}
body:not([data-motion=off]) .list a,body:not([data-motion=off]) .feat,body:not([data-motion=off]) .prod,body:not([data-motion=off]) .ibf-btn,body:not([data-motion=off]) .chip.act,body:not([data-motion=off]) .pill{transition:background .2s,background-color .25s,color .25s,border-color .25s,box-shadow .3s,translate .25s cubic-bezier(.2,.7,.2,1),scale .15s ease}
body:not([data-motion=off]) .list .go,body:not([data-motion=off]) .feat .go{transition:translate .25s cubic-bezier(.2,.7,.2,1),scale .25s}
body:not([data-motion=off]) .feat:active,body:not([data-motion=off]) .prod:active{scale:.985}
body:not([data-motion=off]) .list a:active,body:not([data-motion=off]) .chip.act:active,body:not([data-motion=off]) .pill:active,body:not([data-motion=off]) .ibf-btn:active{scale:var(--mo-press)}
body:not([data-motion=off]) .prod img{transition:scale .6s cubic-bezier(.2,.7,.2,1)}
@media (hover:hover){
  body:not([data-motion=off]) .btn:hover{translate:0 var(--mo-lift)}
  body:not([data-motion=off]) .btn.pop:hover{box-shadow:0 10px 26px -12px var(--pop)}
  body:not([data-motion=off]) .btn.pop:hover::after{translate:135% 0;transition:translate .75s ease}
  body:not([data-motion=off]) .social-icon:hover{scale:var(--mo-pop);translate:0 -1px;border-color:var(--accent)}
  body:not([data-motion=off]) .feat:hover{translate:0 var(--mo-lift);box-shadow:0 16px 34px -18px var(--accent-2,var(--accent))}
  body:not([data-motion=off]) .feat:hover .go{scale:1.1;translate:2px 0}
  body:not([data-motion=off]) .list a:hover .go{translate:4px 0}
  body:not([data-motion=off]) .prod:hover{translate:0 var(--mo-lift)}
  body:not([data-motion=off]) .prod:hover img{scale:1.04}
  body:not([data-motion=off]) .chip.act:hover,body:not([data-motion=off]) .pill:hover{translate:0 -1px}
  body:not([data-motion=off]) .ibf-btn:hover{translate:0 var(--mo-lift)}
}
/* Follow bar: a pressed follow, unfollow or message holds a gentle pulse while the page moves on. */
.ibf-btn.mo-sent{animation:mo-sent 1s ease-in-out infinite}
@keyframes mo-sent{50%{opacity:.6;scale:.97}}
/* Section tabs: one indicator slides to the section in view (the script adds it and .mo-tabs). */
.tabs.mo-tabs a{position:relative;z-index:1;transition:color .3s ease}
.tabs.mo-tabs a.on{background:transparent}
.tabs.mo-tabs .mo-tab-ind{position:absolute;left:0;top:0;z-index:0;pointer-events:none;background:var(--ink);border-radius:999px;opacity:1}
.tabs.mo-tabs.mo-ready .mo-tab-ind{transition:transform .45s cubic-bezier(.3,.9,.3,1),width .45s cubic-bezier(.3,.9,.3,1),opacity .2s}

/* ── 3. Below-the-fold reveals (only sections the script marked .mo-rv) ── */
.js-anim .mo-rv .mo-it,.js-anim .mo-rv>.label{opacity:0;translate:0 var(--mo-rise)}
.js-anim .mo-rv>.label i{clip-path:inset(0 100% 0 0)}
.js-anim .mo-rv.mo-in .mo-it,.js-anim .mo-rv.mo-in>.label{opacity:1;translate:none;transition:opacity var(--mo-dur) ease,translate var(--mo-dur) cubic-bezier(.2,.7,.2,1);transition-delay:calc(var(--mo-i,0) * 70ms)}
.js-anim .mo-rv.mo-in>.label i{clip-path:inset(0 0 0 0);transition:clip-path .6s cubic-bezier(.6,0,.2,1) .18s}
/* Lazy pictures fade in once loaded; their space is already held, so nothing moves. */
.js-anim img.mo-img{opacity:0}
.js-anim img.mo-img.mo-img-in{opacity:1;transition:opacity .5s ease}
/* New posts in the feed fade up as they arrive. */
.js-anim .sf-item.mo-new{animation:mo-rise .55s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(var(--mo-i,0) * 60ms)}
@keyframes mo-rise{from{opacity:0;translate:0 12px}}

/* ── 4. Live touches ── */
body:not([data-motion=off]) .open-chip.on i{position:relative}
body:not([data-motion=off]) .open-chip.on i::after{content:"";position:absolute;inset:0;border-radius:50%;background:#4ADE80;animation:mo-ping 2.4s cubic-bezier(0,0,.2,1) infinite}
body:not([data-motion=off]) i.live{animation:mo-breathe 2.2s ease-in-out infinite}
@keyframes mo-ping{0%{opacity:.7;scale:1}80%,100%{opacity:0;scale:2.8}}
@keyframes mo-breathe{50%{opacity:.45}}
body:not([data-motion=off]) .live-now-card{position:relative}
body:not([data-motion=off]) .live-now-card::after{content:"";position:absolute;inset:-1px;border-radius:inherit;box-shadow:0 0 0 2px #e5342b;pointer-events:none;opacity:0;animation:mo-ring 2.6s ease-out infinite}
@keyframes mo-ring{0%{opacity:.6;scale:1}100%{opacity:0;scale:1.025 1.14}}

/* ── 5. Reading progress: a hairline in the skin's accent (long pages only) ── */
.mo-progress{position:fixed;left:0;right:0;top:0;height:2px;z-index:70;pointer-events:none;background:linear-gradient(90deg,var(--accent),var(--accent-2,var(--accent)));transform:scaleX(0);transform-origin:0 50%;will-change:transform}
}

/* Reduced motion, print, or a gallery picture: no progress bar and nothing hidden, whatever the script did. */
@media (prefers-reduced-motion:reduce){.mo-progress,.mo-tab-ind{display:none}.tabs.mo-tabs a.on{background:var(--ink)}}
@media print{.mo-progress{display:none}.mo-rv .mo-it,.mo-rv>.label,img.mo-img{opacity:1!important;translate:none!important}.mo-rv>.label i{clip-path:none!important}}
